earthsdk3-cesium 3.4.0 → 3.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-cesium.iife.js +109 -109
- package/dist/earthsdk3-cesium.js +2329 -2328
- package/dist/earthsdk3-cesium.umd.cjs +24 -24
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(R,_e){typeof exports=="object"&&typeof module<"u"?_e(exports,require("cesium"),require("xbsj-base"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut")):typeof define=="function"&&define.amd?define(["exports","cesium","xbsj-base","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut"],_e):(R=typeof globalThis<"u"?globalThis:R||self,_e(R.EarthSDK3_Cesium={},R.Cesium,R.xbsj_base,R.EarthSDK3,R.html2canvas,R.Mapbox,R.Delaunator,R.earcut))})(this,function(R,_e,l,w,$h,G_,H_,q_){"use strict";var Jk=Object.defineProperty;var Bk=(R,_e,l)=>_e in R?Jk(R,_e,{enumerable:!0,configurable:!0,writable:!0,value:l}):R[_e]=l;var v=(R,_e,l)=>Bk(R,typeof _e!="symbol"?_e+"":_e,l);var Ho=typeof document<"u"?document.currentScript:null;function um(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=um(_e),$_=um(G_);window.Cesium=h;function X_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:l.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const i=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);i&&(h.Ion.defaultAccessToken=i[1],console.log("更新默认Cesium.Ion.Token成功"))});const Bs=class Bs extends l.Destroyable{};v(Bs,"defaults",{enabled:!0}),v(Bs,"createDefaultProps",()=>({...Bs.defaults}));let Nt=Bs;l.extendClassProps(Nt.prototype,Nt.createDefaultProps);class Qt extends w.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,r)=>this.flyTo(o,r))),this.d(i.flyInEvent.don((o,r)=>this.flyIn(o,r))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:s}=o;i.flyInParam={position:r,rotation:s,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,r,s,a){const{sceneObject:c,czmViewer:d}=this,u=d.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:s??0,pDelta:a??0},e);u&&u.then(p=>{})}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;if(!o.actived)return!1;if(n.flyToParam&&(n.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),n.flyInParam){const{position:r,rotation:s,flyDuration:a}=n.flyInParam,c=i??a;return this.flyToWithPromise(e,r,void 0,s,c),!0}return!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;if(!o.actived)return!1;if(n.flyInParam){const{position:r,rotation:s,flyDuration:a}=n.flyInParam,c=i??a;return this.flyToWithPromise(e,r,void 0,s,c),!0}return!1}get czmViewer(){return this.viewer}}function Ve(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const Y_=new h.Cartographic;function ce(t,i){const e=h.Cartographic.fromCartesian(t,void 0,Y_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function Ee(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function pm(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function si(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function rs(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function Xh(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function fm(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ai(t,i){if(t.length===4)return Xh(t,i);if(t.length===3)return si(t,i);if(t.length===2)return Ee(t,i);throw new Error("toCartesian error: should not be here!")}function Z_(t,i){if(t instanceof h.Cartesian2)return pm(t,i);if(t instanceof h.Cartesian3)return rs(t,i);if(t instanceof h.Cartesian4)return fm(t,i);throw new Error("fromCartesian error: should not be here!")}function Q_(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function qo(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function ie(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function K_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function cn(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function J_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function gm(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function B_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function ss(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function j_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function e1(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function t1(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const i1=new h.HeadingPitchRoll,n1=new h.Cartesian3;function o1(t,i,e){const n=gm(i,i1),o=Ve(t,n1);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function Ge(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function r1(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const s1=new h.Cartesian3;function Pe(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,s1),i)}function a1(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function gi(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),rectangle:t.rectangle&&Ge(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ee(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ee(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new zy({ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ee(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ee(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new Ly({ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ee(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ee(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function as(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:r,edgeColor:s,edgeWidth:a}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(d=>new h.ClippingPlane(si(d.normal),d.distance)),enabled:n,modelMatrix:c,unionClippingRegions:r,edgeColor:s&&ie(s),edgeWidth:a})}function Kl(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let r of n.planes)t.add(new h.ClippingPlane(si(r.normal),r.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=ie(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function Jl(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(r=>Ve(r))})),enabled:e,inverse:n})}function Bl(t,i){return Yh(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function mm(t,i){return Yh(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function Yh(t,i,e,n,o){const[r,s,a]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-r)),d=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(s)),u=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(a)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(c,p,p),p}function hn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function vm(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Fe(t,i){if(!((!t.localScale||hn(t.localScale,3))&&(!t.localRotation||hn(t.localRotation,3))&&(!t.localPosition||hn(t.localPosition,3))&&(!t.localModelMatrix||hn(t.localModelMatrix,16))&&(!t.scale||hn(t.scale,3))&&(!t.rotation||hn(t.rotation,3))&&(!t.position||hn(t.position,3))&&(!t.modelMatrix||hn(t.modelMatrix,16)))||t.localScale&&!vm(t.localScale)||t.scale&&!vm(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,r,s]=t.localScale??[1,1,1],a=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,r,s),new h.Matrix4);h.Matrix4.multiply(a,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),r=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(r),n,n)}if(t.localRotation){const o=Bl(t.localRotation),r=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(r),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(r,n,n)}if(t.scale){const[o,r,s]=t.scale??[1,1,1],a=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,r,s),new h.Matrix4);h.Matrix4.multiply(a,n,n)}if(t.rotation){const o=Bl(t.rotation),r=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(r),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),r=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(r,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const l1=new h.Cartesian3,ls=new h.HeadingPitchRoll,c1=new h.Matrix4,h1=new h.Cartesian3,d1=new h.Cartographic;function u1(t,i=[0,0,0],e=0,n){const[o,r,s]=t,a=h.Cartesian3.fromDegrees(o,r,s,void 0,l1),c=[...i];for(let u=0;u<3;++u)c[u]=h.Math.RADIANS_PER_DEGREE*c[u];if(e!==0){ls.heading=c[0],ls.pitch=c[1],ls.roll=c[2],ls.heading-=h.Math.PI_OVER_TWO;const u=h.Transforms.headingPitchRollToFixedFrame(a,ls,void 0,void 0,c1),p=h.Matrix4.multiplyByPointAsVector(u,h.Cartesian3.UNIT_X,h1);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(a,p,a)}const d=h.Cartographic.fromCartesian(a,void 0,d1);if(d)return n=n||[0,0,0],n[0]=d.longitude*180/Math.PI,n[1]=d.latitude*180/Math.PI,n[2]=d.height,n}function ym(t,i,e,n){return u1(t,i,e,n)}const dn=h.Math.toDegrees;function Vt(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=dn(e),i[1]=dn(n),i[2]=o,i):[dn(e),dn(n),o]}function $o(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=dn(e),i[1]=dn(n),i[2]=dn(o),i):[e,n,o].map(dn)}class jl extends l.Destroyable{constructor(e){super();v(this,"_originViewMatrix",new h.Matrix4);v(this,"_originProjMatrix",new h.Matrix4);v(this,"_changed",new l.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class p1 extends l.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class f1 extends l.Destroyable{constructor(e){super();v(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new l.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new p1(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class Qn extends l.Destroyable{constructor(e,n,o,r){super();v(this,"_visibleAlpha",this.disposeVar(l.react(1)));v(this,"_viewDistance",this.disposeVar(l.react(0)));v(this,"_debug",this.disposeVar(l.react(!1)));v(this,"_viewDistanceDebug",this.disposeVar(new f1(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:s,czmViewer:a}=this,[c,d,u]=l.getReactFuncs(n),[p,f,g]=l.getReactFuncs(s),[m,y,P]=r?l.getReactFuncs(r):[void 0,void 0,void 0],S=()=>{let T=1,I=Number.NEGATIVE_INFINITY;const b=c(),x=p(),z=m?m():0,W=a.getCurrentCameraInfo();if(!b||!x||!W){this._viewDistance.value=I,this._visibleAlpha.value=T;return}I=w.cartesianDistance(W.position,x)-(z??0);const[N,L,U,_]=b;N>L||L>U||U>_?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):I>=L&&I<=U?T=1:I<=N||I>=_?T=0:I>N&&I<L?L-N<=0?T=0:T=(I-N)/(L-N):I>U&&I<_?(_<=U&&(T=0),T=(_-I)/(_-U)):(T=1,console.error("不应该运行至此!")),this._viewDistance.value=I,this._visibleAlpha.value=T};S();const C=[a.cameraChanged,u,g];P&&C.push(P);const E=this.disposeVar(l.createNextAnimateFrameEvent(...C));this.dispose(E.disposableOn(S))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const g1=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Vi(t,i,e){var n=g1;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function dt(t){const i=t.length;let e;const n=[];for(let o=0;o<i;++o){const[r,s,a]=t[o],c=h.Cartesian3.fromDegrees(r,s,a);if(!c)continue;const{x:d,y:u,z:p}=c;[d,u,p].every(Number.isFinite)&&(!e||!h.Cartesian3.equals(e,c))&&(e=c,n.push(e))}return n}function Kn(t,i,e,n){const o=w.geoRhumbDistance(t,e),r=w.geoRhumbHeading(t,e),s=Math.cos(r*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(i*Math.PI/180);return s>0?w.geoRhumbDestination(t,o,i,n):w.geoRhumbDestination(t,o,i+180,n),[s>0?o:-o,n]}function m1(t,i,e){const n=e*.1,o=[];for(let r=-9;r<10;++r){const s=w.geoRhumbDestination(t,n*r,i);s&&o.push(s)}return o}function v1(t,i){return w.geoNearestPointOnLine(t,i).geometry.coordinates}const wm=new h.Cartesian3,y1=new h.Ray,w1=new h.Plane(h.Cartesian3.UNIT_X,0);function ec(t,i,e,n){const o=h.Cartesian3.normalize(i,wm),r=h.Cartesian3.cross(t.camera.right,o,wm);h.Cartesian3.normalize(r,r);const s=h.Plane.fromPointNormal(i,r,w1),a=t.camera.getPickRay(e,y1);if(a)return h.IntersectionTests.rayPlane(a,s,n)}const Zh=new h.Cartesian3,C1=new h.Ray,_1=new h.Cartographic,P1=new h.Ellipsoid;function Xo(t,i,e,n){const o=t.camera.getPickRay(i,C1);if(!o)return;const r=h.Cartesian3.fromElements(e,e,e,Zh),s=h.Cartesian3.add(r,h.Ellipsoid.WGS84.radii,Zh),a=h.Ellipsoid.fromCartesian3(s,P1),c=h.IntersectionTests.rayEllipsoid(o,a);if(c){const d=c.start>0?c.start:c.stop;if(d){const u=h.Ray.getPoint(o,d,Zh),p=h.Cartographic.fromCartesian(u,void 0,_1);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function Yo(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function Cm(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const _m=new h.Cartographic,Pm=new h.Cartesian3,Tt=[0,0,0],un=[0,0,0],Qh=new h.Cartesian2,Kh=new h.Cartesian3;function Jh(t,i,e,n,o,r){o.constraintMode="none",Yo([0,0,0],o.startDragPos),r=r||{},ai(l.getDomEventCurrentTargetPos(t),Qh);const s=e.position;if(!Ve(s,Kh))return;const a=Vi(i,Kh,n);if(a===void 0||!ec(i,Kh,Qh,Pm)||!ce(Pm,Tt))return;const c=Cm(Tt[2])*w.geoDistance(s,Tt);if(!r.z&&c<a&&Math.abs(s[2]-Tt[2])<e.dimensions[0]&&Tt[2]>s[2])return o.constraintMode="z",Yo(Tt,o.startDragPos),!0;if(!Xo(i,Qh,s[2],_m)||!qo(_m,Tt))return;const d=Cm(s[2])*w.geoDistance(s,Tt),u=e.dimensions[0];if(!(d>1.05*u)){if(!r.zAxis&&d>.95*u&&d<=1.05*u){o.constraintMode="zAxis",Yo(Tt,o.startDragPos);return}{const[p,f]=Kn(s,e.heading+90,Tt,un);if(!r.x&&p>0&&f&&(un[2]=s[2],w.geoDistance(un,Tt)<a)){o.constraintMode="x",Yo(un,o.startDragPos);return}}{const[p,f]=Kn(s,e.heading,Tt,un);if(!r.y&&p>0&&f&&(un[2]=s[2],w.geoDistance(un,Tt)<a)){o.constraintMode="y",Yo(un,o.startDragPos);return}}r.xy||(o.constraintMode="xy",Yo(Tt,o.startDragPos))}}async function Sm(t,i,e,n){var a;const o=(a=t.viewer)==null?void 0:a.scene;if(!o)throw new Error("!scene");const r=l.getDomEventCurrentTargetPos(i),s=ai(r);if(e===void 0){const c=t.quickPickPosition(r);return c?await c:void 0}else{const c=Xo(o,s,e);return c?qo(c):void 0}}let Bh,jh;function Em(t,i,e,n,o){o=o||new h.Cartesian3,Bh=Bh||new h.Ray,jh=jh||new h.Plane(h.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(n,Bh),s=h.Plane.fromPointNormal(i,e,jh);return o=h.IntersectionTests.rayPlane(r,s,o),o}function Am(t){const i=h.Material.fromType(t.type);return ed(i,t),i}function Ut(t){return t&&w.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function S1(t){return{x:t[0],y:t[1]}}function ed(t,i){i.type==="Color"?t.uniforms.color=ie(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=ie(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=ie(i.color??[1,1,1,1]),t.uniforms.gapColor=ie(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=ie(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=ie(i.color??[1,1,1,1]),t.uniforms.outlineColor=ie(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.color=ie(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=ie(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=Ee(i.lineCount??[8,8]),t.uniforms.lineThickness=Ee(i.lineThickness??[1,1]),t.uniforms.lineOffset=Ee(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=ie(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=ie(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=ie(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=ie(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=Ee(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=ie(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=ie(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=Ee(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=ie(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=ie(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=Ut(i.specularMap),t.uniforms.normalMap=Ut(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=ie(i.color??[1,0,0,.7]),t.uniforms.rimColor=ie(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=ie(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=ie(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=S1(i.fadeDirection??[!0,!0]),t.uniforms.time=Ee(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=ie(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=Ut(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=Ut(i.image):i.type==="ElevationBand"?(t.uniforms.color=Ut(i.colors),t.uniforms.heights=Ut(i.heights)):console.warn(`未知材质类型,无法更新 ${i.type}`)}function li(t,i){const e=l.react(void 0);let n="";const[o,r,s]=l.getReactFuncs(t),a=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=Am(c)):e.value&&ed(e.value,c):(n="",e.value=void 0)}catch{}};return a(),e.dispose(s.disposableOn(a)),e}function Ui(t){const i=dt(t.positions),e=t.holes&&t.holes.map(n=>Ui(n));return{positions:i,holes:e}}function td(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),r=new h.Cartographic(i[0]*e,i[1]*e,i[2]),s=new h.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new h.Cartographic);if(s)return s.height=(o.height+r.height)*.5,[s.longitude*n,s.latitude*n,s.height]}const Tm=new h.Cartesian4,E1=new h.Matrix4;function A1(){return{left:0,top:0,right:0,bottom:0,depth:0}}function Mm(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Im(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,s=t.camera.frustum.projectionMatrix,a=h.Matrix4.multiply(s,r,E1),c=h.Matrix4.multiplyByVector(a,h.Cartesian4.fromElements(i.x,i.y,i.z,1,Tm),Tm);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const d=o*(c.x*.5+.5),u=n*(c.y*.5+.5),p=o-d,f=n-u,g=c.z;if(!(d<0||u<0||p<0||f<0||g<0||g>1))return e?(e.left=d,e.top=f,e.right=p,e.bottom=u,e.depth=g):e={left:d,top:f,right:p,bottom:u,depth:g},e}const Jn={left:0,top:0,right:0,bottom:0,depth:0};class tc extends l.Destroyable{constructor(e,n=!0,o){super();v(this,"_cartesian",new h.Cartesian3);v(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});v(this,"_winPosValid",!1);v(this,"_changedEvent",new l.Event);v(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new jl(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Im(this._viewer,this._cartesian,Jn);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?Mm(this._winPos,Jn)||(e=!0,this._winPos.left=Jn.left,this._winPos.top=Jn.top,this._winPos.right=Jn.right,this._winPos.bottom=Jn.bottom,this._winPos.depth=Jn.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function Dm(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),r=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const T1=h.Check,M1=h.defaultValue,Bn=h.defined,bm=h.Math.EPSILON10;function I1(t,i,e,n){if(T1.defined("equalsEpsilon",i),!Bn(t))return;e=M1(e,!1);const o=Bn(n),r=t.length;if(r<2)return t;let s,a=t[0],c,d,u=0,p=-1;for(s=1;s<r;++s)c=t[s],i(a,c,bm)?(Bn(d)||(d=t.slice(0,s),u=s-1,p=0),o&&n.push(s)):(Bn(d)&&(d.push(c),u=s,o&&(p=n.length)),a=c);return e&&i(t[0],t[r-1],bm)&&(o&&(Bn(d)?n.splice(p,0,u):n.push(r-1)),Bn(d)?d.length-=1:d=t.slice(0,-1)),Bn(d)?d:t}const we=h.Cartesian3,Zo=h.Cartographic,jn=h.defaultValue,eo=h.defined,Rm=h.DeveloperError,xm=h.Ellipsoid,D1=h.EllipsoidGeodesic,Fm=h.EllipsoidRhumbLine,b1=h.IntersectionTests,id=h.Math,Qo=h.Matrix4,to=h.Plane,je={};je.numberOfPoints=function(t,i,e){const n=we.distance(t,i);return Math.ceil(n/e)},je.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const R1=new Zo;je.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const r=t[o];n[o]=i.cartesianToCartographic(r,R1).height}return n};const x1=new Qo,F1=new we,km=new we,k1=new to(we.UNIT_X,0),zm=new we,z1=new to(we.UNIT_X,0),L1=new we,O1=new we,nd=[];function Lm(t,i,e){const n=nd;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const s=(e-i)/t;for(o=0;o<t;o++){const a=i+o*s;n[o]=a}return n}const ic=new Zo,nc=new Zo,pn=new we,od=new we,N1=new we,rd=new D1;let cs=new Fm;function V1(t,i,e,n,o,r,s,a){const c=n.scaleToGeodeticSurface(t,od),d=n.scaleToGeodeticSurface(i,N1),u=je.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,ic),f=n.cartesianToCartographic(d,nc),g=Lm(u,o,r);rd.setEndPoints(p,f);const m=rd.surfaceDistance/u;let y=a;p.height=o;let P=n.cartographicToCartesian(p,pn);we.pack(P,s,y),y+=3;for(let S=1;S<u;S++){const C=rd.interpolateUsingSurfaceDistance(S*m,nc);C.height=g[S],P=n.cartographicToCartesian(C,pn),we.pack(P,s,y),y+=3}return y}function U1(t,i,e,n,o,r,s,a){const c=n.cartesianToCartographic(t,ic),d=n.cartesianToCartographic(i,nc),u=je.numberOfPointsRhumbLine(c,d,e);c.height=0,d.height=0;const p=Lm(u,o,r);cs.ellipsoid.equals(n)||(cs=new Fm(void 0,void 0,n)),cs.setEndPoints(c,d);const f=cs.surfaceDistance/u;let g=a;c.height=o;let m=n.cartographicToCartesian(c,pn);we.pack(m,s,g),g+=3;for(let y=1;y<u;y++){const P=cs.interpolateUsingSurfaceDistance(y*f,nc);P.height=p[y],m=n.cartographicToCartesian(P,pn),we.pack(m,s,g),g+=3}return g}je.wrapLongitude=function(t,i){const e=[],n=[];if(eo(t)&&t.length>0){i=jn(i,Qo.IDENTITY);const o=Qo.inverseTransformation(i,x1),r=Qo.multiplyByPoint(o,we.ZERO,F1),s=we.normalize(Qo.multiplyByPointAsVector(o,we.UNIT_Y,km),km),a=to.fromPointNormal(r,s,k1),c=we.normalize(Qo.multiplyByPointAsVector(o,we.UNIT_X,zm),zm),d=to.fromPointNormal(r,c,z1);let u=1;e.push(we.clone(t[0]));let p=e[0];const f=t.length;for(let g=1;g<f;++g){const m=t[g];if(to.getPointDistance(d,p)<0||to.getPointDistance(d,m)<0){const y=b1.lineSegmentPlane(p,m,a,L1);if(eo(y)){const P=we.multiplyByScalar(s,5e-9,O1);to.getPointDistance(a,p)<0&&we.negate(P,P),e.push(we.add(y,P,new we)),n.push(u+1),we.negate(P,P),e.push(we.add(y,P,new we)),u=1}}e.push(we.clone(t[g])),u++,p=m}n.push(u)}return{positions:e,lengths:n}},je.generateArc=function(t){eo(t)||(t={});const i=t.positions;if(!eo(i))throw new Rm("options.positions is required.");const e=i.length,n=jn(t.ellipsoid,xm.WGS84);let o=jn(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],od);if(o=r?o[0]:o,o!==0){const P=n.geodeticSurfaceNormal(y,pn);we.multiplyByScalar(P,o,P),we.add(y,P,y)}return[y.x,y.y,y.z]}let s=t.minDistance;if(!eo(s)){const y=jn(t.granularity,id.RADIANS_PER_DEGREE);s=id.chordLength(y,n.maximumRadius)}let a=0,c;for(c=0;c<e-1;c++)a+=je.numberOfPoints(i[c],i[c+1],s);const d=(a+1)*3,u=new Array(d);let p=0;for(c=0;c<e-1;c++){const y=i[c],P=i[c+1],S=r?o[c]:o,C=r?o[c+1]:o;p=V1(y,P,s,n,S,C,u,p)}nd.length=0;const f=i[e-1],g=n.cartesianToCartographic(f,ic);g.height=r?o[e-1]:o;const m=n.cartographicToCartesian(g,pn);return we.pack(m,u,d-3),u};const Om=new Zo,W1=new Zo;je.generateRhumbArc=function(t){eo(t)||(t={});const i=t.positions;if(!eo(i))throw new Rm("options.positions is required.");const e=i.length,n=jn(t.ellipsoid,xm.WGS84);let o=jn(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const S=n.scaleToGeodeticSurface(i[0],od);if(o=r?o[0]:o,o!==0){const C=n.geodeticSurfaceNormal(S,pn);we.multiplyByScalar(C,o,C),we.add(S,C,S)}return[S.x,S.y,S.z]}const s=jn(t.granularity,id.RADIANS_PER_DEGREE);let a=0,c,d=n.cartesianToCartographic(i[0],Om),u;for(c=0;c<e-1;c++)u=n.cartesianToCartographic(i[c+1],W1),a+=je.numberOfPointsRhumbLine(d,u,s),d=Zo.clone(u,Om);const p=(a+1)*3,f=new Array(p);let g=0;for(c=0;c<e-1;c++){const S=i[c],C=i[c+1],E=r?o[c]:o,T=r?o[c+1]:o;g=U1(S,C,s,n,E,T,f,g)}nd.length=0;const m=i[e-1],y=n.cartesianToCartographic(m,ic);y.height=r?o[e-1]:o;const P=n.cartographicToCartesian(y,pn);return we.pack(P,f,p-3),f},je.generateCartesianArc=function(t){const i=je.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=we.unpack(i,o*3);return n},je.generateCartesianRhumbArc=function(t){const i=je.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=we.unpack(i,o*3);return n};const oc=h.ArcType,G1=h.Cartesian3,H1=h.Math;function Nm(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let r=I1(t.positions,G1.equalsEpsilon,!1,o);if(!(r.length<2)){if(i===oc.GEODESIC||i===oc.RHUMB){let a;i===oc.GEODESIC?(a=H1.chordLength(e,n.maximumRadius),je.numberOfPoints):(a=e,je.numberOfPointsRhumbLine);const c=je.extractHeights(r,n);i===oc.GEODESIC?r=je.generateCartesianArc({positions:r,minDistance:a,ellipsoid:n,height:c}):r=je.generateCartesianRhumbArc({positions:r,granularity:a,ellipsoid:n,height:c})}return r}}function sd(t,i="GEODESIC",e){const o=t.map(w.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let r;if(e>0&&i!=="NONE"){if(r=Nm({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let s=0;const a=[0],c=r.length;for(let p=1;p<c;++p)s+=h.Cartesian3.distance(r[p-1],r[p]),a.push(s);const d=r.map(p=>w.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:a.map((p,f)=>[a[f],d[f],void 0]),distances:a}}function Vm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function ad(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:r,initialRotationMode:s="YForwardZUp"}=t;if(n){const[a,c,d]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(a,c,d),void 0,e)}if(o){const a=new h.Quaternion;s==="YForwardZUp"?Bl(o,a):s==="XForwardZUp"&&mm(o,a);const c=h.Matrix3.fromQuaternion(a);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return r&&h.Matrix4.multiplyByScale(e,ai(r),e),Vm(e,i)}const q1=new h.Matrix4;function Um(t,i){const e=h.Matrix4.fromArray(t,0,q1);return h.Matrix4.inverse(e,e),Vm(e,i)}const $1=new h.Matrix4,X1=new h.Cartesian3;function Wm(t,i,e){const[n,o,r]=i,s=h.Cartesian3.fromDegrees(n,o,r,void 0,X1),a=h.Matrix4.fromArray(t,0,$1),c=h.Matrix4.multiplyByPoint(a,s,s),{x:d,y:u,z:p}=c;return e=e||[0,0,0],e[0]=d,e[1]=u,e[2]=p,e}const Y1=new h.Matrix4,Z1=new h.Cartesian3,Q1=new h.Cartographic;function fn(t,i,e){const[n,o,r]=i,s=h.Cartesian3.fromElements(n,o,r,Z1),a=h.Matrix4.fromArray(t,0,Y1),c=h.Matrix4.multiplyByPoint(a,s,s),d=h.Cartographic.fromCartesian(c,void 0,Q1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(d.longitude),e[1]=h.Math.toDegrees(d.latitude),e[2]=d.height,e}function Mt(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:r}=t,s=ad({position:e,rotation:n,scale:o,initialRotationMode:r}),a=Um(s);return[i.map(d=>Wm(a,d)),s,a]}function gn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:r}=t,s=ad({position:e,rotation:n,scale:o,initialRotationMode:r});return[i.map(c=>fn(s,c)),s]}function Gm(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=_e.Cartesian3.fromDegrees(...t[e]),o=_e.Cartesian3.fromDegrees(...t[e+1]),r=_e.Cartesian3.fromDegrees(...t[e+2]),s=_e.Cartesian3.angleBetween(_e.Cartesian3.subtract(n,o,new _e.Cartesian3),_e.Cartesian3.subtract(r,o,new _e.Cartesian3));i.push(isNaN(s)?0:_e.Math.toDegrees(s))}return i}function ld(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>ce(n)))),t.holes&&t.holes.forEach(n=>{e=ld(n,e)}),e}function Wt(t){return typeof t=="string"?w.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:w.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class cd extends l.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:r}=i.viewer,[s,a,c]=l.getReactFuncs(e),[d,u,p]=l.getReactFuncs(n),f=new h.Cartesian3,g=()=>{let m=s();m&&(m=[...m],i.editingHeightOffset&&(m[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...m,void 0,f))};g(),this.dispose(c.disposableOn(g)),this.dispose(r.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const m=Vi(r,f,o);m!==void 0?u([m,m,m]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${m??"undefined"}`)}))}}function K1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,r;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))r=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(r,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(r,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(r,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];r=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(r,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(r,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(r,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let s,a,c,d,u,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(s=ce(e),d=ce(h.Cartesian3.add(r,h.Cartesian3.subtract(r,e,new h.Cartesian3),new h.Cartesian3)),a=ce(n),u=ce(h.Cartesian3.add(r,h.Cartesian3.subtract(r,n,new h.Cartesian3),new h.Cartesian3)),c=ce(o),p=ce(h.Cartesian3.add(r,h.Cartesian3.subtract(r,o,new h.Cartesian3),new h.Cartesian3))):(s=fn(i,[e.x,e.y,e.z]),d=fn(i,[-e.x,-e.y,-e.z]),a=fn(i,[n.x,n.y,n.z]),u=fn(i,[-n.x,-n.y,-n.z]),c=fn(i,[o.x,o.y,o.z]),p=fn(i,[-o.x,-o.y,-o.z])),!s||!d||!a||!u||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(s[0],d[0],a[0],u[0],c[0],p[0])),h.Math.toRadians(Math.min(s[1],d[1],a[1],u[1],c[1],p[1])),h.Math.toRadians(Math.max(s[0],d[0],a[0],u[0],c[0],p[0])),h.Math.toRadians(Math.max(s[1],d[1],a[1],u[1],c[1],p[1])),Math.min(s[2],d[2],a[2],u[2],c[2],p[2]),Math.max(s[2],d[2],a[2],u[2],c[2],p[2])]}const Hm=l.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await l.step(t,async c=>new Promise(async(d,u)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(g=>g.json()).then(g=>{g&&!Reflect.has(g,"success")?n[f]=g:o.push({index:p,url:f,message:g.message}),p==i.length-1&&d()}).catch(g=>{o.push({index:p,url:f,message:g}),p==i.length-1&&d()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const r=[],s=[],a=[];for(const c in n){const d=n[c];s.push(d.geometricError??d.root.geometricError??0);const u=K1(d);r.push(u),a.push({content:{uri:c},boundingVolume:{region:u},geometricError:d.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...s),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(c=>c[0])),Math.min(...r.map(c=>c[1])),Math.max(...r.map(c=>c[2])),Math.max(...r.map(c=>c[3])),Math.min(...r.map(c=>c[4])),Math.max(...r.map(c=>c[5]))],e.tilesUrl.root.children=a),e});function J1(t){return new Promise((i,e)=>{Hm.restart(void 0,t),Hm.completeEvent.don(n=>{i(n)})})}class hd extends l.Destroyable{constructor(e){super();v(this,"_center",this.disposeVar(l.reactArrayWithUndefined(void 0)));v(this,"_radius",this.disposeVar(l.react(0)));const[n,o,r]=l.getReactFuncs(e);{const s=()=>{const a=n();if(a){const{center:c,minPos:d,maxPos:u}=w.getMinMaxCorner(a);this._center.value=c,this._radius.value=w.geoDistance(d,u)/2}else this._center.value=void 0};s(),this.dispose(r.disposableOn(s))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function qm(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
1
|
+
(function(R,_e){typeof exports=="object"&&typeof module<"u"?_e(exports,require("cesium"),require("xbsj-base"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut")):typeof define=="function"&&define.amd?define(["exports","cesium","xbsj-base","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut"],_e):(R=typeof globalThis<"u"?globalThis:R||self,_e(R.EarthSDK3_Cesium={},R.Cesium,R.xbsj_base,R.EarthSDK3,R.html2canvas,R.Mapbox,R.Delaunator,R.earcut))})(this,(function(R,_e,l,w,$h,G_,H_,q_){"use strict";var Jk=Object.defineProperty;var Bk=(R,_e,l)=>_e in R?Jk(R,_e,{enumerable:!0,configurable:!0,writable:!0,value:l}):R[_e]=l;var v=(R,_e,l)=>Bk(R,typeof _e!="symbol"?_e+"":_e,l);var Ho=typeof document<"u"?document.currentScript:null;function um(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=um(_e),$_=um(G_);window.Cesium=h;function X_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:l.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const i=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);i&&(h.Ion.defaultAccessToken=i[1],console.log("更新默认Cesium.Ion.Token成功"))});const Bs=class Bs extends l.Destroyable{};v(Bs,"defaults",{enabled:!0}),v(Bs,"createDefaultProps",()=>({...Bs.defaults}));let Nt=Bs;l.extendClassProps(Nt.prototype,Nt.createDefaultProps);class Qt extends w.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,r)=>this.flyTo(o,r))),this.d(i.flyInEvent.don((o,r)=>this.flyIn(o,r))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:s}=o;i.flyInParam={position:r,rotation:s,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,r,s,a){const{sceneObject:c,czmViewer:d}=this,u=d.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:s??0,pDelta:a??0},e);u&&u.then(p=>{})}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;if(!o.actived)return!1;if(n.flyToParam&&(n.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),n.flyInParam){const{position:r,rotation:s,flyDuration:a}=n.flyInParam,c=i??a;return this.flyToWithPromise(e,r,void 0,s,c),!0}return!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;if(!o.actived)return!1;if(n.flyInParam){const{position:r,rotation:s,flyDuration:a}=n.flyInParam,c=i??a;return this.flyToWithPromise(e,r,void 0,s,c),!0}return!1}get czmViewer(){return this.viewer}}function Ve(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const Y_=new h.Cartographic;function ce(t,i){const e=h.Cartographic.fromCartesian(t,void 0,Y_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function Ee(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function pm(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function si(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function rs(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function Xh(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function fm(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ai(t,i){if(t.length===4)return Xh(t,i);if(t.length===3)return si(t,i);if(t.length===2)return Ee(t,i);throw new Error("toCartesian error: should not be here!")}function Z_(t,i){if(t instanceof h.Cartesian2)return pm(t,i);if(t instanceof h.Cartesian3)return rs(t,i);if(t instanceof h.Cartesian4)return fm(t,i);throw new Error("fromCartesian error: should not be here!")}function Q_(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function qo(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function ie(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function K_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function cn(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function J_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function gm(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function B_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function ss(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function j_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function e1(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function t1(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const i1=new h.HeadingPitchRoll,n1=new h.Cartesian3;function o1(t,i,e){const n=gm(i,i1),o=Ve(t,n1);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function Ge(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function r1(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const s1=new h.Cartesian3;function Pe(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,s1),i)}function a1(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function gi(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),rectangle:t.rectangle&&Ge(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ee(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ee(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new zy({ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ee(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ee(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new Ly({ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ee(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ee(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function as(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:r,edgeColor:s,edgeWidth:a}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(d=>new h.ClippingPlane(si(d.normal),d.distance)),enabled:n,modelMatrix:c,unionClippingRegions:r,edgeColor:s&&ie(s),edgeWidth:a})}function Kl(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let r of n.planes)t.add(new h.ClippingPlane(si(r.normal),r.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=ie(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function Jl(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(r=>Ve(r))})),enabled:e,inverse:n})}function Bl(t,i){return Yh(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function mm(t,i){return Yh(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function Yh(t,i,e,n,o){const[r,s,a]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-r)),d=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(s)),u=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(a)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(c,p,p),p}function hn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function vm(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Fe(t,i){if(!((!t.localScale||hn(t.localScale,3))&&(!t.localRotation||hn(t.localRotation,3))&&(!t.localPosition||hn(t.localPosition,3))&&(!t.localModelMatrix||hn(t.localModelMatrix,16))&&(!t.scale||hn(t.scale,3))&&(!t.rotation||hn(t.rotation,3))&&(!t.position||hn(t.position,3))&&(!t.modelMatrix||hn(t.modelMatrix,16)))||t.localScale&&!vm(t.localScale)||t.scale&&!vm(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,r,s]=t.localScale??[1,1,1],a=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,r,s),new h.Matrix4);h.Matrix4.multiply(a,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),r=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(r),n,n)}if(t.localRotation){const o=Bl(t.localRotation),r=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(r),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(r,n,n)}if(t.scale){const[o,r,s]=t.scale??[1,1,1],a=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,r,s),new h.Matrix4);h.Matrix4.multiply(a,n,n)}if(t.rotation){const o=Bl(t.rotation),r=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(r),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),r=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(r,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const l1=new h.Cartesian3,ls=new h.HeadingPitchRoll,c1=new h.Matrix4,h1=new h.Cartesian3,d1=new h.Cartographic;function u1(t,i=[0,0,0],e=0,n){const[o,r,s]=t,a=h.Cartesian3.fromDegrees(o,r,s,void 0,l1),c=[...i];for(let u=0;u<3;++u)c[u]=h.Math.RADIANS_PER_DEGREE*c[u];if(e!==0){ls.heading=c[0],ls.pitch=c[1],ls.roll=c[2],ls.heading-=h.Math.PI_OVER_TWO;const u=h.Transforms.headingPitchRollToFixedFrame(a,ls,void 0,void 0,c1),p=h.Matrix4.multiplyByPointAsVector(u,h.Cartesian3.UNIT_X,h1);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(a,p,a)}const d=h.Cartographic.fromCartesian(a,void 0,d1);if(d)return n=n||[0,0,0],n[0]=d.longitude*180/Math.PI,n[1]=d.latitude*180/Math.PI,n[2]=d.height,n}function ym(t,i,e,n){return u1(t,i,e,n)}const dn=h.Math.toDegrees;function Vt(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=dn(e),i[1]=dn(n),i[2]=o,i):[dn(e),dn(n),o]}function $o(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=dn(e),i[1]=dn(n),i[2]=dn(o),i):[e,n,o].map(dn)}class jl extends l.Destroyable{constructor(e){super();v(this,"_originViewMatrix",new h.Matrix4);v(this,"_originProjMatrix",new h.Matrix4);v(this,"_changed",new l.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class p1 extends l.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class f1 extends l.Destroyable{constructor(e){super();v(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new l.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new p1(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class Qn extends l.Destroyable{constructor(e,n,o,r){super();v(this,"_visibleAlpha",this.disposeVar(l.react(1)));v(this,"_viewDistance",this.disposeVar(l.react(0)));v(this,"_debug",this.disposeVar(l.react(!1)));v(this,"_viewDistanceDebug",this.disposeVar(new f1(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:s,czmViewer:a}=this,[c,d,u]=l.getReactFuncs(n),[p,f,g]=l.getReactFuncs(s),[m,y,P]=r?l.getReactFuncs(r):[void 0,void 0,void 0],S=()=>{let T=1,I=Number.NEGATIVE_INFINITY;const b=c(),x=p(),z=m?m():0,W=a.getCurrentCameraInfo();if(!b||!x||!W){this._viewDistance.value=I,this._visibleAlpha.value=T;return}I=w.cartesianDistance(W.position,x)-(z??0);const[N,L,U,_]=b;N>L||L>U||U>_?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):I>=L&&I<=U?T=1:I<=N||I>=_?T=0:I>N&&I<L?L-N<=0?T=0:T=(I-N)/(L-N):I>U&&I<_?(_<=U&&(T=0),T=(_-I)/(_-U)):(T=1,console.error("不应该运行至此!")),this._viewDistance.value=I,this._visibleAlpha.value=T};S();const C=[a.cameraChanged,u,g];P&&C.push(P);const E=this.disposeVar(l.createNextAnimateFrameEvent(...C));this.dispose(E.disposableOn(S))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const g1=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Vi(t,i,e){var n=g1;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function dt(t){const i=t.length;let e;const n=[];for(let o=0;o<i;++o){const[r,s,a]=t[o],c=h.Cartesian3.fromDegrees(r,s,a);if(!c)continue;const{x:d,y:u,z:p}=c;[d,u,p].every(Number.isFinite)&&(!e||!h.Cartesian3.equals(e,c))&&(e=c,n.push(e))}return n}function Kn(t,i,e,n){const o=w.geoRhumbDistance(t,e),r=w.geoRhumbHeading(t,e),s=Math.cos(r*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(i*Math.PI/180);return s>0?w.geoRhumbDestination(t,o,i,n):w.geoRhumbDestination(t,o,i+180,n),[s>0?o:-o,n]}function m1(t,i,e){const n=e*.1,o=[];for(let r=-9;r<10;++r){const s=w.geoRhumbDestination(t,n*r,i);s&&o.push(s)}return o}function v1(t,i){return w.geoNearestPointOnLine(t,i).geometry.coordinates}const wm=new h.Cartesian3,y1=new h.Ray,w1=new h.Plane(h.Cartesian3.UNIT_X,0);function ec(t,i,e,n){const o=h.Cartesian3.normalize(i,wm),r=h.Cartesian3.cross(t.camera.right,o,wm);h.Cartesian3.normalize(r,r);const s=h.Plane.fromPointNormal(i,r,w1),a=t.camera.getPickRay(e,y1);if(a)return h.IntersectionTests.rayPlane(a,s,n)}const Zh=new h.Cartesian3,C1=new h.Ray,_1=new h.Cartographic,P1=new h.Ellipsoid;function Xo(t,i,e,n){const o=t.camera.getPickRay(i,C1);if(!o)return;const r=h.Cartesian3.fromElements(e,e,e,Zh),s=h.Cartesian3.add(r,h.Ellipsoid.WGS84.radii,Zh),a=h.Ellipsoid.fromCartesian3(s,P1),c=h.IntersectionTests.rayEllipsoid(o,a);if(c){const d=c.start>0?c.start:c.stop;if(d){const u=h.Ray.getPoint(o,d,Zh),p=h.Cartographic.fromCartesian(u,void 0,_1);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function Yo(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function Cm(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const _m=new h.Cartographic,Pm=new h.Cartesian3,Tt=[0,0,0],un=[0,0,0],Qh=new h.Cartesian2,Kh=new h.Cartesian3;function Jh(t,i,e,n,o,r){o.constraintMode="none",Yo([0,0,0],o.startDragPos),r=r||{},ai(l.getDomEventCurrentTargetPos(t),Qh);const s=e.position;if(!Ve(s,Kh))return;const a=Vi(i,Kh,n);if(a===void 0||!ec(i,Kh,Qh,Pm)||!ce(Pm,Tt))return;const c=Cm(Tt[2])*w.geoDistance(s,Tt);if(!r.z&&c<a&&Math.abs(s[2]-Tt[2])<e.dimensions[0]&&Tt[2]>s[2])return o.constraintMode="z",Yo(Tt,o.startDragPos),!0;if(!Xo(i,Qh,s[2],_m)||!qo(_m,Tt))return;const d=Cm(s[2])*w.geoDistance(s,Tt),u=e.dimensions[0];if(!(d>1.05*u)){if(!r.zAxis&&d>.95*u&&d<=1.05*u){o.constraintMode="zAxis",Yo(Tt,o.startDragPos);return}{const[p,f]=Kn(s,e.heading+90,Tt,un);if(!r.x&&p>0&&f&&(un[2]=s[2],w.geoDistance(un,Tt)<a)){o.constraintMode="x",Yo(un,o.startDragPos);return}}{const[p,f]=Kn(s,e.heading,Tt,un);if(!r.y&&p>0&&f&&(un[2]=s[2],w.geoDistance(un,Tt)<a)){o.constraintMode="y",Yo(un,o.startDragPos);return}}r.xy||(o.constraintMode="xy",Yo(Tt,o.startDragPos))}}async function Sm(t,i,e,n){var a;const o=(a=t.viewer)==null?void 0:a.scene;if(!o)throw new Error("!scene");const r=l.getDomEventCurrentTargetPos(i),s=ai(r);if(e===void 0){const c=t.quickPickPosition(r);return c?await c:void 0}else{const c=Xo(o,s,e);return c?qo(c):void 0}}let Bh,jh;function Em(t,i,e,n,o){o=o||new h.Cartesian3,Bh=Bh||new h.Ray,jh=jh||new h.Plane(h.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(n,Bh),s=h.Plane.fromPointNormal(i,e,jh);return o=h.IntersectionTests.rayPlane(r,s,o),o}function Am(t){const i=h.Material.fromType(t.type);return ed(i,t),i}function Ut(t){return t&&w.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function S1(t){return{x:t[0],y:t[1]}}function ed(t,i){i.type==="Color"?t.uniforms.color=ie(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=ie(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=ie(i.color??[1,1,1,1]),t.uniforms.gapColor=ie(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=ie(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=ie(i.color??[1,1,1,1]),t.uniforms.outlineColor=ie(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.color=ie(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=Ut(i.image),t.uniforms.repeat=Ee(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=ie(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=Ee(i.lineCount??[8,8]),t.uniforms.lineThickness=Ee(i.lineThickness??[1,1]),t.uniforms.lineOffset=Ee(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=ie(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=ie(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=ie(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=ie(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=Ee(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=ie(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=ie(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=Ee(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=ie(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=ie(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=Ut(i.specularMap),t.uniforms.normalMap=Ut(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=ie(i.color??[1,0,0,.7]),t.uniforms.rimColor=ie(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=ie(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=ie(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=S1(i.fadeDirection??[!0,!0]),t.uniforms.time=Ee(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=ie(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=Ut(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=Ut(i.image):i.type==="ElevationBand"?(t.uniforms.color=Ut(i.colors),t.uniforms.heights=Ut(i.heights)):console.warn(`未知材质类型,无法更新 ${i.type}`)}function li(t,i){const e=l.react(void 0);let n="";const[o,r,s]=l.getReactFuncs(t),a=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=Am(c)):e.value&&ed(e.value,c):(n="",e.value=void 0)}catch{}};return a(),e.dispose(s.disposableOn(a)),e}function Ui(t){const i=dt(t.positions),e=t.holes&&t.holes.map(n=>Ui(n));return{positions:i,holes:e}}function td(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),r=new h.Cartographic(i[0]*e,i[1]*e,i[2]),s=new h.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new h.Cartographic);if(s)return s.height=(o.height+r.height)*.5,[s.longitude*n,s.latitude*n,s.height]}const Tm=new h.Cartesian4,E1=new h.Matrix4;function A1(){return{left:0,top:0,right:0,bottom:0,depth:0}}function Mm(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Im(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,s=t.camera.frustum.projectionMatrix,a=h.Matrix4.multiply(s,r,E1),c=h.Matrix4.multiplyByVector(a,h.Cartesian4.fromElements(i.x,i.y,i.z,1,Tm),Tm);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const d=o*(c.x*.5+.5),u=n*(c.y*.5+.5),p=o-d,f=n-u,g=c.z;if(!(d<0||u<0||p<0||f<0||g<0||g>1))return e?(e.left=d,e.top=f,e.right=p,e.bottom=u,e.depth=g):e={left:d,top:f,right:p,bottom:u,depth:g},e}const Jn={left:0,top:0,right:0,bottom:0,depth:0};class tc extends l.Destroyable{constructor(e,n=!0,o){super();v(this,"_cartesian",new h.Cartesian3);v(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});v(this,"_winPosValid",!1);v(this,"_changedEvent",new l.Event);v(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new jl(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Im(this._viewer,this._cartesian,Jn);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?Mm(this._winPos,Jn)||(e=!0,this._winPos.left=Jn.left,this._winPos.top=Jn.top,this._winPos.right=Jn.right,this._winPos.bottom=Jn.bottom,this._winPos.depth=Jn.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function Dm(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),r=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const T1=h.Check,M1=h.defaultValue,Bn=h.defined,bm=h.Math.EPSILON10;function I1(t,i,e,n){if(T1.defined("equalsEpsilon",i),!Bn(t))return;e=M1(e,!1);const o=Bn(n),r=t.length;if(r<2)return t;let s,a=t[0],c,d,u=0,p=-1;for(s=1;s<r;++s)c=t[s],i(a,c,bm)?(Bn(d)||(d=t.slice(0,s),u=s-1,p=0),o&&n.push(s)):(Bn(d)&&(d.push(c),u=s,o&&(p=n.length)),a=c);return e&&i(t[0],t[r-1],bm)&&(o&&(Bn(d)?n.splice(p,0,u):n.push(r-1)),Bn(d)?d.length-=1:d=t.slice(0,-1)),Bn(d)?d:t}const we=h.Cartesian3,Zo=h.Cartographic,jn=h.defaultValue,eo=h.defined,Rm=h.DeveloperError,xm=h.Ellipsoid,D1=h.EllipsoidGeodesic,Fm=h.EllipsoidRhumbLine,b1=h.IntersectionTests,id=h.Math,Qo=h.Matrix4,to=h.Plane,je={};je.numberOfPoints=function(t,i,e){const n=we.distance(t,i);return Math.ceil(n/e)},je.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const R1=new Zo;je.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const r=t[o];n[o]=i.cartesianToCartographic(r,R1).height}return n};const x1=new Qo,F1=new we,km=new we,k1=new to(we.UNIT_X,0),zm=new we,z1=new to(we.UNIT_X,0),L1=new we,O1=new we,nd=[];function Lm(t,i,e){const n=nd;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const s=(e-i)/t;for(o=0;o<t;o++){const a=i+o*s;n[o]=a}return n}const ic=new Zo,nc=new Zo,pn=new we,od=new we,N1=new we,rd=new D1;let cs=new Fm;function V1(t,i,e,n,o,r,s,a){const c=n.scaleToGeodeticSurface(t,od),d=n.scaleToGeodeticSurface(i,N1),u=je.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,ic),f=n.cartesianToCartographic(d,nc),g=Lm(u,o,r);rd.setEndPoints(p,f);const m=rd.surfaceDistance/u;let y=a;p.height=o;let P=n.cartographicToCartesian(p,pn);we.pack(P,s,y),y+=3;for(let S=1;S<u;S++){const C=rd.interpolateUsingSurfaceDistance(S*m,nc);C.height=g[S],P=n.cartographicToCartesian(C,pn),we.pack(P,s,y),y+=3}return y}function U1(t,i,e,n,o,r,s,a){const c=n.cartesianToCartographic(t,ic),d=n.cartesianToCartographic(i,nc),u=je.numberOfPointsRhumbLine(c,d,e);c.height=0,d.height=0;const p=Lm(u,o,r);cs.ellipsoid.equals(n)||(cs=new Fm(void 0,void 0,n)),cs.setEndPoints(c,d);const f=cs.surfaceDistance/u;let g=a;c.height=o;let m=n.cartographicToCartesian(c,pn);we.pack(m,s,g),g+=3;for(let y=1;y<u;y++){const P=cs.interpolateUsingSurfaceDistance(y*f,nc);P.height=p[y],m=n.cartographicToCartesian(P,pn),we.pack(m,s,g),g+=3}return g}je.wrapLongitude=function(t,i){const e=[],n=[];if(eo(t)&&t.length>0){i=jn(i,Qo.IDENTITY);const o=Qo.inverseTransformation(i,x1),r=Qo.multiplyByPoint(o,we.ZERO,F1),s=we.normalize(Qo.multiplyByPointAsVector(o,we.UNIT_Y,km),km),a=to.fromPointNormal(r,s,k1),c=we.normalize(Qo.multiplyByPointAsVector(o,we.UNIT_X,zm),zm),d=to.fromPointNormal(r,c,z1);let u=1;e.push(we.clone(t[0]));let p=e[0];const f=t.length;for(let g=1;g<f;++g){const m=t[g];if(to.getPointDistance(d,p)<0||to.getPointDistance(d,m)<0){const y=b1.lineSegmentPlane(p,m,a,L1);if(eo(y)){const P=we.multiplyByScalar(s,5e-9,O1);to.getPointDistance(a,p)<0&&we.negate(P,P),e.push(we.add(y,P,new we)),n.push(u+1),we.negate(P,P),e.push(we.add(y,P,new we)),u=1}}e.push(we.clone(t[g])),u++,p=m}n.push(u)}return{positions:e,lengths:n}},je.generateArc=function(t){eo(t)||(t={});const i=t.positions;if(!eo(i))throw new Rm("options.positions is required.");const e=i.length,n=jn(t.ellipsoid,xm.WGS84);let o=jn(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],od);if(o=r?o[0]:o,o!==0){const P=n.geodeticSurfaceNormal(y,pn);we.multiplyByScalar(P,o,P),we.add(y,P,y)}return[y.x,y.y,y.z]}let s=t.minDistance;if(!eo(s)){const y=jn(t.granularity,id.RADIANS_PER_DEGREE);s=id.chordLength(y,n.maximumRadius)}let a=0,c;for(c=0;c<e-1;c++)a+=je.numberOfPoints(i[c],i[c+1],s);const d=(a+1)*3,u=new Array(d);let p=0;for(c=0;c<e-1;c++){const y=i[c],P=i[c+1],S=r?o[c]:o,C=r?o[c+1]:o;p=V1(y,P,s,n,S,C,u,p)}nd.length=0;const f=i[e-1],g=n.cartesianToCartographic(f,ic);g.height=r?o[e-1]:o;const m=n.cartographicToCartesian(g,pn);return we.pack(m,u,d-3),u};const Om=new Zo,W1=new Zo;je.generateRhumbArc=function(t){eo(t)||(t={});const i=t.positions;if(!eo(i))throw new Rm("options.positions is required.");const e=i.length,n=jn(t.ellipsoid,xm.WGS84);let o=jn(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const S=n.scaleToGeodeticSurface(i[0],od);if(o=r?o[0]:o,o!==0){const C=n.geodeticSurfaceNormal(S,pn);we.multiplyByScalar(C,o,C),we.add(S,C,S)}return[S.x,S.y,S.z]}const s=jn(t.granularity,id.RADIANS_PER_DEGREE);let a=0,c,d=n.cartesianToCartographic(i[0],Om),u;for(c=0;c<e-1;c++)u=n.cartesianToCartographic(i[c+1],W1),a+=je.numberOfPointsRhumbLine(d,u,s),d=Zo.clone(u,Om);const p=(a+1)*3,f=new Array(p);let g=0;for(c=0;c<e-1;c++){const S=i[c],C=i[c+1],E=r?o[c]:o,T=r?o[c+1]:o;g=U1(S,C,s,n,E,T,f,g)}nd.length=0;const m=i[e-1],y=n.cartesianToCartographic(m,ic);y.height=r?o[e-1]:o;const P=n.cartographicToCartesian(y,pn);return we.pack(P,f,p-3),f},je.generateCartesianArc=function(t){const i=je.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=we.unpack(i,o*3);return n},je.generateCartesianRhumbArc=function(t){const i=je.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=we.unpack(i,o*3);return n};const oc=h.ArcType,G1=h.Cartesian3,H1=h.Math;function Nm(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let r=I1(t.positions,G1.equalsEpsilon,!1,o);if(!(r.length<2)){if(i===oc.GEODESIC||i===oc.RHUMB){let a;i===oc.GEODESIC?(a=H1.chordLength(e,n.maximumRadius),je.numberOfPoints):(a=e,je.numberOfPointsRhumbLine);const c=je.extractHeights(r,n);i===oc.GEODESIC?r=je.generateCartesianArc({positions:r,minDistance:a,ellipsoid:n,height:c}):r=je.generateCartesianRhumbArc({positions:r,granularity:a,ellipsoid:n,height:c})}return r}}function sd(t,i="GEODESIC",e){const o=t.map(w.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let r;if(e>0&&i!=="NONE"){if(r=Nm({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let s=0;const a=[0],c=r.length;for(let p=1;p<c;++p)s+=h.Cartesian3.distance(r[p-1],r[p]),a.push(s);const d=r.map(p=>w.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:a.map((p,f)=>[a[f],d[f],void 0]),distances:a}}function Vm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function ad(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:r,initialRotationMode:s="YForwardZUp"}=t;if(n){const[a,c,d]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(a,c,d),void 0,e)}if(o){const a=new h.Quaternion;s==="YForwardZUp"?Bl(o,a):s==="XForwardZUp"&&mm(o,a);const c=h.Matrix3.fromQuaternion(a);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return r&&h.Matrix4.multiplyByScale(e,ai(r),e),Vm(e,i)}const q1=new h.Matrix4;function Um(t,i){const e=h.Matrix4.fromArray(t,0,q1);return h.Matrix4.inverse(e,e),Vm(e,i)}const $1=new h.Matrix4,X1=new h.Cartesian3;function Wm(t,i,e){const[n,o,r]=i,s=h.Cartesian3.fromDegrees(n,o,r,void 0,X1),a=h.Matrix4.fromArray(t,0,$1),c=h.Matrix4.multiplyByPoint(a,s,s),{x:d,y:u,z:p}=c;return e=e||[0,0,0],e[0]=d,e[1]=u,e[2]=p,e}const Y1=new h.Matrix4,Z1=new h.Cartesian3,Q1=new h.Cartographic;function fn(t,i,e){const[n,o,r]=i,s=h.Cartesian3.fromElements(n,o,r,Z1),a=h.Matrix4.fromArray(t,0,Y1),c=h.Matrix4.multiplyByPoint(a,s,s),d=h.Cartographic.fromCartesian(c,void 0,Q1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(d.longitude),e[1]=h.Math.toDegrees(d.latitude),e[2]=d.height,e}function Mt(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:r}=t,s=ad({position:e,rotation:n,scale:o,initialRotationMode:r}),a=Um(s);return[i.map(d=>Wm(a,d)),s,a]}function gn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:r}=t,s=ad({position:e,rotation:n,scale:o,initialRotationMode:r});return[i.map(c=>fn(s,c)),s]}function Gm(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=_e.Cartesian3.fromDegrees(...t[e]),o=_e.Cartesian3.fromDegrees(...t[e+1]),r=_e.Cartesian3.fromDegrees(...t[e+2]),s=_e.Cartesian3.angleBetween(_e.Cartesian3.subtract(n,o,new _e.Cartesian3),_e.Cartesian3.subtract(r,o,new _e.Cartesian3));i.push(isNaN(s)?0:_e.Math.toDegrees(s))}return i}function ld(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>ce(n)))),t.holes&&t.holes.forEach(n=>{e=ld(n,e)}),e}function Wt(t){return typeof t=="string"?w.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:w.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class cd extends l.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:r}=i.viewer,[s,a,c]=l.getReactFuncs(e),[d,u,p]=l.getReactFuncs(n),f=new h.Cartesian3,g=()=>{let m=s();m&&(m=[...m],i.editingHeightOffset&&(m[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...m,void 0,f))};g(),this.dispose(c.disposableOn(g)),this.dispose(r.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const m=Vi(r,f,o);m!==void 0?u([m,m,m]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${m??"undefined"}`)}))}}function K1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,r;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))r=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(r,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(r,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(r,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];r=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(r,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(r,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(r,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let s,a,c,d,u,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(s=ce(e),d=ce(h.Cartesian3.add(r,h.Cartesian3.subtract(r,e,new h.Cartesian3),new h.Cartesian3)),a=ce(n),u=ce(h.Cartesian3.add(r,h.Cartesian3.subtract(r,n,new h.Cartesian3),new h.Cartesian3)),c=ce(o),p=ce(h.Cartesian3.add(r,h.Cartesian3.subtract(r,o,new h.Cartesian3),new h.Cartesian3))):(s=fn(i,[e.x,e.y,e.z]),d=fn(i,[-e.x,-e.y,-e.z]),a=fn(i,[n.x,n.y,n.z]),u=fn(i,[-n.x,-n.y,-n.z]),c=fn(i,[o.x,o.y,o.z]),p=fn(i,[-o.x,-o.y,-o.z])),!s||!d||!a||!u||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(s[0],d[0],a[0],u[0],c[0],p[0])),h.Math.toRadians(Math.min(s[1],d[1],a[1],u[1],c[1],p[1])),h.Math.toRadians(Math.max(s[0],d[0],a[0],u[0],c[0],p[0])),h.Math.toRadians(Math.max(s[1],d[1],a[1],u[1],c[1],p[1])),Math.min(s[2],d[2],a[2],u[2],c[2],p[2]),Math.max(s[2],d[2],a[2],u[2],c[2],p[2])]}const Hm=l.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await l.step(t,async c=>new Promise(async(d,u)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(g=>g.json()).then(g=>{g&&!Reflect.has(g,"success")?n[f]=g:o.push({index:p,url:f,message:g.message}),p==i.length-1&&d()}).catch(g=>{o.push({index:p,url:f,message:g}),p==i.length-1&&d()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const r=[],s=[],a=[];for(const c in n){const d=n[c];s.push(d.geometricError??d.root.geometricError??0);const u=K1(d);r.push(u),a.push({content:{uri:c},boundingVolume:{region:u},geometricError:d.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...s),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(c=>c[0])),Math.min(...r.map(c=>c[1])),Math.max(...r.map(c=>c[2])),Math.max(...r.map(c=>c[3])),Math.min(...r.map(c=>c[4])),Math.max(...r.map(c=>c[5]))],e.tilesUrl.root.children=a),e});function J1(t){return new Promise((i,e)=>{Hm.restart(void 0,t),Hm.completeEvent.don(n=>{i(n)})})}class hd extends l.Destroyable{constructor(e){super();v(this,"_center",this.disposeVar(l.reactArrayWithUndefined(void 0)));v(this,"_radius",this.disposeVar(l.react(0)));const[n,o,r]=l.getReactFuncs(e);{const s=()=>{const a=n();if(a){const{center:c,minPos:d,maxPos:u}=w.getMinMaxCorner(a);this._center.value=c,this._radius.value=w.geoDistance(d,u)/2}else this._center.value=void 0};s(),this.dispose(r.disposableOn(s))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function qm(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
2
2
|
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
|
|
3
3
|
|
|
4
4
|
uniform sampler2D specularMap;
|
|
@@ -113,7 +113,7 @@ ${e};
|
|
|
113
113
|
margin: auto;
|
|
114
114
|
">
|
|
115
115
|
</div>
|
|
116
|
-
`}function ro(t,i){if(t)return Object.prototype.hasOwnProperty.call(t,i)?t[i]!=null?Object.assign({},t[i]):void 0:ro(t.childPickedInfo,i)}function so(t){return new Promise((e,n)=>{let o=new Image;o.src=t+"?v="+Math.random(),o.crossOrigin="*",o.onload=function(){e({width:o.width,height:o.height,base64:i(o),url:t})},o.onerror=function(){e(void 0)}});function i(e){let n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").drawImage(e,0,0,e.width,e.height);let r=e.src.substring(e.src.lastIndexOf(".")+1).toLowerCase();return n.toDataURL("image/"+r)}}function Km(t,i){const{width:e,height:n}=i;t.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[-e*.5,-n*.5,0],max:[e*.5,n*.5,0]}},t.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array([-.5*e,-.5*n,0,.5*e,-.5*n,0,.5*e,.5*n,0,-.5*e,.5*n,0])},normal:{componentsPerAttribute:3,typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([-1,-1,1,-1,1,1,-1,1])}},t.indexTypedArray=new Uint16Array([0,1,2,0,2,3])}function Jm(t){const i=l.min(l.objsIterator(t,["0"])),e=l.min(l.objsIterator(t,["1"])),n=l.min(l.objsIterator(t,["2"])),o=l.max(l.objsIterator(t,["0"])),r=l.max(l.objsIterator(t,["1"])),s=l.max(l.objsIterator(t,["2"]));return{minPos:[i,e,n],maxPos:[o,r,s]}}function vd(t,i){const e=360/i.segments,n=Math.PI/180*e,o=Math.floor(360/e),r=i.startRadius,s=i.stopRadius,a=i.height,c=[...new Array(o+1).keys()],d=c.map(I=>I*n).map(I=>[r*Math.cos(I),r*Math.sin(I),0]),u=c.map(I=>I*n).map(I=>[s*Math.cos(I),s*Math.sin(I),a]),p=[...d,...u],{minPos:f,maxPos:g}=Jm(p);t.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:f,max:g}};const m=c.map(I=>[0,1,0]).flat(),y=c.map(I=>[I/o,0]).flat(),P=c.map(I=>[I/o,1]).flat();t.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array(p.flat())},normal:{componentsPerAttribute:3,typedArray:new Float32Array([...m,...m])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([...y,...P])}};const S=[...new Array(o).keys()],C=S.map(I=>[I,I+o+1,I+o+2,I,I+o+2,I+1]),E=S.map(I=>[I,I+o+2,I+o+1,I,I+1,I+o+2]),T=[...C,...E].flat();t.indexTypedArray=new Uint16Array(T)}function hP(t,i){for(let[e,{defaultValue:n,componentName:o,originPropName:r=e}]of Object.entries(i))Reflect.has(t,e)?console.error(`Prop(${e}) conflicts!`):Object.defineProperties(t,{[e]:{get(){return this[o][r]},set(s){this[o][r]=s}},[`${e}Changed`]:{get(){return this[o][`${r}Changed`]}}})}function dP(t){const i={};for(let[e,{defaultValue:n}]of Object.entries(t))i[e]=n;return i}function yd(t,i,e,n){const o=new $e(e,n);return o.innerHTML=oo(t),o.position=i,o.show=!0,o}function Bm(t){const[i,e,n]=l.getReactFuncs(t),o=l.react(void 0),r=()=>{const s=i();o.value=s&&w.getGeoBoundingSphereFromPositions(s)};return r(),o.dispose(n.disposableOn(r)),o}function mi(t,i,e,n,o){const r=h.subscribeAndEvaluate(t,i,e,n,o);return()=>r.dispose()}var uP=function(){function t(i){this.points=i.points||[],this.duration=i.duration||1e4,this.sharpness=i.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=i.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var n=this.points[e],o=this.points[e+1];this.centers.push({x:(n.x+o.x)/2,y:(n.y+o.y)/2,z:(n.z+o.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var r=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,s=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,a=this.points[e+1].z-(this.centers[e].z+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+r),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+s),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+a)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+r),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+s),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+a)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return t.prototype.cacheSteps=function(i){var e=[],n=this.pos(0);e.push(0);for(var o=0;o<this.duration;o+=10){var r=this.pos(o),s=Math.sqrt((r.x-n.x)*(r.x-n.x)+(r.y-n.y)*(r.y-n.y)+(r.z-n.z)*(r.z-n.z));s>i&&(e.push(o),n=r)}return e},t.prototype.vector=function(i){var e=this.pos(i+10),n=this.pos(i-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(i){var e=i-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var o=Math.floor((this.points.length-1)*n),r=(this.length-1)*n-o;return pP(r,this.points[o],this.controls[o][1],this.controls[o+1][0],this.points[o+1])},t}();function pP(t,i,e,n,o){var r=fP(t),s={x:o.x*r[0]+n.x*r[1]+e.x*r[2]+i.x*r[3],y:o.y*r[0]+n.y*r[1]+e.y*r[2]+i.y*r[3],z:o.z*r[0]+n.z*r[1]+e.z*r[2]+i.z*r[3]};return s}function fP(t){var i=t*t,e=i*t;return[e,3*i*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}function gP(t,i){i===void 0&&(i={});var e=i.resolution||1e3,n=i.sharpness||.85;const o=[],r=t.map(d=>{const[u,p,f]=w.lbhToXyz(d);return{x:u,y:p,z:f}});for(var s=new uP({duration:e,points:r,sharpness:n}),a=function(d){var u=s.pos(d);const p=w.xyzToLbh([u.x,u.y,u.z]);o.push(p)},c=0;c<s.duration;c+=10)a(c);return a(s.duration),o}function wd(t,i,e){return gP(t,{resolution:i,sharpness:e})}function Wi(t){var e;const i=(e=ro(t,"pickResult"))==null?void 0:e.pointerEvent;return(i==null?void 0:i.buttons)!=0?(i==null?void 0:i.button)??0:-1}const Kt=[0,-30,0],mP=new h.Cartesian3,us=new h.HeadingPitchRoll,vP=new h.Matrix4,yP=new h.Cartesian3;function wP(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}const CP=[0,0,0];function ps(t,i){const{position:e,viewDistance:n,rotation:o,duration:r,cancelCallback:s,hdelta:a,pdelta:c}=i;if(!e&&n===void 0&&!o)return;const[d,u,p]=e??wP(t.positionCartographic,CP),f=h.Cartesian3.fromDegrees(d,u,p,void 0,mP),g=o&&[...o].map(h.Math.toRadians)||[t.heading,t.pitch,t.roll];let m={heading:g[0],pitch:g[1],roll:g[2]};if(n){us.heading=g[0],us.pitch=g[1],us.roll=g[2],us.heading-=h.Math.PI_OVER_TWO;const S=h.Transforms.headingPitchRollToFixedFrame(f,us,void 0,void 0,vP),C=h.Matrix4.multiplyByPointAsVector(S,h.Cartesian3.UNIT_X,yP);h.Cartesian3.multiplyByScalar(C,n,C),h.Cartesian3.subtract(f,C,f)}if(a&&(m.heading-=h.Math.toRadians(a)),c&&(m.pitch+=h.Math.toRadians(c)),r===0){t.setView({destination:f,orientation:m});return}let y;const P=new Promise((S,C)=>{t.flyTo({destination:f,orientation:m,duration:(r??1e3)*.001,complete:()=>{S(!0)},cancel:()=>{s&&s(),S(!1)}});const E=t._currentFlight;y=()=>{E===t._currentFlight&&(t.cancelFlight(),t._currentFlight&&(console.error("cancelFlight后_currentFlight不应该存在!"),C("cancelFlight后_currentFlight不应该存在!")))}});return l.pairToPromise([y,P])}function se(t,i,e,n,o,r){const s=t==null?void 0:t.camera;return s&&ps(s,{position:i,viewDistance:e,rotation:n,duration:o&&o*1e3,cancelCallback:r})}async function Jt(t,i,e,n,o,r,s=!1){if(!t.viewer)return;const a=_d(t,o),c=[...Kt];s&&(c[0]=i.rotation[0]-90);const{position:d,rotation:u}=lc(n,c,a);let p=await t.flyTo({distance:0,heading:u[0],pitch:u[1],flyDuration:r??1,hDelta:0,pDelta:0},d);return i.flyOverEvent.emit(e,p?"over":p==null?"error":"cancelled",t),p??!1}async function ae(t,i,e,n,o,r=!1){const s=w.getGeoBoundingSphereFromPositions(n);if(s&&s.center&&s.radius&&t.viewer){const a=_d(t,s.radius),c=[...Kt];r&&(c[0]=i.rotation[0]-90);const{position:d,rotation:u}=lc(s.center,c,a);let p=await t.flyTo({distance:0,heading:u[0],pitch:u[1],flyDuration:o??1,hDelta:0,pDelta:0},d);return i.flyOverEvent.emit(e,p?"over":p==null?"error":"cancelled",t),p??!1}return!1}async function It(t,i,e,n,o,r=!1){const s=_P(t,o);if(s!=null){const[a,c]=s,d=[...Kt];r&&(d[0]=i.rotation[0]-90);const{position:u,rotation:p}=lc(a,d,c);let f=await t.flyTo({distance:0,heading:p[0],pitch:p[1],flyDuration:n??1,hDelta:0,pDelta:0},u);return i.flyOverEvent.emit(e,f?"over":f==null?"error":"cancelled",t),f??!1}return!1}function _P(t,i){if(i instanceof ke&&i.nativePrimitive&&i.nativePrimitive.boundingVolume)return Cd(t,i.nativePrimitive.boundingVolume);if(i instanceof at&&i.primitive)return Cd(t,i.primitive.boundingSphere)}function Cd(t,i){let e,n;if(i instanceof h.BoundingSphere)n=ce(i.center),e=i.radius;else if(i instanceof h.BoundingRectangle){const{x:o,y:r,width:s,height:a}=i,c=h.Rectangle.fromRadians(o,r,o+s,r+a),d=h.BoundingSphere.fromRectangle2D(c);n=ce(d.center),e=d.radius}else if(i instanceof h.OrientedBoundingBox){n=ce(i.center);const o=i.halfAxes,r=l.Vector.magnitude([o[0],o[1],o[2]]),s=l.Vector.magnitude([o[3],o[4],o[5]]),a=l.Vector.magnitude([o[6],o[7],o[8]]);e=Math.max(r,s,a)}if(!(!n||e===void 0||!t.viewer))return e=_d(t,e),[n,e]}function _d(t,i){if(i=Math.abs(i),i==0&&(i=1),!t.viewer)return i;const e=i/((t.flyToBoundingSize??256)*.5/(t.viewer.canvas.width/2)*Math.tan(h.Math.toRadians(t.fov/2)));return Math.sqrt(i*i+e*e)}function lc(t,i,e){const n=new h.Cartesian3(-e*Math.cos(h.Math.toRadians(i[1]))*Math.cos(h.Math.toRadians(i[0]-90)),e*Math.cos(h.Math.toRadians(i[1]))*Math.sin(h.Math.toRadians(i[0]-90)),-e*Math.sin(h.Math.toRadians(i[1]))),o=h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(...t));let r=h.Matrix4.multiplyByPoint(o,n,new h.Cartesian3);const s=h.Cartesian3.fromDegrees(...t),a=h.Cartesian3.subtract(s,r,new h.Cartesian3);h.Cartesian3.normalize(a,a);const c=h.Transforms.rotationMatrixFromPositionVelocity(r,a,h.Ellipsoid.WGS84),d=h.Matrix4.fromRotationTranslation(c,r);var u=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(d,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),p=h.Matrix4.multiply(h.Matrix4.inverse(u,new h.Matrix4),d,new h.Matrix4),f=h.Matrix4.getMatrix3(p,new h.Matrix3),g=h.Quaternion.fromRotationMatrix(f),m=h.HeadingPitchRoll.fromQuaternion(g);const y=h.Cartographic.fromCartesian(r);return{position:[h.Math.toDegrees(y.longitude),h.Math.toDegrees(y.latitude),y.height],rotation:[h.Math.toDegrees(m.heading)+90,h.Math.toDegrees(m.pitch),h.Math.toDegrees(m.roll)]}}function jm(t,i=128,e=128,n="image/jpeg"){let o;return new Promise((r,s)=>{var a=t._postRender.addEventListener(()=>{let c=t.canvas,d=c.width,u=c.height;o||(o=document.createElement("canvas")),o.setAttribute("width",`${i}`),o.setAttribute("height",`${e}`);let p,f,g,m;d/i<u/e?(p=0,g=d,m=e*d/i,f=(u-m)*.5):(f=0,m=u,g=i*u/e,p=(d-g)*.5);let y=o.getContext("2d");if(!y){a(),s(new Error("captureScreenCanvas.getContext('2d') error!"));return}y.drawImage(c,p,f,g,m,0,0,i,e);let P=o.toDataURL(n);a(),r(P)},null)})}async function ev(t,i){const e=[],n=i.length;let o=0;for(let r=0;r<n-1;++r)o+=await tv(t,i[r],i[r+1]),e.push(o);return e}function tv(t,i,e){const n=si(i),o=si(e),r=[];return new Promise(async s=>{const a=parseInt(h.Cartesian3.distance(n,o).toString()),c=h.Cartographic.fromCartesian(n),d=[c.longitude,c.latitude],u=h.Cartographic.fromCartesian(o),p=[u.longitude,u.latitude];r.push(new h.Cartographic(d[0],d[1]));for(let m=1;m<=a-1;m++){let y=h.Math.lerp(d[0],p[0],m/a),P=h.Math.lerp(d[1],p[1],m/a);r.push(new h.Cartographic(y,P))}const f=await h.sampleTerrainMostDetailed(t.terrainProvider,[...r]),g=await iv(f);s(g)})}function iv(t){return new Promise(i=>{let e=0;t.map((n,o)=>{if(o==t.length-1)return;const r=t[o+1],s=h.Cartesian3.fromRadians(n.longitude,n.latitude,n.height),a=h.Cartesian3.fromRadians(r.longitude,r.latitude,r.height);e+=h.Cartesian3.distance(s,a)}),i(e)})}class PP extends l.Destroyable{constructor(i){super(),this._nativePrimitive=i;const{sceneObject:e,sceneScaleFromPixelSize:n,viewer:o,primitive:r}=this,s=()=>{if(!this.finalShow){r.show=!1;return}r.show=!0;const a=Fe({localScale:e.localScale,initialRotation:"xForwardzUp",localRotation:e.localRotation,localPosition:e.localPosition,localModelMatrix:e.localModelMatrix,sceneScaleFromPixelSize:n.value,scale:e.scale,rotation:e.rotation,position:e.instances&&e.instances.length!==0?ce(h.BoundingSphere.fromPoints(e.instances.map(c=>Ve(c.position))).center):e.position,modelMatrix:e.modelMatrix});if(!a){console.warn("computeCzmModelMatrix error.");return}r.modelMatrix=a};{let a=!0;this.dispose(e.showChanged.disposableOn(()=>a=!0)),this.dispose(e.localPositionChanged.disposableOn(()=>a=!0)),this.dispose(e.localRotationChanged.disposableOn(()=>a=!0)),this.dispose(e.localScaleChanged.disposableOn(()=>a=!0)),this.dispose(e.localModelMatrixChanged.disposableOn(()=>a=!0)),this.dispose(e.positionChanged.disposableOn(()=>a=!0)),this.dispose(e.rotationChanged.disposableOn(()=>a=!0)),this.dispose(e.instancesChanged.disposableOn(()=>a=!0)),this.dispose(e.scaleChanged.disposableOn(()=>a=!0)),this.dispose(e.modelMatrixChanged.disposableOn(()=>a=!0)),this.dispose(n.changed.disposableOn(()=>a=!0)),this.dispose(e.readyEvent.don(()=>a=!0)),s(),this.dispose(o.scene.preUpdate.addEventListener(()=>{a&&(a&&(a=!1),s())}))}}get nativePrimitive(){return this._nativePrimitive}get czmCzmModelPrimitive(){return this.nativePrimitive.czmCzmModelPrimitive}get sceneObject(){return this.czmCzmModelPrimitive}get sceneScaleFromPixelSize(){return this.czmCzmModelPrimitive.sceneScaleFromPixelSize}get viewer(){return this.czmCzmModelPrimitive.czmViewer.viewer}get finalShow(){return this.czmCzmModelPrimitive.finalShow}get primitive(){return this.nativePrimitive.primitive}}class SP extends l.Destroyable{constructor(i){super(),this._owner=i}get owner(){return this._owner}updateNodeMatrix(i){const e=this.owner.owner.owner.owner,n=i._nodesByName&&Object.keys(i._nodesByName);if(n)for(const o of n){const r=i.getNode(o);if(!r){console.error(`!node ${o}`);continue}const s=e.nodeTransformations&&e.nodeTransformations[o];if(!s){h.Matrix4.equals(r.matrix,r.originalMatrix)||(r.matrix=void 0);continue}const{translationX:a,translationY:c,translationZ:d,rotationHeading:u,rotationPitch:p,rotationRoll:f,scaleX:g,scaleY:m,scaleZ:y}=s;if(!Number.isFinite(a)||!Number.isFinite(c)||!Number.isFinite(d)||!Number.isFinite(u)||!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(g)||!Number.isFinite(m)||!Number.isFinite(y)){console.error(`transformation数值有误!${JSON.stringify(s,void 0," ")}`,s);continue}if(g<0||m<0||y<0){console.error("scaleX < 0 || scaleY < 0 || scaleZ < 0");continue}const P=h.Math.toRadians,S=h.Matrix4.fromTranslationQuaternionRotationScale(new h.Cartesian3(a,c,d),h.Quaternion.fromHeadingPitchRoll(new h.HeadingPitchRoll(P(u),P(p),P(f))),new h.Cartesian3(g,m,y));r.matrix=h.Matrix4.multiply(r.originalMatrix,S,r.matrix??new h.Matrix4)}}update(){const i=this.owner.owner.owner.owner,{primitive:e}=this.owner;if(e.activeAnimations.animateWhilePaused=i.activeAnimationsAnimateWhilePaused??at.defaults.activeAnimationsAnimateWhilePaused,e.activeAnimations.removeAll(),i.activeAnimations)for(let n of i.activeAnimations)e.activeAnimations.add({name:n.name,index:n.index,startTime:n.startTime,delay:n.delay,stopTime:n.stopTime,removeOnStop:n.removeOnStop,multiplier:n.multiplier,reverse:n.reverse,loop:n.loop,animationTime:n.animationTime});this.updateNodeMatrix(e)}}const EP=[6378137,6378137,6356752314245179e-9];var ut;(t=>{t.heightReferencePropsMap={NONE:h.HeightReference.NONE,CLAMP_TO_GROUND:h.HeightReference.CLAMP_TO_GROUND,RELATIVE_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND},t.shadowPropsMap={DISABLED:h.ShadowMode.DISABLED,CAST_ONLY:h.ShadowMode.CAST_ONLY,ENABLED:h.ShadowMode.ENABLED,RECEIVE_ONLY:h.ShadowMode.RECEIVE_ONLY},t.classificationTypeMap={TERRAIN:h.ClassificationType.TERRAIN,CESIUM_3D_TILE:h.ClassificationType.CESIUM_3D_TILE,BOTH:h.ClassificationType.BOTH,NONE:void 0},t.textureMinificationFilterType={NEAREST:h.TextureMinificationFilter.NEAREST,LINEAR:h.TextureMinificationFilter.LINEAR,NEAREST_MIPMAP_NEAREST:h.TextureMinificationFilter.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:h.TextureMinificationFilter.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:h.TextureMinificationFilter.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:h.TextureMinificationFilter.LINEAR_MIPMAP_LINEAR},t.textureMagnificationFilterType={NEAREST:h.TextureMagnificationFilter.NEAREST,LINEAR:h.TextureMagnificationFilter.LINEAR},t.colorBlendModeType={HIGHLIGHT:h.ColorBlendMode.HIGHLIGHT,REPLACE:h.ColorBlendMode.REPLACE,MIX:h.ColorBlendMode.MIX},t.horizontalOriginType={CENTER:h.HorizontalOrigin.CENTER,LEFT:h.HorizontalOrigin.LEFT,RIGHT:h.HorizontalOrigin.RIGHT},t.verticalOriginOriginType={CENTER:h.VerticalOrigin.CENTER,BOTTOM:h.VerticalOrigin.BOTTOM,BASELINE:h.VerticalOrigin.BASELINE,TOP:h.VerticalOrigin.TOP},t.labelStyleType={FILL:h.LabelStyle.FILL,OUTLINE:h.LabelStyle.OUTLINE,FILL_AND_OUTLINE:h.LabelStyle.FILL_AND_OUTLINE},t.blendOptionType={OPAQUE:h.BlendOption.OPAQUE,TRANSLUCENT:h.BlendOption.TRANSLUCENT,OPAQUE_AND_TRANSLUCENT:h.BlendOption.OPAQUE_AND_TRANSLUCENT}})(ut||(ut={}));const Pd={river:{waterColor:[95/255,115/255,70/255,1],frequency:800,waveVelocity:.6,amplitude:.1,specularIntensity:.8,flowDirection:0,flowSpeed:0},ocean:{waterColor:[12/255,30/255,69/255,1],frequency:360,waveVelocity:.8,amplitude:.5,specularIntensity:.8,flowDirection:0,flowSpeed:0},lake:{waterColor:[32/255,84/255,105/255,1],frequency:200,waveVelocity:.4,amplitude:.01,specularIntensity:.8,flowDirection:0,flowSpeed:0}};class AP extends l.Destroyable{constructor(e,n,o){super();v(this,"_modelMatrixUpdating");v(this,"_nativePrimitiveReady");this._gltf=e,this._primitive=n,this._owner=o,this._modelMatrixUpdating=this.disposeVar(new PP(this));const{czmViewer:r,sceneObject:s,pickingManager:a}=this,{viewer:c}=r;if(!c)throw new Error("!viewer");const{scene:d}=c;d.primitives.add(this._primitive),this.dispose(()=>d.primitives.remove(this._primitive)),this.owner.owner.owner.setPrimitive(this._primitive),this.dispose(()=>this.owner.owner.owner.setPrimitive(void 0)),this.dispose(s.printDebugInfoEvent.disposableOn(()=>{console.log(`---czm-model-primitive-debug-info-viewerid-${r.id}-begin---`),console.log("CzmCzmModelPrimitive: ",this),console.log("native gltf: ",this.gltf),console.log("native primitive: ",this.primitive),console.log(`---czm-model-primitive-debug-info-viewerid-${r.id}-end---`)}));const u=this._primitive.readyEvent.addEventListener(()=>{if(u(),!this.primitive.ready)throw console.error("!this.primitive.ready"),new Error("!this.primitive.ready");if(this._nativePrimitiveReady)throw console.error("this._nativePrimitiveReady"),new Error("this._nativePrimitiveReady");this._nativePrimitiveReady=this.disposeVar(new SP(this)),this._nativePrimitiveReady.update()});this.dispose(u)}get owner(){return this._owner}get czmCzmModelPrimitive(){return this.owner.owner.owner}get czmViewer(){return this.czmCzmModelPrimitive.czmViewer}get viewer(){return this.czmViewer.viewer}get scene(){return this.viewer.scene}get primitive(){return this._primitive}get sceneObject(){return this.czmCzmModelPrimitive}get gltf(){return this._gltf}get pickingManager(){var e;return(e=this.czmViewer.extensions)==null?void 0:e.pickingManager}get nativePrimitiveReady(){return this._nativePrimitiveReady}update(){const{visibleAlpha:e,finalShow:n,finalSpecularEnvironmentMapsReact:o}=this.owner.owner.owner,r=this.owner.owner.owner,{primitive:s}=this,a=n;s.show=a,s.clampAnimations=r.clampAnimations??!0,s.shadows=ut.shadowPropsMap[r.shadows??"DISABLED"],s.debugShowBoundingVolume=r.debugShowBoundingVolume??!1,s.debugWireframe=r.debugWireframe??!1,s.backFaceCulling=r.backFaceCulling??!0,s.heightReference=r.heightReference?ut.heightReferencePropsMap[r.heightReference]:ut.heightReferencePropsMap.NONE,s.distanceDisplayCondition=ss(r.distanceDisplayCondition??[0,Number.MAX_VALUE]);{const d=r.color??[1,1,1,1];d[3]*=e;const u=ie(d);s.color=u}s.colorBlendMode=ut.colorBlendModeType[r.colorBlendMode??"HIGHLIGHT"],s.silhouetteColor=r.silhouetteColor&&ie(r.silhouetteColor)||h.Color.RED,s.silhouetteSize=r.silhouetteSize??0,s.colorBlendAmount=r.colorBlendAmount??.5,s.lightColor=(r.lightColor&&si(r.lightColor))??void 0;const c=s.imageBasedLighting;c&&(c.imageBasedLightingFactor=Ee(r.imageBasedLightingFactor??at.defaults.imageBasedLightingFactor),c.sphericalHarmonicCoefficients=r.sphericalHarmonicCoefficients&&ud(r.sphericalHarmonicCoefficients),c.specularEnvironmentMaps=o.value),s.environmentMapManager&&dd(s.environmentMapManager,r),s.minimumPixelSize=r.nativeMinimumPixelSize,s.maximumScale=r.nativeMaximumScale,s.scale=r.nativeScale,this._nativePrimitiveReady&&this._nativePrimitiveReady.update()}}const cc=new h.Cartesian3,TP=new h.HeadingPitchRoll,nv=new h.Matrix3,MP=new h.Quaternion,hc=h.ModelComponents.Attribute,IP=h.ModelComponents.FeatureIdAttribute,ov=h.ModelComponents.Instances;function DP(t,i,e,n){if(!n||n.length===0){const W=i.nodes,N=W.length;for(let L=0;L<N;L++){const U=W[L];U.primitives.length>0&&(U.instances=void 0)}return}let o;const r=n?n.length:0;if(r===0)return;const s=new Float32Array(3*r),a=new Float32Array(4*r),c=new Float32Array(3*r),d=new Float32Array(r),u=new Array(4),p=new Array(3),f=h.BoundingSphere.fromPoints(n.map(W=>Ve(W.position))),g=h.Matrix4.inverse(h.Transforms.northWestUpToFixedFrame(f.center),new h.Matrix4);for(o=0;o<r;o++)h.Matrix4.multiplyByPoint(g,Ve(n[o].position),cc),s[3*o+0]=cc.x,s[3*o+1]=cc.y,s[3*o+2]=cc.z,h.Matrix3.fromHeadingPitchRoll(h.HeadingPitchRoll.fromDegrees(...n[o].rotation??[0,0,0],TP),nv),h.Quaternion.pack(h.Quaternion.fromRotationMatrix(nv,MP),u,0),a[4*o+0]=u[0],a[4*o+1]=u[1],a[4*o+2]=u[2],a[4*o+3]=u[3],h.Cartesian3.pack(h.Cartesian3.fromArray(n[o].scale??[1,1,1]),p,0),c[3*o+0]=p[1],c[3*o+1]=p[0],c[3*o+2]=p[2],d[o]=o;const m=new ov;m.transformInWorldSpace=!0,t._buffers||(t._buffers=[]);const y=t._buffers,P=new hc;P.name="Instance Translation",P.semantic=h.InstanceAttributeSemantic.TRANSLATION,P.componentDatatype=h.ComponentDatatype.FLOAT,P.type=h.AttributeType.VEC3,P.count=r,P.typedArray=s,m.attributes.push(P);const S=new hc;S.name="Instance Rotation",S.semantic=h.InstanceAttributeSemantic.ROTATION,S.componentDatatype=h.ComponentDatatype.FLOAT,S.type=h.AttributeType.VEC4,S.count=r,S.typedArray=a,m.attributes.push(S);const C=new hc;C.name="Instance Scale",C.semantic=h.InstanceAttributeSemantic.SCALE,C.componentDatatype=h.ComponentDatatype.FLOAT,C.type=h.AttributeType.VEC3,C.count=r,C.typedArray=c,m.attributes.push(C);const E=new hc;E.name="Instance Feature ID",E.setIndex=0,E.semantic=h.InstanceAttributeSemantic.FEATURE_ID,E.componentDatatype=h.ComponentDatatype.FLOAT,E.type=h.AttributeType.SCALAR,E.count=r;const T=h.Buffer.createVertexBuffer({context:e.context,typedArray:d,usage:h.BufferUsage.STATIC_DRAW});T.vertexArrayDestroyable=!1,y.push(T),E.buffer=T,m.attributes.push(E);const I=new IP;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",m.featureIds.push(I);const b=i.nodes,x=b.length;let z=!1;for(o=0;o<x;o++){const W=b[o];W.primitives.length>0&&(W.instances=z?RP(m):m,z=!0)}}function bP(t,i){var o;const e=t?t.length:0;if(e===0){i.structuralMetadata=void 0;return}let n;if(t!=null&&t[0]){const r={id:new Array(e)};for(let c=0;c<e;c++)r.id[c]=((o=t[c])==null?void 0:o.id)??c;const s=new h.JsonMetadataTable({count:e,properties:r}),a=new h.PropertyTable({name:h.MetadataClass.BATCH_TABLE_CLASS_NAME,count:e,jsonMetadataTable:s});n=new h.StructuralMetadata({schema:{},propertyTables:[a]})}else{const r=new h.PropertyTable({name:h.MetadataClass.BATCH_TABLE_CLASS_NAME,count:e});n=new h.StructuralMetadata({schema:{},propertyTables:[r]})}i.structuralMetadata=n}function RP(t){const i=new ov;i.transformInWorldSpace=t.transformInWorldSpace;const e=t.attributes,n=e.length;for(let o=0;o<n;o++){const r=h.clone(e[o],!1);i.attributes.push(r)}return i}class xP extends l.Destroyable{constructor(e){super();v(this,"_nativePrimitive");this._owner=e;const n=this.owner.owner,{visibleAlphaChanged:o}=n,r=c=>{var u;this.nativePrimitive&&this.nativePrimitive.pickingManager&&(this.nativePrimitive.pickingManager.pause=!0),c._resourcesLoaded=c._texturesLoaded=!1;const d=(u=e.owner.czmViewer.viewer)==null?void 0:u.scene.preUpdate.addEventListener(p=>{const f=p.frameState;if(c._loader.components){const g=c._loader.components;DP(c._loader,g,f,n.instances),bP(n.instances,g),c._loader._components=g,c._loader._arrayBuffer=void 0,n.instances&&n.instances.length>0?c._featureTableIdDirty=!0:c._drawCommandsBuilt=!1,d&&d(),this.nativePrimitive&&this.nativePrimitive.pickingManager&&(this.nativePrimitive.pickingManager.pause=!1),f.afterRender.push(()=>{var m;(m=this.nativePrimitive)==null||m.update()})}})};{let c=Promise.resolve();const d=()=>{c=c.then(()=>{if(!this.nativePrimitive)return;const u=this.nativePrimitive.primitive;r(u)})};d(),this.ad(n.instancesChanged.don(d))}this.ad(n.setMaterialEvent.don(async c=>{let d=!0;if(!this.nativePrimitive)return;if(c=="default")d=hs(this.nativePrimitive.primitive,"default");else{if(!this.nativePrimitive)return;const p={};for(const f in c){let g,m,y;const P=c[f];p[f]={...P},Reflect.has(P,"baseColorTexture")&&(P.baseColorTexture==null?p[f].baseColorTexture=void 0:P.baseColorTexture.value!=""&&(g=io(this.owner.owner.czmViewer.viewer,P.baseColorTexture,{magFilter:P.magFilter,minFilter:P.minFilter}))),Reflect.has(P,"normalTexture")&&(P.normalTexture==null?p[f].normalTexture=void 0:P.normalTexture.value!=""&&(m=io(this.owner.owner.czmViewer.viewer,P.normalTexture,{magFilter:P.magFilter,minFilter:P.minFilter}))),Reflect.has(P,"metallicRoughnessTexture")&&(P.metallicRoughnessTexture==null?p[f].metallicRoughnessTexture=void 0:P.metallicRoughnessTexture.value!=""&&(y=io(this.owner.owner.czmViewer.viewer,P.metallicRoughnessTexture,{magFilter:P.magFilter,minFilter:P.minFilter})));const S=await Promise.allSettled([g,m,y]);g=S[0].value,m=S[1].value,y=S[2].value,y!=null&&(p[f].metallicRoughnessTexture=y),g!=null&&(p[f].baseColorTexture=g),m!=null&&(p[f].normalTexture=m)}d=hs(this.nativePrimitive.primitive,p)}const u=w.ESSceneObject.getSceneObject(this._owner.owner.id);u&&u instanceof w.ESGltfModel&&u.setMaterialInfoEvent.emit({type:d?"success":"warn",message:d?"完成":"部分材质颜色纹理设置失败,请检查原始模型中材质是否具有baseColorTexture属性"})}));const s=async()=>{const c=this.owner.owner,{finalModelUriReact:d,czmViewer:u,visibleAlpha:p,finalShow:f}=c,g=u.viewer;if(!d.value)return;const m=n.customShaderInstanceClass&&new n.customShaderInstanceClass(n,u),y=n.color??[1,1,1,1];y[3]*=p;const P=ie(y);let S;const C=await h.Model.fromGltfAsync({url:n.gltfJson?void 0:d.value,gltf:n.gltfJson?JSON.parse(JSON.stringify(n.gltfJson)):void 0,releaseGltfJson:!!n.gltfJson,basePath:n.basePath,show:f,allowPicking:n.allowPicking,incrementallyLoadTextures:n.incrementallyLoadTextures,asynchronous:n.asynchronous,clampAnimations:n.clampAnimations,shadows:n.shadows&&ut.shadowPropsMap[n.shadows],debugShowBoundingVolume:n.debugShowBoundingVolume,debugWireframe:n.debugWireframe,backFaceCulling:n.backFaceCulling,showOutline:n.showOutline,heightReference:n.heightReference&&ut.heightReferencePropsMap[n.heightReference],distanceDisplayCondition:n.distanceDisplayCondition&&ss(n.distanceDisplayCondition),color:P,scene:g.scene,colorBlendMode:n.colorBlendMode&&ut.colorBlendModeType[n.colorBlendMode],credit:n.credit,silhouetteColor:n.silhouetteColor&&ie(n.silhouetteColor),colorBlendAmount:n.colorBlendAmount,silhouetteSize:n.silhouetteSize,upAxis:n.upAxis,forwardAxis:n.forwardAxis,customShader:m&&m.customShader,opaquePass:h.Pass[n.opaquePass],gltfCallback:T=>{S=T}});h.Model.prototype&&(C.ESSceneObjectID=n.id);const E=C.readyEvent.addEventListener(T=>{n.instances&&r(T),n.readyEvent.emit(T)});return this.dispose(E),[C,m,S]};this.disposeVar(l.createProcessingFromAsyncFunc(async c=>{const d=this.owner.owner,{finalModelUriReact:u}=d;if(!u.value)return;const p=await c.promise(s());if(!p)return;const[f,g,m]=p;this._nativePrimitive=this.disposeVar(new AP(m,f,this)),this._nativePrimitive.update(),this.owner.owner.gltf=m})).start();{const c=()=>{this.nativePrimitive&&this.nativePrimitive.update()};c();const d=this.disposeVar(l.createNextAnimateFrameEvent(n.showChanged,n.clampAnimationsChanged,n.shadowsChanged,n.debugShowBoundingVolumeChanged,n.debugWireframeChanged,n.backFaceCullingChanged,n.heightReferenceChanged,n.distanceDisplayConditionChanged,n.colorChanged,n.colorBlendModeChanged,n.silhouetteColorChanged,n.colorBlendAmountChanged,n.silhouetteSizeChanged,n.activeAnimationsChanged,n.activeAnimationsAnimateWhilePausedChanged,n.nodeTransformationsChanged,n.nativeMinimumPixelSizeChanged,n.nativeMaximumScaleChanged,n.nativeScaleChanged,n.environmentMapManagerChanged,n.imageBasedLightingFactorChanged,o));this.dispose(d.disposableOn(c))}}get owner(){return this._owner}get nativePrimitive(){return this._nativePrimitive}}class FP extends l.Destroyable{constructor(i){super(),this._owner=i;const{owner:e}=this,{finalModelUriReact:n,finalSpecularEnvironmentMapsReact:o}=e,r=this.disposeVar(l.createNextAnimateFrameEvent(n.changed,e.basePathChanged,e.allowPickingChanged,e.incrementallyLoadTexturesChanged,e.showOutlineChanged,e.asynchronousChanged,e.creditChanged,e.forwardAxisChanged,e.upAxisChanged,e.lightColorChanged,e.sphericalHarmonicCoefficientsChanged,o.changed,e.customShaderInstanceClassChanged,e.opaquePassChanged,e.gltfJsonChanged,e.resetEvent));this.disposeVar(new l.ObjResettingWithEvent(r,()=>new xP(this)))}get owner(){return this._owner}}const Sd={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Kr=class Kr extends l.Destroyable{constructor(e,n){super();v(this,"_readyEvent",this.disposeVar(new l.Event));v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_customShaderInstanceClass",this.disposeVar(l.react(void 0)));v(this,"_updateCustomShaderEvent",this.disposeVar(new l.Event));v(this,"_activeAnimations",this.disposeVar(l.reactDeepArrayWithUndefined(void 0,(e,n)=>e.animationTime===n.animationTime&&e.delay===n.delay&&e.index===n.index&&e.loop===n.loop&&e.multiplier===n.multiplier&&e.name===n.name&&e.removeOnStop===n.removeOnStop&&e.reverse===n.reverse&&h.JulianDate.equals(e.startTime,n.startTime)&&h.JulianDate.equals(e.stopTime,n.stopTime)&&!0,e=>({...e}))));v(this,"_primitive");v(this,"_customShaderInstance");v(this,"_gltf",this.disposeVar(l.react(void 0)));v(this,"_czmViewVisibleDistanceRangeControl");v(this,"_sceneScaleFromPixelSize",this.disposeVar(l.react(void 0)));v(this,"_finalShowReact",this.disposeVar(l.react(!0)));v(this,"_finalModelUriReact");v(this,"_finalSpecularEnvironmentMapsReact",this.disposeVar(w.ESSceneObject.context.createEnvStrReact([this,"specularEnvironmentMaps"])));v(this,"_id",this.disposeVar(l.react(void 0)));v(this,"_setMaterialEvent",this.disposeVar(new l.Event));v(this,"_resetEvent",this.disposeVar(new l.Event));v(this,"_printDebugInfoEvent",this.disposeVar(new l.Event));v(this,"_smoothMoving",this.disposeVar(new Zm));v(this,"_smoothMovingBinding",this.dispose(this._smoothMoving.currentPositionChanged.disposableOn(()=>this.position=this._smoothMoving.currentPosition)));v(this,"_smoothMovingBinding2",this.dispose(this._smoothMoving.currentPositionChanged.disposableOn(()=>this.rotation=[this._smoothMoving.currentHeading??0,this.rotation&&this.rotation[1]||0,this.rotation&&this.rotation[2]||0])));this._czmViewer=e,n&&(this.id=n),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Qn(this.czmViewer,[this,"viewDistanceRange"],[this,"position"])),this.dispose(l.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"])),this._finalModelUriReact=this.disposeVar(w.ESSceneObject.context.createEnvStrReact([this,"url"],Kr.defaultUrl)),this.disposeVar(new FP(this));const o=e.viewer;if(!o)return;const r=()=>{try{this.customShaderInstanceClass=this.customShaderInstanceClassStr&&Function(`"use strict";return (${this.customShaderInstanceClassStr})`)()}catch{this.customShaderInstanceClass=void 0}};r(),this.dispose(this.customShaderInstanceClassStrChanged.disposableOn(r));{const a=()=>{if(!this.activeAnimationsJson){this.activeAnimations=void 0;return}this.activeAnimations=this.activeAnimationsJson.map(c=>{let d;try{d=c.animationTime&&Function(`"use strict";return (${c.animationTime})`)()}catch(u){console.error(`animationTimeStr eval error: ${u}`,u),d=void 0}return{name:c.name,index:c.index,startTime:c.startTime!==void 0&&h.JulianDate.fromDate(new Date(c.startTime))||void 0,delay:c.delay,stopTime:c.stopTime!==void 0&&h.JulianDate.fromDate(new Date(c.stopTime))||void 0,removeOnStop:c.removeOnStop,multiplier:c.multiplier,reverse:c.reverse,loop:c.loop&&h.ModelAnimationLoop[c.loop],animationTime:d}})};a(),this.activeAnimationsJsonChanged.disposableOn(a)}{const a=()=>this._finalShowReact.value=(this.show??!0)&&this.visibleAlpha>0;a(),this.dispose(this.showChanged.disposableOn(a)),this.dispose(this.visibleAlphaChanged.disposableOn(a))}const{sceneScaleFromPixelSize:s}=this;{const a=()=>{let c;if(this.position&&this.pixelSize){const d=h.Cartesian3.fromDegrees(...this.position);d&&(c=Vi(o.scene,d,this.pixelSize),c&&(this.maximumScale!==void 0&&c>this.maximumScale&&(c=this.maximumScale),this.minimumScale!==void 0&&c<this.minimumScale&&(c=this.minimumScale)))}s.value=c};a(),this.dispose(o.scene.preUpdate.addEventListener(a))}this.dispose(this.flyToEvent.disposableOn(a=>{if(!this.position){console.warn("当前没有位置信息,无法飞入!");return}if(this._primitive&&this._primitive.ready&&this._primitive.boundingSphere){const{center:c,radius:d}=this._primitive._boundingSphere;h.Matrix4.multiplyByPoint(this._primitive.modelMatrix,c,new h.Cartesian3);const u=d*3;se(o,this.position,u,void 0,a)}else{const c=o.scene.camera.positionCartographic.height;se(o,this.position,c,void 0,a)}})),this.dispose(this.updateCustomShaderEvent.disposableOn(a=>{this._customShaderInstance&&a(this._customShaderInstance,this,this.czmViewer)}))}get readyEvent(){return this._readyEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customShaderInstanceClass(){return this._customShaderInstanceClass.value}set customShaderInstanceClass(e){this._customShaderInstanceClass.value=e}get customShaderInstanceClassChanged(){return this._customShaderInstanceClass.changed}get updateCustomShaderEvent(){return this._updateCustomShaderEvent}updateCustomShader(e){this._updateCustomShaderEvent.emit(e)}get activeAnimations(){return this._activeAnimations.value}get activeAnimationsChanged(){return this._activeAnimations.changed}set activeAnimations(e){this._activeAnimations.value=e}setPrimitive(e){this._primitive=e}get primitive(){return this._primitive}get gltf(){return this._gltf.value}set gltf(e){this._gltf.value=e}get gltfChanged(){return this._gltf.changed}get czmViewerVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get sceneScaleFromPixelSize(){return this._sceneScaleFromPixelSize}get finalShow(){return this._finalShowReact.value}get finalModelUriReact(){return this._finalModelUriReact}get finalSpecularEnvironmentMapsReact(){return this._finalSpecularEnvironmentMapsReact}get czmViewer(){return this._czmViewer}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){this._setMaterialEvent.emit(e)}get resetEvent(){return this._resetEvent}reset(){this._resetEvent.emit()}get ready(){return!!this._primitive&&this._primitive.ready}async openLocalDir(){const e=await l.defaultGetLocalFilePath(["gltf","glb"],"gltf");this.url=e}deleteNodeTransformation(e){if(!this.nodeTransformations||!this.nodeTransformations[e])return;const n={...this.nodeTransformations};delete n[e],this.nodeTransformations=n}setNodeTranslation(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...Sd};if(n.length!==3||n.some(r=>!Number.isFinite(r))){console.error(`setNodeTranslation error: translation.length !== 3 || translation.some(e => !Number.isFinite(e)): ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,translationX:n[0],translationY:n[1],translationZ:n[2]}}}getNodeTranslation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.translationX,n.translationY,n.translationZ]}setNodeRotation(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...Sd};if(n.length!==3||n.some(r=>!Number.isFinite(r))){console.error(`setNodeTranslation error: rotation.length !== 3 || rotation.some(e => !Number.isFinite(e)) ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}getNodeRotation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}setNodeScale(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...Sd};if(n.length!==3||n.some(r=>!Number.isFinite(r)||r<0)){console.error(`setNodeTranslation error: scale.length !== 3 || scale.some(e => !Number.isFinite(e) || e < 0) ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodeScale(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}smoothMove(e,n){this.position||(this.position=e),this._smoothMoving.restart(this.position,0),this._smoothMoving.restart(e,n)}};v(Kr,"defaultUrl","${earthsdk3-assets-script-dir}/assets/glb/building.glb"),v(Kr,"defaultSpecularEnvironmentMaps","${earthsdk3-assets-script-dir}/assets/EnvironmentMap/kiara_6_afternoon_2k_ibl.ktx2"),v(Kr,"defaults",{activeAnimationsAnimateWhilePaused:!1,viewDistanceRange:[1e3,1e4,3e4,6e4],imageBasedLightingFactor:[1,1]});let at=Kr;(t=>{t.createDefaultProps=()=>({show:void 0,url:void 0,allowPicking:void 0,allowPickingDepth:!0,maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),scale:l.reactArrayWithUndefined(void 0),localPosition:l.reactArrayWithUndefined(void 0),localRotation:l.reactArrayWithUndefined(void 0),localScale:l.reactArrayWithUndefined(void 0),localModelMatrix:l.reactArrayWithUndefined(void 0),modelMatrix:l.reactArrayWithUndefined(void 0),forwardAxis:void 0,upAxis:void 0,color:l.reactArrayWithUndefined(void 0),silhouetteColor:l.reactArrayWithUndefined(void 0),shadows:void 0,credit:void 0,basePath:void 0,gltfJson:l.reactJson(void 0),heightReference:void 0,distanceDisplayCondition:void 0,colorBlendMode:void 0,incrementallyLoadTextures:void 0,asynchronous:void 0,clampAnimations:void 0,debugShowBoundingVolume:void 0,debugWireframe:void 0,backFaceCulling:void 0,showOutline:void 0,colorBlendAmount:void 0,silhouetteSize:void 0,imageBasedLightingFactor:l.reactArrayWithUndefined(void 0),lightColor:void 0,environmentMapManager:l.reactJsonWithUndefined(void 0),sphericalHarmonicCoefficients:void 0,specularEnvironmentMaps:void 0,customShaderInstanceClassStr:void 0,activeAnimationsJson:l.reactJsonWithUndefined(void 0),activeAnimationsAnimateWhilePaused:void 0,nodeTransformations:l.reactJsonWithUndefined(void 0),viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,nativeMinimumPixelSize:0,nativeMaximumScale:void 0,nativeScale:1,opaquePass:"OPAQUE",instances:l.reactArrayWithUndefined(void 0)})})(at||(at={})),l.extendClassProps(at.prototype,at.createDefaultProps);const kP={id:"e80d8802-e7dc-40d6-8cff-cfe3a12c8763",type:"CzmCustomPrimitive",show:!0,allowPicking:!0,cull:!1,pass:"OVERLAY",vertexShaderSource:`in vec3 position;
|
|
116
|
+
`}function ro(t,i){if(t)return Object.prototype.hasOwnProperty.call(t,i)?t[i]!=null?Object.assign({},t[i]):void 0:ro(t.childPickedInfo,i)}function so(t){return new Promise((e,n)=>{let o=new Image;o.src=t+"?v="+Math.random(),o.crossOrigin="*",o.onload=function(){e({width:o.width,height:o.height,base64:i(o),url:t})},o.onerror=function(){e(void 0)}});function i(e){let n=document.createElement("canvas");n.width=e.width,n.height=e.height,n.getContext("2d").drawImage(e,0,0,e.width,e.height);let r=e.src.substring(e.src.lastIndexOf(".")+1).toLowerCase();return n.toDataURL("image/"+r)}}function Km(t,i){const{width:e,height:n}=i;t.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[-e*.5,-n*.5,0],max:[e*.5,n*.5,0]}},t.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array([-.5*e,-.5*n,0,.5*e,-.5*n,0,.5*e,.5*n,0,-.5*e,.5*n,0])},normal:{componentsPerAttribute:3,typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([-1,-1,1,-1,1,1,-1,1])}},t.indexTypedArray=new Uint16Array([0,1,2,0,2,3])}function Jm(t){const i=l.min(l.objsIterator(t,["0"])),e=l.min(l.objsIterator(t,["1"])),n=l.min(l.objsIterator(t,["2"])),o=l.max(l.objsIterator(t,["0"])),r=l.max(l.objsIterator(t,["1"])),s=l.max(l.objsIterator(t,["2"]));return{minPos:[i,e,n],maxPos:[o,r,s]}}function vd(t,i){const e=360/i.segments,n=Math.PI/180*e,o=Math.floor(360/e),r=i.startRadius,s=i.stopRadius,a=i.height,c=[...new Array(o+1).keys()],d=c.map(I=>I*n).map(I=>[r*Math.cos(I),r*Math.sin(I),0]),u=c.map(I=>I*n).map(I=>[s*Math.cos(I),s*Math.sin(I),a]),p=[...d,...u],{minPos:f,maxPos:g}=Jm(p);t.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:f,max:g}};const m=c.map(I=>[0,1,0]).flat(),y=c.map(I=>[I/o,0]).flat(),P=c.map(I=>[I/o,1]).flat();t.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array(p.flat())},normal:{componentsPerAttribute:3,typedArray:new Float32Array([...m,...m])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([...y,...P])}};const S=[...new Array(o).keys()],C=S.map(I=>[I,I+o+1,I+o+2,I,I+o+2,I+1]),E=S.map(I=>[I,I+o+2,I+o+1,I,I+1,I+o+2]),T=[...C,...E].flat();t.indexTypedArray=new Uint16Array(T)}function hP(t,i){for(let[e,{defaultValue:n,componentName:o,originPropName:r=e}]of Object.entries(i))Reflect.has(t,e)?console.error(`Prop(${e}) conflicts!`):Object.defineProperties(t,{[e]:{get(){return this[o][r]},set(s){this[o][r]=s}},[`${e}Changed`]:{get(){return this[o][`${r}Changed`]}}})}function dP(t){const i={};for(let[e,{defaultValue:n}]of Object.entries(t))i[e]=n;return i}function yd(t,i,e,n){const o=new $e(e,n);return o.innerHTML=oo(t),o.position=i,o.show=!0,o}function Bm(t){const[i,e,n]=l.getReactFuncs(t),o=l.react(void 0),r=()=>{const s=i();o.value=s&&w.getGeoBoundingSphereFromPositions(s)};return r(),o.dispose(n.disposableOn(r)),o}function mi(t,i,e,n,o){const r=h.subscribeAndEvaluate(t,i,e,n,o);return()=>r.dispose()}var uP=(function(){function t(i){this.points=i.points||[],this.duration=i.duration||1e4,this.sharpness=i.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=i.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var n=this.points[e],o=this.points[e+1];this.centers.push({x:(n.x+o.x)/2,y:(n.y+o.y)/2,z:(n.z+o.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var r=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,s=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,a=this.points[e+1].z-(this.centers[e].z+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+r),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+s),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+a)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+r),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+s),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+a)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this}return t.prototype.cacheSteps=function(i){var e=[],n=this.pos(0);e.push(0);for(var o=0;o<this.duration;o+=10){var r=this.pos(o),s=Math.sqrt((r.x-n.x)*(r.x-n.x)+(r.y-n.y)*(r.y-n.y)+(r.z-n.z)*(r.z-n.z));s>i&&(e.push(o),n=r)}return e},t.prototype.vector=function(i){var e=this.pos(i+10),n=this.pos(i-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},t.prototype.pos=function(i){var e=i-this.delay;e<0&&(e=0),e>this.duration&&(e=this.duration-1);var n=e/this.duration;if(n>=1)return this.points[this.length-1];var o=Math.floor((this.points.length-1)*n),r=(this.length-1)*n-o;return pP(r,this.points[o],this.controls[o][1],this.controls[o+1][0],this.points[o+1])},t})();function pP(t,i,e,n,o){var r=fP(t),s={x:o.x*r[0]+n.x*r[1]+e.x*r[2]+i.x*r[3],y:o.y*r[0]+n.y*r[1]+e.y*r[2]+i.y*r[3],z:o.z*r[0]+n.z*r[1]+e.z*r[2]+i.z*r[3]};return s}function fP(t){var i=t*t,e=i*t;return[e,3*i*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]}function gP(t,i){i===void 0&&(i={});var e=i.resolution||1e3,n=i.sharpness||.85;const o=[],r=t.map(d=>{const[u,p,f]=w.lbhToXyz(d);return{x:u,y:p,z:f}});for(var s=new uP({duration:e,points:r,sharpness:n}),a=function(d){var u=s.pos(d);const p=w.xyzToLbh([u.x,u.y,u.z]);o.push(p)},c=0;c<s.duration;c+=10)a(c);return a(s.duration),o}function wd(t,i,e){return gP(t,{resolution:i,sharpness:e})}function Wi(t){var e;const i=(e=ro(t,"pickResult"))==null?void 0:e.pointerEvent;return(i==null?void 0:i.buttons)!=0?(i==null?void 0:i.button)??0:-1}const Kt=[0,-30,0],mP=new h.Cartesian3,us=new h.HeadingPitchRoll,vP=new h.Matrix4,yP=new h.Cartesian3;function wP(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}const CP=[0,0,0];function ps(t,i){const{position:e,viewDistance:n,rotation:o,duration:r,cancelCallback:s,hdelta:a,pdelta:c}=i;if(!e&&n===void 0&&!o)return;const[d,u,p]=e??wP(t.positionCartographic,CP),f=h.Cartesian3.fromDegrees(d,u,p,void 0,mP),g=o&&[...o].map(h.Math.toRadians)||[t.heading,t.pitch,t.roll];let m={heading:g[0],pitch:g[1],roll:g[2]};if(n){us.heading=g[0],us.pitch=g[1],us.roll=g[2],us.heading-=h.Math.PI_OVER_TWO;const S=h.Transforms.headingPitchRollToFixedFrame(f,us,void 0,void 0,vP),C=h.Matrix4.multiplyByPointAsVector(S,h.Cartesian3.UNIT_X,yP);h.Cartesian3.multiplyByScalar(C,n,C),h.Cartesian3.subtract(f,C,f)}if(a&&(m.heading-=h.Math.toRadians(a)),c&&(m.pitch+=h.Math.toRadians(c)),r===0){t.setView({destination:f,orientation:m});return}let y;const P=new Promise((S,C)=>{t.flyTo({destination:f,orientation:m,duration:(r??1e3)*.001,complete:()=>{S(!0)},cancel:()=>{s&&s(),S(!1)}});const E=t._currentFlight;y=()=>{E===t._currentFlight&&(t.cancelFlight(),t._currentFlight&&(console.error("cancelFlight后_currentFlight不应该存在!"),C("cancelFlight后_currentFlight不应该存在!")))}});return l.pairToPromise([y,P])}function se(t,i,e,n,o,r){const s=t==null?void 0:t.camera;return s&&ps(s,{position:i,viewDistance:e,rotation:n,duration:o&&o*1e3,cancelCallback:r})}async function Jt(t,i,e,n,o,r,s=!1){if(!t.viewer)return;const a=_d(t,o),c=[...Kt];s&&(c[0]=i.rotation[0]-90);const{position:d,rotation:u}=lc(n,c,a);let p=await t.flyTo({distance:0,heading:u[0],pitch:u[1],flyDuration:r??1,hDelta:0,pDelta:0},d);return i.flyOverEvent.emit(e,p?"over":p==null?"error":"cancelled",t),p??!1}async function ae(t,i,e,n,o,r=!1){const s=w.getGeoBoundingSphereFromPositions(n);if(s&&s.center&&s.radius&&t.viewer){const a=_d(t,s.radius),c=[...Kt];r&&(c[0]=i.rotation[0]-90);const{position:d,rotation:u}=lc(s.center,c,a);let p=await t.flyTo({distance:0,heading:u[0],pitch:u[1],flyDuration:o??1,hDelta:0,pDelta:0},d);return i.flyOverEvent.emit(e,p?"over":p==null?"error":"cancelled",t),p??!1}return!1}async function It(t,i,e,n,o,r=!1){const s=_P(t,o);if(s!=null){const[a,c]=s,d=[...Kt];r&&(d[0]=i.rotation[0]-90);const{position:u,rotation:p}=lc(a,d,c);let f=await t.flyTo({distance:0,heading:p[0],pitch:p[1],flyDuration:n??1,hDelta:0,pDelta:0},u);return i.flyOverEvent.emit(e,f?"over":f==null?"error":"cancelled",t),f??!1}return!1}function _P(t,i){if(i instanceof ke&&i.nativePrimitive&&i.nativePrimitive.boundingVolume)return Cd(t,i.nativePrimitive.boundingVolume);if(i instanceof at&&i.primitive)return Cd(t,i.primitive.boundingSphere)}function Cd(t,i){let e,n;if(i instanceof h.BoundingSphere)n=ce(i.center),e=i.radius;else if(i instanceof h.BoundingRectangle){const{x:o,y:r,width:s,height:a}=i,c=h.Rectangle.fromRadians(o,r,o+s,r+a),d=h.BoundingSphere.fromRectangle2D(c);n=ce(d.center),e=d.radius}else if(i instanceof h.OrientedBoundingBox){n=ce(i.center);const o=i.halfAxes,r=l.Vector.magnitude([o[0],o[1],o[2]]),s=l.Vector.magnitude([o[3],o[4],o[5]]),a=l.Vector.magnitude([o[6],o[7],o[8]]);e=Math.max(r,s,a)}if(!(!n||e===void 0||!t.viewer))return e=_d(t,e),[n,e]}function _d(t,i){if(i=Math.abs(i),i==0&&(i=1),!t.viewer)return i;const e=i/((t.flyToBoundingSize??256)*.5/(t.viewer.canvas.width/2)*Math.tan(h.Math.toRadians(t.fov/2)));return Math.sqrt(i*i+e*e)}function lc(t,i,e){const n=new h.Cartesian3(-e*Math.cos(h.Math.toRadians(i[1]))*Math.cos(h.Math.toRadians(i[0]-90)),e*Math.cos(h.Math.toRadians(i[1]))*Math.sin(h.Math.toRadians(i[0]-90)),-e*Math.sin(h.Math.toRadians(i[1]))),o=h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(...t));let r=h.Matrix4.multiplyByPoint(o,n,new h.Cartesian3);const s=h.Cartesian3.fromDegrees(...t),a=h.Cartesian3.subtract(s,r,new h.Cartesian3);h.Cartesian3.normalize(a,a);const c=h.Transforms.rotationMatrixFromPositionVelocity(r,a,h.Ellipsoid.WGS84),d=h.Matrix4.fromRotationTranslation(c,r);var u=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(d,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),p=h.Matrix4.multiply(h.Matrix4.inverse(u,new h.Matrix4),d,new h.Matrix4),f=h.Matrix4.getMatrix3(p,new h.Matrix3),g=h.Quaternion.fromRotationMatrix(f),m=h.HeadingPitchRoll.fromQuaternion(g);const y=h.Cartographic.fromCartesian(r);return{position:[h.Math.toDegrees(y.longitude),h.Math.toDegrees(y.latitude),y.height],rotation:[h.Math.toDegrees(m.heading)+90,h.Math.toDegrees(m.pitch),h.Math.toDegrees(m.roll)]}}function jm(t,i=128,e=128,n="image/jpeg"){let o;return new Promise((r,s)=>{var a=t._postRender.addEventListener(()=>{let c=t.canvas,d=c.width,u=c.height;o||(o=document.createElement("canvas")),o.setAttribute("width",`${i}`),o.setAttribute("height",`${e}`);let p,f,g,m;d/i<u/e?(p=0,g=d,m=e*d/i,f=(u-m)*.5):(f=0,m=u,g=i*u/e,p=(d-g)*.5);let y=o.getContext("2d");if(!y){a(),s(new Error("captureScreenCanvas.getContext('2d') error!"));return}y.drawImage(c,p,f,g,m,0,0,i,e);let P=o.toDataURL(n);a(),r(P)},null)})}async function ev(t,i){const e=[],n=i.length;let o=0;for(let r=0;r<n-1;++r)o+=await tv(t,i[r],i[r+1]),e.push(o);return e}function tv(t,i,e){const n=si(i),o=si(e),r=[];return new Promise(async s=>{const a=parseInt(h.Cartesian3.distance(n,o).toString()),c=h.Cartographic.fromCartesian(n),d=[c.longitude,c.latitude],u=h.Cartographic.fromCartesian(o),p=[u.longitude,u.latitude];r.push(new h.Cartographic(d[0],d[1]));for(let m=1;m<=a-1;m++){let y=h.Math.lerp(d[0],p[0],m/a),P=h.Math.lerp(d[1],p[1],m/a);r.push(new h.Cartographic(y,P))}const f=await h.sampleTerrainMostDetailed(t.terrainProvider,[...r]),g=await iv(f);s(g)})}function iv(t){return new Promise(i=>{let e=0;t.map((n,o)=>{if(o==t.length-1)return;const r=t[o+1],s=h.Cartesian3.fromRadians(n.longitude,n.latitude,n.height),a=h.Cartesian3.fromRadians(r.longitude,r.latitude,r.height);e+=h.Cartesian3.distance(s,a)}),i(e)})}class PP extends l.Destroyable{constructor(i){super(),this._nativePrimitive=i;const{sceneObject:e,sceneScaleFromPixelSize:n,viewer:o,primitive:r}=this,s=()=>{if(!this.finalShow){r.show=!1;return}r.show=!0;const a=Fe({localScale:e.localScale,initialRotation:"xForwardzUp",localRotation:e.localRotation,localPosition:e.localPosition,localModelMatrix:e.localModelMatrix,sceneScaleFromPixelSize:n.value,scale:e.scale,rotation:e.rotation,position:e.instances&&e.instances.length!==0?ce(h.BoundingSphere.fromPoints(e.instances.map(c=>Ve(c.position))).center):e.position,modelMatrix:e.modelMatrix});if(!a){console.warn("computeCzmModelMatrix error.");return}r.modelMatrix=a};{let a=!0;this.dispose(e.showChanged.disposableOn(()=>a=!0)),this.dispose(e.localPositionChanged.disposableOn(()=>a=!0)),this.dispose(e.localRotationChanged.disposableOn(()=>a=!0)),this.dispose(e.localScaleChanged.disposableOn(()=>a=!0)),this.dispose(e.localModelMatrixChanged.disposableOn(()=>a=!0)),this.dispose(e.positionChanged.disposableOn(()=>a=!0)),this.dispose(e.rotationChanged.disposableOn(()=>a=!0)),this.dispose(e.instancesChanged.disposableOn(()=>a=!0)),this.dispose(e.scaleChanged.disposableOn(()=>a=!0)),this.dispose(e.modelMatrixChanged.disposableOn(()=>a=!0)),this.dispose(n.changed.disposableOn(()=>a=!0)),this.dispose(e.readyEvent.don(()=>a=!0)),s(),this.dispose(o.scene.preUpdate.addEventListener(()=>{a&&(a&&(a=!1),s())}))}}get nativePrimitive(){return this._nativePrimitive}get czmCzmModelPrimitive(){return this.nativePrimitive.czmCzmModelPrimitive}get sceneObject(){return this.czmCzmModelPrimitive}get sceneScaleFromPixelSize(){return this.czmCzmModelPrimitive.sceneScaleFromPixelSize}get viewer(){return this.czmCzmModelPrimitive.czmViewer.viewer}get finalShow(){return this.czmCzmModelPrimitive.finalShow}get primitive(){return this.nativePrimitive.primitive}}class SP extends l.Destroyable{constructor(i){super(),this._owner=i}get owner(){return this._owner}updateNodeMatrix(i){const e=this.owner.owner.owner.owner,n=i._nodesByName&&Object.keys(i._nodesByName);if(n)for(const o of n){const r=i.getNode(o);if(!r){console.error(`!node ${o}`);continue}const s=e.nodeTransformations&&e.nodeTransformations[o];if(!s){h.Matrix4.equals(r.matrix,r.originalMatrix)||(r.matrix=void 0);continue}const{translationX:a,translationY:c,translationZ:d,rotationHeading:u,rotationPitch:p,rotationRoll:f,scaleX:g,scaleY:m,scaleZ:y}=s;if(!Number.isFinite(a)||!Number.isFinite(c)||!Number.isFinite(d)||!Number.isFinite(u)||!Number.isFinite(p)||!Number.isFinite(f)||!Number.isFinite(g)||!Number.isFinite(m)||!Number.isFinite(y)){console.error(`transformation数值有误!${JSON.stringify(s,void 0," ")}`,s);continue}if(g<0||m<0||y<0){console.error("scaleX < 0 || scaleY < 0 || scaleZ < 0");continue}const P=h.Math.toRadians,S=h.Matrix4.fromTranslationQuaternionRotationScale(new h.Cartesian3(a,c,d),h.Quaternion.fromHeadingPitchRoll(new h.HeadingPitchRoll(P(u),P(p),P(f))),new h.Cartesian3(g,m,y));r.matrix=h.Matrix4.multiply(r.originalMatrix,S,r.matrix??new h.Matrix4)}}update(){const i=this.owner.owner.owner.owner,{primitive:e}=this.owner;if(e.activeAnimations.animateWhilePaused=i.activeAnimationsAnimateWhilePaused??at.defaults.activeAnimationsAnimateWhilePaused,e.activeAnimations.removeAll(),i.activeAnimations)for(let n of i.activeAnimations)e.activeAnimations.add({name:n.name,index:n.index,startTime:n.startTime,delay:n.delay,stopTime:n.stopTime,removeOnStop:n.removeOnStop,multiplier:n.multiplier,reverse:n.reverse,loop:n.loop,animationTime:n.animationTime});this.updateNodeMatrix(e)}}const EP=[6378137,6378137,6356752314245179e-9];var ut;(t=>{t.heightReferencePropsMap={NONE:h.HeightReference.NONE,CLAMP_TO_GROUND:h.HeightReference.CLAMP_TO_GROUND,RELATIVE_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND},t.shadowPropsMap={DISABLED:h.ShadowMode.DISABLED,CAST_ONLY:h.ShadowMode.CAST_ONLY,ENABLED:h.ShadowMode.ENABLED,RECEIVE_ONLY:h.ShadowMode.RECEIVE_ONLY},t.classificationTypeMap={TERRAIN:h.ClassificationType.TERRAIN,CESIUM_3D_TILE:h.ClassificationType.CESIUM_3D_TILE,BOTH:h.ClassificationType.BOTH,NONE:void 0},t.textureMinificationFilterType={NEAREST:h.TextureMinificationFilter.NEAREST,LINEAR:h.TextureMinificationFilter.LINEAR,NEAREST_MIPMAP_NEAREST:h.TextureMinificationFilter.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:h.TextureMinificationFilter.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:h.TextureMinificationFilter.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:h.TextureMinificationFilter.LINEAR_MIPMAP_LINEAR},t.textureMagnificationFilterType={NEAREST:h.TextureMagnificationFilter.NEAREST,LINEAR:h.TextureMagnificationFilter.LINEAR},t.colorBlendModeType={HIGHLIGHT:h.ColorBlendMode.HIGHLIGHT,REPLACE:h.ColorBlendMode.REPLACE,MIX:h.ColorBlendMode.MIX},t.horizontalOriginType={CENTER:h.HorizontalOrigin.CENTER,LEFT:h.HorizontalOrigin.LEFT,RIGHT:h.HorizontalOrigin.RIGHT},t.verticalOriginOriginType={CENTER:h.VerticalOrigin.CENTER,BOTTOM:h.VerticalOrigin.BOTTOM,BASELINE:h.VerticalOrigin.BASELINE,TOP:h.VerticalOrigin.TOP},t.labelStyleType={FILL:h.LabelStyle.FILL,OUTLINE:h.LabelStyle.OUTLINE,FILL_AND_OUTLINE:h.LabelStyle.FILL_AND_OUTLINE},t.blendOptionType={OPAQUE:h.BlendOption.OPAQUE,TRANSLUCENT:h.BlendOption.TRANSLUCENT,OPAQUE_AND_TRANSLUCENT:h.BlendOption.OPAQUE_AND_TRANSLUCENT}})(ut||(ut={}));const Pd={river:{waterColor:[95/255,115/255,70/255,1],frequency:800,waveVelocity:.6,amplitude:.1,specularIntensity:.8,flowDirection:0,flowSpeed:0},ocean:{waterColor:[12/255,30/255,69/255,1],frequency:360,waveVelocity:.8,amplitude:.5,specularIntensity:.8,flowDirection:0,flowSpeed:0},lake:{waterColor:[32/255,84/255,105/255,1],frequency:200,waveVelocity:.4,amplitude:.01,specularIntensity:.8,flowDirection:0,flowSpeed:0}};class AP extends l.Destroyable{constructor(e,n,o){super();v(this,"_modelMatrixUpdating");v(this,"_nativePrimitiveReady");this._gltf=e,this._primitive=n,this._owner=o,this._modelMatrixUpdating=this.disposeVar(new PP(this));const{czmViewer:r,sceneObject:s,pickingManager:a}=this,{viewer:c}=r;if(!c)throw new Error("!viewer");const{scene:d}=c;d.primitives.add(this._primitive),this.dispose(()=>d.primitives.remove(this._primitive)),this.owner.owner.owner.setPrimitive(this._primitive),this.dispose(()=>this.owner.owner.owner.setPrimitive(void 0)),this.dispose(s.printDebugInfoEvent.disposableOn(()=>{console.log(`---czm-model-primitive-debug-info-viewerid-${r.id}-begin---`),console.log("CzmCzmModelPrimitive: ",this),console.log("native gltf: ",this.gltf),console.log("native primitive: ",this.primitive),console.log(`---czm-model-primitive-debug-info-viewerid-${r.id}-end---`)}));const u=this._primitive.readyEvent.addEventListener(()=>{if(u(),!this.primitive.ready)throw console.error("!this.primitive.ready"),new Error("!this.primitive.ready");if(this._nativePrimitiveReady)throw console.error("this._nativePrimitiveReady"),new Error("this._nativePrimitiveReady");this._nativePrimitiveReady=this.disposeVar(new SP(this)),this._nativePrimitiveReady.update()});this.dispose(u)}get owner(){return this._owner}get czmCzmModelPrimitive(){return this.owner.owner.owner}get czmViewer(){return this.czmCzmModelPrimitive.czmViewer}get viewer(){return this.czmViewer.viewer}get scene(){return this.viewer.scene}get primitive(){return this._primitive}get sceneObject(){return this.czmCzmModelPrimitive}get gltf(){return this._gltf}get pickingManager(){var e;return(e=this.czmViewer.extensions)==null?void 0:e.pickingManager}get nativePrimitiveReady(){return this._nativePrimitiveReady}update(){const{visibleAlpha:e,finalShow:n,finalSpecularEnvironmentMapsReact:o}=this.owner.owner.owner,r=this.owner.owner.owner,{primitive:s}=this,a=n;s.show=a,s.clampAnimations=r.clampAnimations??!0,s.shadows=ut.shadowPropsMap[r.shadows??"DISABLED"],s.debugShowBoundingVolume=r.debugShowBoundingVolume??!1,s.debugWireframe=r.debugWireframe??!1,s.backFaceCulling=r.backFaceCulling??!0,s.heightReference=r.heightReference?ut.heightReferencePropsMap[r.heightReference]:ut.heightReferencePropsMap.NONE,s.distanceDisplayCondition=ss(r.distanceDisplayCondition??[0,Number.MAX_VALUE]);{const d=r.color??[1,1,1,1];d[3]*=e;const u=ie(d);s.color=u}s.colorBlendMode=ut.colorBlendModeType[r.colorBlendMode??"HIGHLIGHT"],s.silhouetteColor=r.silhouetteColor&&ie(r.silhouetteColor)||h.Color.RED,s.silhouetteSize=r.silhouetteSize??0,s.colorBlendAmount=r.colorBlendAmount??.5,s.lightColor=(r.lightColor&&si(r.lightColor))??void 0;const c=s.imageBasedLighting;c&&(c.imageBasedLightingFactor=Ee(r.imageBasedLightingFactor??at.defaults.imageBasedLightingFactor),c.sphericalHarmonicCoefficients=r.sphericalHarmonicCoefficients&&ud(r.sphericalHarmonicCoefficients),c.specularEnvironmentMaps=o.value),s.environmentMapManager&&dd(s.environmentMapManager,r),s.minimumPixelSize=r.nativeMinimumPixelSize,s.maximumScale=r.nativeMaximumScale,s.scale=r.nativeScale,this._nativePrimitiveReady&&this._nativePrimitiveReady.update()}}const cc=new h.Cartesian3,TP=new h.HeadingPitchRoll,nv=new h.Matrix3,MP=new h.Quaternion,hc=h.ModelComponents.Attribute,IP=h.ModelComponents.FeatureIdAttribute,ov=h.ModelComponents.Instances;function DP(t,i,e,n){if(!n||n.length===0){const W=i.nodes,N=W.length;for(let L=0;L<N;L++){const U=W[L];U.primitives.length>0&&(U.instances=void 0)}return}let o;const r=n?n.length:0;if(r===0)return;const s=new Float32Array(3*r),a=new Float32Array(4*r),c=new Float32Array(3*r),d=new Float32Array(r),u=new Array(4),p=new Array(3),f=h.BoundingSphere.fromPoints(n.map(W=>Ve(W.position))),g=h.Matrix4.inverse(h.Transforms.northWestUpToFixedFrame(f.center),new h.Matrix4);for(o=0;o<r;o++)h.Matrix4.multiplyByPoint(g,Ve(n[o].position),cc),s[3*o+0]=cc.x,s[3*o+1]=cc.y,s[3*o+2]=cc.z,h.Matrix3.fromHeadingPitchRoll(h.HeadingPitchRoll.fromDegrees(...n[o].rotation??[0,0,0],TP),nv),h.Quaternion.pack(h.Quaternion.fromRotationMatrix(nv,MP),u,0),a[4*o+0]=u[0],a[4*o+1]=u[1],a[4*o+2]=u[2],a[4*o+3]=u[3],h.Cartesian3.pack(h.Cartesian3.fromArray(n[o].scale??[1,1,1]),p,0),c[3*o+0]=p[1],c[3*o+1]=p[0],c[3*o+2]=p[2],d[o]=o;const m=new ov;m.transformInWorldSpace=!0,t._buffers||(t._buffers=[]);const y=t._buffers,P=new hc;P.name="Instance Translation",P.semantic=h.InstanceAttributeSemantic.TRANSLATION,P.componentDatatype=h.ComponentDatatype.FLOAT,P.type=h.AttributeType.VEC3,P.count=r,P.typedArray=s,m.attributes.push(P);const S=new hc;S.name="Instance Rotation",S.semantic=h.InstanceAttributeSemantic.ROTATION,S.componentDatatype=h.ComponentDatatype.FLOAT,S.type=h.AttributeType.VEC4,S.count=r,S.typedArray=a,m.attributes.push(S);const C=new hc;C.name="Instance Scale",C.semantic=h.InstanceAttributeSemantic.SCALE,C.componentDatatype=h.ComponentDatatype.FLOAT,C.type=h.AttributeType.VEC3,C.count=r,C.typedArray=c,m.attributes.push(C);const E=new hc;E.name="Instance Feature ID",E.setIndex=0,E.semantic=h.InstanceAttributeSemantic.FEATURE_ID,E.componentDatatype=h.ComponentDatatype.FLOAT,E.type=h.AttributeType.SCALAR,E.count=r;const T=h.Buffer.createVertexBuffer({context:e.context,typedArray:d,usage:h.BufferUsage.STATIC_DRAW});T.vertexArrayDestroyable=!1,y.push(T),E.buffer=T,m.attributes.push(E);const I=new IP;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",m.featureIds.push(I);const b=i.nodes,x=b.length;let z=!1;for(o=0;o<x;o++){const W=b[o];W.primitives.length>0&&(W.instances=z?RP(m):m,z=!0)}}function bP(t,i){var o;const e=t?t.length:0;if(e===0){i.structuralMetadata=void 0;return}let n;if(t!=null&&t[0]){const r={id:new Array(e)};for(let c=0;c<e;c++)r.id[c]=((o=t[c])==null?void 0:o.id)??c;const s=new h.JsonMetadataTable({count:e,properties:r}),a=new h.PropertyTable({name:h.MetadataClass.BATCH_TABLE_CLASS_NAME,count:e,jsonMetadataTable:s});n=new h.StructuralMetadata({schema:{},propertyTables:[a]})}else{const r=new h.PropertyTable({name:h.MetadataClass.BATCH_TABLE_CLASS_NAME,count:e});n=new h.StructuralMetadata({schema:{},propertyTables:[r]})}i.structuralMetadata=n}function RP(t){const i=new ov;i.transformInWorldSpace=t.transformInWorldSpace;const e=t.attributes,n=e.length;for(let o=0;o<n;o++){const r=h.clone(e[o],!1);i.attributes.push(r)}return i}class xP extends l.Destroyable{constructor(e){super();v(this,"_nativePrimitive");this._owner=e;const n=this.owner.owner,{visibleAlphaChanged:o}=n,r=c=>{var u;this.nativePrimitive&&this.nativePrimitive.pickingManager&&(this.nativePrimitive.pickingManager.pause=!0),c._resourcesLoaded=c._texturesLoaded=!1;const d=(u=e.owner.czmViewer.viewer)==null?void 0:u.scene.preUpdate.addEventListener(p=>{const f=p.frameState;if(c._loader.components){const g=c._loader.components;DP(c._loader,g,f,n.instances),bP(n.instances,g),c._loader._components=g,c._loader._arrayBuffer=void 0,n.instances&&n.instances.length>0?c._featureTableIdDirty=!0:c._drawCommandsBuilt=!1,d&&d(),this.nativePrimitive&&this.nativePrimitive.pickingManager&&(this.nativePrimitive.pickingManager.pause=!1),f.afterRender.push(()=>{var m;(m=this.nativePrimitive)==null||m.update()})}})};{let c=Promise.resolve();const d=()=>{c=c.then(()=>{if(!this.nativePrimitive)return;const u=this.nativePrimitive.primitive;r(u)})};d(),this.ad(n.instancesChanged.don(d))}this.ad(n.setMaterialEvent.don(async c=>{let d=!0;if(!this.nativePrimitive)return;if(c=="default")d=hs(this.nativePrimitive.primitive,"default");else{if(!this.nativePrimitive)return;const p={};for(const f in c){let g,m,y;const P=c[f];p[f]={...P},Reflect.has(P,"baseColorTexture")&&(P.baseColorTexture==null?p[f].baseColorTexture=void 0:P.baseColorTexture.value!=""&&(g=io(this.owner.owner.czmViewer.viewer,P.baseColorTexture,{magFilter:P.magFilter,minFilter:P.minFilter}))),Reflect.has(P,"normalTexture")&&(P.normalTexture==null?p[f].normalTexture=void 0:P.normalTexture.value!=""&&(m=io(this.owner.owner.czmViewer.viewer,P.normalTexture,{magFilter:P.magFilter,minFilter:P.minFilter}))),Reflect.has(P,"metallicRoughnessTexture")&&(P.metallicRoughnessTexture==null?p[f].metallicRoughnessTexture=void 0:P.metallicRoughnessTexture.value!=""&&(y=io(this.owner.owner.czmViewer.viewer,P.metallicRoughnessTexture,{magFilter:P.magFilter,minFilter:P.minFilter})));const S=await Promise.allSettled([g,m,y]);g=S[0].value,m=S[1].value,y=S[2].value,y!=null&&(p[f].metallicRoughnessTexture=y),g!=null&&(p[f].baseColorTexture=g),m!=null&&(p[f].normalTexture=m)}d=hs(this.nativePrimitive.primitive,p)}const u=w.ESSceneObject.getSceneObject(this._owner.owner.id);u&&u instanceof w.ESGltfModel&&u.setMaterialInfoEvent.emit({type:d?"success":"warn",message:d?"完成":"部分材质颜色纹理设置失败,请检查原始模型中材质是否具有baseColorTexture属性"})}));const s=async()=>{const c=this.owner.owner,{finalModelUriReact:d,czmViewer:u,visibleAlpha:p,finalShow:f}=c,g=u.viewer;if(!d.value)return;const m=n.customShaderInstanceClass&&new n.customShaderInstanceClass(n,u),y=n.color??[1,1,1,1];y[3]*=p;const P=ie(y);let S;const C=await h.Model.fromGltfAsync({url:n.gltfJson?void 0:d.value,gltf:n.gltfJson?JSON.parse(JSON.stringify(n.gltfJson)):void 0,releaseGltfJson:!!n.gltfJson,basePath:n.basePath,show:f,allowPicking:n.allowPicking,incrementallyLoadTextures:n.incrementallyLoadTextures,asynchronous:n.asynchronous,clampAnimations:n.clampAnimations,shadows:n.shadows&&ut.shadowPropsMap[n.shadows],debugShowBoundingVolume:n.debugShowBoundingVolume,debugWireframe:n.debugWireframe,backFaceCulling:n.backFaceCulling,showOutline:n.showOutline,heightReference:n.heightReference&&ut.heightReferencePropsMap[n.heightReference],distanceDisplayCondition:n.distanceDisplayCondition&&ss(n.distanceDisplayCondition),color:P,scene:g.scene,colorBlendMode:n.colorBlendMode&&ut.colorBlendModeType[n.colorBlendMode],credit:n.credit,silhouetteColor:n.silhouetteColor&&ie(n.silhouetteColor),colorBlendAmount:n.colorBlendAmount,silhouetteSize:n.silhouetteSize,upAxis:n.upAxis,forwardAxis:n.forwardAxis,customShader:m&&m.customShader,opaquePass:h.Pass[n.opaquePass],gltfCallback:T=>{S=T}});h.Model.prototype&&(C.ESSceneObjectID=n.id);const E=C.readyEvent.addEventListener(T=>{n.instances&&r(T),n.readyEvent.emit(T)});return this.dispose(E),[C,m,S]};this.disposeVar(l.createProcessingFromAsyncFunc(async c=>{const d=this.owner.owner,{finalModelUriReact:u}=d;if(!u.value)return;const p=await c.promise(s());if(!p)return;const[f,g,m]=p;this._nativePrimitive=this.disposeVar(new AP(m,f,this)),this._nativePrimitive.update(),this.owner.owner.gltf=m})).start();{const c=()=>{this.nativePrimitive&&this.nativePrimitive.update()};c();const d=this.disposeVar(l.createNextAnimateFrameEvent(n.showChanged,n.clampAnimationsChanged,n.shadowsChanged,n.debugShowBoundingVolumeChanged,n.debugWireframeChanged,n.backFaceCullingChanged,n.heightReferenceChanged,n.distanceDisplayConditionChanged,n.colorChanged,n.colorBlendModeChanged,n.silhouetteColorChanged,n.colorBlendAmountChanged,n.silhouetteSizeChanged,n.activeAnimationsChanged,n.activeAnimationsAnimateWhilePausedChanged,n.nodeTransformationsChanged,n.nativeMinimumPixelSizeChanged,n.nativeMaximumScaleChanged,n.nativeScaleChanged,n.environmentMapManagerChanged,n.imageBasedLightingFactorChanged,o));this.dispose(d.disposableOn(c))}}get owner(){return this._owner}get nativePrimitive(){return this._nativePrimitive}}class FP extends l.Destroyable{constructor(i){super(),this._owner=i;const{owner:e}=this,{finalModelUriReact:n,finalSpecularEnvironmentMapsReact:o}=e,r=this.disposeVar(l.createNextAnimateFrameEvent(n.changed,e.basePathChanged,e.allowPickingChanged,e.incrementallyLoadTexturesChanged,e.showOutlineChanged,e.asynchronousChanged,e.creditChanged,e.forwardAxisChanged,e.upAxisChanged,e.lightColorChanged,e.sphericalHarmonicCoefficientsChanged,o.changed,e.customShaderInstanceClassChanged,e.opaquePassChanged,e.gltfJsonChanged,e.resetEvent));this.disposeVar(new l.ObjResettingWithEvent(r,()=>new xP(this)))}get owner(){return this._owner}}const Sd={translationX:0,translationY:0,translationZ:0,rotationHeading:0,rotationPitch:0,rotationRoll:0,scaleX:1,scaleY:1,scaleZ:1},Kr=class Kr extends l.Destroyable{constructor(e,n){super();v(this,"_readyEvent",this.disposeVar(new l.Event));v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_customShaderInstanceClass",this.disposeVar(l.react(void 0)));v(this,"_updateCustomShaderEvent",this.disposeVar(new l.Event));v(this,"_activeAnimations",this.disposeVar(l.reactDeepArrayWithUndefined(void 0,(e,n)=>e.animationTime===n.animationTime&&e.delay===n.delay&&e.index===n.index&&e.loop===n.loop&&e.multiplier===n.multiplier&&e.name===n.name&&e.removeOnStop===n.removeOnStop&&e.reverse===n.reverse&&h.JulianDate.equals(e.startTime,n.startTime)&&h.JulianDate.equals(e.stopTime,n.stopTime)&&!0,e=>({...e}))));v(this,"_primitive");v(this,"_customShaderInstance");v(this,"_gltf",this.disposeVar(l.react(void 0)));v(this,"_czmViewVisibleDistanceRangeControl");v(this,"_sceneScaleFromPixelSize",this.disposeVar(l.react(void 0)));v(this,"_finalShowReact",this.disposeVar(l.react(!0)));v(this,"_finalModelUriReact");v(this,"_finalSpecularEnvironmentMapsReact",this.disposeVar(w.ESSceneObject.context.createEnvStrReact([this,"specularEnvironmentMaps"])));v(this,"_id",this.disposeVar(l.react(void 0)));v(this,"_setMaterialEvent",this.disposeVar(new l.Event));v(this,"_resetEvent",this.disposeVar(new l.Event));v(this,"_printDebugInfoEvent",this.disposeVar(new l.Event));v(this,"_smoothMoving",this.disposeVar(new Zm));v(this,"_smoothMovingBinding",this.dispose(this._smoothMoving.currentPositionChanged.disposableOn(()=>this.position=this._smoothMoving.currentPosition)));v(this,"_smoothMovingBinding2",this.dispose(this._smoothMoving.currentPositionChanged.disposableOn(()=>this.rotation=[this._smoothMoving.currentHeading??0,this.rotation&&this.rotation[1]||0,this.rotation&&this.rotation[2]||0])));this._czmViewer=e,n&&(this.id=n),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Qn(this.czmViewer,[this,"viewDistanceRange"],[this,"position"])),this.dispose(l.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"])),this._finalModelUriReact=this.disposeVar(w.ESSceneObject.context.createEnvStrReact([this,"url"],Kr.defaultUrl)),this.disposeVar(new FP(this));const o=e.viewer;if(!o)return;const r=()=>{try{this.customShaderInstanceClass=this.customShaderInstanceClassStr&&Function(`"use strict";return (${this.customShaderInstanceClassStr})`)()}catch{this.customShaderInstanceClass=void 0}};r(),this.dispose(this.customShaderInstanceClassStrChanged.disposableOn(r));{const a=()=>{if(!this.activeAnimationsJson){this.activeAnimations=void 0;return}this.activeAnimations=this.activeAnimationsJson.map(c=>{let d;try{d=c.animationTime&&Function(`"use strict";return (${c.animationTime})`)()}catch(u){console.error(`animationTimeStr eval error: ${u}`,u),d=void 0}return{name:c.name,index:c.index,startTime:c.startTime!==void 0&&h.JulianDate.fromDate(new Date(c.startTime))||void 0,delay:c.delay,stopTime:c.stopTime!==void 0&&h.JulianDate.fromDate(new Date(c.stopTime))||void 0,removeOnStop:c.removeOnStop,multiplier:c.multiplier,reverse:c.reverse,loop:c.loop&&h.ModelAnimationLoop[c.loop],animationTime:d}})};a(),this.activeAnimationsJsonChanged.disposableOn(a)}{const a=()=>this._finalShowReact.value=(this.show??!0)&&this.visibleAlpha>0;a(),this.dispose(this.showChanged.disposableOn(a)),this.dispose(this.visibleAlphaChanged.disposableOn(a))}const{sceneScaleFromPixelSize:s}=this;{const a=()=>{let c;if(this.position&&this.pixelSize){const d=h.Cartesian3.fromDegrees(...this.position);d&&(c=Vi(o.scene,d,this.pixelSize),c&&(this.maximumScale!==void 0&&c>this.maximumScale&&(c=this.maximumScale),this.minimumScale!==void 0&&c<this.minimumScale&&(c=this.minimumScale)))}s.value=c};a(),this.dispose(o.scene.preUpdate.addEventListener(a))}this.dispose(this.flyToEvent.disposableOn(a=>{if(!this.position){console.warn("当前没有位置信息,无法飞入!");return}if(this._primitive&&this._primitive.ready&&this._primitive.boundingSphere){const{center:c,radius:d}=this._primitive._boundingSphere;h.Matrix4.multiplyByPoint(this._primitive.modelMatrix,c,new h.Cartesian3);const u=d*3;se(o,this.position,u,void 0,a)}else{const c=o.scene.camera.positionCartographic.height;se(o,this.position,c,void 0,a)}})),this.dispose(this.updateCustomShaderEvent.disposableOn(a=>{this._customShaderInstance&&a(this._customShaderInstance,this,this.czmViewer)}))}get readyEvent(){return this._readyEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customShaderInstanceClass(){return this._customShaderInstanceClass.value}set customShaderInstanceClass(e){this._customShaderInstanceClass.value=e}get customShaderInstanceClassChanged(){return this._customShaderInstanceClass.changed}get updateCustomShaderEvent(){return this._updateCustomShaderEvent}updateCustomShader(e){this._updateCustomShaderEvent.emit(e)}get activeAnimations(){return this._activeAnimations.value}get activeAnimationsChanged(){return this._activeAnimations.changed}set activeAnimations(e){this._activeAnimations.value=e}setPrimitive(e){this._primitive=e}get primitive(){return this._primitive}get gltf(){return this._gltf.value}set gltf(e){this._gltf.value=e}get gltfChanged(){return this._gltf.changed}get czmViewerVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get sceneScaleFromPixelSize(){return this._sceneScaleFromPixelSize}get finalShow(){return this._finalShowReact.value}get finalModelUriReact(){return this._finalModelUriReact}get finalSpecularEnvironmentMapsReact(){return this._finalSpecularEnvironmentMapsReact}get czmViewer(){return this._czmViewer}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){this._setMaterialEvent.emit(e)}get resetEvent(){return this._resetEvent}reset(){this._resetEvent.emit()}get ready(){return!!this._primitive&&this._primitive.ready}async openLocalDir(){const e=await l.defaultGetLocalFilePath(["gltf","glb"],"gltf");this.url=e}deleteNodeTransformation(e){if(!this.nodeTransformations||!this.nodeTransformations[e])return;const n={...this.nodeTransformations};delete n[e],this.nodeTransformations=n}setNodeTranslation(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...Sd};if(n.length!==3||n.some(r=>!Number.isFinite(r))){console.error(`setNodeTranslation error: translation.length !== 3 || translation.some(e => !Number.isFinite(e)): ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,translationX:n[0],translationY:n[1],translationZ:n[2]}}}getNodeTranslation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.translationX,n.translationY,n.translationZ]}setNodeRotation(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...Sd};if(n.length!==3||n.some(r=>!Number.isFinite(r))){console.error(`setNodeTranslation error: rotation.length !== 3 || rotation.some(e => !Number.isFinite(e)) ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,rotationHeading:n[0],rotationPitch:n[1],rotationRoll:n[2]}}}getNodeRotation(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.rotationHeading,n.rotationPitch,n.rotationRoll]}setNodeScale(e,n){this.nodeTransformations||(this.nodeTransformations={});const o=this.nodeTransformations[e]??{...Sd};if(n.length!==3||n.some(r=>!Number.isFinite(r)||r<0)){console.error(`setNodeTranslation error: scale.length !== 3 || scale.some(e => !Number.isFinite(e) || e < 0) ${e} ${n}`);return}this.nodeTransformations={...this.nodeTransformations,[e]:{...o,scaleX:n[0],scaleY:n[1],scaleZ:n[2]}}}getNodeScale(e){if(!this.nodeTransformations)return;const n=this.nodeTransformations[e];if(n)return[n.scaleX,n.scaleY,n.scaleZ]}get printDebugInfoEvent(){return this._printDebugInfoEvent}printDebugInfo(){this._printDebugInfoEvent.emit()}smoothMove(e,n){this.position||(this.position=e),this._smoothMoving.restart(this.position,0),this._smoothMoving.restart(e,n)}};v(Kr,"defaultUrl","${earthsdk3-assets-script-dir}/assets/glb/building.glb"),v(Kr,"defaultSpecularEnvironmentMaps","${earthsdk3-assets-script-dir}/assets/EnvironmentMap/kiara_6_afternoon_2k_ibl.ktx2"),v(Kr,"defaults",{activeAnimationsAnimateWhilePaused:!1,viewDistanceRange:[1e3,1e4,3e4,6e4],imageBasedLightingFactor:[1,1]});let at=Kr;(t=>{t.createDefaultProps=()=>({show:void 0,url:void 0,allowPicking:void 0,allowPickingDepth:!0,maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),scale:l.reactArrayWithUndefined(void 0),localPosition:l.reactArrayWithUndefined(void 0),localRotation:l.reactArrayWithUndefined(void 0),localScale:l.reactArrayWithUndefined(void 0),localModelMatrix:l.reactArrayWithUndefined(void 0),modelMatrix:l.reactArrayWithUndefined(void 0),forwardAxis:void 0,upAxis:void 0,color:l.reactArrayWithUndefined(void 0),silhouetteColor:l.reactArrayWithUndefined(void 0),shadows:void 0,credit:void 0,basePath:void 0,gltfJson:l.reactJson(void 0),heightReference:void 0,distanceDisplayCondition:void 0,colorBlendMode:void 0,incrementallyLoadTextures:void 0,asynchronous:void 0,clampAnimations:void 0,debugShowBoundingVolume:void 0,debugWireframe:void 0,backFaceCulling:void 0,showOutline:void 0,colorBlendAmount:void 0,silhouetteSize:void 0,imageBasedLightingFactor:l.reactArrayWithUndefined(void 0),lightColor:void 0,environmentMapManager:l.reactJsonWithUndefined(void 0),sphericalHarmonicCoefficients:void 0,specularEnvironmentMaps:void 0,customShaderInstanceClassStr:void 0,activeAnimationsJson:l.reactJsonWithUndefined(void 0),activeAnimationsAnimateWhilePaused:void 0,nodeTransformations:l.reactJsonWithUndefined(void 0),viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,nativeMinimumPixelSize:0,nativeMaximumScale:void 0,nativeScale:1,opaquePass:"OPAQUE",instances:l.reactArrayWithUndefined(void 0)})})(at||(at={})),l.extendClassProps(at.prototype,at.createDefaultProps);const kP={id:"e80d8802-e7dc-40d6-8cff-cfe3a12c8763",type:"CzmCustomPrimitive",show:!0,allowPicking:!0,cull:!1,pass:"OVERLAY",vertexShaderSource:`in vec3 position;
|
|
117
117
|
in vec2 st;
|
|
118
118
|
uniform sampler2D u_image;
|
|
119
119
|
out vec2 v_st;
|
|
@@ -316,14 +316,14 @@ ${hv}
|
|
|
316
316
|
// out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
317
317
|
// #endif
|
|
318
318
|
}
|
|
319
|
-
`;o.vertexShaderSource=r,o.fragmentShaderSource=s;const a={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}};o.renderState=a;const c=()=>{this.czmTextureId?o.uniformMap={myImage:{type:"texture",id:this.czmTextureId},myColor:this.color??[1,1,1,1]}:o.uniformMap={myImage:{type:"image",uri:w.ESSceneObject.context.getStrFromEnv(this.uri??"${earthsdk3-assets-script-dir}/assets/img/location.png")},myColor:this.color??[1,1,1,1]}};c(),this.dispose(this.uriChanged.disposableOn(c)),this.dispose(this.czmTextureIdChanged.disposableOn(c)),this.dispose(this.colorChanged.disposableOn(c)),this.dispose(l.bind([o,"show"],[this,"show"])),this.dispose(l.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([o,"position"],[this,"position"]));{const p=()=>{o.pixelSize=this.pixelSize};p(),this.dispose(this.pixelSizeChanged.disposableOn(p))}this.dispose(l.track([o,"maximumScale"],[this,"maximumScale"])),this.dispose(l.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(l.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"]));const d=()=>{const{scale:p=[1,1]}=this;o.scale=[this.useAxis.includes("X")?p[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?p[1]:1]};d(),this.dispose(this.scaleChanged.disposableOn(d));const u=()=>{const p=-(this.originRatioAndOffset[0]*this.size[0]+this.originRatioAndOffset[2]),f=this.originRatioAndOffset[1]*this.size[1]+this.originRatioAndOffset[3];o.localPosition=[this.useAxis.includes("X")?p:0,this.useAxis.includes("Y")?this.useAxis.includes("X")?f:p:0,this.useAxis.includes("Z")?f:0],o.localScale=[this.useAxis.includes("X")?this.size[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?this.size[1]:1]};{const p=()=>{const f={XY:[0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0,0],YZ:[0,0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0],XZ:[0,0,0,0,0,-1,1,0,-1,1,0,0,0,0,0,0,0,-1,1,0,-1,1,0,0]},g={XY:{min:[0,-1,0],max:[1,0,0]},YZ:{min:[0,0,-1],max:[0,1,0]},XZ:{min:[0,0,-1],max:[1,0,0]}};o.attributes={position:{typedArray:new Float32Array(f[this.useAxis??js.defaults.useAxis]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,1]),componentsPerAttribute:2}},o.boundingVolume={type:"LocalAxisedBoundingBox",data:g[this.useAxis??js.defaults.useAxis]},u()};p(),this.d(this.useAxisChanged.don(p))}this.dispose(this.originRatioAndOffsetChanged.disposableOn(u)),this.dispose(this.sizeChanged.disposableOn(u)),this.dispose(this.flyToEvent.disposableOn(p=>{o.flyTo(p)})),this.disposeVar(new l.ObjResettingWithEvent(this.rotationModeChanged,()=>new RS(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customPrimitive(){return this._customPrimitive}};v(js,"defaults",{position:[0,0,0],viewDistanceRange:[1e3,1e4,3e4,6e4],useAxis:"XY"});let Hi=js;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",czmTextureId:"",position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),rotationWithCamera:!1,rotationMode:"WithProp",useAxis:"XY",size:l.reactArray([1,1]),scale:[1,1],maximumScale:Number.MAX_VALUE,minimumScale:Number.MIN_VALUE,pixelSize:50,color:l.reactArray([1,1,1,1]),originRatioAndOffset:l.reactArray([.5,1,0,0]),viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Hi||(Hi={})),l.extendClassProps(Hi.prototype,Hi.createDefaultProps);class RS extends l.Destroyable{constructor(i,e){super(),this._czmViewer=i,this._czmImageModel=e;const{customPrimitive:n,rotationMode:o}=this._czmImageModel;if(o==="WithProp")this.dispose(l.track([n,"rotation"],[this._czmImageModel,"rotation"]));else if(o==="WithCameraOnlyZ"){const r=()=>{const{rotation:s}=this._czmImageModel,a=this._czmViewer.getCameraInfo();a&&(n.rotation=[a.rotation[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),s[1],s[2]])};r(),this.dispose(this._czmViewer.cameraChanged.disposableOn(r)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(r))}else if(o==="WithCamera"){const r=()=>{const s=this._czmViewer.getCameraInfo();if(!s)return;const a=s.rotation;n.rotation=[a[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),a[1]+(this._czmImageModel.useAxis.includes("Z")?0:90),a[2]]};r(),this.dispose(this._czmViewer.cameraChanged.disposableOn(r)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(r))}}}class or extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");v(this,"_id",this.disposeVar(l.react(l.createGuid())));n&&(this.id=n);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Yt(e.viewer))return;const s=this.disposeVar(li([this,"material"])),a=this.disposeVar(l.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,s.changed)),c=this.disposeVar(new l.ObjResettingWithEvent(a,()=>{if(s.value)return new xS(e,o,this,s.value)}));this.dispose(this.flyToEvent.disposableOn(d=>{e.actived&&(a.flush(),c.obj&&c.obj.flyTo(d))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,arcType:"GEODESIC",material:l.reactJson({type:"Color"}),stRotation:0,polygonHierarchy:l.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:1,perPositionHeight:!1,closeTop:!0,closeBottom:!0})})(or||(or={})),l.extendClassProps(or.prototype,or.createDefaultProps);class xS extends l.Destroyable{constructor(e,n,o,r){super();v(this,"_boundingSphere",(()=>{const e=this._sceneObject;this._material;const n=new h.BoundingSphere;if(!e.polygonHierarchy)return;const o=dt(e.polygonHierarchy.positions);if(o.length<3){n.radius=-1;return}return h.BoundingSphere.fromPoints(o,n),n})());this._czmViewer=e,this._viewer=n,this._sceneObject=o,this._material=r;const s=this._sceneObject,a=this._material,c=this._viewer;if(!s.polygonHierarchy)return;const d=new h.MaterialAppearance({material:a}),u=[],p=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ui(s.polygonHierarchy),stRotation:s.stRotation&&h.Math.toRadians(s.stRotation),arcType:s.arcType&&h.ArcType[s.arcType],height:s.height,extrudedHeight:s.extrudedHeight,perPositionHeight:s.perPositionHeight,closeTop:s.closeTop,closeBottom:s.closeBottom,ellipsoid:s.ellipsoid&&Pe(s.ellipsoid),granularity:s.granularity!==void 0?h.Math.toRadians(s.granularity):void 0}),id:this});u.push(p);const f=new h.GroundPrimitive({geometryInstances:u,appearance:d,asynchronous:!1,allowPicking:s.allowPicking,compressVertices:!1});h.GroundPrimitive.prototype&&(f.ESSceneObjectID=o.id),c.scene.primitives.add(f),this.dispose(()=>c.scene.primitives.remove(f));{const g=()=>{f.show=s.show};g(),this.dispose(s.showChanged.disposableOn(g))}this.disposeVar(new Re.ObjectsToExcludeWrapper(this._czmViewer,f))}flyTo(e){const n=this._boundingSphere;if(n&&n.radius>0){const o=ce(n.center);o&&se(this._viewer,o,n.radius*4,void 0,e)}}}class FS extends l.Destroyable{constructor(e,n){super();v(this,"_groundPolygonPrimitive");this._groundPolygonPrimitive=this.disposeVar(new or(n,e.id));const o=this._groundPolygonPrimitive;{const r=()=>{const a=e.show,c=e.fill;o.show=a&&c&&e.visibleAlpha>0,o.polygonHierarchy=o.show?{positions:e.positions||[]}:{positions:[]},o.material={type:"Color",color:e.color||[1,1,1,.5]}};r();const s=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(s.disposableOn(r))}this.dispose(l.track([o,"allowPicking"],[e,"allowPicking"]))}get groundPolygonPrimitive(){return this._groundPolygonPrimitive}}class kS extends l.Destroyable{constructor(e,n,o){super();v(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Ie(n,e.id));const r=this._geoPolyline;r.arcType="GEODESIC",r.loop=!0;{const s=()=>{const c=e.show,d=e.outline;if(r.show=c&&d&&e.visibleAlpha>0,r.show&&e.positions&&e.positions.length>1){const u=e.positions[0][2];r.positions=e.positions.map(p=>[p[0],p[1],u])}else r.positions=void 0;r.color=e.outlineColor,r.width=e.outlineWidth};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(l.track([r,"ground"],[e,"strokeGround"]))}get geoPolyline(){return this._geoPolyline}}class zS extends l.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new FS(e,n)),this._bottomPolyline=this.disposeVar(new kS(e,n,o)),this.dispose(e.flyToEvent.disposableOn(r=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,s,a,void 0,r)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,a,c,void 0,r)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Cn extends l.Destroyable{constructor(e,n){super();v(this,"_positions",this.disposeVar(l.reactPositions(void 0)));v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");this.d(this.polygonHierarchyChanged.don(()=>{this.polygonHierarchy?this.positions=this.polygonHierarchy.positions:this.positions=void 0})),this.d(this.positionsChanged.don(()=>{this.positions?this.polygonHierarchy.positions=[...this.positions]:this.polygonHierarchy={positions:[]}}));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(li([this,"material"])),s=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=g=>{if(!this.polygonHierarchy)return;const m=new h.MaterialAppearance({material:g}),y=[],P=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ui(this.polygonHierarchy),stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),arcType:this.arcType&&h.ArcType[this.arcType],height:this.height,extrudedHeight:this.extrudedHeight,perPositionHeight:this.perPositionHeight,closeTop:this.closeTop,closeBottom:this.closeBottom,ellipsoid:this.ellipsoid&&Pe(this.ellipsoid),granularity:this.granularity!==void 0?h.Math.toRadians(this.granularity):void 0}),id:this});y.push(P);const S=new h.Primitive({geometryInstances:y,appearance:m,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(S.ESSceneObjectID=n),S},c=new h.BoundingSphere,d=()=>{if(s(),!this.polygonHierarchy)return;const g=dt(this.polygonHierarchy.positions);if(g.length<3||!r.value){c.radius=-1;return}h.BoundingSphere.fromPoints(g,c),this._primitive=a(r.value),this._primitive&&o.scene.primitives.add(this._primitive)},u=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};d(),u();const p=this.disposeVar(l.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,r.changed));this.dispose(p.disposableOn(()=>{d(),u()}));const f=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(e.actived&&(p.flush(),f.flush(),c.radius>0)){const m=ce(c.center),y=this.height??0,P=this.extrudedHeight??0,S=Math.max(y,P),C=c.radius<S?S:c.radius;m&&se(o,m,C*4,void 0,g)}}))}get positions(){return this._positions.value}get positionsChanged(){return this._positions.changed}set positions(e){this._positions.value=e}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}v(Cn,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,material:l.reactJson({type:"Color"}),stRotation:void 0,polygonHierarchy:l.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0})})(Cn||(Cn={})),l.extendClassProps(Cn.prototype,Cn.createDefaultProps);class mv extends l.Destroyable{constructor(e,n,o,r){super();v(this,"_czmInnerPolygonPrimitive");this._czmInnerPolygonPrimitive=this.disposeVar(new Cn(n,e.id));const s=this._czmInnerPolygonPrimitive;{const a=()=>{const d=e.show,u=e.fill;if(s.show=d&&u&&e.visibleAlpha>0,e.positions&&e.positions.length>0&&!r?s.height=e.positions[0][2]:s.height=void 0,s.polygonHierarchy=s.show?{positions:e.positions||[]}:{positions:[]},s.material={type:"Color",color:e.color||[1,1,1,.5]},o){if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");s.extrudedHeight=(s.height??0)+e.depth}};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(c.disposableOn(a))}this.dispose(l.track([s,"allowPicking"],[e,"allowPicking"]))}get czmInnerPolygonPrimitive(){return this._czmInnerPolygonPrimitive}}class vv extends l.Destroyable{constructor(e,n,o){super();v(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Ie(n,e.id));const r=this._geoPolyline;r.arcType="GEODESIC",r.loop=!0,this.dispose(l.bind([r,"depthTest"],[e,"depthTest"])),this.dispose(l.bind([r,"ground"],[e,"strokeGround"]));{const s=()=>{const c=e.show,d=e.outline;if(r.show=c&&d&&e.visibleAlpha>0,r.show&&e.positions&&e.positions.length>1){const u=e.positions[0][2];r.positions=e.positions.map(p=>[p[0],p[1],u])}else r.positions=void 0;r.color=e.outlineColor,r.width=e.outlineWidth};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"]))}get geoPolyline(){return this._geoPolyline}}class LS extends l.Destroyable{constructor(i,e){super();const n=this.disposeVar(new ci(e,i.id));n.arcType="GEODESIC",this.dispose(l.track([n,"allowPicking"],[i,"allowPicking"])),this.dispose(l.bind([n,"depthTest"],[i,"depthTest"]));{const o=()=>{if(i.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=i.show,a=i.outline;n.show=s&&a&&i.visibleAlpha>0,n.color=i.outlineColor,n.width=i.outlineWidth;let c;if(n.show&&i.positions&&i.positions.length>1){const u=i.positions[0][2];c=i.positions.map(p=>[p[0],p[1],u])}let d;if(i.positions&&i.positions.length>0?d=i.positions[0][2]:d=void 0,n.show&&c){const u=d,p=(d??0)+i.depth;n.positions=c.map(f=>[[f[0],f[1],u],[f[0],f[1],p]])}else n.positions=void 0};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(i.showChanged,i.outlineChanged,i.outlineColorChanged,i.outlineWidthChanged,i.colorChanged,i.positionsChanged,i.visibleAlphaChanged));this.dispose(r.disposableOn(o))}}}class OS extends l.Destroyable{constructor(i,e){super();const n=this.disposeVar(new Ie(e,i.id));n.arcType="GEODESIC",n.loop=!0,this.dispose(l.track([n,"allowPicking"],[i,"allowPicking"])),this.dispose(l.bind([n,"depthTest"],[i,"depthTest"]));{const o=()=>{if(i.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=i.show,a=i.outline;n.show=s&&a&&i.visibleAlpha>0,n.color=i.outlineColor,n.width=i.outlineWidth;let c;if(n.show&&i.positions&&i.positions.length>1){const u=i.positions[0][2];c=i.positions.map(p=>[p[0],p[1],u])}let d;if(i.positions&&i.positions.length>0?d=i.positions[0][2]:d=void 0,n.show&&c){const u=(d??0)+i.depth;n.positions=c.map(p=>[p[0],p[1],u])}else n.positions=void 0};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(i.showChanged,i.outlineChanged,i.outlineColorChanged,i.outlineWidthChanged,i.colorChanged,i.positionsChanged,i.visibleAlphaChanged));this.dispose(r.disposableOn(o))}}}class NS extends l.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new mv(e,n,!0,o)),this._bottomPolyline=this.disposeVar(new vv(e,n,o)),this.disposeVar(new LS(e,n)),this.disposeVar(new OS(e,n)),this.dispose(e.flyToEvent.disposableOn(r=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,s,a,void 0,r)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,a,c,void 0,r)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class VS extends l.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new mv(e,n,!1,o)),this._bottomPolyline=this.disposeVar(new vv(e,n,o)),this.dispose(e.flyToEvent.disposableOn(r=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,s,a,void 0,r)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,a,c,void 0,r)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class _n extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_polygonOrGroundPolygonResetting");v(this,"_czmViewVisibleDistanceRangeControl");v(this,"_id",this.disposeVar(l.react(l.createGuid())));v(this,"_positionsCenter");this._positionsCenter=this.ad(new hd(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Qn(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(l.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const o=this.disposeVar(l.createNextAnimateFrameEvent(this.groundChanged,this.depthChanged,this.strokeGroundChanged));this._polygonOrGroundPolygonResetting=this.disposeVar(new l.ObjResettingWithEvent(o,()=>this.ground?new zS(this,e):this.depth!==void 0&&this.depth>0?new NS(this,e):new VS(this,e)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polygonOrGroundPolygonResetting(){return this._polygonOrGroundPolygonResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get positionsCenter(){return this._positionsCenter}}v(_n,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,strokeGround:!1,outline:!0,outlineColor:l.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:l.reactArray([1,1,1,.5]),positions:l.reactPositions(void 0),depth:0,zIndex:0,viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(_n||(_n={})),l.extendClassProps(_n.prototype,_n.createDefaultProps);class gs extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(li([this,"material"])),s=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(f,g)=>{const m=new h.MaterialAppearance({material:g}),y=[],P=new h.GeometryInstance({geometry:new h.RectangleGeometry({rectangle:f,height:this.height,rotation:this.rotation&&h.Math.toRadians(this.rotation),extrudedHeight:this.extrudedHeight,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});y.push(P);const S=new h.Primitive({geometryInstances:y,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.Primitive.prototype&&(S.ESSceneObjectID=n),S},c=()=>{if(s(),!this.positions)return;const f=Ge(this.positions);!f||!r.value||(this._primitive=a(f,r.value),this._primitive&&o.scene.primitives.add(this._primitive))},d=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),d();const u=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.stRotationChanged,this.rotationChanged,r.changed,this.allowPickingChanged));this.dispose(u.disposableOn(()=>{c(),d()}));const p=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{d()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const g=Ge(this.positions),m=h.BoundingSphere.fromRectangle3D(g,void 0,this.height);if(m.radius>0){const y=ce(m.center);y&&se(o,y,m.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),positions:l.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,stRotation:void 0})})(gs||(gs={})),l.extendClassProps(gs.prototype,gs.createDefaultProps);const Lh=class Lh extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(li([this,"material"],Lh.defaults.material)),s=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(f,g)=>{const m=new h.MaterialAppearance({material:g}),y=[],P=new h.GeometryInstance({geometry:new h.RectangleGeometry({rectangle:f,rotation:this.rotation&&h.Math.toRadians(this.rotation),stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});y.push(P);const S=new h.GroundPrimitive({geometryInstances:y,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.GroundPrimitive.prototype&&(S.ESSceneObjectID=n),S},c=()=>{if(s(),!this.positions)return;const f=Ge(this.positions);!f||!r.value||(this._primitive=a(f,r.value),this._primitive&&o.scene.primitives.add(this._primitive))},d=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),d();const u=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.stRotationChanged,this.rotationChanged,r.changed,this.allowPickingChanged));this.dispose(u.disposableOn(()=>{c(),d()}));const p=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{d()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const g=Ge(this.positions),m=h.BoundingSphere.fromRectangle3D(g,void 0,0);if(m.radius>0){const y=ce(m.center);y&&se(o,y,m.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Lh,"defaults",{material:{type:"Color",color:[1,1,1,.5]}});let lo=Lh;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),positions:l.reactArrayWithUndefined(void 0),rotation:void 0,stRotation:void 0})})(lo||(lo={})),l.extendClassProps(lo.prototype,lo.createDefaultProps);class ms extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(r);const s=new h.Color,a=f=>{const g=new h.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),m=[],y=new h.GeometryInstance({geometry:new h.RectangleOutlineGeometry({rectangle:f,height:this.height??0,extrudedHeight:this.extrudedHeight,rotation:this.rotation&&h.Math.toRadians(this.rotation)}),attributes:{color:this.color?h.ColorGeometryInstanceAttribute.fromColor(ie(this.color,s)):h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,1,1,1))},id:this});m.push(y);const P=new h.Primitive({geometryInstances:m,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.Primitive.prototype&&(P.ESSceneObjectID=n),P},c=()=>{if(r(),!this.positions)return;const f=Ge(this.positions);f&&(this._primitive=a(f),this._primitive&&o.scene.primitives.add(this._primitive))},d=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),d();const u=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.colorChanged,this.translucentChanged,this.extrudedHeightChanged,this.heightChanged,this.rotationChanged,this.allowPickingChanged));this.dispose(u.disposableOn(()=>{c(),d()}));const p=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{d()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const g=Ge(this.positions),m=h.BoundingSphere.fromRectangle3D(g,void 0,this.height);if(m.radius>0){const y=ce(m.center);y&&se(o,y,m.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,translucent:void 0,color:l.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,positions:l.reactArrayWithUndefined(void 0)})})(ms||(ms={})),l.extendClassProps(ms.prototype,ms.createDefaultProps);const ea=class ea extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));if(!e.viewer)return;const r=this.ad(new gs(e,n)),s=this.ad(new lo(e,n)),a=this.ad(new ms(e,n));this.dispose(l.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const u=this.show??!0,p=this.ground??!1,f=this.outline??!1;a.show=u&&!p&&f,r.show=u&&!p,a.show?a.positions=this.rectangle:a.positions=void 0,r.show?r.positions=this.rectangle:r.positions=void 0,a.rotation=r.rotation=this.rotation,r.material=this.material??ea.defaults.material,r.stRotation=this.stRotation,a.extrudedHeight=r.extrudedHeight=this.extrudedHeight,a.height=r.height=this.height,a.color=this.outlineColor,a.translucent=this.outlineTranslucent,s.show=u&&p,s.show?s.positions=this.rectangle:s.positions=void 0,s.rotation=this.rotation,s.material=this.material??ea.defaults.material,s.stRotation=this.stRotation};c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.heightChanged,this.extrudedHeightChanged,this.materialChanged,this.rectangleChanged,this.outlineColorChanged,this.stRotationChanged,this.rotationChanged,this.outlineTranslucentChanged,this.groundChanged));this.dispose(d.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(u=>{this.ground?s.flyTo(u):r.flyTo(u)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ea,"defaults",{material:{type:"Color",color:[1,1,1,.5]},rectangle:void 0,extrudedHeight:void 0});let Ci=ea;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outlineTranslucent:!0,outline:!1,outlineColor:l.reactArray([1,1,1,1]),height:0,extrudedHeight:void 0,material:l.reactJsonWithUndefined(void 0),rectangle:l.reactArrayWithUndefined(void 0),rotation:0,stRotation:0})})(Ci||(Ci={})),l.extendClassProps(Ci.prototype,Ci.createDefaultProps);const ta=class ta extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const r=this.disposeVar(li([this,"material"])),s=(p,f)=>{if(!p||!this.radius)return;const g=new h.MaterialAppearance({material:f}),m=[],y=()=>{let I=this.granularity??ta.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),I=I|0,I=Math.max(1,I),h.Math.toRadians(I)},P=new h.GeometryInstance({geometry:new h.CircleGeometry({center:p,height:this.height,extrudedHeight:this.extrudedHeight,radius:this.radius,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&Pe(this.ellipsoid),granularity:y()}),id:this}),S=Fe({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),C=Fe({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!C||!S){console.warn("modelMatrix is undefined!");return}const E=h.Matrix4.inverseTransformation(S,new h.Matrix4);h.Matrix4.multiply(C,E,P.modelMatrix),m.push(P);const T=new h.Primitive({geometryInstances:m,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??ta.defaults.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(T.ESSceneObjectID=n),T},a=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=Ve(this.position);!p||!r.value||(this._primitive=s(p,r.value),this._primitive&&o.scene.primitives.add(this._primitive))},c=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};a(),c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.ellipsoidChanged,this.granularityChanged,this.stRotationChanged,r.changed,this.rotationChanged));this.dispose(d.disposableOn(()=>{a(),c()}));const u=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(u.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)se(o,this.position,this.radius*4,void 0,1e3);else{const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ta,"defaults",{show:!0,allowPicking:!1,translucent:!0,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Pn=ta;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJson({type:"Color"}),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,stRotation:void 0,ellipsoid:void 0,granularity:void 0})})(Pn||(Pn={})),l.extendClassProps(Pn.prototype,Pn.createDefaultProps);const ko=class ko extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const r=this.disposeVar(li([this,"material"],ko.defaults.material)),s=(p,f)=>{if(!p||!this.radius)return;const g=new h.MaterialAppearance({material:f}),m=[],y=()=>{let C=this.granularity??ko.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),C=C|0,C=Math.max(1,C),h.Math.toRadians(C)},P=new h.GeometryInstance({geometry:new h.CircleGeometry({center:p,radius:this.radius,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),granularity:y(),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&Pe(this.ellipsoid)}),id:this});m.push(P);const S=new h.GroundPrimitive({geometryInstances:m,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??ko.defaults.allowPicking,compressVertices:!1});return h.GroundPrimitive.prototype&&(S.ESSceneObjectID=n),S},a=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position||!this.radius||!r.value)return;const p=Ve(this.position);this._primitive=s(p,r.value),this._primitive&&o.scene.primitives.add(this._primitive)},c=()=>{const p=this.show??ko.defaults.show;this._primitive&&(this._primitive.show=p)};a(),c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.stRotationChanged,this.granularityChanged,this.ellipsoidChanged,this.materialChanged,r.changed));this.dispose(d.disposableOn(()=>{a(),c()}));const u=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(u.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)se(o,this.position,this.radius*4,void 0,1e3);else{const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ko,"defaults",{show:!0,allowPicking:!1,material:{type:"Color",color:[1,1,1,.5]},radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Sn=ko;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),granularity:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),radius:void 0,stRotation:void 0,ellipsoid:void 0})})(Sn||(Sn={})),l.extendClassProps(Sn.prototype,Sn.createDefaultProps);const ia=class ia extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const r=new h.Color,s=p=>{if(!p||!this.radius)return;const f=new h.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),g=[],m=h.ColorGeometryInstanceAttribute.fromColor(h.Color.WHITE),y=()=>{let I=this.granularity??ia.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),I=I|0,I=Math.max(1,I),h.Math.toRadians(I)},P=new h.GeometryInstance({geometry:new h.CircleOutlineGeometry({center:p,radius:this.radius,height:this.height,extrudedHeight:this.extrudedHeight,ellipsoid:this.ellipsoid&&Pe(this.ellipsoid),granularity:y(),numberOfVerticalLines:this.numberOfVerticalLines}),attributes:{color:this.outlineColor?h.ColorGeometryInstanceAttribute.fromColor(ie(this.outlineColor,r)):m},id:this}),S=Fe({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),C=Fe({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!C||!S){console.warn("modelMatrix is undefined!");return}const E=h.Matrix4.inverseTransformation(S,new h.Matrix4);h.Matrix4.multiply(C,E,P.modelMatrix),g.push(P);const T=new h.Primitive({geometryInstances:g,appearance:f,asynchronous:!1,allowPicking:this.allowPicking??ia.defaults.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(T.ESSceneObjectID=n),T},a=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=Ve(this.position);p&&(this._primitive=s(p),this._primitive&&o.scene.primitives.add(this._primitive))},c=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};a(),c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.outlineColorChanged,this.translucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.rotationChanged));this.dispose(d.disposableOn(()=>{a(),c()}));const u=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(u.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ia,"defaults",{show:!0,translucent:!0,allowPicking:!1,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1,numberOfVerticalLines:0});let En=ia;(t=>{t.createDefaultProps=()=>({show:!0,translucent:void 0,allowPicking:void 0,outlineColor:l.reactArrayWithUndefined(void 0),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,ellipsoid:void 0,granularity:void 0,numberOfVerticalLines:void 0})})(En||(En={})),l.extendClassProps(En.prototype,En.createDefaultProps);class co extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));if(!e.viewer)return;const r=this.ad(new Pn(e,n)),s=this.ad(new Sn(e,n)),a=this.ad(new En(e,n));this.dispose(l.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([a,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const u=this.show??!0,p=this.ground??!1,f=this.outline??!1;a.show=u&&!p&&f,r.show=u&&!p,a.show?a.position=this.position:a.position=void 0,r.show?r.position=this.position:r.position=void 0,r.rotation=a.rotation=this.rotation,a.radius=r.radius=this.radius,a.extrudedHeight=r.extrudedHeight=this.extrudedHeight,this.position&&(a.height=r.height=this.position[2]),this.granularity===0&&(console.error("granularity不能设置为0"),this.granularity=1),r.granularity=a.granularity=this.granularity,r.ellipsoid=a.ellipsoid=this.ellipsoid,r.material=this.material,r.stRotation=this.stRotation,a.outlineColor=this.outlineColor,a.translucent=this.outlineTranslucent,a.numberOfVerticalLines=this.numberOfVerticalLines,s.show=u&&p,s.show?s.position=this.position:s.position=void 0,s.radius=this.radius,this.granularity===0?(console.error("granularity不能设置为0"),s.granularity=1):s.granularity=this.granularity,s.rotation=this.rotation,s.ellipsoid=this.ellipsoid,s.material=this.material,s.stRotation=this.stRotation};c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.radiusChanged,this.outlineChanged,this.extrudedHeightChanged,this.materialChanged,this.positionChanged,this.outlineColorChanged,this.stRotationChanged,this.outlineTranslucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.groundChanged,this.rotationChanged));this.dispose(d.disposableOn(c)),this.dispose(this.flyToEvent.disposableOn(u=>{this.ground?s.flyTo(u):r.flyTo(u)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}v(co,"defaults",{extrudedHeight:void 0}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,outline:!0,outlineTranslucent:!0,extrudedHeight:void 0,outlineColor:l.reactArray([1,1,1,1]),material:l.reactJson({type:"Color",color:[1,1,1,.5]}),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),radius:0,stRotation:0,ellipsoid:l.reactArray([6378137,6378137,6356752314245179e-9]),granularity:1,numberOfVerticalLines:0})})(co||(co={})),l.extendClassProps(co.prototype,co.createDefaultProps);class vs extends l.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_flyToEvent",this.dv(new l.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Yt(e.viewer))return;const s=h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),a=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.d(a);const c=()=>{const E={baseWaterColor:ie(this.waterColor),normalMap:s,frequency:this.frequency,animationSpeed:this.waveVelocity,amplitude:this.amplitude,specularIntensity:this.specularIntensity};return new h.Material({fabric:{type:"Water",uniforms:E}})},d=()=>{if(!this.points)return;const E={positions:this.points},T=new h.PolygonGeometry({polygonHierarchy:Ui(E),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,height:this.height});return new h.GeometryInstance({geometry:T,id:this})},u=()=>{if(!this.points)return;const E=new h.EllipsoidSurfaceAppearance({material:c(),aboveGround:!0}),T=d();let I;return this.ground??!1?I=new h.GroundPrimitive({geometryInstances:T,appearance:E,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}):I=new h.Primitive({geometryInstances:T,appearance:E,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}),h.Primitive.prototype&&h.GroundPrimitive.prototype&&(I.ESSceneObjectID=n),I},p=new h.BoundingSphere,f=()=>{a(),g(p),this._primitive=u(),this._primitive&&o.scene.primitives.add(this._primitive)},g=E=>{if(!this.points)return;const T=dt(this.points);if(T.length<3){E.radius=-1;return}h.BoundingSphere.fromPoints(T,E)},m=()=>{const E=this.show??!0;this._primitive&&(this._primitive.show=E)},y=()=>{f(),m()};y();let P=l.debounce(y,500);const S=this.dv(l.createNextAnimateFrameEvent(this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.specularIntensityChanged,this.waveVelocityChanged,this.groundChanged,this.allowPickingChanged));this.d(S.don(y));const C=this.dv(l.createNextAnimateFrameEvent(this.pointsChanged,this.heightChanged));this.d(C.don(()=>{if(!this.points){a();return}this._primitive&&!this.ground?(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=d(),g(p),P&&P[0]()):y()})),this.d(this.showChanged.don(m)),this.d(this.flyToEvent.don(E=>{if(p.radius>0){const T=ce(p.center);T&&se(o,T,p.radius*4,void 0,E)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,points:l.reactPositions(void 0),height:void 0,allowPicking:!0,ground:!1,waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,baseWaterImage:l.reactJsonWithUndefined(void 0),flowSpeed:0})})(vs||(vs={})),l.extendClassProps(vs.prototype,vs.createDefaultProps);class ho extends l.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_flyToEvent",this.dv(new l.Event));v(this,"_updateBoundingSphereEvent",this.ad(new l.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=new h.BoundingSphere,s=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.d(s);const a=E=>w.ESSceneObject.context.getStrFromEnv(E),c=()=>{this._primitive=new h[this.ground?"GroundPrimitive":"Primitive"]({compressVertices:!1,asynchronous:!1,allowPicking:this.allowPicking,geometryInstances:f()}),h.Primitive.prototype&&(this._primitive.ESSceneObjectID=n),o.scene.primitives.add(this._primitive)},d=()=>{var b;const E=a(this.normalMap??h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")),T={baseWaterColor:ie(this.waterColor??[.25,.6,1,.7]),normalMap:E,frequency:this.frequency,animationSpeed:this.animationSpeed,amplitude:this.amplitude,specularIntensity:this.specularIntensity};if(this.blendColor&&(T.blendColor=ie(this.blendColor)),this.specularMap&&(T.specularMap=a(this.specularMap)),this.points&&this.points.length>=1){const{maxPos:x,minPos:z}=w.getMinMaxCorner(this.points),W=w.getDistancesFromPositions([z,[x[0],x[1],z[2]]],"GEODESIC")[0],N=w.getDistancesFromPositions([z,[z[0],x[1],x[2]]],"GEODESIC")[0];this.baseWaterImage&&(this.baseWaterImage.url&&(T.baseWaterImage=a(this.baseWaterImage.url)),this.baseWaterImage.uDis&&(T.repeatX=W/this.baseWaterImage.uDis),this.baseWaterImage.vDis&&(T.repeatY=N/this.baseWaterImage.vDis)),T.flowSpeed=this.flowSpeed/(((b=this.baseWaterImage)==null?void 0:b.uDis)??W)}if(this._primitive&&this._primitive.appearance){this._primitive.appearance.material.uniforms=Object.assign({},this._primitive.appearance.material.uniforms,T);return}const I=new h.EllipsoidSurfaceAppearance({material:qm(T),aboveGround:!0});this._primitive&&(this._primitive.appearance=I)},u=this.ad(l.createNextAnimateFrameEvent(this.baseWaterImageChanged,this.waterColorChanged,this.blendColorChanged,this.specularMapChanged,this.flowSpeedChanged,this.normalMapChanged,this.frequencyChanged,this.animationSpeedChanged,this.amplitudeChanged,this.specularIntensityChanged));this.ad(u.don(d));const p=E=>{if(!this.points)return;const T=dt(this.points);if(T.length<3){E.radius=-1;return}h.BoundingSphere.fromPoints(T,E)},f=()=>{if(!this.points||this.points.length<3)return;const{minPos:E}=w.getMinMaxCorner(this.points),[T]=Mt({originPosition:E},this.points),{minPos:I,maxPos:b}=w.getMinMaxCorner(T),x=b[0]-I[0],z=b[1]-I[1],W={positions:this.points},N=new h.PolygonGeometry({polygonHierarchy:Ui(W),vertexFormat:h.VertexFormat.DEFAULT,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),perPositionHeight:!0,attributes:{st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(T.map(U=>[h.Math.clamp(U[0]/x,0,1),h.Math.clamp(U[1]/z,0,1)]).flat())})}});return new h.GeometryInstance({id:this,geometry:N})},g=()=>{this._primitive&&(this._primitive.show=this.show??!0)},m=this.ad(l.createNextAnimateFrameEvent(this.showChanged));this.ad(m.don(g));const y=this.ad(()=>{s(),c(),g(),d(),p(r)});y();const P=this.ad(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.groundChanged));this.ad(P.don(y)),this.ad(new l.ObjResettingWithEvent(this.updateBoundingSphereEvent,E=>{const T=new l.Destroyable;return E?T.ad(o.scene.preUpdate.addEventListener(()=>{const I=o.camera;o.camera.frustum.computeCullingVolume(I.position,I.direction,I.up).computeVisibility(r)===h.Intersect.OUTSIDE&&y()})):(y(),T.ad(this.pointsChanged.don(y))),T}));const S=()=>{if(!this.points||this.points.length<3){y();return}this._primitive instanceof h.Primitive?(this._primitive._state=3,this._primitive._appearance=void 0):this._primitive._primitive=void 0,this._primitive.geometryInstances=f(),this._primitive._recomputeBoundingSpheres=!0},C=this.dv(l.createNextAnimateFrameEvent(this.pointsChanged,this.stRotationChanged));this.d(C.don(S)),this.d(this.flyToEvent.don(E=>{if(r.radius>0){const T=ce(r.center);T&&se(o,T,r.radius*4,void 0,E)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get updateBoundingSphereEvent(){return this._updateBoundingSphereEvent}updateBoundingSphere(e){this._updateBoundingSphereEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,points:l.reactPositions(void 0),allowPicking:!0,waterColor:[.1497,.165,.0031,1],blendColor:l.reactArrayWithUndefined(void 0),specularMap:void 0,normalMap:h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),frequency:1e3,animationSpeed:.005,amplitude:10,specularIntensity:.3,baseWaterImage:l.reactJsonWithUndefined(void 0),flowSpeed:0,stRotation:void 0,ground:void 0})})(ho||(ho={})),l.extendClassProps(ho.prototype,ho.createDefaultProps);class uo extends l.Destroyable{constructor(e,n){super();v(this,"pointPrimitives");v(this,"_flyToEvent",this.dv(new l.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Yt(e.viewer))return;let{pointPrimitives:s}=this;const a=()=>{s&&(s.removeAll(),o.scene.primitives.remove(s),s=void 0)};this.d(a);const c=()=>{const m=new h.PointPrimitiveCollection({show:this.show??!0,debugShowBoundingVolume:this.debugShowBoundingVolume??!1,blendOption:(this.blendOption&&ut.blendOptionType[this.blendOption])??h.BlendOption.OPAQUE_AND_TRANSLUCENT});return this.pointPrimitiveOptions&&(this.pointPrimitiveOptions.forEach(P=>{m.add({show:P.show??!0,color:P.color&&ie(P.color),disableDepthTestDistance:P.disableDepthTestDistance,distanceDisplayCondition:P.distanceDisplayCondition&&ss(P.distanceDisplayCondition),outlineColor:P.outlineColor&&ie(P.outlineColor),outlineWidth:P.outlineWidth,pixelSize:P.pixelSize,position:P.position&&Ve(P.position),scaleByDistance:P.scaleByDistance&&cn(P.scaleByDistance),translucencyByDistance:P.translucencyByDistance&&cn(P.translucencyByDistance)})}),h.PointPrimitiveCollection.prototype&&(m.ESSceneObjectID=n)),m},d=()=>{a(),s=c(),o.scene.primitives.add(s)};d();const u=this.dv(l.createNextAnimateFrameEvent(this.showChanged,this.debugShowBoundingVolumeChanged,this.blendOptionChanged)),p=()=>{s&&(s.show=this.show??!0,s.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,s.blendOption=(this.blendOption&&ut.blendOptionType[this.blendOption])??h.BlendOption.OPAQUE_AND_TRANSLUCENT)};this.d(u.don(p));const f=this.dv(l.createNextAnimateFrameEvent(this.pointPrimitiveOptionsChanged));this.d(f.don(d));const g=new h.BoundingSphere;this.d(this.flyToEvent.don(m=>{if(!(!e.actived||!this.pointPrimitiveOptions))if(u.flush(),f.flush(),this.pointPrimitiveOptions.length===1){const y=this.pointPrimitiveOptions[0].position;if(!y)return;const P=o.scene.camera.positionCartographic.height;se(o,y,P,void 0,m)}else{const y=this.pointPrimitiveOptions,P=[];y.forEach(C=>{C.position&&P.push(C.position)});const S=dt(P);if(h.BoundingSphere.fromPoints(S,g),g.radius>0){const C=ce(g.center);C&&se(o,C,g.radius*4,void 0,m)}}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,debugShowBoundingVolume:void 0,blendOption:void 0,pointPrimitiveOptions:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArrayWithUndefined(void 0),scale:l.reactArrayWithUndefined(void 0),localPosition:l.reactArrayWithUndefined(void 0),localRotation:l.reactArrayWithUndefined(void 0),localScale:l.reactArrayWithUndefined(void 0),localModelMatrix:l.reactArrayWithUndefined(void 0),modelMatrix:l.reactArrayWithUndefined(void 0)})})(uo||(uo={})),l.extendClassProps(uo.prototype,uo.createDefaultProps);class US extends l.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("!viewer");const o=ue.czmJulianDateToTimeStamp,r=ue.getClockRange,s=ue.getClockStep;{const a=()=>n.clockViewModel.startTime=h.JulianDate.fromDate(new Date(i.startTime??w.getDefaultValue(ue.defaults.startTime)));a(),this.dispose(mi(n.clockViewModel,"startTime",c=>i.startTime=o(c))),this.dispose(i.startTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.stopTime=h.JulianDate.fromDate(new Date(i.stopTime??w.getDefaultValue(ue.defaults.stopTime)));a(),this.dispose(mi(n.clockViewModel,"stopTime",c=>i.stopTime=o(c))),this.dispose(i.stopTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(i.currentTime??w.getDefaultValue(ue.defaults.currentTime)));a(),this.dispose(mi(n.clockViewModel,"currentTime",c=>i.currentTime=o(c))),this.dispose(i.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.multiplier=i.multiplier??ue.defaults.multiplier;a(),this.dispose(mi(n.clockViewModel,"multiplier",c=>{(i.multiplier??ue.defaults.multiplier!==c)&&(i.multiplier=c)})),this.dispose(i.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockStep=h.ClockStep[i.clockStep??ue.defaults.clockStep];a(),this.dispose(mi(n.clockViewModel,"clockStep",c=>{const d=s(c);(i.clockStep??ue.defaults.clockStep!==d)&&(i.clockStep=d)})),this.dispose(i.clockStepChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockRange=h.ClockRange[i.clockRange??ue.defaults.clockRange];a(),this.dispose(mi(n.clockViewModel,"clockRange",c=>{const d=r(c);(i.clockRange??ue.defaults.clockRange!==d)&&(i.clockRange=d)})),this.dispose(i.clockRangeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.shouldAnimate=i.shouldAnimate??ue.defaults.shouldAnimate;a(),this.dispose(mi(n.clockViewModel,"shouldAnimate",c=>{(i.shouldAnimate??ue.defaults.shouldAnimate!==c)&&(i.shouldAnimate=c)})),this.dispose(i.shouldAnimateChanged.disposableOn(a))}}}const zo=class zo extends l.Destroyable{constructor(i){super(),this.disposeVar(new l.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled??zo.defaults.enabled)return new US(this,i)}))}};v(zo,"czmJulianDateToTimeStamp",WS),v(zo,"getClockRange",GS),v(zo,"getClockStep",HS),v(zo,"defaults",{enabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+24*60*60*1e3,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1});let ue=zo;(t=>{t.createDefaultProps=()=>({enabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0})})(ue||(ue={})),l.extendClassProps(ue.prototype,ue.createDefaultProps);function WS(t){return h.JulianDate.toDate(t).getTime()}function GS(t){if(t===h.ClockRange.CLAMPED)return"CLAMPED";if(t===h.ClockRange.LOOP_STOP)return"LOOP_STOP";if(t===h.ClockRange.UNBOUNDED)return"UNBOUNDED";throw new Error(`getClockRange error: ${t}`)}function HS(t){if(t===h.ClockStep.SYSTEM_CLOCK)return"SYSTEM_CLOCK";if(t===h.ClockStep.SYSTEM_CLOCK_MULTIPLIER)return"SYSTEM_CLOCK_MULTIPLIER";if(t===h.ClockStep.TICK_DEPENDENT)return"TICK_DEPENDENT";throw new Error(`clockStep未知类型: ${t}`)}function D(t){return t!=null}function H(t){this.name="DeveloperError",this.message=t;let i;try{throw new Error}catch(e){i=e.stack}this.stack=i}D(Object.create)&&(H.prototype=Object.create(Error.prototype),H.prototype.constructor=H),H.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return D(this.stack)&&(t+=`
|
|
320
|
-
${this.stack.toString()}`),t},H.throwInstantiationError=function(){throw new H("This function defines an interface and should not be called directly.")};const A={};A.typeOf={};function qS(t){return`${t} is required, actual value was undefined`}function rr(t,i,e){return`Expected ${e} to be typeof ${i}, actual typeof was ${t}`}A.defined=function(t,i){if(!D(i))throw new H(qS(t))},A.typeOf.func=function(t,i){if(typeof i!="function")throw new H(rr(typeof i,"function",t))},A.typeOf.string=function(t,i){if(typeof i!="string")throw new H(rr(typeof i,"string",t))},A.typeOf.number=function(t,i){if(typeof i!="number")throw new H(rr(typeof i,"number",t))},A.typeOf.number.lessThan=function(t,i,e){if(A.typeOf.number(t,i),i>=e)throw new H(`Expected ${t} to be less than ${e}, actual value was ${i}`)},A.typeOf.number.lessThanOrEquals=function(t,i,e){if(A.typeOf.number(t,i),i>e)throw new H(`Expected ${t} to be less than or equal to ${e}, actual value was ${i}`)},A.typeOf.number.greaterThan=function(t,i,e){if(A.typeOf.number(t,i),i<=e)throw new H(`Expected ${t} to be greater than ${e}, actual value was ${i}`)},A.typeOf.number.greaterThanOrEquals=function(t,i,e){if(A.typeOf.number(t,i),i<e)throw new H(`Expected ${t} to be greater than or equal to ${e}, actual value was ${i}`)},A.typeOf.object=function(t,i){if(typeof i!="object")throw new H(rr(typeof i,"object",t))},A.typeOf.bool=function(t,i){if(typeof i!="boolean")throw new H(rr(typeof i,"boolean",t))},A.typeOf.bigint=function(t,i){if(typeof i!="bigint")throw new H(rr(typeof i,"bigint",t))},A.typeOf.number.equals=function(t,i,e,n){if(A.typeOf.number(t,e),A.typeOf.number(i,n),e!==n)throw new H(`${t} must be equal to ${i}, the actual values are ${e} and ${n}`)};var yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dd,wv;function $S(){if(wv)return Dd;wv=1;var t=function(i){i==null&&(i=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,i.constructor==Array?this.init_by_array(i,i.length):this.init_seed(i)};return t.prototype.init_seed=function(i){for(this.mt[0]=i>>>0,this.mti=1;this.mti<this.N;this.mti++){var i=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((i&4294901760)>>>16)*1812433253<<16)+(i&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},t.prototype.init_by_array=function(i,e){var n,o,r;for(this.init_seed(19650218),n=1,o=0,r=this.N>e?this.N:e;r;r--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1664525<<16)+(s&65535)*1664525)+i[o]+o,this.mt[n]>>>=0,n++,o++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),o>=e&&(o=0)}for(r=this.N-1;r;r--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1566083941<<16)+(s&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},t.prototype.random_int=function(){var i,e=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++)i=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^i>>>1^e[i&1];for(;n<this.N-1;n++)i=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^i>>>1^e[i&1];i=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^i>>>1^e[i&1],this.mti=0}return i=this.mt[this.mti++],i^=i>>>11,i^=i<<7&2636928640,i^=i<<15&4022730752,i^=i>>>18,i>>>0},t.prototype.random_int31=function(){return this.random_int()>>>1},t.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},t.prototype.random=function(){return this.random_int()*(1/4294967296)},t.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},t.prototype.random_long=function(){var i=this.random_int()>>>5,e=this.random_int()>>>6;return(i*67108864+e)*(1/9007199254740992)},Dd=t,Dd}var XS=$S();const Cv=mc(XS),O={};O.EPSILON1=.1,O.EPSILON2=.01,O.EPSILON3=.001,O.EPSILON4=1e-4,O.EPSILON5=1e-5,O.EPSILON6=1e-6,O.EPSILON7=1e-7,O.EPSILON8=1e-8,O.EPSILON9=1e-9,O.EPSILON10=1e-10,O.EPSILON11=1e-11,O.EPSILON12=1e-12,O.EPSILON13=1e-13,O.EPSILON14=1e-14,O.EPSILON15=1e-15,O.EPSILON16=1e-16,O.EPSILON17=1e-17,O.EPSILON18=1e-18,O.EPSILON19=1e-19,O.EPSILON20=1e-20,O.EPSILON21=1e-21,O.GRAVITATIONALPARAMETER=3986004418e5,O.SOLAR_RADIUS=6955e5,O.LUNAR_RADIUS=1737400,O.SIXTY_FOUR_KILOBYTES=64*1024,O.FOUR_GIGABYTES=4*1024*1024*1024,O.sign=Math.sign??function(i){return i=+i,i===0||i!==i?i:i>0?1:-1},O.signNotZero=function(t){return t<0?-1:1},O.toSNorm=function(t,i){return i=i??255,Math.round((O.clamp(t,-1,1)*.5+.5)*i)},O.fromSNorm=function(t,i){return i=i??255,O.clamp(t,0,i)/i*2-1},O.normalize=function(t,i,e){return e=Math.max(e-i,0),e===0?0:O.clamp((t-i)/e,0,1)},O.sinh=Math.sinh??function(i){return(Math.exp(i)-Math.exp(-i))/2},O.cosh=Math.cosh??function(i){return(Math.exp(i)+Math.exp(-i))/2},O.lerp=function(t,i,e){return(1-e)*t+e*i},O.PI=Math.PI,O.ONE_OVER_PI=1/Math.PI,O.PI_OVER_TWO=Math.PI/2,O.PI_OVER_THREE=Math.PI/3,O.PI_OVER_FOUR=Math.PI/4,O.PI_OVER_SIX=Math.PI/6,O.THREE_PI_OVER_TWO=3*Math.PI/2,O.TWO_PI=2*Math.PI,O.ONE_OVER_TWO_PI=1/(2*Math.PI),O.RADIANS_PER_DEGREE=Math.PI/180,O.DEGREES_PER_RADIAN=180/Math.PI,O.RADIANS_PER_ARCSECOND=O.RADIANS_PER_DEGREE/3600,O.toRadians=function(t){if(!D(t))throw new H("degrees is required.");return t*O.RADIANS_PER_DEGREE},O.toDegrees=function(t){if(!D(t))throw new H("radians is required.");return t*O.DEGREES_PER_RADIAN},O.convertLongitudeRange=function(t){if(!D(t))throw new H("angle is required.");const i=O.TWO_PI,e=t-Math.floor(t/i)*i;return e<-Math.PI?e+i:e>=Math.PI?e-i:e},O.clampToLatitudeRange=function(t){if(!D(t))throw new H("angle is required.");return O.clamp(t,-1*O.PI_OVER_TWO,O.PI_OVER_TWO)},O.negativePiToPi=function(t){if(!D(t))throw new H("angle is required.");return t>=-O.PI&&t<=O.PI?t:O.zeroToTwoPi(t+O.PI)-O.PI},O.zeroToTwoPi=function(t){if(!D(t))throw new H("angle is required.");if(t>=0&&t<=O.TWO_PI)return t;const i=O.mod(t,O.TWO_PI);return Math.abs(i)<O.EPSILON14&&Math.abs(t)>O.EPSILON14?O.TWO_PI:i},O.mod=function(t,i){if(!D(t))throw new H("m is required.");if(!D(i))throw new H("n is required.");if(i===0)throw new H("divisor cannot be 0.");return O.sign(t)===O.sign(i)&&Math.abs(t)<Math.abs(i)?t:(t%i+i)%i},O.equalsEpsilon=function(t,i,e,n){if(!D(t))throw new H("left is required.");if(!D(i))throw new H("right is required.");e=e??0,n=n??e;const o=Math.abs(t-i);return o<=n||o<=e*Math.max(Math.abs(t),Math.abs(i))},O.lessThan=function(t,i,e){if(!D(t))throw new H("first is required.");if(!D(i))throw new H("second is required.");if(!D(e))throw new H("absoluteEpsilon is required.");return t-i<-e},O.lessThanOrEquals=function(t,i,e){if(!D(t))throw new H("first is required.");if(!D(i))throw new H("second is required.");if(!D(e))throw new H("absoluteEpsilon is required.");return t-i<e},O.greaterThan=function(t,i,e){if(!D(t))throw new H("first is required.");if(!D(i))throw new H("second is required.");if(!D(e))throw new H("absoluteEpsilon is required.");return t-i>e},O.greaterThanOrEquals=function(t,i,e){if(!D(t))throw new H("first is required.");if(!D(i))throw new H("second is required.");if(!D(e))throw new H("absoluteEpsilon is required.");return t-i>-e};const vc=[1];O.factorial=function(t){if(typeof t!="number"||t<0)throw new H("A number greater than or equal to 0 is required.");const i=vc.length;if(t>=i){let e=vc[i-1];for(let n=i;n<=t;n++){const o=e*n;vc.push(o),e=o}}return vc[t]},O.incrementWrap=function(t,i,e){if(e=e??0,!D(t))throw new H("n is required.");if(i<=e)throw new H("maximumValue must be greater than minimumValue.");return++t,t>i&&(t=e),t},O.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new H("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0},O.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new H("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},O.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new H("A number between 0 and (2^32)-1 is required.");return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t},O.clamp=function(t,i,e){return A.typeOf.number("value",t),A.typeOf.number("min",i),A.typeOf.number("max",e),t<i?i:t>e?e:t};let _v=new Cv;O.setRandomNumberSeed=function(t){if(!D(t))throw new H("seed is required.");_v=new Cv(t)},O.nextRandomNumber=function(){return _v.random()},O.randomBetween=function(t,i){return O.nextRandomNumber()*(i-t)+t},O.acosClamped=function(t){if(!D(t))throw new H("value is required.");return Math.acos(O.clamp(t,-1,1))},O.asinClamped=function(t){if(!D(t))throw new H("value is required.");return Math.asin(O.clamp(t,-1,1))},O.chordLength=function(t,i){if(!D(t))throw new H("angle is required.");if(!D(i))throw new H("radius is required.");return 2*i*Math.sin(t*.5)},O.logBase=function(t,i){if(!D(t))throw new H("number is required.");if(!D(i))throw new H("base is required.");return Math.log(t)/Math.log(i)},O.cbrt=Math.cbrt??function(i){const e=Math.pow(Math.abs(i),.3333333333333333);return i<0?-e:e},O.log2=Math.log2??function(i){return Math.log(i)*Math.LOG2E},O.fog=function(t,i){const e=t*i;return 1-Math.exp(-(e*e))},O.fastApproximateAtan=function(t){return A.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},O.fastApproximateAtan2=function(t,i){A.typeOf.number("x",t),A.typeOf.number("y",i);let e,n=Math.abs(t);e=Math.abs(i);const o=Math.max(n,e);e=Math.min(n,e);const r=e/o;if(isNaN(r))throw new H("either x or y must be nonzero");return n=O.fastApproximateAtan(r),n=Math.abs(i)>Math.abs(t)?O.PI_OVER_TWO-n:n,n=t<0?O.PI-n:n,n=i<0?-n:n,n};function k(t,i,e){this.x=t??0,this.y=i??0,this.z=e??0}k.fromSpherical=function(t,i){A.typeOf.object("spherical",t),D(i)||(i=new k);const e=t.clock,n=t.cone,o=t.magnitude??1,r=o*Math.sin(n);return i.x=r*Math.cos(e),i.y=r*Math.sin(e),i.z=o*Math.cos(n),i},k.fromElements=function(t,i,e,n){return D(n)?(n.x=t,n.y=i,n.z=e,n):new k(t,i,e)},k.clone=function(t,i){if(D(t))return D(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i):new k(t.x,t.y,t.z)},k.fromCartesian4=k.clone,k.packedLength=3,k.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e]=t.z,i},k.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new k),e.x=t[i++],e.y=t[i++],e.z=t[i],e},k.packArray=function(t,i){A.defined("array",t);const e=t.length,n=e*3;if(!D(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new H("If result is a typed array, it must have exactly array.length * 3 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)k.pack(t[o],i,o*3);return i},k.unpackArray=function(t,i){if(A.defined("array",t),A.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new H("array length must be a multiple of 3.");const e=t.length;D(i)?i.length=e/3:i=new Array(e/3);for(let n=0;n<e;n+=3){const o=n/3;i[o]=k.unpack(t,n,i[o])}return i},k.fromArray=k.unpack,k.maximumComponent=function(t){return A.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},k.minimumComponent=function(t){return A.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},k.minimumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e.z=Math.min(t.z,i.z),e},k.maximumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e.z=Math.max(t.z,i.z),e},k.clamp=function(t,i,e,n){A.typeOf.object("value",t),A.typeOf.object("min",i),A.typeOf.object("max",e),A.typeOf.object("result",n);const o=O.clamp(t.x,i.x,e.x),r=O.clamp(t.y,i.y,e.y),s=O.clamp(t.z,i.z,e.z);return n.x=o,n.y=r,n.z=s,n},k.magnitudeSquared=function(t){return A.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},k.magnitude=function(t){return Math.sqrt(k.magnitudeSquared(t))};const yc=new k;k.distance=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),k.subtract(t,i,yc),k.magnitude(yc)},k.distanceSquared=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),k.subtract(t,i,yc),k.magnitudeSquared(yc)},k.normalize=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=k.magnitude(t);if(i.x=t.x/e,i.y=t.y/e,i.z=t.z/e,isNaN(i.x)||isNaN(i.y)||isNaN(i.z))throw new H("normalized result is not a number");return i},k.dot=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z},k.multiplyComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x*i.x,e.y=t.y*i.y,e.z=t.z*i.z,e},k.divideComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x/i.x,e.y=t.y/i.y,e.z=t.z/i.z,e},k.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e},k.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e},k.multiplyByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e},k.divideByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e},k.negate=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i},k.abs=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=Math.abs(t.x),i.y=Math.abs(t.y),i.z=Math.abs(t.z),i};const Pv=new k;k.lerp=function(t,i,e,n){return A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n),k.multiplyByScalar(i,e,Pv),n=k.multiplyByScalar(t,1-e,n),k.add(Pv,n,n)};const wc=new k,bd=new k;k.angleBetween=function(t,i){A.typeOf.object("left",t),A.typeOf.object("right",i),k.normalize(t,wc),k.normalize(i,bd);const e=k.dot(wc,bd),n=k.magnitude(k.cross(wc,bd,wc));return Math.atan2(n,e)};const YS=new k;k.mostOrthogonalAxis=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=k.normalize(t,YS);return k.abs(e,e),e.x<=e.y?e.x<=e.z?i=k.clone(k.UNIT_X,i):i=k.clone(k.UNIT_Z,i):e.y<=e.z?i=k.clone(k.UNIT_Y,i):i=k.clone(k.UNIT_Z,i),i},k.projectVector=function(t,i,e){A.defined("a",t),A.defined("b",i),A.defined("result",e);const n=k.dot(t,i)/k.dot(i,i);return k.multiplyByScalar(i,n,e)},k.equals=function(t,i){return t===i||D(t)&&D(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z},k.equalsArray=function(t,i,e){return t.x===i[e]&&t.y===i[e+1]&&t.z===i[e+2]},k.equalsEpsilon=function(t,i,e,n){return t===i||D(t)&&D(i)&&O.equalsEpsilon(t.x,i.x,e,n)&&O.equalsEpsilon(t.y,i.y,e,n)&&O.equalsEpsilon(t.z,i.z,e,n)},k.cross=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t.x,o=t.y,r=t.z,s=i.x,a=i.y,c=i.z,d=o*c-r*a,u=r*s-n*c,p=n*a-o*s;return e.x=d,e.y=u,e.z=p,e},k.midpoint=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=(t.x+i.x)*.5,e.y=(t.y+i.y)*.5,e.z=(t.z+i.z)*.5,e},k.fromDegrees=function(t,i,e,n,o){return A.typeOf.number("longitude",t),A.typeOf.number("latitude",i),t=O.toRadians(t),i=O.toRadians(i),k.fromRadians(t,i,e,n,o)};let jt=new k,sr=new k;k._ellipsoidRadiiSquared=new k(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9),k.fromRadians=function(t,i,e,n,o){A.typeOf.number("longitude",t),A.typeOf.number("latitude",i),e=e??0;const r=D(n)?n.radiiSquared:k._ellipsoidRadiiSquared,s=Math.cos(i);jt.x=s*Math.cos(t),jt.y=s*Math.sin(t),jt.z=Math.sin(i),jt=k.normalize(jt,jt),k.multiplyComponents(r,jt,sr);const a=Math.sqrt(k.dot(jt,sr));return sr=k.divideByScalar(sr,a,sr),jt=k.multiplyByScalar(jt,e,jt),D(o)||(o=new k),k.add(sr,jt,o)},k.fromDegreesArray=function(t,i,e){if(A.defined("coordinates",t),t.length<2||t.length%2!==0)throw new H("the number of coordinates must be a multiple of 2 and at least 2");const n=t.length;D(e)?e.length=n/2:e=new Array(n/2);for(let o=0;o<n;o+=2){const r=t[o],s=t[o+1],a=o/2;e[a]=k.fromDegrees(r,s,0,i,e[a])}return e},k.fromRadiansArray=function(t,i,e){if(A.defined("coordinates",t),t.length<2||t.length%2!==0)throw new H("the number of coordinates must be a multiple of 2 and at least 2");const n=t.length;D(e)?e.length=n/2:e=new Array(n/2);for(let o=0;o<n;o+=2){const r=t[o],s=t[o+1],a=o/2;e[a]=k.fromRadians(r,s,0,i,e[a])}return e},k.fromDegreesArrayHeights=function(t,i,e){if(A.defined("coordinates",t),t.length<3||t.length%3!==0)throw new H("the number of coordinates must be a multiple of 3 and at least 3");const n=t.length;D(e)?e.length=n/3:e=new Array(n/3);for(let o=0;o<n;o+=3){const r=t[o],s=t[o+1],a=t[o+2],c=o/3;e[c]=k.fromDegrees(r,s,a,i,e[c])}return e},k.fromRadiansArrayHeights=function(t,i,e){if(A.defined("coordinates",t),t.length<3||t.length%3!==0)throw new H("the number of coordinates must be a multiple of 3 and at least 3");const n=t.length;D(e)?e.length=n/3:e=new Array(n/3);for(let o=0;o<n;o+=3){const r=t[o],s=t[o+1],a=t[o+2],c=o/3;e[c]=k.fromRadians(r,s,a,i,e[c])}return e},k.ZERO=Object.freeze(new k(0,0,0)),k.ONE=Object.freeze(new k(1,1,1)),k.UNIT_X=Object.freeze(new k(1,0,0)),k.UNIT_Y=Object.freeze(new k(0,1,0)),k.UNIT_Z=Object.freeze(new k(0,0,1)),k.prototype.clone=function(t){return k.clone(this,t)},k.prototype.equals=function(t){return k.equals(this,t)},k.prototype.equalsEpsilon=function(t,i,e){return k.equalsEpsilon(this,t,i,e)},k.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};const ZS=new k,QS=new k;function Sv(t,i,e,n,o){if(!D(t))throw new H("cartesian is required.");if(!D(i))throw new H("oneOverRadii is required.");if(!D(e))throw new H("oneOverRadiiSquared is required.");if(!D(n))throw new H("centerToleranceSquared is required.");const r=t.x,s=t.y,a=t.z,c=i.x,d=i.y,u=i.z,p=r*r*c*c,f=s*s*d*d,g=a*a*u*u,m=p+f+g,y=Math.sqrt(1/m),P=k.multiplyByScalar(t,y,ZS);if(m<n)return isFinite(y)?k.clone(P,o):void 0;const S=e.x,C=e.y,E=e.z,T=QS;T.x=P.x*S*2,T.y=P.y*C*2,T.z=P.z*E*2;let I=(1-y)*k.magnitude(t)/(.5*k.magnitude(T)),b=0,x,z,W,N,L,U,_,M,F,V,G;do{I-=b,W=1/(1+I*S),N=1/(1+I*C),L=1/(1+I*E),U=W*W,_=N*N,M=L*L,F=U*W,V=_*N,G=M*L,x=p*U+f*_+g*M-1,z=p*F*S+f*V*C+g*G*E;const Z=-2*z;b=x/Z}while(Math.abs(x)>O.EPSILON12);return D(o)?(o.x=r*W,o.y=s*N,o.z=a*L,o):new k(r*W,s*N,a*L)}function fe(t,i,e){this.longitude=t??0,this.latitude=i??0,this.height=e??0}fe.fromRadians=function(t,i,e,n){return A.typeOf.number("longitude",t),A.typeOf.number("latitude",i),e=e??0,D(n)?(n.longitude=t,n.latitude=i,n.height=e,n):new fe(t,i,e)},fe.fromDegrees=function(t,i,e,n){return A.typeOf.number("longitude",t),A.typeOf.number("latitude",i),t=O.toRadians(t),i=O.toRadians(i),fe.fromRadians(t,i,e,n)};const KS=new k,JS=new k,BS=new k;fe._ellipsoidOneOverRadii=new k(1/6378137,1/6378137,1/6356752314245179e-9),fe._ellipsoidOneOverRadiiSquared=new k(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),fe._ellipsoidCenterToleranceSquared=O.EPSILON1,fe.fromCartesian=function(t,i,e){const n=D(i)?i.oneOverRadii:fe._ellipsoidOneOverRadii,o=D(i)?i.oneOverRadiiSquared:fe._ellipsoidOneOverRadiiSquared,r=D(i)?i._centerToleranceSquared:fe._ellipsoidCenterToleranceSquared,s=Sv(t,n,o,r,JS);if(!D(s))return;let a=k.multiplyComponents(s,o,KS);a=k.normalize(a,a);const c=k.subtract(t,s,BS),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),p=O.sign(k.dot(c,t))*k.magnitude(c);return D(e)?(e.longitude=d,e.latitude=u,e.height=p,e):new fe(d,u,p)},fe.toCartesian=function(t,i,e){return A.defined("cartographic",t),k.fromRadians(t.longitude,t.latitude,t.height,i,e)},fe.clone=function(t,i){if(D(t))return D(i)?(i.longitude=t.longitude,i.latitude=t.latitude,i.height=t.height,i):new fe(t.longitude,t.latitude,t.height)},fe.equals=function(t,i){return t===i||D(t)&&D(i)&&t.longitude===i.longitude&&t.latitude===i.latitude&&t.height===i.height},fe.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t.longitude-i.longitude)<=e&&Math.abs(t.latitude-i.latitude)<=e&&Math.abs(t.height-i.height)<=e},fe.ZERO=Object.freeze(new fe(0,0,0)),fe.prototype.clone=function(t){return fe.clone(this,t)},fe.prototype.equals=function(t){return fe.equals(this,t)},fe.prototype.equalsEpsilon=function(t,i){return fe.equalsEpsilon(this,t,i)},fe.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function ee(t,i){this.x=t??0,this.y=i??0}ee.fromElements=function(t,i,e){return D(e)?(e.x=t,e.y=i,e):new ee(t,i)},ee.clone=function(t,i){if(D(t))return D(i)?(i.x=t.x,i.y=t.y,i):new ee(t.x,t.y)},ee.fromCartesian3=ee.clone,ee.fromCartesian4=ee.clone,ee.packedLength=2,ee.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t.x,i[e]=t.y,i},ee.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new ee),e.x=t[i++],e.y=t[i],e},ee.packArray=function(t,i){A.defined("array",t);const e=t.length,n=e*2;if(!D(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new H("If result is a typed array, it must have exactly array.length * 2 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)ee.pack(t[o],i,o*2);return i},ee.unpackArray=function(t,i){if(A.defined("array",t),A.typeOf.number.greaterThanOrEquals("array.length",t.length,2),t.length%2!==0)throw new H("array length must be a multiple of 2.");const e=t.length;D(i)?i.length=e/2:i=new Array(e/2);for(let n=0;n<e;n+=2){const o=n/2;i[o]=ee.unpack(t,n,i[o])}return i},ee.fromArray=ee.unpack,ee.maximumComponent=function(t){return A.typeOf.object("cartesian",t),Math.max(t.x,t.y)},ee.minimumComponent=function(t){return A.typeOf.object("cartesian",t),Math.min(t.x,t.y)},ee.minimumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e},ee.maximumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e},ee.clamp=function(t,i,e,n){A.typeOf.object("value",t),A.typeOf.object("min",i),A.typeOf.object("max",e),A.typeOf.object("result",n);const o=O.clamp(t.x,i.x,e.x),r=O.clamp(t.y,i.y,e.y);return n.x=o,n.y=r,n},ee.magnitudeSquared=function(t){return A.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},ee.magnitude=function(t){return Math.sqrt(ee.magnitudeSquared(t))};const Cc=new ee;ee.distance=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),ee.subtract(t,i,Cc),ee.magnitude(Cc)},ee.distanceSquared=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),ee.subtract(t,i,Cc),ee.magnitudeSquared(Cc)},ee.normalize=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=ee.magnitude(t);if(i.x=t.x/e,i.y=t.y/e,isNaN(i.x)||isNaN(i.y))throw new H("normalized result is not a number");return i},ee.dot=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),t.x*i.x+t.y*i.y},ee.cross=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),t.x*i.y-t.y*i.x},ee.multiplyComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x*i.x,e.y=t.y*i.y,e},ee.divideComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x/i.x,e.y=t.y/i.y,e},ee.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e},ee.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e},ee.multiplyByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e},ee.divideByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e},ee.negate=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i},ee.abs=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=Math.abs(t.x),i.y=Math.abs(t.y),i};const Ev=new ee;ee.lerp=function(t,i,e,n){return A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n),ee.multiplyByScalar(i,e,Ev),n=ee.multiplyByScalar(t,1-e,n),ee.add(Ev,n,n)};const Av=new ee,Tv=new ee;ee.angleBetween=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),ee.normalize(t,Av),ee.normalize(i,Tv),O.acosClamped(ee.dot(Av,Tv))};const jS=new ee;ee.mostOrthogonalAxis=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=ee.normalize(t,jS);return ee.abs(e,e),e.x<=e.y?i=ee.clone(ee.UNIT_X,i):i=ee.clone(ee.UNIT_Y,i),i},ee.equals=function(t,i){return t===i||D(t)&&D(i)&&t.x===i.x&&t.y===i.y},ee.equalsArray=function(t,i,e){return t.x===i[e]&&t.y===i[e+1]},ee.equalsEpsilon=function(t,i,e,n){return t===i||D(t)&&D(i)&&O.equalsEpsilon(t.x,i.x,e,n)&&O.equalsEpsilon(t.y,i.y,e,n)},ee.ZERO=Object.freeze(new ee(0,0)),ee.ONE=Object.freeze(new ee(1,1)),ee.UNIT_X=Object.freeze(new ee(1,0)),ee.UNIT_Y=Object.freeze(new ee(0,1)),ee.prototype.clone=function(t){return ee.clone(this,t)},ee.prototype.equals=function(t){return ee.equals(this,t)},ee.prototype.equalsEpsilon=function(t,i,e){return ee.equalsEpsilon(this,t,i,e)},ee.prototype.toString=function(){return`(${this.x}, ${this.y})`};function Mv(t,i,e,n){i=i??0,e=e??0,n=n??0,A.typeOf.number.greaterThanOrEquals("x",i,0),A.typeOf.number.greaterThanOrEquals("y",e,0),A.typeOf.number.greaterThanOrEquals("z",n,0),t._radii=new k(i,e,n),t._radiiSquared=new k(i*i,e*e,n*n),t._radiiToTheFourth=new k(i*i*i*i,e*e*e*e,n*n*n*n),t._oneOverRadii=new k(i===0?0:1/i,e===0?0:1/e,n===0?0:1/n),t._oneOverRadiiSquared=new k(i===0?0:1/(i*i),e===0?0:1/(e*e),n===0?0:1/(n*n)),t._minimumRadius=Math.min(i,e,n),t._maximumRadius=Math.max(i,e,n),t._centerToleranceSquared=O.EPSILON1,t._radiiSquared.z!==0&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function le(t,i,e){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,Mv(this,t,i,e)}Object.defineProperties(le.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}}}),le.clone=function(t,i){if(!D(t))return;const e=t._radii;return D(i)?(k.clone(e,i._radii),k.clone(t._radiiSquared,i._radiiSquared),k.clone(t._radiiToTheFourth,i._radiiToTheFourth),k.clone(t._oneOverRadii,i._oneOverRadii),k.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new le(e.x,e.y,e.z)},le.fromCartesian3=function(t,i){return D(i)||(i=new le),D(t)&&Mv(i,t.x,t.y,t.z),i},le.WGS84=Object.freeze(new le(6378137,6378137,6356752314245179e-9)),le.UNIT_SPHERE=Object.freeze(new le(1,1,1)),le.MOON=Object.freeze(new le(O.LUNAR_RADIUS,O.LUNAR_RADIUS,O.LUNAR_RADIUS)),le._default=le.WGS84,Object.defineProperties(le,{default:{get:function(){return le._default},set:function(t){A.typeOf.object("value",t),le._default=t,k._ellipsoidRadiiSquared=t.radiiSquared,fe._ellipsoidOneOverRadii=t.oneOverRadii,fe._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,fe._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}}}),le.prototype.clone=function(t){return le.clone(this,t)},le.packedLength=k.packedLength,le.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,k.pack(t._radii,i,e),i},le.unpack=function(t,i,e){A.defined("array",t),i=i??0;const n=k.unpack(t,i);return le.fromCartesian3(n,e)},le.prototype.geocentricSurfaceNormal=k.normalize,le.prototype.geodeticSurfaceNormalCartographic=function(t,i){A.typeOf.object("cartographic",t);const e=t.longitude,n=t.latitude,o=Math.cos(n),r=o*Math.cos(e),s=o*Math.sin(e),a=Math.sin(n);return D(i)||(i=new k),i.x=r,i.y=s,i.z=a,k.normalize(i,i)},le.prototype.geodeticSurfaceNormal=function(t,i){if(A.typeOf.object("cartesian",t),isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new H("cartesian has a NaN component");if(!k.equalsEpsilon(t,k.ZERO,O.EPSILON14))return D(i)||(i=new k),i=k.multiplyComponents(t,this._oneOverRadiiSquared,i),k.normalize(i,i)};const eE=new k,tE=new k;le.prototype.cartographicToCartesian=function(t,i){const e=eE,n=tE;this.geodeticSurfaceNormalCartographic(t,e),k.multiplyComponents(this._radiiSquared,e,n);const o=Math.sqrt(k.dot(e,n));return k.divideByScalar(n,o,n),k.multiplyByScalar(e,t.height,e),D(i)||(i=new k),k.add(n,e,i)},le.prototype.cartographicArrayToCartesianArray=function(t,i){A.defined("cartographics",t);const e=t.length;D(i)?i.length=e:i=new Array(e);for(let n=0;n<e;n++)i[n]=this.cartographicToCartesian(t[n],i[n]);return i};const iE=new k,nE=new k,oE=new k;le.prototype.cartesianToCartographic=function(t,i){const e=this.scaleToGeodeticSurface(t,nE);if(!D(e))return;const n=this.geodeticSurfaceNormal(e,iE),o=k.subtract(t,e,oE),r=Math.atan2(n.y,n.x),s=Math.asin(n.z),a=O.sign(k.dot(o,t))*k.magnitude(o);return D(i)?(i.longitude=r,i.latitude=s,i.height=a,i):new fe(r,s,a)},le.prototype.cartesianArrayToCartographicArray=function(t,i){A.defined("cartesians",t);const e=t.length;D(i)?i.length=e:i=new Array(e);for(let n=0;n<e;++n)i[n]=this.cartesianToCartographic(t[n],i[n]);return i},le.prototype.scaleToGeodeticSurface=function(t,i){return Sv(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,i)},le.prototype.scaleToGeocentricSurface=function(t,i){A.typeOf.object("cartesian",t),D(i)||(i=new k);const e=t.x,n=t.y,o=t.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(e*e*r.x+n*n*r.y+o*o*r.z);return k.multiplyByScalar(t,s,i)},le.prototype.transformPositionToScaledSpace=function(t,i){return D(i)||(i=new k),k.multiplyComponents(t,this._oneOverRadii,i)},le.prototype.transformPositionFromScaledSpace=function(t,i){return D(i)||(i=new k),k.multiplyComponents(t,this._radii,i)},le.prototype.equals=function(t){return this===t||D(t)&&k.equals(this._radii,t._radii)},le.prototype.toString=function(){return this._radii.toString()},le.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,e){if(A.typeOf.object("position",t),!O.equalsEpsilon(this._radii.x,this._radii.y,O.EPSILON15))throw new H("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");A.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),i=i??0;const n=this._squaredXOverSquaredZ;if(D(e)||(e=new k),e.x=0,e.y=0,e.z=t.z*(1-n),!(Math.abs(e.z)>=this._radii.z-i))return e};const rE=new k;le.prototype.getLocalCurvature=function(t,i){A.typeOf.object("surfacePosition",t),D(i)||(i=new ee);const e=this.getSurfaceNormalIntersectionWithZAxis(t,0,rE),n=k.distance(t,e),o=this.minimumRadius*n/this.maximumRadius**2,r=n*o**2;return ee.fromElements(1/n,1/r,i)};const sE=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],aE=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Iv(t,i,e){A.typeOf.number("a",t),A.typeOf.number("b",i),A.typeOf.func("func",e);const n=.5*(i+t),o=.5*(i-t);let r=0;for(let s=0;s<5;s++){const a=o*sE[s];r+=aE[s]*(e(n+a)+e(n-a))}return r*=o,r}le.prototype.surfaceArea=function(t){A.typeOf.object("rectangle",t);const i=t.west;let e=t.east;const n=t.south,o=t.north;for(;e<i;)e+=O.TWO_PI;const r=this._radiiSquared,s=r.x,a=r.y,c=r.z,d=s*a;return Iv(n,o,function(u){const p=Math.cos(u),f=Math.sin(u);return Math.cos(u)*Iv(i,e,function(g){const m=Math.cos(g),y=Math.sin(g);return Math.sqrt(d*f*f+c*(a*m*m+s*y*y)*p*p)})})};function q(t,i,e,n,o,r,s,a,c){this[0]=t??0,this[1]=n??0,this[2]=s??0,this[3]=i??0,this[4]=o??0,this[5]=a??0,this[6]=e??0,this[7]=r??0,this[8]=c??0}q.packedLength=9,q.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t[0],i[e++]=t[1],i[e++]=t[2],i[e++]=t[3],i[e++]=t[4],i[e++]=t[5],i[e++]=t[6],i[e++]=t[7],i[e++]=t[8],i},q.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new q),e[0]=t[i++],e[1]=t[i++],e[2]=t[i++],e[3]=t[i++],e[4]=t[i++],e[5]=t[i++],e[6]=t[i++],e[7]=t[i++],e[8]=t[i++],e},q.packArray=function(t,i){A.defined("array",t);const e=t.length,n=e*9;if(!D(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new H("If result is a typed array, it must have exactly array.length * 9 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)q.pack(t[o],i,o*9);return i},q.unpackArray=function(t,i){if(A.defined("array",t),A.typeOf.number.greaterThanOrEquals("array.length",t.length,9),t.length%9!==0)throw new H("array length must be a multiple of 9.");const e=t.length;D(i)?i.length=e/9:i=new Array(e/9);for(let n=0;n<e;n+=9){const o=n/9;i[o]=q.unpack(t,n,i[o])}return i},q.clone=function(t,i){if(D(t))return D(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i):new q(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},q.fromArray=q.unpack,q.fromColumnMajorArray=function(t,i){return A.defined("values",t),q.clone(t,i)},q.fromRowMajorArray=function(t,i){return A.defined("values",t),D(i)?(i[0]=t[0],i[1]=t[3],i[2]=t[6],i[3]=t[1],i[4]=t[4],i[5]=t[7],i[6]=t[2],i[7]=t[5],i[8]=t[8],i):new q(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},q.fromQuaternion=function(t,i){A.typeOf.object("quaternion",t);const e=t.x*t.x,n=t.x*t.y,o=t.x*t.z,r=t.x*t.w,s=t.y*t.y,a=t.y*t.z,c=t.y*t.w,d=t.z*t.z,u=t.z*t.w,p=t.w*t.w,f=e-s-d+p,g=2*(n-u),m=2*(o+c),y=2*(n+u),P=-e+s-d+p,S=2*(a-r),C=2*(o-c),E=2*(a+r),T=-e-s+d+p;return D(i)?(i[0]=f,i[1]=y,i[2]=C,i[3]=g,i[4]=P,i[5]=E,i[6]=m,i[7]=S,i[8]=T,i):new q(f,g,m,y,P,S,C,E,T)},q.fromHeadingPitchRoll=function(t,i){A.typeOf.object("headingPitchRoll",t);const e=Math.cos(-t.pitch),n=Math.cos(-t.heading),o=Math.cos(t.roll),r=Math.sin(-t.pitch),s=Math.sin(-t.heading),a=Math.sin(t.roll),c=e*n,d=-o*s+a*r*n,u=a*s+o*r*n,p=e*s,f=o*n+a*r*s,g=-a*n+o*r*s,m=-r,y=a*e,P=o*e;return D(i)?(i[0]=c,i[1]=p,i[2]=m,i[3]=d,i[4]=f,i[5]=y,i[6]=u,i[7]=g,i[8]=P,i):new q(c,d,u,p,f,g,m,y,P)},q.fromScale=function(t,i){return A.typeOf.object("scale",t),D(i)?(i[0]=t.x,i[1]=0,i[2]=0,i[3]=0,i[4]=t.y,i[5]=0,i[6]=0,i[7]=0,i[8]=t.z,i):new q(t.x,0,0,0,t.y,0,0,0,t.z)},q.fromUniformScale=function(t,i){return A.typeOf.number("scale",t),D(i)?(i[0]=t,i[1]=0,i[2]=0,i[3]=0,i[4]=t,i[5]=0,i[6]=0,i[7]=0,i[8]=t,i):new q(t,0,0,0,t,0,0,0,t)},q.fromCrossProduct=function(t,i){return A.typeOf.object("vector",t),D(i)?(i[0]=0,i[1]=t.z,i[2]=-t.y,i[3]=-t.z,i[4]=0,i[5]=t.x,i[6]=t.y,i[7]=-t.x,i[8]=0,i):new q(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},q.fromRotationX=function(t,i){A.typeOf.number("angle",t);const e=Math.cos(t),n=Math.sin(t);return D(i)?(i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=e,i[5]=n,i[6]=0,i[7]=-n,i[8]=e,i):new q(1,0,0,0,e,-n,0,n,e)},q.fromRotationY=function(t,i){A.typeOf.number("angle",t);const e=Math.cos(t),n=Math.sin(t);return D(i)?(i[0]=e,i[1]=0,i[2]=-n,i[3]=0,i[4]=1,i[5]=0,i[6]=n,i[7]=0,i[8]=e,i):new q(e,0,n,0,1,0,-n,0,e)},q.fromRotationZ=function(t,i){A.typeOf.number("angle",t);const e=Math.cos(t),n=Math.sin(t);return D(i)?(i[0]=e,i[1]=n,i[2]=0,i[3]=-n,i[4]=e,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new q(e,-n,0,n,e,0,0,0,1)},q.toArray=function(t,i){return A.typeOf.object("matrix",t),D(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},q.getElementIndex=function(t,i){return A.typeOf.number.greaterThanOrEquals("row",i,0),A.typeOf.number.lessThanOrEquals("row",i,2),A.typeOf.number.greaterThanOrEquals("column",t,0),A.typeOf.number.lessThanOrEquals("column",t,2),t*3+i},q.getColumn=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,2),A.typeOf.object("result",e);const n=i*3,o=t[n],r=t[n+1],s=t[n+2];return e.x=o,e.y=r,e.z=s,e},q.setColumn=function(t,i,e,n){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,2),A.typeOf.object("cartesian",e),A.typeOf.object("result",n),n=q.clone(t,n);const o=i*3;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n},q.getRow=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,2),A.typeOf.object("result",e);const n=t[i],o=t[i+3],r=t[i+6];return e.x=n,e.y=o,e.z=r,e},q.setRow=function(t,i,e,n){return A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,2),A.typeOf.object("cartesian",e),A.typeOf.object("result",n),n=q.clone(t,n),n[i]=e.x,n[i+3]=e.y,n[i+6]=e.z,n};const lE=new k;q.setScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("scale",i),A.typeOf.object("result",e);const n=q.getScale(t,lE),o=i.x/n.x,r=i.y/n.y,s=i.z/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*s,e};const cE=new k;q.setUniformScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number("scale",i),A.typeOf.object("result",e);const n=q.getScale(t,cE),o=i/n.x,r=i/n.y,s=i/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*s,e};const Rd=new k;q.getScale=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i.x=k.magnitude(k.fromElements(t[0],t[1],t[2],Rd)),i.y=k.magnitude(k.fromElements(t[3],t[4],t[5],Rd)),i.z=k.magnitude(k.fromElements(t[6],t[7],t[8],Rd)),i};const Dv=new k;q.getMaximumScale=function(t){return q.getScale(t,Dv),k.maximumComponent(Dv)};const hE=new k;q.setRotation=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("result",e);const n=q.getScale(t,hE);return e[0]=i[0]*n.x,e[1]=i[1]*n.x,e[2]=i[2]*n.x,e[3]=i[3]*n.y,e[4]=i[4]*n.y,e[5]=i[5]*n.y,e[6]=i[6]*n.z,e[7]=i[7]*n.z,e[8]=i[8]*n.z,e};const dE=new k;q.getRotation=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=q.getScale(t,dE);return i[0]=t[0]/e.x,i[1]=t[1]/e.x,i[2]=t[2]/e.x,i[3]=t[3]/e.y,i[4]=t[4]/e.y,i[5]=t[5]/e.y,i[6]=t[6]/e.z,i[7]=t[7]/e.z,i[8]=t[8]/e.z,i},q.multiply=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t[0]*i[0]+t[3]*i[1]+t[6]*i[2],o=t[1]*i[0]+t[4]*i[1]+t[7]*i[2],r=t[2]*i[0]+t[5]*i[1]+t[8]*i[2],s=t[0]*i[3]+t[3]*i[4]+t[6]*i[5],a=t[1]*i[3]+t[4]*i[4]+t[7]*i[5],c=t[2]*i[3]+t[5]*i[4]+t[8]*i[5],d=t[0]*i[6]+t[3]*i[7]+t[6]*i[8],u=t[1]*i[6]+t[4]*i[7]+t[7]*i[8],p=t[2]*i[6]+t[5]*i[7]+t[8]*i[8];return e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c,e[6]=d,e[7]=u,e[8]=p,e},q.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e},q.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e},q.multiplyByVector=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("cartesian",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=t[0]*n+t[3]*o+t[6]*r,a=t[1]*n+t[4]*o+t[7]*r,c=t[2]*n+t[5]*o+t[8]*r;return e.x=s,e.y=a,e.z=c,e},q.multiplyByScalar=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e},q.multiplyByScale=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.object("scale",i),A.typeOf.object("result",e),e[0]=t[0]*i.x,e[1]=t[1]*i.x,e[2]=t[2]*i.x,e[3]=t[3]*i.y,e[4]=t[4]*i.y,e[5]=t[5]*i.y,e[6]=t[6]*i.z,e[7]=t[7]*i.z,e[8]=t[8]*i.z,e},q.multiplyByUniformScale=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.number("scale",i),A.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e},q.negate=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=-t[0],i[1]=-t[1],i[2]=-t[2],i[3]=-t[3],i[4]=-t[4],i[5]=-t[5],i[6]=-t[6],i[7]=-t[7],i[8]=-t[8],i},q.transpose=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[0],n=t[3],o=t[6],r=t[1],s=t[4],a=t[7],c=t[2],d=t[5],u=t[8];return i[0]=e,i[1]=n,i[2]=o,i[3]=r,i[4]=s,i[5]=a,i[6]=c,i[7]=d,i[8]=u,i};function uE(t){let i=0;for(let e=0;e<9;++e){const n=t[e];i+=n*n}return Math.sqrt(i)}const xd=[1,0,0],Fd=[2,2,1];function pE(t){let i=0;for(let e=0;e<3;++e){const n=t[q.getElementIndex(Fd[e],xd[e])];i+=2*n*n}return Math.sqrt(i)}function fE(t,i){const e=O.EPSILON15;let n=0,o=1;for(let d=0;d<3;++d){const u=Math.abs(t[q.getElementIndex(Fd[d],xd[d])]);u>n&&(o=d,n=u)}let r=1,s=0;const a=xd[o],c=Fd[o];if(Math.abs(t[q.getElementIndex(c,a)])>e){const d=t[q.getElementIndex(c,c)],u=t[q.getElementIndex(a,a)],p=t[q.getElementIndex(c,a)],f=(d-u)/2/p;let g;f<0?g=-1/(-f+Math.sqrt(1+f*f)):g=1/(f+Math.sqrt(1+f*f)),r=1/Math.sqrt(1+g*g),s=g*r}return i=q.clone(q.IDENTITY,i),i[q.getElementIndex(a,a)]=i[q.getElementIndex(c,c)]=r,i[q.getElementIndex(c,a)]=s,i[q.getElementIndex(a,c)]=-s,i}const _c=new q,bv=new q;q.computeEigenDecomposition=function(t,i){A.typeOf.object("matrix",t);const e=O.EPSILON20,n=10;let o=0,r=0;D(i)||(i={});const s=i.unitary=q.clone(q.IDENTITY,i.unitary),a=i.diagonal=q.clone(t,i.diagonal),c=e*uE(a);for(;r<n&&pE(a)>c;)fE(a,_c),q.transpose(_c,bv),q.multiply(a,_c,a),q.multiply(bv,a,a),q.multiply(s,_c,s),++o>2&&(++r,o=0);return i},q.abs=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=Math.abs(t[0]),i[1]=Math.abs(t[1]),i[2]=Math.abs(t[2]),i[3]=Math.abs(t[3]),i[4]=Math.abs(t[4]),i[5]=Math.abs(t[5]),i[6]=Math.abs(t[6]),i[7]=Math.abs(t[7]),i[8]=Math.abs(t[8]),i},q.determinant=function(t){A.typeOf.object("matrix",t);const i=t[0],e=t[3],n=t[6],o=t[1],r=t[4],s=t[7],a=t[2],c=t[5],d=t[8];return i*(r*d-c*s)+o*(c*n-e*d)+a*(e*s-r*n)},q.inverse=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[0],n=t[1],o=t[2],r=t[3],s=t[4],a=t[5],c=t[6],d=t[7],u=t[8],p=q.determinant(t);if(Math.abs(p)<=O.EPSILON15)throw new H("matrix is not invertible");i[0]=s*u-d*a,i[1]=d*o-n*u,i[2]=n*a-s*o,i[3]=c*a-r*u,i[4]=e*u-c*o,i[5]=r*o-e*a,i[6]=r*d-c*s,i[7]=c*n-e*d,i[8]=e*s-r*n;const f=1/p;return q.multiplyByScalar(i,f,i)};const gE=new q;q.inverseTranspose=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),q.inverse(q.transpose(t,gE),i)},q.equals=function(t,i){return t===i||D(t)&&D(i)&&t[0]===i[0]&&t[1]===i[1]&&t[2]===i[2]&&t[3]===i[3]&&t[4]===i[4]&&t[5]===i[5]&&t[6]===i[6]&&t[7]===i[7]&&t[8]===i[8]},q.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t[0]-i[0])<=e&&Math.abs(t[1]-i[1])<=e&&Math.abs(t[2]-i[2])<=e&&Math.abs(t[3]-i[3])<=e&&Math.abs(t[4]-i[4])<=e&&Math.abs(t[5]-i[5])<=e&&Math.abs(t[6]-i[6])<=e&&Math.abs(t[7]-i[7])<=e&&Math.abs(t[8]-i[8])<=e},q.IDENTITY=Object.freeze(new q(1,0,0,0,1,0,0,0,1)),q.ZERO=Object.freeze(new q(0,0,0,0,0,0,0,0,0)),q.COLUMN0ROW0=0,q.COLUMN0ROW1=1,q.COLUMN0ROW2=2,q.COLUMN1ROW0=3,q.COLUMN1ROW1=4,q.COLUMN1ROW2=5,q.COLUMN2ROW0=6,q.COLUMN2ROW1=7,q.COLUMN2ROW2=8,Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}}),q.prototype.clone=function(t){return q.clone(this,t)},q.prototype.equals=function(t){return q.equals(this,t)},q.equalsArray=function(t,i,e){return t[0]===i[e]&&t[1]===i[e+1]&&t[2]===i[e+2]&&t[3]===i[e+3]&&t[4]===i[e+4]&&t[5]===i[e+5]&&t[6]===i[e+6]&&t[7]===i[e+7]&&t[8]===i[e+8]},q.prototype.equalsEpsilon=function(t,i){return q.equalsEpsilon(this,t,i)},q.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
319
|
+
`;o.vertexShaderSource=r,o.fragmentShaderSource=s;const a={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}};o.renderState=a;const c=()=>{this.czmTextureId?o.uniformMap={myImage:{type:"texture",id:this.czmTextureId},myColor:this.color??[1,1,1,1]}:o.uniformMap={myImage:{type:"image",uri:w.ESSceneObject.context.getStrFromEnv(this.uri??"${earthsdk3-assets-script-dir}/assets/img/location.png")},myColor:this.color??[1,1,1,1]}};c(),this.dispose(this.uriChanged.disposableOn(c)),this.dispose(this.czmTextureIdChanged.disposableOn(c)),this.dispose(this.colorChanged.disposableOn(c)),this.dispose(l.bind([o,"show"],[this,"show"])),this.dispose(l.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([o,"position"],[this,"position"]));{const p=()=>{o.pixelSize=this.pixelSize};p(),this.dispose(this.pixelSizeChanged.disposableOn(p))}this.dispose(l.track([o,"maximumScale"],[this,"maximumScale"])),this.dispose(l.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(l.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"]));const d=()=>{const{scale:p=[1,1]}=this;o.scale=[this.useAxis.includes("X")?p[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?p[1]:1]};d(),this.dispose(this.scaleChanged.disposableOn(d));const u=()=>{const p=-(this.originRatioAndOffset[0]*this.size[0]+this.originRatioAndOffset[2]),f=this.originRatioAndOffset[1]*this.size[1]+this.originRatioAndOffset[3];o.localPosition=[this.useAxis.includes("X")?p:0,this.useAxis.includes("Y")?this.useAxis.includes("X")?f:p:0,this.useAxis.includes("Z")?f:0],o.localScale=[this.useAxis.includes("X")?this.size[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?this.size[1]:1]};{const p=()=>{const f={XY:[0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0,0],YZ:[0,0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0],XZ:[0,0,0,0,0,-1,1,0,-1,1,0,0,0,0,0,0,0,-1,1,0,-1,1,0,0]},g={XY:{min:[0,-1,0],max:[1,0,0]},YZ:{min:[0,0,-1],max:[0,1,0]},XZ:{min:[0,0,-1],max:[1,0,0]}};o.attributes={position:{typedArray:new Float32Array(f[this.useAxis??js.defaults.useAxis]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,1]),componentsPerAttribute:2}},o.boundingVolume={type:"LocalAxisedBoundingBox",data:g[this.useAxis??js.defaults.useAxis]},u()};p(),this.d(this.useAxisChanged.don(p))}this.dispose(this.originRatioAndOffsetChanged.disposableOn(u)),this.dispose(this.sizeChanged.disposableOn(u)),this.dispose(this.flyToEvent.disposableOn(p=>{o.flyTo(p)})),this.disposeVar(new l.ObjResettingWithEvent(this.rotationModeChanged,()=>new RS(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customPrimitive(){return this._customPrimitive}};v(js,"defaults",{position:[0,0,0],viewDistanceRange:[1e3,1e4,3e4,6e4],useAxis:"XY"});let Hi=js;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",czmTextureId:"",position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),rotationWithCamera:!1,rotationMode:"WithProp",useAxis:"XY",size:l.reactArray([1,1]),scale:[1,1],maximumScale:Number.MAX_VALUE,minimumScale:Number.MIN_VALUE,pixelSize:50,color:l.reactArray([1,1,1,1]),originRatioAndOffset:l.reactArray([.5,1,0,0]),viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Hi||(Hi={})),l.extendClassProps(Hi.prototype,Hi.createDefaultProps);class RS extends l.Destroyable{constructor(i,e){super(),this._czmViewer=i,this._czmImageModel=e;const{customPrimitive:n,rotationMode:o}=this._czmImageModel;if(o==="WithProp")this.dispose(l.track([n,"rotation"],[this._czmImageModel,"rotation"]));else if(o==="WithCameraOnlyZ"){const r=()=>{const{rotation:s}=this._czmImageModel,a=this._czmViewer.getCameraInfo();a&&(n.rotation=[a.rotation[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),s[1],s[2]])};r(),this.dispose(this._czmViewer.cameraChanged.disposableOn(r)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(r))}else if(o==="WithCamera"){const r=()=>{const s=this._czmViewer.getCameraInfo();if(!s)return;const a=s.rotation;n.rotation=[a[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),a[1]+(this._czmImageModel.useAxis.includes("Z")?0:90),a[2]]};r(),this.dispose(this._czmViewer.cameraChanged.disposableOn(r)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(r))}}}class or extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");v(this,"_id",this.disposeVar(l.react(l.createGuid())));n&&(this.id=n);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Yt(e.viewer))return;const s=this.disposeVar(li([this,"material"])),a=this.disposeVar(l.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,s.changed)),c=this.disposeVar(new l.ObjResettingWithEvent(a,()=>{if(s.value)return new xS(e,o,this,s.value)}));this.dispose(this.flyToEvent.disposableOn(d=>{e.actived&&(a.flush(),c.obj&&c.obj.flyTo(d))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,arcType:"GEODESIC",material:l.reactJson({type:"Color"}),stRotation:0,polygonHierarchy:l.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:1,perPositionHeight:!1,closeTop:!0,closeBottom:!0})})(or||(or={})),l.extendClassProps(or.prototype,or.createDefaultProps);class xS extends l.Destroyable{constructor(e,n,o,r){super();v(this,"_boundingSphere",(()=>{const e=this._sceneObject;this._material;const n=new h.BoundingSphere;if(!e.polygonHierarchy)return;const o=dt(e.polygonHierarchy.positions);if(o.length<3){n.radius=-1;return}return h.BoundingSphere.fromPoints(o,n),n})());this._czmViewer=e,this._viewer=n,this._sceneObject=o,this._material=r;const s=this._sceneObject,a=this._material,c=this._viewer;if(!s.polygonHierarchy)return;const d=new h.MaterialAppearance({material:a}),u=[],p=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ui(s.polygonHierarchy),stRotation:s.stRotation&&h.Math.toRadians(s.stRotation),arcType:s.arcType&&h.ArcType[s.arcType],height:s.height,extrudedHeight:s.extrudedHeight,perPositionHeight:s.perPositionHeight,closeTop:s.closeTop,closeBottom:s.closeBottom,ellipsoid:s.ellipsoid&&Pe(s.ellipsoid),granularity:s.granularity!==void 0?h.Math.toRadians(s.granularity):void 0}),id:this});u.push(p);const f=new h.GroundPrimitive({geometryInstances:u,appearance:d,asynchronous:!1,allowPicking:s.allowPicking,compressVertices:!1});h.GroundPrimitive.prototype&&(f.ESSceneObjectID=o.id),c.scene.primitives.add(f),this.dispose(()=>c.scene.primitives.remove(f));{const g=()=>{f.show=s.show};g(),this.dispose(s.showChanged.disposableOn(g))}this.disposeVar(new Re.ObjectsToExcludeWrapper(this._czmViewer,f))}flyTo(e){const n=this._boundingSphere;if(n&&n.radius>0){const o=ce(n.center);o&&se(this._viewer,o,n.radius*4,void 0,e)}}}class FS extends l.Destroyable{constructor(e,n){super();v(this,"_groundPolygonPrimitive");this._groundPolygonPrimitive=this.disposeVar(new or(n,e.id));const o=this._groundPolygonPrimitive;{const r=()=>{const a=e.show,c=e.fill;o.show=a&&c&&e.visibleAlpha>0,o.polygonHierarchy=o.show?{positions:e.positions||[]}:{positions:[]},o.material={type:"Color",color:e.color||[1,1,1,.5]}};r();const s=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(s.disposableOn(r))}this.dispose(l.track([o,"allowPicking"],[e,"allowPicking"]))}get groundPolygonPrimitive(){return this._groundPolygonPrimitive}}class kS extends l.Destroyable{constructor(e,n,o){super();v(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Ie(n,e.id));const r=this._geoPolyline;r.arcType="GEODESIC",r.loop=!0;{const s=()=>{const c=e.show,d=e.outline;if(r.show=c&&d&&e.visibleAlpha>0,r.show&&e.positions&&e.positions.length>1){const u=e.positions[0][2];r.positions=e.positions.map(p=>[p[0],p[1],u])}else r.positions=void 0;r.color=e.outlineColor,r.width=e.outlineWidth};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(l.track([r,"ground"],[e,"strokeGround"]))}get geoPolyline(){return this._geoPolyline}}class zS extends l.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new FS(e,n)),this._bottomPolyline=this.disposeVar(new kS(e,n,o)),this.dispose(e.flyToEvent.disposableOn(r=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,s,a,void 0,r)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,a,c,void 0,r)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Cn extends l.Destroyable{constructor(e,n){super();v(this,"_positions",this.disposeVar(l.reactPositions(void 0)));v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");this.d(this.polygonHierarchyChanged.don(()=>{this.polygonHierarchy?this.positions=this.polygonHierarchy.positions:this.positions=void 0})),this.d(this.positionsChanged.don(()=>{this.positions?this.polygonHierarchy.positions=[...this.positions]:this.polygonHierarchy={positions:[]}}));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(li([this,"material"])),s=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=g=>{if(!this.polygonHierarchy)return;const m=new h.MaterialAppearance({material:g}),y=[],P=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ui(this.polygonHierarchy),stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),arcType:this.arcType&&h.ArcType[this.arcType],height:this.height,extrudedHeight:this.extrudedHeight,perPositionHeight:this.perPositionHeight,closeTop:this.closeTop,closeBottom:this.closeBottom,ellipsoid:this.ellipsoid&&Pe(this.ellipsoid),granularity:this.granularity!==void 0?h.Math.toRadians(this.granularity):void 0}),id:this});y.push(P);const S=new h.Primitive({geometryInstances:y,appearance:m,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(S.ESSceneObjectID=n),S},c=new h.BoundingSphere,d=()=>{if(s(),!this.polygonHierarchy)return;const g=dt(this.polygonHierarchy.positions);if(g.length<3||!r.value){c.radius=-1;return}h.BoundingSphere.fromPoints(g,c),this._primitive=a(r.value),this._primitive&&o.scene.primitives.add(this._primitive)},u=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};d(),u();const p=this.disposeVar(l.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,r.changed));this.dispose(p.disposableOn(()=>{d(),u()}));const f=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(e.actived&&(p.flush(),f.flush(),c.radius>0)){const m=ce(c.center),y=this.height??0,P=this.extrudedHeight??0,S=Math.max(y,P),C=c.radius<S?S:c.radius;m&&se(o,m,C*4,void 0,g)}}))}get positions(){return this._positions.value}get positionsChanged(){return this._positions.changed}set positions(e){this._positions.value=e}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}v(Cn,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,material:l.reactJson({type:"Color"}),stRotation:void 0,polygonHierarchy:l.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0})})(Cn||(Cn={})),l.extendClassProps(Cn.prototype,Cn.createDefaultProps);class mv extends l.Destroyable{constructor(e,n,o,r){super();v(this,"_czmInnerPolygonPrimitive");this._czmInnerPolygonPrimitive=this.disposeVar(new Cn(n,e.id));const s=this._czmInnerPolygonPrimitive;{const a=()=>{const d=e.show,u=e.fill;if(s.show=d&&u&&e.visibleAlpha>0,e.positions&&e.positions.length>0&&!r?s.height=e.positions[0][2]:s.height=void 0,s.polygonHierarchy=s.show?{positions:e.positions||[]}:{positions:[]},s.material={type:"Color",color:e.color||[1,1,1,.5]},o){if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");s.extrudedHeight=(s.height??0)+e.depth}};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(c.disposableOn(a))}this.dispose(l.track([s,"allowPicking"],[e,"allowPicking"]))}get czmInnerPolygonPrimitive(){return this._czmInnerPolygonPrimitive}}class vv extends l.Destroyable{constructor(e,n,o){super();v(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new Ie(n,e.id));const r=this._geoPolyline;r.arcType="GEODESIC",r.loop=!0,this.dispose(l.bind([r,"depthTest"],[e,"depthTest"])),this.dispose(l.bind([r,"ground"],[e,"strokeGround"]));{const s=()=>{const c=e.show,d=e.outline;if(r.show=c&&d&&e.visibleAlpha>0,r.show&&e.positions&&e.positions.length>1){const u=e.positions[0][2];r.positions=e.positions.map(p=>[p[0],p[1],u])}else r.positions=void 0;r.color=e.outlineColor,r.width=e.outlineWidth};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"]))}get geoPolyline(){return this._geoPolyline}}class LS extends l.Destroyable{constructor(i,e){super();const n=this.disposeVar(new ci(e,i.id));n.arcType="GEODESIC",this.dispose(l.track([n,"allowPicking"],[i,"allowPicking"])),this.dispose(l.bind([n,"depthTest"],[i,"depthTest"]));{const o=()=>{if(i.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=i.show,a=i.outline;n.show=s&&a&&i.visibleAlpha>0,n.color=i.outlineColor,n.width=i.outlineWidth;let c;if(n.show&&i.positions&&i.positions.length>1){const u=i.positions[0][2];c=i.positions.map(p=>[p[0],p[1],u])}let d;if(i.positions&&i.positions.length>0?d=i.positions[0][2]:d=void 0,n.show&&c){const u=d,p=(d??0)+i.depth;n.positions=c.map(f=>[[f[0],f[1],u],[f[0],f[1],p]])}else n.positions=void 0};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(i.showChanged,i.outlineChanged,i.outlineColorChanged,i.outlineWidthChanged,i.colorChanged,i.positionsChanged,i.visibleAlphaChanged));this.dispose(r.disposableOn(o))}}}class OS extends l.Destroyable{constructor(i,e){super();const n=this.disposeVar(new Ie(e,i.id));n.arcType="GEODESIC",n.loop=!0,this.dispose(l.track([n,"allowPicking"],[i,"allowPicking"])),this.dispose(l.bind([n,"depthTest"],[i,"depthTest"]));{const o=()=>{if(i.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=i.show,a=i.outline;n.show=s&&a&&i.visibleAlpha>0,n.color=i.outlineColor,n.width=i.outlineWidth;let c;if(n.show&&i.positions&&i.positions.length>1){const u=i.positions[0][2];c=i.positions.map(p=>[p[0],p[1],u])}let d;if(i.positions&&i.positions.length>0?d=i.positions[0][2]:d=void 0,n.show&&c){const u=(d??0)+i.depth;n.positions=c.map(p=>[p[0],p[1],u])}else n.positions=void 0};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(i.showChanged,i.outlineChanged,i.outlineColorChanged,i.outlineWidthChanged,i.colorChanged,i.positionsChanged,i.visibleAlphaChanged));this.dispose(r.disposableOn(o))}}}class NS extends l.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new mv(e,n,!0,o)),this._bottomPolyline=this.disposeVar(new vv(e,n,o)),this.disposeVar(new LS(e,n)),this.disposeVar(new OS(e,n)),this.dispose(e.flyToEvent.disposableOn(r=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,s,a,void 0,r)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,a,c,void 0,r)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class VS extends l.Destroyable{constructor(e,n){super();v(this,"_innerPolygon");v(this,"_bottomPolyline");const o=e.ground;this._innerPolygon=this.disposeVar(new mv(e,n,!1,o)),this._bottomPolyline=this.disposeVar(new vv(e,n,o)),this.dispose(e.flyToEvent.disposableOn(r=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;se(n.viewer,s,a,void 0,r)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],c=e.positionsCenter.radius*4;se(n.viewer,a,c,void 0,r)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class _n extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_polygonOrGroundPolygonResetting");v(this,"_czmViewVisibleDistanceRangeControl");v(this,"_id",this.disposeVar(l.react(l.createGuid())));v(this,"_positionsCenter");this._positionsCenter=this.ad(new hd(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Qn(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(l.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const o=this.disposeVar(l.createNextAnimateFrameEvent(this.groundChanged,this.depthChanged,this.strokeGroundChanged));this._polygonOrGroundPolygonResetting=this.disposeVar(new l.ObjResettingWithEvent(o,()=>this.ground?new zS(this,e):this.depth!==void 0&&this.depth>0?new NS(this,e):new VS(this,e)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polygonOrGroundPolygonResetting(){return this._polygonOrGroundPolygonResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get positionsCenter(){return this._positionsCenter}}v(_n,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,strokeGround:!1,outline:!0,outlineColor:l.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:l.reactArray([1,1,1,.5]),positions:l.reactPositions(void 0),depth:0,zIndex:0,viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(_n||(_n={})),l.extendClassProps(_n.prototype,_n.createDefaultProps);class gs extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(li([this,"material"])),s=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(f,g)=>{const m=new h.MaterialAppearance({material:g}),y=[],P=new h.GeometryInstance({geometry:new h.RectangleGeometry({rectangle:f,height:this.height,rotation:this.rotation&&h.Math.toRadians(this.rotation),extrudedHeight:this.extrudedHeight,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});y.push(P);const S=new h.Primitive({geometryInstances:y,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.Primitive.prototype&&(S.ESSceneObjectID=n),S},c=()=>{if(s(),!this.positions)return;const f=Ge(this.positions);!f||!r.value||(this._primitive=a(f,r.value),this._primitive&&o.scene.primitives.add(this._primitive))},d=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),d();const u=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.stRotationChanged,this.rotationChanged,r.changed,this.allowPickingChanged));this.dispose(u.disposableOn(()=>{c(),d()}));const p=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{d()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const g=Ge(this.positions),m=h.BoundingSphere.fromRectangle3D(g,void 0,this.height);if(m.radius>0){const y=ce(m.center);y&&se(o,y,m.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),positions:l.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,stRotation:void 0})})(gs||(gs={})),l.extendClassProps(gs.prototype,gs.createDefaultProps);const Lh=class Lh extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(li([this,"material"],Lh.defaults.material)),s=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(f,g)=>{const m=new h.MaterialAppearance({material:g}),y=[],P=new h.GeometryInstance({geometry:new h.RectangleGeometry({rectangle:f,rotation:this.rotation&&h.Math.toRadians(this.rotation),stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});y.push(P);const S=new h.GroundPrimitive({geometryInstances:y,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.GroundPrimitive.prototype&&(S.ESSceneObjectID=n),S},c=()=>{if(s(),!this.positions)return;const f=Ge(this.positions);!f||!r.value||(this._primitive=a(f,r.value),this._primitive&&o.scene.primitives.add(this._primitive))},d=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),d();const u=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.stRotationChanged,this.rotationChanged,r.changed,this.allowPickingChanged));this.dispose(u.disposableOn(()=>{c(),d()}));const p=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{d()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const g=Ge(this.positions),m=h.BoundingSphere.fromRectangle3D(g,void 0,0);if(m.radius>0){const y=ce(m.center);y&&se(o,y,m.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Lh,"defaults",{material:{type:"Color",color:[1,1,1,.5]}});let lo=Lh;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),positions:l.reactArrayWithUndefined(void 0),rotation:void 0,stRotation:void 0})})(lo||(lo={})),l.extendClassProps(lo.prototype,lo.createDefaultProps);class ms extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(r);const s=new h.Color,a=f=>{const g=new h.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),m=[],y=new h.GeometryInstance({geometry:new h.RectangleOutlineGeometry({rectangle:f,height:this.height??0,extrudedHeight:this.extrudedHeight,rotation:this.rotation&&h.Math.toRadians(this.rotation)}),attributes:{color:this.color?h.ColorGeometryInstanceAttribute.fromColor(ie(this.color,s)):h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,1,1,1))},id:this});m.push(y);const P=new h.Primitive({geometryInstances:m,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return h.Primitive.prototype&&(P.ESSceneObjectID=n),P},c=()=>{if(r(),!this.positions)return;const f=Ge(this.positions);f&&(this._primitive=a(f),this._primitive&&o.scene.primitives.add(this._primitive))},d=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};c(),d();const u=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.colorChanged,this.translucentChanged,this.extrudedHeightChanged,this.heightChanged,this.rotationChanged,this.allowPickingChanged));this.dispose(u.disposableOn(()=>{c(),d()}));const p=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{d()})),this.dispose(this.flyToEvent.disposableOn(f=>{if(!e.actived||!this.positions)return;const g=Ge(this.positions),m=h.BoundingSphere.fromRectangle3D(g,void 0,this.height);if(m.radius>0){const y=ce(m.center);y&&se(o,y,m.radius*4,void 0,f)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,translucent:void 0,color:l.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,positions:l.reactArrayWithUndefined(void 0)})})(ms||(ms={})),l.extendClassProps(ms.prototype,ms.createDefaultProps);const ea=class ea extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));if(!e.viewer)return;const r=this.ad(new gs(e,n)),s=this.ad(new lo(e,n)),a=this.ad(new ms(e,n));this.dispose(l.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const u=this.show??!0,p=this.ground??!1,f=this.outline??!1;a.show=u&&!p&&f,r.show=u&&!p,a.show?a.positions=this.rectangle:a.positions=void 0,r.show?r.positions=this.rectangle:r.positions=void 0,a.rotation=r.rotation=this.rotation,r.material=this.material??ea.defaults.material,r.stRotation=this.stRotation,a.extrudedHeight=r.extrudedHeight=this.extrudedHeight,a.height=r.height=this.height,a.color=this.outlineColor,a.translucent=this.outlineTranslucent,s.show=u&&p,s.show?s.positions=this.rectangle:s.positions=void 0,s.rotation=this.rotation,s.material=this.material??ea.defaults.material,s.stRotation=this.stRotation};c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.heightChanged,this.extrudedHeightChanged,this.materialChanged,this.rectangleChanged,this.outlineColorChanged,this.stRotationChanged,this.rotationChanged,this.outlineTranslucentChanged,this.groundChanged));this.dispose(d.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(u=>{this.ground?s.flyTo(u):r.flyTo(u)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ea,"defaults",{material:{type:"Color",color:[1,1,1,.5]},rectangle:void 0,extrudedHeight:void 0});let Ci=ea;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outlineTranslucent:!0,outline:!1,outlineColor:l.reactArray([1,1,1,1]),height:0,extrudedHeight:void 0,material:l.reactJsonWithUndefined(void 0),rectangle:l.reactArrayWithUndefined(void 0),rotation:0,stRotation:0})})(Ci||(Ci={})),l.extendClassProps(Ci.prototype,Ci.createDefaultProps);const ta=class ta extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const r=this.disposeVar(li([this,"material"])),s=(p,f)=>{if(!p||!this.radius)return;const g=new h.MaterialAppearance({material:f}),m=[],y=()=>{let I=this.granularity??ta.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),I=I|0,I=Math.max(1,I),h.Math.toRadians(I)},P=new h.GeometryInstance({geometry:new h.CircleGeometry({center:p,height:this.height,extrudedHeight:this.extrudedHeight,radius:this.radius,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&Pe(this.ellipsoid),granularity:y()}),id:this}),S=Fe({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),C=Fe({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!C||!S){console.warn("modelMatrix is undefined!");return}const E=h.Matrix4.inverseTransformation(S,new h.Matrix4);h.Matrix4.multiply(C,E,P.modelMatrix),m.push(P);const T=new h.Primitive({geometryInstances:m,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??ta.defaults.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(T.ESSceneObjectID=n),T},a=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=Ve(this.position);!p||!r.value||(this._primitive=s(p,r.value),this._primitive&&o.scene.primitives.add(this._primitive))},c=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};a(),c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.ellipsoidChanged,this.granularityChanged,this.stRotationChanged,r.changed,this.rotationChanged));this.dispose(d.disposableOn(()=>{a(),c()}));const u=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(u.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)se(o,this.position,this.radius*4,void 0,1e3);else{const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ta,"defaults",{show:!0,allowPicking:!1,translucent:!0,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Pn=ta;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJson({type:"Color"}),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,stRotation:void 0,ellipsoid:void 0,granularity:void 0})})(Pn||(Pn={})),l.extendClassProps(Pn.prototype,Pn.createDefaultProps);const ko=class ko extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const r=this.disposeVar(li([this,"material"],ko.defaults.material)),s=(p,f)=>{if(!p||!this.radius)return;const g=new h.MaterialAppearance({material:f}),m=[],y=()=>{let C=this.granularity??ko.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),C=C|0,C=Math.max(1,C),h.Math.toRadians(C)},P=new h.GeometryInstance({geometry:new h.CircleGeometry({center:p,radius:this.radius,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),granularity:y(),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&Pe(this.ellipsoid)}),id:this});m.push(P);const S=new h.GroundPrimitive({geometryInstances:m,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??ko.defaults.allowPicking,compressVertices:!1});return h.GroundPrimitive.prototype&&(S.ESSceneObjectID=n),S},a=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position||!this.radius||!r.value)return;const p=Ve(this.position);this._primitive=s(p,r.value),this._primitive&&o.scene.primitives.add(this._primitive)},c=()=>{const p=this.show??ko.defaults.show;this._primitive&&(this._primitive.show=p)};a(),c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.stRotationChanged,this.granularityChanged,this.ellipsoidChanged,this.materialChanged,r.changed));this.dispose(d.disposableOn(()=>{a(),c()}));const u=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(u.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)se(o,this.position,this.radius*4,void 0,1e3);else{const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ko,"defaults",{show:!0,allowPicking:!1,material:{type:"Color",color:[1,1,1,.5]},radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Sn=ko;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),granularity:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),radius:void 0,stRotation:void 0,ellipsoid:void 0})})(Sn||(Sn={})),l.extendClassProps(Sn.prototype,Sn.createDefaultProps);const ia=class ia extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_primitive");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0});const r=new h.Color,s=p=>{if(!p||!this.radius)return;const f=new h.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),g=[],m=h.ColorGeometryInstanceAttribute.fromColor(h.Color.WHITE),y=()=>{let I=this.granularity??ia.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),I=I|0,I=Math.max(1,I),h.Math.toRadians(I)},P=new h.GeometryInstance({geometry:new h.CircleOutlineGeometry({center:p,radius:this.radius,height:this.height,extrudedHeight:this.extrudedHeight,ellipsoid:this.ellipsoid&&Pe(this.ellipsoid),granularity:y(),numberOfVerticalLines:this.numberOfVerticalLines}),attributes:{color:this.outlineColor?h.ColorGeometryInstanceAttribute.fromColor(ie(this.outlineColor,r)):m},id:this}),S=Fe({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),C=Fe({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!C||!S){console.warn("modelMatrix is undefined!");return}const E=h.Matrix4.inverseTransformation(S,new h.Matrix4);h.Matrix4.multiply(C,E,P.modelMatrix),g.push(P);const T=new h.Primitive({geometryInstances:g,appearance:f,asynchronous:!1,allowPicking:this.allowPicking??ia.defaults.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(T.ESSceneObjectID=n),T},a=()=>{if(this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=Ve(this.position);p&&(this._primitive=s(p),this._primitive&&o.scene.primitives.add(this._primitive))},c=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};a(),c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.outlineColorChanged,this.translucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.rotationChanged));this.dispose(d.disposableOn(()=>{a(),c()}));const u=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(u.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}const p=o.scene.camera.positionCartographic.height;se(o,this.position,p,void 0,1e3)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(ia,"defaults",{show:!0,translucent:!0,allowPicking:!1,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1,numberOfVerticalLines:0});let En=ia;(t=>{t.createDefaultProps=()=>({show:!0,translucent:void 0,allowPicking:void 0,outlineColor:l.reactArrayWithUndefined(void 0),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,ellipsoid:void 0,granularity:void 0,numberOfVerticalLines:void 0})})(En||(En={})),l.extendClassProps(En.prototype,En.createDefaultProps);class co extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));if(!e.viewer)return;const r=this.ad(new Pn(e,n)),s=this.ad(new Sn(e,n)),a=this.ad(new En(e,n));this.dispose(l.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([a,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const u=this.show??!0,p=this.ground??!1,f=this.outline??!1;a.show=u&&!p&&f,r.show=u&&!p,a.show?a.position=this.position:a.position=void 0,r.show?r.position=this.position:r.position=void 0,r.rotation=a.rotation=this.rotation,a.radius=r.radius=this.radius,a.extrudedHeight=r.extrudedHeight=this.extrudedHeight,this.position&&(a.height=r.height=this.position[2]),this.granularity===0&&(console.error("granularity不能设置为0"),this.granularity=1),r.granularity=a.granularity=this.granularity,r.ellipsoid=a.ellipsoid=this.ellipsoid,r.material=this.material,r.stRotation=this.stRotation,a.outlineColor=this.outlineColor,a.translucent=this.outlineTranslucent,a.numberOfVerticalLines=this.numberOfVerticalLines,s.show=u&&p,s.show?s.position=this.position:s.position=void 0,s.radius=this.radius,this.granularity===0?(console.error("granularity不能设置为0"),s.granularity=1):s.granularity=this.granularity,s.rotation=this.rotation,s.ellipsoid=this.ellipsoid,s.material=this.material,s.stRotation=this.stRotation};c();const d=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.radiusChanged,this.outlineChanged,this.extrudedHeightChanged,this.materialChanged,this.positionChanged,this.outlineColorChanged,this.stRotationChanged,this.outlineTranslucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.groundChanged,this.rotationChanged));this.dispose(d.disposableOn(c)),this.dispose(this.flyToEvent.disposableOn(u=>{this.ground?s.flyTo(u):r.flyTo(u)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}v(co,"defaults",{extrudedHeight:void 0}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,outline:!0,outlineTranslucent:!0,extrudedHeight:void 0,outlineColor:l.reactArray([1,1,1,1]),material:l.reactJson({type:"Color",color:[1,1,1,.5]}),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),radius:0,stRotation:0,ellipsoid:l.reactArray([6378137,6378137,6356752314245179e-9]),granularity:1,numberOfVerticalLines:0})})(co||(co={})),l.extendClassProps(co.prototype,co.createDefaultProps);class vs extends l.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_flyToEvent",this.dv(new l.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Yt(e.viewer))return;const s=h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),a=()=>{this._primitive&&(o.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.d(a);const c=()=>{const E={baseWaterColor:ie(this.waterColor),normalMap:s,frequency:this.frequency,animationSpeed:this.waveVelocity,amplitude:this.amplitude,specularIntensity:this.specularIntensity};return new h.Material({fabric:{type:"Water",uniforms:E}})},d=()=>{if(!this.points)return;const E={positions:this.points},T=new h.PolygonGeometry({polygonHierarchy:Ui(E),vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,height:this.height});return new h.GeometryInstance({geometry:T,id:this})},u=()=>{if(!this.points)return;const E=new h.EllipsoidSurfaceAppearance({material:c(),aboveGround:!0}),T=d();let I;return this.ground??!1?I=new h.GroundPrimitive({geometryInstances:T,appearance:E,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}):I=new h.Primitive({geometryInstances:T,appearance:E,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}),h.Primitive.prototype&&h.GroundPrimitive.prototype&&(I.ESSceneObjectID=n),I},p=new h.BoundingSphere,f=()=>{a(),g(p),this._primitive=u(),this._primitive&&o.scene.primitives.add(this._primitive)},g=E=>{if(!this.points)return;const T=dt(this.points);if(T.length<3){E.radius=-1;return}h.BoundingSphere.fromPoints(T,E)},m=()=>{const E=this.show??!0;this._primitive&&(this._primitive.show=E)},y=()=>{f(),m()};y();let P=l.debounce(y,500);const S=this.dv(l.createNextAnimateFrameEvent(this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.specularIntensityChanged,this.waveVelocityChanged,this.groundChanged,this.allowPickingChanged));this.d(S.don(y));const C=this.dv(l.createNextAnimateFrameEvent(this.pointsChanged,this.heightChanged));this.d(C.don(()=>{if(!this.points){a();return}this._primitive&&!this.ground?(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=d(),g(p),P&&P[0]()):y()})),this.d(this.showChanged.don(m)),this.d(this.flyToEvent.don(E=>{if(p.radius>0){const T=ce(p.center);T&&se(o,T,p.radius*4,void 0,E)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,points:l.reactPositions(void 0),height:void 0,allowPicking:!0,ground:!1,waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,baseWaterImage:l.reactJsonWithUndefined(void 0),flowSpeed:0})})(vs||(vs={})),l.extendClassProps(vs.prototype,vs.createDefaultProps);class ho extends l.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_flyToEvent",this.dv(new l.Event));v(this,"_updateBoundingSphereEvent",this.ad(new l.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=new h.BoundingSphere,s=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.d(s);const a=E=>w.ESSceneObject.context.getStrFromEnv(E),c=()=>{this._primitive=new h[this.ground?"GroundPrimitive":"Primitive"]({compressVertices:!1,asynchronous:!1,allowPicking:this.allowPicking,geometryInstances:f()}),h.Primitive.prototype&&(this._primitive.ESSceneObjectID=n),o.scene.primitives.add(this._primitive)},d=()=>{var b;const E=a(this.normalMap??h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")),T={baseWaterColor:ie(this.waterColor??[.25,.6,1,.7]),normalMap:E,frequency:this.frequency,animationSpeed:this.animationSpeed,amplitude:this.amplitude,specularIntensity:this.specularIntensity};if(this.blendColor&&(T.blendColor=ie(this.blendColor)),this.specularMap&&(T.specularMap=a(this.specularMap)),this.points&&this.points.length>=1){const{maxPos:x,minPos:z}=w.getMinMaxCorner(this.points),W=w.getDistancesFromPositions([z,[x[0],x[1],z[2]]],"GEODESIC")[0],N=w.getDistancesFromPositions([z,[z[0],x[1],x[2]]],"GEODESIC")[0];this.baseWaterImage&&(this.baseWaterImage.url&&(T.baseWaterImage=a(this.baseWaterImage.url)),this.baseWaterImage.uDis&&(T.repeatX=W/this.baseWaterImage.uDis),this.baseWaterImage.vDis&&(T.repeatY=N/this.baseWaterImage.vDis)),T.flowSpeed=this.flowSpeed/(((b=this.baseWaterImage)==null?void 0:b.uDis)??W)}if(this._primitive&&this._primitive.appearance){this._primitive.appearance.material.uniforms=Object.assign({},this._primitive.appearance.material.uniforms,T);return}const I=new h.EllipsoidSurfaceAppearance({material:qm(T),aboveGround:!0});this._primitive&&(this._primitive.appearance=I)},u=this.ad(l.createNextAnimateFrameEvent(this.baseWaterImageChanged,this.waterColorChanged,this.blendColorChanged,this.specularMapChanged,this.flowSpeedChanged,this.normalMapChanged,this.frequencyChanged,this.animationSpeedChanged,this.amplitudeChanged,this.specularIntensityChanged));this.ad(u.don(d));const p=E=>{if(!this.points)return;const T=dt(this.points);if(T.length<3){E.radius=-1;return}h.BoundingSphere.fromPoints(T,E)},f=()=>{if(!this.points||this.points.length<3)return;const{minPos:E}=w.getMinMaxCorner(this.points),[T]=Mt({originPosition:E},this.points),{minPos:I,maxPos:b}=w.getMinMaxCorner(T),x=b[0]-I[0],z=b[1]-I[1],W={positions:this.points},N=new h.PolygonGeometry({polygonHierarchy:Ui(W),vertexFormat:h.VertexFormat.DEFAULT,stRotation:this.stRotation&&h.Math.toRadians(this.stRotation),perPositionHeight:!0,attributes:{st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(T.map(U=>[h.Math.clamp(U[0]/x,0,1),h.Math.clamp(U[1]/z,0,1)]).flat())})}});return new h.GeometryInstance({id:this,geometry:N})},g=()=>{this._primitive&&(this._primitive.show=this.show??!0)},m=this.ad(l.createNextAnimateFrameEvent(this.showChanged));this.ad(m.don(g));const y=this.ad(()=>{s(),c(),g(),d(),p(r)});y();const P=this.ad(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.groundChanged));this.ad(P.don(y)),this.ad(new l.ObjResettingWithEvent(this.updateBoundingSphereEvent,E=>{const T=new l.Destroyable;return E?T.ad(o.scene.preUpdate.addEventListener(()=>{const I=o.camera;o.camera.frustum.computeCullingVolume(I.position,I.direction,I.up).computeVisibility(r)===h.Intersect.OUTSIDE&&y()})):(y(),T.ad(this.pointsChanged.don(y))),T}));const S=()=>{if(!this.points||this.points.length<3){y();return}this._primitive instanceof h.Primitive?(this._primitive._state=3,this._primitive._appearance=void 0):this._primitive._primitive=void 0,this._primitive.geometryInstances=f(),this._primitive._recomputeBoundingSpheres=!0},C=this.dv(l.createNextAnimateFrameEvent(this.pointsChanged,this.stRotationChanged));this.d(C.don(S)),this.d(this.flyToEvent.don(E=>{if(r.radius>0){const T=ce(r.center);T&&se(o,T,r.radius*4,void 0,E)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get updateBoundingSphereEvent(){return this._updateBoundingSphereEvent}updateBoundingSphere(e){this._updateBoundingSphereEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:!0,points:l.reactPositions(void 0),allowPicking:!0,waterColor:[.1497,.165,.0031,1],blendColor:l.reactArrayWithUndefined(void 0),specularMap:void 0,normalMap:h.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),frequency:1e3,animationSpeed:.005,amplitude:10,specularIntensity:.3,baseWaterImage:l.reactJsonWithUndefined(void 0),flowSpeed:0,stRotation:void 0,ground:void 0})})(ho||(ho={})),l.extendClassProps(ho.prototype,ho.createDefaultProps);class uo extends l.Destroyable{constructor(e,n){super();v(this,"pointPrimitives");v(this,"_flyToEvent",this.dv(new l.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}if(!Yt(e.viewer))return;let{pointPrimitives:s}=this;const a=()=>{s&&(s.removeAll(),o.scene.primitives.remove(s),s=void 0)};this.d(a);const c=()=>{const m=new h.PointPrimitiveCollection({show:this.show??!0,debugShowBoundingVolume:this.debugShowBoundingVolume??!1,blendOption:(this.blendOption&&ut.blendOptionType[this.blendOption])??h.BlendOption.OPAQUE_AND_TRANSLUCENT});return this.pointPrimitiveOptions&&(this.pointPrimitiveOptions.forEach(P=>{m.add({show:P.show??!0,color:P.color&&ie(P.color),disableDepthTestDistance:P.disableDepthTestDistance,distanceDisplayCondition:P.distanceDisplayCondition&&ss(P.distanceDisplayCondition),outlineColor:P.outlineColor&&ie(P.outlineColor),outlineWidth:P.outlineWidth,pixelSize:P.pixelSize,position:P.position&&Ve(P.position),scaleByDistance:P.scaleByDistance&&cn(P.scaleByDistance),translucencyByDistance:P.translucencyByDistance&&cn(P.translucencyByDistance)})}),h.PointPrimitiveCollection.prototype&&(m.ESSceneObjectID=n)),m},d=()=>{a(),s=c(),o.scene.primitives.add(s)};d();const u=this.dv(l.createNextAnimateFrameEvent(this.showChanged,this.debugShowBoundingVolumeChanged,this.blendOptionChanged)),p=()=>{s&&(s.show=this.show??!0,s.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,s.blendOption=(this.blendOption&&ut.blendOptionType[this.blendOption])??h.BlendOption.OPAQUE_AND_TRANSLUCENT)};this.d(u.don(p));const f=this.dv(l.createNextAnimateFrameEvent(this.pointPrimitiveOptionsChanged));this.d(f.don(d));const g=new h.BoundingSphere;this.d(this.flyToEvent.don(m=>{if(!(!e.actived||!this.pointPrimitiveOptions))if(u.flush(),f.flush(),this.pointPrimitiveOptions.length===1){const y=this.pointPrimitiveOptions[0].position;if(!y)return;const P=o.scene.camera.positionCartographic.height;se(o,y,P,void 0,m)}else{const y=this.pointPrimitiveOptions,P=[];y.forEach(C=>{C.position&&P.push(C.position)});const S=dt(P);if(h.BoundingSphere.fromPoints(S,g),g.radius>0){const C=ce(g.center);C&&se(o,C,g.radius*4,void 0,m)}}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,debugShowBoundingVolume:void 0,blendOption:void 0,pointPrimitiveOptions:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArrayWithUndefined(void 0),scale:l.reactArrayWithUndefined(void 0),localPosition:l.reactArrayWithUndefined(void 0),localRotation:l.reactArrayWithUndefined(void 0),localScale:l.reactArrayWithUndefined(void 0),localModelMatrix:l.reactArrayWithUndefined(void 0),modelMatrix:l.reactArrayWithUndefined(void 0)})})(uo||(uo={})),l.extendClassProps(uo.prototype,uo.createDefaultProps);class US extends l.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("!viewer");const o=ue.czmJulianDateToTimeStamp,r=ue.getClockRange,s=ue.getClockStep;{const a=()=>n.clockViewModel.startTime=h.JulianDate.fromDate(new Date(i.startTime??w.getDefaultValue(ue.defaults.startTime)));a(),this.dispose(mi(n.clockViewModel,"startTime",c=>i.startTime=o(c))),this.dispose(i.startTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.stopTime=h.JulianDate.fromDate(new Date(i.stopTime??w.getDefaultValue(ue.defaults.stopTime)));a(),this.dispose(mi(n.clockViewModel,"stopTime",c=>i.stopTime=o(c))),this.dispose(i.stopTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(i.currentTime??w.getDefaultValue(ue.defaults.currentTime)));a(),this.dispose(mi(n.clockViewModel,"currentTime",c=>i.currentTime=o(c))),this.dispose(i.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.multiplier=i.multiplier??ue.defaults.multiplier;a(),this.dispose(mi(n.clockViewModel,"multiplier",c=>{(i.multiplier??ue.defaults.multiplier!==c)&&(i.multiplier=c)})),this.dispose(i.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockStep=h.ClockStep[i.clockStep??ue.defaults.clockStep];a(),this.dispose(mi(n.clockViewModel,"clockStep",c=>{const d=s(c);(i.clockStep??ue.defaults.clockStep!==d)&&(i.clockStep=d)})),this.dispose(i.clockStepChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockRange=h.ClockRange[i.clockRange??ue.defaults.clockRange];a(),this.dispose(mi(n.clockViewModel,"clockRange",c=>{const d=r(c);(i.clockRange??ue.defaults.clockRange!==d)&&(i.clockRange=d)})),this.dispose(i.clockRangeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.shouldAnimate=i.shouldAnimate??ue.defaults.shouldAnimate;a(),this.dispose(mi(n.clockViewModel,"shouldAnimate",c=>{(i.shouldAnimate??ue.defaults.shouldAnimate!==c)&&(i.shouldAnimate=c)})),this.dispose(i.shouldAnimateChanged.disposableOn(a))}}}const zo=class zo extends l.Destroyable{constructor(i){super(),this.disposeVar(new l.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled??zo.defaults.enabled)return new US(this,i)}))}};v(zo,"czmJulianDateToTimeStamp",WS),v(zo,"getClockRange",GS),v(zo,"getClockStep",HS),v(zo,"defaults",{enabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+1440*60*1e3,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1});let ue=zo;(t=>{t.createDefaultProps=()=>({enabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0})})(ue||(ue={})),l.extendClassProps(ue.prototype,ue.createDefaultProps);function WS(t){return h.JulianDate.toDate(t).getTime()}function GS(t){if(t===h.ClockRange.CLAMPED)return"CLAMPED";if(t===h.ClockRange.LOOP_STOP)return"LOOP_STOP";if(t===h.ClockRange.UNBOUNDED)return"UNBOUNDED";throw new Error(`getClockRange error: ${t}`)}function HS(t){if(t===h.ClockStep.SYSTEM_CLOCK)return"SYSTEM_CLOCK";if(t===h.ClockStep.SYSTEM_CLOCK_MULTIPLIER)return"SYSTEM_CLOCK_MULTIPLIER";if(t===h.ClockStep.TICK_DEPENDENT)return"TICK_DEPENDENT";throw new Error(`clockStep未知类型: ${t}`)}function D(t){return t!=null}function H(t){this.name="DeveloperError",this.message=t;let i;try{throw new Error}catch(e){i=e.stack}this.stack=i}D(Object.create)&&(H.prototype=Object.create(Error.prototype),H.prototype.constructor=H),H.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return D(this.stack)&&(t+=`
|
|
320
|
+
${this.stack.toString()}`),t},H.throwInstantiationError=function(){throw new H("This function defines an interface and should not be called directly.")};const A={};A.typeOf={};function qS(t){return`${t} is required, actual value was undefined`}function rr(t,i,e){return`Expected ${e} to be typeof ${i}, actual typeof was ${t}`}A.defined=function(t,i){if(!D(i))throw new H(qS(t))},A.typeOf.func=function(t,i){if(typeof i!="function")throw new H(rr(typeof i,"function",t))},A.typeOf.string=function(t,i){if(typeof i!="string")throw new H(rr(typeof i,"string",t))},A.typeOf.number=function(t,i){if(typeof i!="number")throw new H(rr(typeof i,"number",t))},A.typeOf.number.lessThan=function(t,i,e){if(A.typeOf.number(t,i),i>=e)throw new H(`Expected ${t} to be less than ${e}, actual value was ${i}`)},A.typeOf.number.lessThanOrEquals=function(t,i,e){if(A.typeOf.number(t,i),i>e)throw new H(`Expected ${t} to be less than or equal to ${e}, actual value was ${i}`)},A.typeOf.number.greaterThan=function(t,i,e){if(A.typeOf.number(t,i),i<=e)throw new H(`Expected ${t} to be greater than ${e}, actual value was ${i}`)},A.typeOf.number.greaterThanOrEquals=function(t,i,e){if(A.typeOf.number(t,i),i<e)throw new H(`Expected ${t} to be greater than or equal to ${e}, actual value was ${i}`)},A.typeOf.object=function(t,i){if(typeof i!="object")throw new H(rr(typeof i,"object",t))},A.typeOf.bool=function(t,i){if(typeof i!="boolean")throw new H(rr(typeof i,"boolean",t))},A.typeOf.bigint=function(t,i){if(typeof i!="bigint")throw new H(rr(typeof i,"bigint",t))},A.typeOf.number.equals=function(t,i,e,n){if(A.typeOf.number(t,e),A.typeOf.number(i,n),e!==n)throw new H(`${t} must be equal to ${i}, the actual values are ${e} and ${n}`)};var yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dd,wv;function $S(){if(wv)return Dd;wv=1;var t=function(i){i==null&&(i=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,i.constructor==Array?this.init_by_array(i,i.length):this.init_seed(i)};return t.prototype.init_seed=function(i){for(this.mt[0]=i>>>0,this.mti=1;this.mti<this.N;this.mti++){var i=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((i&4294901760)>>>16)*1812433253<<16)+(i&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},t.prototype.init_by_array=function(i,e){var n,o,r;for(this.init_seed(19650218),n=1,o=0,r=this.N>e?this.N:e;r;r--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1664525<<16)+(s&65535)*1664525)+i[o]+o,this.mt[n]>>>=0,n++,o++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),o>=e&&(o=0)}for(r=this.N-1;r;r--){var s=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((s&4294901760)>>>16)*1566083941<<16)+(s&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},t.prototype.random_int=function(){var i,e=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++)i=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^i>>>1^e[i&1];for(;n<this.N-1;n++)i=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^i>>>1^e[i&1];i=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^i>>>1^e[i&1],this.mti=0}return i=this.mt[this.mti++],i^=i>>>11,i^=i<<7&2636928640,i^=i<<15&4022730752,i^=i>>>18,i>>>0},t.prototype.random_int31=function(){return this.random_int()>>>1},t.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},t.prototype.random=function(){return this.random_int()*(1/4294967296)},t.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},t.prototype.random_long=function(){var i=this.random_int()>>>5,e=this.random_int()>>>6;return(i*67108864+e)*(1/9007199254740992)},Dd=t,Dd}var XS=$S();const Cv=mc(XS),O={};O.EPSILON1=.1,O.EPSILON2=.01,O.EPSILON3=.001,O.EPSILON4=1e-4,O.EPSILON5=1e-5,O.EPSILON6=1e-6,O.EPSILON7=1e-7,O.EPSILON8=1e-8,O.EPSILON9=1e-9,O.EPSILON10=1e-10,O.EPSILON11=1e-11,O.EPSILON12=1e-12,O.EPSILON13=1e-13,O.EPSILON14=1e-14,O.EPSILON15=1e-15,O.EPSILON16=1e-16,O.EPSILON17=1e-17,O.EPSILON18=1e-18,O.EPSILON19=1e-19,O.EPSILON20=1e-20,O.EPSILON21=1e-21,O.GRAVITATIONALPARAMETER=3986004418e5,O.SOLAR_RADIUS=6955e5,O.LUNAR_RADIUS=1737400,O.SIXTY_FOUR_KILOBYTES=64*1024,O.FOUR_GIGABYTES=4*1024*1024*1024,O.sign=Math.sign??function(i){return i=+i,i===0||i!==i?i:i>0?1:-1},O.signNotZero=function(t){return t<0?-1:1},O.toSNorm=function(t,i){return i=i??255,Math.round((O.clamp(t,-1,1)*.5+.5)*i)},O.fromSNorm=function(t,i){return i=i??255,O.clamp(t,0,i)/i*2-1},O.normalize=function(t,i,e){return e=Math.max(e-i,0),e===0?0:O.clamp((t-i)/e,0,1)},O.sinh=Math.sinh??function(i){return(Math.exp(i)-Math.exp(-i))/2},O.cosh=Math.cosh??function(i){return(Math.exp(i)+Math.exp(-i))/2},O.lerp=function(t,i,e){return(1-e)*t+e*i},O.PI=Math.PI,O.ONE_OVER_PI=1/Math.PI,O.PI_OVER_TWO=Math.PI/2,O.PI_OVER_THREE=Math.PI/3,O.PI_OVER_FOUR=Math.PI/4,O.PI_OVER_SIX=Math.PI/6,O.THREE_PI_OVER_TWO=3*Math.PI/2,O.TWO_PI=2*Math.PI,O.ONE_OVER_TWO_PI=1/(2*Math.PI),O.RADIANS_PER_DEGREE=Math.PI/180,O.DEGREES_PER_RADIAN=180/Math.PI,O.RADIANS_PER_ARCSECOND=O.RADIANS_PER_DEGREE/3600,O.toRadians=function(t){if(!D(t))throw new H("degrees is required.");return t*O.RADIANS_PER_DEGREE},O.toDegrees=function(t){if(!D(t))throw new H("radians is required.");return t*O.DEGREES_PER_RADIAN},O.convertLongitudeRange=function(t){if(!D(t))throw new H("angle is required.");const i=O.TWO_PI,e=t-Math.floor(t/i)*i;return e<-Math.PI?e+i:e>=Math.PI?e-i:e},O.clampToLatitudeRange=function(t){if(!D(t))throw new H("angle is required.");return O.clamp(t,-1*O.PI_OVER_TWO,O.PI_OVER_TWO)},O.negativePiToPi=function(t){if(!D(t))throw new H("angle is required.");return t>=-O.PI&&t<=O.PI?t:O.zeroToTwoPi(t+O.PI)-O.PI},O.zeroToTwoPi=function(t){if(!D(t))throw new H("angle is required.");if(t>=0&&t<=O.TWO_PI)return t;const i=O.mod(t,O.TWO_PI);return Math.abs(i)<O.EPSILON14&&Math.abs(t)>O.EPSILON14?O.TWO_PI:i},O.mod=function(t,i){if(!D(t))throw new H("m is required.");if(!D(i))throw new H("n is required.");if(i===0)throw new H("divisor cannot be 0.");return O.sign(t)===O.sign(i)&&Math.abs(t)<Math.abs(i)?t:(t%i+i)%i},O.equalsEpsilon=function(t,i,e,n){if(!D(t))throw new H("left is required.");if(!D(i))throw new H("right is required.");e=e??0,n=n??e;const o=Math.abs(t-i);return o<=n||o<=e*Math.max(Math.abs(t),Math.abs(i))},O.lessThan=function(t,i,e){if(!D(t))throw new H("first is required.");if(!D(i))throw new H("second is required.");if(!D(e))throw new H("absoluteEpsilon is required.");return t-i<-e},O.lessThanOrEquals=function(t,i,e){if(!D(t))throw new H("first is required.");if(!D(i))throw new H("second is required.");if(!D(e))throw new H("absoluteEpsilon is required.");return t-i<e},O.greaterThan=function(t,i,e){if(!D(t))throw new H("first is required.");if(!D(i))throw new H("second is required.");if(!D(e))throw new H("absoluteEpsilon is required.");return t-i>e},O.greaterThanOrEquals=function(t,i,e){if(!D(t))throw new H("first is required.");if(!D(i))throw new H("second is required.");if(!D(e))throw new H("absoluteEpsilon is required.");return t-i>-e};const vc=[1];O.factorial=function(t){if(typeof t!="number"||t<0)throw new H("A number greater than or equal to 0 is required.");const i=vc.length;if(t>=i){let e=vc[i-1];for(let n=i;n<=t;n++){const o=e*n;vc.push(o),e=o}}return vc[t]},O.incrementWrap=function(t,i,e){if(e=e??0,!D(t))throw new H("n is required.");if(i<=e)throw new H("maximumValue must be greater than minimumValue.");return++t,t>i&&(t=e),t},O.isPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new H("A number between 0 and (2^32)-1 is required.");return t!==0&&(t&t-1)===0},O.nextPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>2147483648)throw new H("A number between 0 and 2^31 is required.");return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},O.previousPowerOfTwo=function(t){if(typeof t!="number"||t<0||t>4294967295)throw new H("A number between 0 and (2^32)-1 is required.");return t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t|=t>>32,t=(t>>>0)-(t>>>1),t},O.clamp=function(t,i,e){return A.typeOf.number("value",t),A.typeOf.number("min",i),A.typeOf.number("max",e),t<i?i:t>e?e:t};let _v=new Cv;O.setRandomNumberSeed=function(t){if(!D(t))throw new H("seed is required.");_v=new Cv(t)},O.nextRandomNumber=function(){return _v.random()},O.randomBetween=function(t,i){return O.nextRandomNumber()*(i-t)+t},O.acosClamped=function(t){if(!D(t))throw new H("value is required.");return Math.acos(O.clamp(t,-1,1))},O.asinClamped=function(t){if(!D(t))throw new H("value is required.");return Math.asin(O.clamp(t,-1,1))},O.chordLength=function(t,i){if(!D(t))throw new H("angle is required.");if(!D(i))throw new H("radius is required.");return 2*i*Math.sin(t*.5)},O.logBase=function(t,i){if(!D(t))throw new H("number is required.");if(!D(i))throw new H("base is required.");return Math.log(t)/Math.log(i)},O.cbrt=Math.cbrt??function(i){const e=Math.pow(Math.abs(i),.3333333333333333);return i<0?-e:e},O.log2=Math.log2??function(i){return Math.log(i)*Math.LOG2E},O.fog=function(t,i){const e=t*i;return 1-Math.exp(-(e*e))},O.fastApproximateAtan=function(t){return A.typeOf.number("x",t),t*(-.1784*Math.abs(t)-.0663*t*t+1.0301)},O.fastApproximateAtan2=function(t,i){A.typeOf.number("x",t),A.typeOf.number("y",i);let e,n=Math.abs(t);e=Math.abs(i);const o=Math.max(n,e);e=Math.min(n,e);const r=e/o;if(isNaN(r))throw new H("either x or y must be nonzero");return n=O.fastApproximateAtan(r),n=Math.abs(i)>Math.abs(t)?O.PI_OVER_TWO-n:n,n=t<0?O.PI-n:n,n=i<0?-n:n,n};function k(t,i,e){this.x=t??0,this.y=i??0,this.z=e??0}k.fromSpherical=function(t,i){A.typeOf.object("spherical",t),D(i)||(i=new k);const e=t.clock,n=t.cone,o=t.magnitude??1,r=o*Math.sin(n);return i.x=r*Math.cos(e),i.y=r*Math.sin(e),i.z=o*Math.cos(n),i},k.fromElements=function(t,i,e,n){return D(n)?(n.x=t,n.y=i,n.z=e,n):new k(t,i,e)},k.clone=function(t,i){if(D(t))return D(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i):new k(t.x,t.y,t.z)},k.fromCartesian4=k.clone,k.packedLength=3,k.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e]=t.z,i},k.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new k),e.x=t[i++],e.y=t[i++],e.z=t[i],e},k.packArray=function(t,i){A.defined("array",t);const e=t.length,n=e*3;if(!D(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new H("If result is a typed array, it must have exactly array.length * 3 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)k.pack(t[o],i,o*3);return i},k.unpackArray=function(t,i){if(A.defined("array",t),A.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new H("array length must be a multiple of 3.");const e=t.length;D(i)?i.length=e/3:i=new Array(e/3);for(let n=0;n<e;n+=3){const o=n/3;i[o]=k.unpack(t,n,i[o])}return i},k.fromArray=k.unpack,k.maximumComponent=function(t){return A.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)},k.minimumComponent=function(t){return A.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)},k.minimumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e.z=Math.min(t.z,i.z),e},k.maximumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e.z=Math.max(t.z,i.z),e},k.clamp=function(t,i,e,n){A.typeOf.object("value",t),A.typeOf.object("min",i),A.typeOf.object("max",e),A.typeOf.object("result",n);const o=O.clamp(t.x,i.x,e.x),r=O.clamp(t.y,i.y,e.y),s=O.clamp(t.z,i.z,e.z);return n.x=o,n.y=r,n.z=s,n},k.magnitudeSquared=function(t){return A.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z},k.magnitude=function(t){return Math.sqrt(k.magnitudeSquared(t))};const yc=new k;k.distance=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),k.subtract(t,i,yc),k.magnitude(yc)},k.distanceSquared=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),k.subtract(t,i,yc),k.magnitudeSquared(yc)},k.normalize=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=k.magnitude(t);if(i.x=t.x/e,i.y=t.y/e,i.z=t.z/e,isNaN(i.x)||isNaN(i.y)||isNaN(i.z))throw new H("normalized result is not a number");return i},k.dot=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z},k.multiplyComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x*i.x,e.y=t.y*i.y,e.z=t.z*i.z,e},k.divideComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x/i.x,e.y=t.y/i.y,e.z=t.z/i.z,e},k.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e},k.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e},k.multiplyByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e},k.divideByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e},k.negate=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i},k.abs=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=Math.abs(t.x),i.y=Math.abs(t.y),i.z=Math.abs(t.z),i};const Pv=new k;k.lerp=function(t,i,e,n){return A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n),k.multiplyByScalar(i,e,Pv),n=k.multiplyByScalar(t,1-e,n),k.add(Pv,n,n)};const wc=new k,bd=new k;k.angleBetween=function(t,i){A.typeOf.object("left",t),A.typeOf.object("right",i),k.normalize(t,wc),k.normalize(i,bd);const e=k.dot(wc,bd),n=k.magnitude(k.cross(wc,bd,wc));return Math.atan2(n,e)};const YS=new k;k.mostOrthogonalAxis=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=k.normalize(t,YS);return k.abs(e,e),e.x<=e.y?e.x<=e.z?i=k.clone(k.UNIT_X,i):i=k.clone(k.UNIT_Z,i):e.y<=e.z?i=k.clone(k.UNIT_Y,i):i=k.clone(k.UNIT_Z,i),i},k.projectVector=function(t,i,e){A.defined("a",t),A.defined("b",i),A.defined("result",e);const n=k.dot(t,i)/k.dot(i,i);return k.multiplyByScalar(i,n,e)},k.equals=function(t,i){return t===i||D(t)&&D(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z},k.equalsArray=function(t,i,e){return t.x===i[e]&&t.y===i[e+1]&&t.z===i[e+2]},k.equalsEpsilon=function(t,i,e,n){return t===i||D(t)&&D(i)&&O.equalsEpsilon(t.x,i.x,e,n)&&O.equalsEpsilon(t.y,i.y,e,n)&&O.equalsEpsilon(t.z,i.z,e,n)},k.cross=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t.x,o=t.y,r=t.z,s=i.x,a=i.y,c=i.z,d=o*c-r*a,u=r*s-n*c,p=n*a-o*s;return e.x=d,e.y=u,e.z=p,e},k.midpoint=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=(t.x+i.x)*.5,e.y=(t.y+i.y)*.5,e.z=(t.z+i.z)*.5,e},k.fromDegrees=function(t,i,e,n,o){return A.typeOf.number("longitude",t),A.typeOf.number("latitude",i),t=O.toRadians(t),i=O.toRadians(i),k.fromRadians(t,i,e,n,o)};let jt=new k,sr=new k;k._ellipsoidRadiiSquared=new k(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9),k.fromRadians=function(t,i,e,n,o){A.typeOf.number("longitude",t),A.typeOf.number("latitude",i),e=e??0;const r=D(n)?n.radiiSquared:k._ellipsoidRadiiSquared,s=Math.cos(i);jt.x=s*Math.cos(t),jt.y=s*Math.sin(t),jt.z=Math.sin(i),jt=k.normalize(jt,jt),k.multiplyComponents(r,jt,sr);const a=Math.sqrt(k.dot(jt,sr));return sr=k.divideByScalar(sr,a,sr),jt=k.multiplyByScalar(jt,e,jt),D(o)||(o=new k),k.add(sr,jt,o)},k.fromDegreesArray=function(t,i,e){if(A.defined("coordinates",t),t.length<2||t.length%2!==0)throw new H("the number of coordinates must be a multiple of 2 and at least 2");const n=t.length;D(e)?e.length=n/2:e=new Array(n/2);for(let o=0;o<n;o+=2){const r=t[o],s=t[o+1],a=o/2;e[a]=k.fromDegrees(r,s,0,i,e[a])}return e},k.fromRadiansArray=function(t,i,e){if(A.defined("coordinates",t),t.length<2||t.length%2!==0)throw new H("the number of coordinates must be a multiple of 2 and at least 2");const n=t.length;D(e)?e.length=n/2:e=new Array(n/2);for(let o=0;o<n;o+=2){const r=t[o],s=t[o+1],a=o/2;e[a]=k.fromRadians(r,s,0,i,e[a])}return e},k.fromDegreesArrayHeights=function(t,i,e){if(A.defined("coordinates",t),t.length<3||t.length%3!==0)throw new H("the number of coordinates must be a multiple of 3 and at least 3");const n=t.length;D(e)?e.length=n/3:e=new Array(n/3);for(let o=0;o<n;o+=3){const r=t[o],s=t[o+1],a=t[o+2],c=o/3;e[c]=k.fromDegrees(r,s,a,i,e[c])}return e},k.fromRadiansArrayHeights=function(t,i,e){if(A.defined("coordinates",t),t.length<3||t.length%3!==0)throw new H("the number of coordinates must be a multiple of 3 and at least 3");const n=t.length;D(e)?e.length=n/3:e=new Array(n/3);for(let o=0;o<n;o+=3){const r=t[o],s=t[o+1],a=t[o+2],c=o/3;e[c]=k.fromRadians(r,s,a,i,e[c])}return e},k.ZERO=Object.freeze(new k(0,0,0)),k.ONE=Object.freeze(new k(1,1,1)),k.UNIT_X=Object.freeze(new k(1,0,0)),k.UNIT_Y=Object.freeze(new k(0,1,0)),k.UNIT_Z=Object.freeze(new k(0,0,1)),k.prototype.clone=function(t){return k.clone(this,t)},k.prototype.equals=function(t){return k.equals(this,t)},k.prototype.equalsEpsilon=function(t,i,e){return k.equalsEpsilon(this,t,i,e)},k.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};function B(t,i,e,n){this.x=t??0,this.y=i??0,this.z=e??0,this.w=n??0}B.fromElements=function(t,i,e,n,o){return D(o)?(o.x=t,o.y=i,o.z=e,o.w=n,o):new B(t,i,e,n)},B.fromColor=function(t,i){return A.typeOf.object("color",t),D(i)?(i.x=t.red,i.y=t.green,i.z=t.blue,i.w=t.alpha,i):new B(t.red,t.green,t.blue,t.alpha)},B.clone=function(t,i){if(D(t))return D(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i.w=t.w,i):new B(t.x,t.y,t.z,t.w)},B.packedLength=4,B.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e++]=t.z,i[e]=t.w,i},B.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new B),e.x=t[i++],e.y=t[i++],e.z=t[i++],e.w=t[i],e},B.packArray=function(t,i){A.defined("array",t);const e=t.length,n=e*4;if(!D(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new H("If result is a typed array, it must have exactly array.length * 4 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)B.pack(t[o],i,o*4);return i},B.unpackArray=function(t,i){if(A.defined("array",t),A.typeOf.number.greaterThanOrEquals("array.length",t.length,4),t.length%4!==0)throw new H("array length must be a multiple of 4.");const e=t.length;D(i)?i.length=e/4:i=new Array(e/4);for(let n=0;n<e;n+=4){const o=n/4;i[o]=B.unpack(t,n,i[o])}return i},B.fromArray=B.unpack,B.maximumComponent=function(t){return A.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)},B.minimumComponent=function(t){return A.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)},B.minimumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e.z=Math.min(t.z,i.z),e.w=Math.min(t.w,i.w),e},B.maximumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e.z=Math.max(t.z,i.z),e.w=Math.max(t.w,i.w),e},B.clamp=function(t,i,e,n){A.typeOf.object("value",t),A.typeOf.object("min",i),A.typeOf.object("max",e),A.typeOf.object("result",n);const o=O.clamp(t.x,i.x,e.x),r=O.clamp(t.y,i.y,e.y),s=O.clamp(t.z,i.z,e.z),a=O.clamp(t.w,i.w,e.w);return n.x=o,n.y=r,n.z=s,n.w=a,n},B.magnitudeSquared=function(t){return A.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},B.magnitude=function(t){return Math.sqrt(B.magnitudeSquared(t))};const Cc=new B;B.distance=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),B.subtract(t,i,Cc),B.magnitude(Cc)},B.distanceSquared=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),B.subtract(t,i,Cc),B.magnitudeSquared(Cc)},B.normalize=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=B.magnitude(t);if(i.x=t.x/e,i.y=t.y/e,i.z=t.z/e,i.w=t.w/e,isNaN(i.x)||isNaN(i.y)||isNaN(i.z)||isNaN(i.w))throw new H("normalized result is not a number");return i},B.dot=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w},B.multiplyComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x*i.x,e.y=t.y*i.y,e.z=t.z*i.z,e.w=t.w*i.w,e},B.divideComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x/i.x,e.y=t.y/i.y,e.z=t.z/i.z,e.w=t.w/i.w,e},B.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e.w=t.w+i.w,e},B.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e.w=t.w-i.w,e},B.multiplyByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},B.divideByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e.w=t.w/i,e},B.negate=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=-t.w,i},B.abs=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=Math.abs(t.x),i.y=Math.abs(t.y),i.z=Math.abs(t.z),i.w=Math.abs(t.w),i};const Sv=new B;B.lerp=function(t,i,e,n){return A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n),B.multiplyByScalar(i,e,Sv),n=B.multiplyByScalar(t,1-e,n),B.add(Sv,n,n)};const ZS=new B;B.mostOrthogonalAxis=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=B.normalize(t,ZS);return B.abs(e,e),e.x<=e.y?e.x<=e.z?e.x<=e.w?i=B.clone(B.UNIT_X,i):i=B.clone(B.UNIT_W,i):e.z<=e.w?i=B.clone(B.UNIT_Z,i):i=B.clone(B.UNIT_W,i):e.y<=e.z?e.y<=e.w?i=B.clone(B.UNIT_Y,i):i=B.clone(B.UNIT_W,i):e.z<=e.w?i=B.clone(B.UNIT_Z,i):i=B.clone(B.UNIT_W,i),i},B.equals=function(t,i){return t===i||D(t)&&D(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z&&t.w===i.w},B.equalsArray=function(t,i,e){return t.x===i[e]&&t.y===i[e+1]&&t.z===i[e+2]&&t.w===i[e+3]},B.equalsEpsilon=function(t,i,e,n){return t===i||D(t)&&D(i)&&O.equalsEpsilon(t.x,i.x,e,n)&&O.equalsEpsilon(t.y,i.y,e,n)&&O.equalsEpsilon(t.z,i.z,e,n)&&O.equalsEpsilon(t.w,i.w,e,n)},B.ZERO=Object.freeze(new B(0,0,0,0)),B.ONE=Object.freeze(new B(1,1,1,1)),B.UNIT_X=Object.freeze(new B(1,0,0,0)),B.UNIT_Y=Object.freeze(new B(0,1,0,0)),B.UNIT_Z=Object.freeze(new B(0,0,1,0)),B.UNIT_W=Object.freeze(new B(0,0,0,1)),B.prototype.clone=function(t){return B.clone(this,t)},B.prototype.equals=function(t){return B.equals(this,t)},B.prototype.equalsEpsilon=function(t,i,e){return B.equalsEpsilon(this,t,i,e)},B.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const Rd=new Float32Array(1),pt=new Uint8Array(Rd.buffer),QS=new Uint32Array([287454020]),Ev=new Uint8Array(QS.buffer)[0]===68;B.packFloat=function(t,i){return A.typeOf.number("value",t),D(i)||(i=new B),Rd[0]=t,Ev?(i.x=pt[0],i.y=pt[1],i.z=pt[2],i.w=pt[3]):(i.x=pt[3],i.y=pt[2],i.z=pt[1],i.w=pt[0]),i},B.unpackFloat=function(t){return A.typeOf.object("packedFloat",t),Ev?(pt[0]=t.x,pt[1]=t.y,pt[2]=t.z,pt[3]=t.w):(pt[0]=t.w,pt[1]=t.z,pt[2]=t.y,pt[3]=t.x),Rd[0]};const _i={};_i.EMPTY_OBJECT=Object.freeze({}),_i.EMPTY_ARRAY=Object.freeze([]);function q(t,i,e,n,o,r,s,a,c){this[0]=t??0,this[1]=n??0,this[2]=s??0,this[3]=i??0,this[4]=o??0,this[5]=a??0,this[6]=e??0,this[7]=r??0,this[8]=c??0}q.packedLength=9,q.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t[0],i[e++]=t[1],i[e++]=t[2],i[e++]=t[3],i[e++]=t[4],i[e++]=t[5],i[e++]=t[6],i[e++]=t[7],i[e++]=t[8],i},q.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new q),e[0]=t[i++],e[1]=t[i++],e[2]=t[i++],e[3]=t[i++],e[4]=t[i++],e[5]=t[i++],e[6]=t[i++],e[7]=t[i++],e[8]=t[i++],e},q.packArray=function(t,i){A.defined("array",t);const e=t.length,n=e*9;if(!D(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new H("If result is a typed array, it must have exactly array.length * 9 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)q.pack(t[o],i,o*9);return i},q.unpackArray=function(t,i){if(A.defined("array",t),A.typeOf.number.greaterThanOrEquals("array.length",t.length,9),t.length%9!==0)throw new H("array length must be a multiple of 9.");const e=t.length;D(i)?i.length=e/9:i=new Array(e/9);for(let n=0;n<e;n+=9){const o=n/9;i[o]=q.unpack(t,n,i[o])}return i},q.clone=function(t,i){if(D(t))return D(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i):new q(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},q.fromArray=q.unpack,q.fromColumnMajorArray=function(t,i){return A.defined("values",t),q.clone(t,i)},q.fromRowMajorArray=function(t,i){return A.defined("values",t),D(i)?(i[0]=t[0],i[1]=t[3],i[2]=t[6],i[3]=t[1],i[4]=t[4],i[5]=t[7],i[6]=t[2],i[7]=t[5],i[8]=t[8],i):new q(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},q.fromQuaternion=function(t,i){A.typeOf.object("quaternion",t);const e=t.x*t.x,n=t.x*t.y,o=t.x*t.z,r=t.x*t.w,s=t.y*t.y,a=t.y*t.z,c=t.y*t.w,d=t.z*t.z,u=t.z*t.w,p=t.w*t.w,f=e-s-d+p,g=2*(n-u),m=2*(o+c),y=2*(n+u),P=-e+s-d+p,S=2*(a-r),C=2*(o-c),E=2*(a+r),T=-e-s+d+p;return D(i)?(i[0]=f,i[1]=y,i[2]=C,i[3]=g,i[4]=P,i[5]=E,i[6]=m,i[7]=S,i[8]=T,i):new q(f,g,m,y,P,S,C,E,T)},q.fromHeadingPitchRoll=function(t,i){A.typeOf.object("headingPitchRoll",t);const e=Math.cos(-t.pitch),n=Math.cos(-t.heading),o=Math.cos(t.roll),r=Math.sin(-t.pitch),s=Math.sin(-t.heading),a=Math.sin(t.roll),c=e*n,d=-o*s+a*r*n,u=a*s+o*r*n,p=e*s,f=o*n+a*r*s,g=-a*n+o*r*s,m=-r,y=a*e,P=o*e;return D(i)?(i[0]=c,i[1]=p,i[2]=m,i[3]=d,i[4]=f,i[5]=y,i[6]=u,i[7]=g,i[8]=P,i):new q(c,d,u,p,f,g,m,y,P)},q.fromScale=function(t,i){return A.typeOf.object("scale",t),D(i)?(i[0]=t.x,i[1]=0,i[2]=0,i[3]=0,i[4]=t.y,i[5]=0,i[6]=0,i[7]=0,i[8]=t.z,i):new q(t.x,0,0,0,t.y,0,0,0,t.z)},q.fromUniformScale=function(t,i){return A.typeOf.number("scale",t),D(i)?(i[0]=t,i[1]=0,i[2]=0,i[3]=0,i[4]=t,i[5]=0,i[6]=0,i[7]=0,i[8]=t,i):new q(t,0,0,0,t,0,0,0,t)},q.fromCrossProduct=function(t,i){return A.typeOf.object("vector",t),D(i)?(i[0]=0,i[1]=t.z,i[2]=-t.y,i[3]=-t.z,i[4]=0,i[5]=t.x,i[6]=t.y,i[7]=-t.x,i[8]=0,i):new q(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},q.fromRotationX=function(t,i){A.typeOf.number("angle",t);const e=Math.cos(t),n=Math.sin(t);return D(i)?(i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=e,i[5]=n,i[6]=0,i[7]=-n,i[8]=e,i):new q(1,0,0,0,e,-n,0,n,e)},q.fromRotationY=function(t,i){A.typeOf.number("angle",t);const e=Math.cos(t),n=Math.sin(t);return D(i)?(i[0]=e,i[1]=0,i[2]=-n,i[3]=0,i[4]=1,i[5]=0,i[6]=n,i[7]=0,i[8]=e,i):new q(e,0,n,0,1,0,-n,0,e)},q.fromRotationZ=function(t,i){A.typeOf.number("angle",t);const e=Math.cos(t),n=Math.sin(t);return D(i)?(i[0]=e,i[1]=n,i[2]=0,i[3]=-n,i[4]=e,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new q(e,-n,0,n,e,0,0,0,1)},q.toArray=function(t,i){return A.typeOf.object("matrix",t),D(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},q.getElementIndex=function(t,i){return A.typeOf.number.greaterThanOrEquals("row",i,0),A.typeOf.number.lessThanOrEquals("row",i,2),A.typeOf.number.greaterThanOrEquals("column",t,0),A.typeOf.number.lessThanOrEquals("column",t,2),t*3+i},q.getColumn=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,2),A.typeOf.object("result",e);const n=i*3,o=t[n],r=t[n+1],s=t[n+2];return e.x=o,e.y=r,e.z=s,e},q.setColumn=function(t,i,e,n){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,2),A.typeOf.object("cartesian",e),A.typeOf.object("result",n),n=q.clone(t,n);const o=i*3;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n},q.getRow=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,2),A.typeOf.object("result",e);const n=t[i],o=t[i+3],r=t[i+6];return e.x=n,e.y=o,e.z=r,e},q.setRow=function(t,i,e,n){return A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,2),A.typeOf.object("cartesian",e),A.typeOf.object("result",n),n=q.clone(t,n),n[i]=e.x,n[i+3]=e.y,n[i+6]=e.z,n};const KS=new k;q.setScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("scale",i),A.typeOf.object("result",e);const n=q.getScale(t,KS),o=i.x/n.x,r=i.y/n.y,s=i.z/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*s,e};const JS=new k;q.setUniformScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number("scale",i),A.typeOf.object("result",e);const n=q.getScale(t,JS),o=i/n.x,r=i/n.y,s=i/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*s,e};const xd=new k;q.getScale=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i.x=k.magnitude(k.fromElements(t[0],t[1],t[2],xd)),i.y=k.magnitude(k.fromElements(t[3],t[4],t[5],xd)),i.z=k.magnitude(k.fromElements(t[6],t[7],t[8],xd)),i};const Av=new k;q.getMaximumScale=function(t){return q.getScale(t,Av),k.maximumComponent(Av)};const BS=new k;q.setRotation=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("result",e);const n=q.getScale(t,BS);return e[0]=i[0]*n.x,e[1]=i[1]*n.x,e[2]=i[2]*n.x,e[3]=i[3]*n.y,e[4]=i[4]*n.y,e[5]=i[5]*n.y,e[6]=i[6]*n.z,e[7]=i[7]*n.z,e[8]=i[8]*n.z,e};const jS=new k;q.getRotation=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=q.getScale(t,jS);return i[0]=t[0]/e.x,i[1]=t[1]/e.x,i[2]=t[2]/e.x,i[3]=t[3]/e.y,i[4]=t[4]/e.y,i[5]=t[5]/e.y,i[6]=t[6]/e.z,i[7]=t[7]/e.z,i[8]=t[8]/e.z,i},q.multiply=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t[0]*i[0]+t[3]*i[1]+t[6]*i[2],o=t[1]*i[0]+t[4]*i[1]+t[7]*i[2],r=t[2]*i[0]+t[5]*i[1]+t[8]*i[2],s=t[0]*i[3]+t[3]*i[4]+t[6]*i[5],a=t[1]*i[3]+t[4]*i[4]+t[7]*i[5],c=t[2]*i[3]+t[5]*i[4]+t[8]*i[5],d=t[0]*i[6]+t[3]*i[7]+t[6]*i[8],u=t[1]*i[6]+t[4]*i[7]+t[7]*i[8],p=t[2]*i[6]+t[5]*i[7]+t[8]*i[8];return e[0]=n,e[1]=o,e[2]=r,e[3]=s,e[4]=a,e[5]=c,e[6]=d,e[7]=u,e[8]=p,e},q.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e},q.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e},q.multiplyByVector=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("cartesian",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=t[0]*n+t[3]*o+t[6]*r,a=t[1]*n+t[4]*o+t[7]*r,c=t[2]*n+t[5]*o+t[8]*r;return e.x=s,e.y=a,e.z=c,e},q.multiplyByScalar=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e},q.multiplyByScale=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.object("scale",i),A.typeOf.object("result",e),e[0]=t[0]*i.x,e[1]=t[1]*i.x,e[2]=t[2]*i.x,e[3]=t[3]*i.y,e[4]=t[4]*i.y,e[5]=t[5]*i.y,e[6]=t[6]*i.z,e[7]=t[7]*i.z,e[8]=t[8]*i.z,e},q.multiplyByUniformScale=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.number("scale",i),A.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e},q.negate=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=-t[0],i[1]=-t[1],i[2]=-t[2],i[3]=-t[3],i[4]=-t[4],i[5]=-t[5],i[6]=-t[6],i[7]=-t[7],i[8]=-t[8],i},q.transpose=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[0],n=t[3],o=t[6],r=t[1],s=t[4],a=t[7],c=t[2],d=t[5],u=t[8];return i[0]=e,i[1]=n,i[2]=o,i[3]=r,i[4]=s,i[5]=a,i[6]=c,i[7]=d,i[8]=u,i};function eE(t){let i=0;for(let e=0;e<9;++e){const n=t[e];i+=n*n}return Math.sqrt(i)}const Fd=[1,0,0],kd=[2,2,1];function tE(t){let i=0;for(let e=0;e<3;++e){const n=t[q.getElementIndex(kd[e],Fd[e])];i+=2*n*n}return Math.sqrt(i)}function iE(t,i){const e=O.EPSILON15;let n=0,o=1;for(let d=0;d<3;++d){const u=Math.abs(t[q.getElementIndex(kd[d],Fd[d])]);u>n&&(o=d,n=u)}let r=1,s=0;const a=Fd[o],c=kd[o];if(Math.abs(t[q.getElementIndex(c,a)])>e){const d=t[q.getElementIndex(c,c)],u=t[q.getElementIndex(a,a)],p=t[q.getElementIndex(c,a)],f=(d-u)/2/p;let g;f<0?g=-1/(-f+Math.sqrt(1+f*f)):g=1/(f+Math.sqrt(1+f*f)),r=1/Math.sqrt(1+g*g),s=g*r}return i=q.clone(q.IDENTITY,i),i[q.getElementIndex(a,a)]=i[q.getElementIndex(c,c)]=r,i[q.getElementIndex(c,a)]=s,i[q.getElementIndex(a,c)]=-s,i}const _c=new q,Tv=new q;q.computeEigenDecomposition=function(t,i){A.typeOf.object("matrix",t);const e=O.EPSILON20,n=10;let o=0,r=0;D(i)||(i={});const s=i.unitary=q.clone(q.IDENTITY,i.unitary),a=i.diagonal=q.clone(t,i.diagonal),c=e*eE(a);for(;r<n&&tE(a)>c;)iE(a,_c),q.transpose(_c,Tv),q.multiply(a,_c,a),q.multiply(Tv,a,a),q.multiply(s,_c,s),++o>2&&(++r,o=0);return i},q.abs=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=Math.abs(t[0]),i[1]=Math.abs(t[1]),i[2]=Math.abs(t[2]),i[3]=Math.abs(t[3]),i[4]=Math.abs(t[4]),i[5]=Math.abs(t[5]),i[6]=Math.abs(t[6]),i[7]=Math.abs(t[7]),i[8]=Math.abs(t[8]),i},q.determinant=function(t){A.typeOf.object("matrix",t);const i=t[0],e=t[3],n=t[6],o=t[1],r=t[4],s=t[7],a=t[2],c=t[5],d=t[8];return i*(r*d-c*s)+o*(c*n-e*d)+a*(e*s-r*n)},q.inverse=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[0],n=t[1],o=t[2],r=t[3],s=t[4],a=t[5],c=t[6],d=t[7],u=t[8],p=q.determinant(t);if(Math.abs(p)<=O.EPSILON15)throw new H("matrix is not invertible");i[0]=s*u-d*a,i[1]=d*o-n*u,i[2]=n*a-s*o,i[3]=c*a-r*u,i[4]=e*u-c*o,i[5]=r*o-e*a,i[6]=r*d-c*s,i[7]=c*n-e*d,i[8]=e*s-r*n;const f=1/p;return q.multiplyByScalar(i,f,i)};const nE=new q;q.inverseTranspose=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),q.inverse(q.transpose(t,nE),i)},q.equals=function(t,i){return t===i||D(t)&&D(i)&&t[0]===i[0]&&t[1]===i[1]&&t[2]===i[2]&&t[3]===i[3]&&t[4]===i[4]&&t[5]===i[5]&&t[6]===i[6]&&t[7]===i[7]&&t[8]===i[8]},q.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t[0]-i[0])<=e&&Math.abs(t[1]-i[1])<=e&&Math.abs(t[2]-i[2])<=e&&Math.abs(t[3]-i[3])<=e&&Math.abs(t[4]-i[4])<=e&&Math.abs(t[5]-i[5])<=e&&Math.abs(t[6]-i[6])<=e&&Math.abs(t[7]-i[7])<=e&&Math.abs(t[8]-i[8])<=e},q.IDENTITY=Object.freeze(new q(1,0,0,0,1,0,0,0,1)),q.ZERO=Object.freeze(new q(0,0,0,0,0,0,0,0,0)),q.COLUMN0ROW0=0,q.COLUMN0ROW1=1,q.COLUMN0ROW2=2,q.COLUMN1ROW0=3,q.COLUMN1ROW1=4,q.COLUMN1ROW2=5,q.COLUMN2ROW0=6,q.COLUMN2ROW1=7,q.COLUMN2ROW2=8,Object.defineProperties(q.prototype,{length:{get:function(){return q.packedLength}}}),q.prototype.clone=function(t){return q.clone(this,t)},q.prototype.equals=function(t){return q.equals(this,t)},q.equalsArray=function(t,i,e){return t[0]===i[e]&&t[1]===i[e+1]&&t[2]===i[e+2]&&t[3]===i[e+3]&&t[4]===i[e+4]&&t[5]===i[e+5]&&t[6]===i[e+6]&&t[7]===i[e+7]&&t[8]===i[e+8]},q.prototype.equalsEpsilon=function(t,i){return q.equalsEpsilon(this,t,i)},q.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
321
321
|
(${this[1]}, ${this[4]}, ${this[7]})
|
|
322
|
-
(${this[2]}, ${this[5]}, ${this[8]})`};function
|
|
323
|
-
${this.stack.toString()}`),t};function X(t,i,e,n,o,r,s,a,c,d,u,p,f,g,m,y){this[0]=t??0,this[1]=o??0,this[2]=c??0,this[3]=f??0,this[4]=i??0,this[5]=r??0,this[6]=d??0,this[7]=g??0,this[8]=e??0,this[9]=s??0,this[10]=u??0,this[11]=m??0,this[12]=n??0,this[13]=a??0,this[14]=p??0,this[15]=y??0}X.packedLength=16,X.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t[0],i[e++]=t[1],i[e++]=t[2],i[e++]=t[3],i[e++]=t[4],i[e++]=t[5],i[e++]=t[6],i[e++]=t[7],i[e++]=t[8],i[e++]=t[9],i[e++]=t[10],i[e++]=t[11],i[e++]=t[12],i[e++]=t[13],i[e++]=t[14],i[e]=t[15],i},X.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new X),e[0]=t[i++],e[1]=t[i++],e[2]=t[i++],e[3]=t[i++],e[4]=t[i++],e[5]=t[i++],e[6]=t[i++],e[7]=t[i++],e[8]=t[i++],e[9]=t[i++],e[10]=t[i++],e[11]=t[i++],e[12]=t[i++],e[13]=t[i++],e[14]=t[i++],e[15]=t[i],e},X.packArray=function(t,i){A.defined("array",t);const e=t.length,n=e*16;if(!D(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new H("If result is a typed array, it must have exactly array.length * 16 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)X.pack(t[o],i,o*16);return i},X.unpackArray=function(t,i){if(A.defined("array",t),A.typeOf.number.greaterThanOrEquals("array.length",t.length,16),t.length%16!==0)throw new H("array length must be a multiple of 16.");const e=t.length;D(i)?i.length=e/16:i=new Array(e/16);for(let n=0;n<e;n+=16){const o=n/16;i[o]=X.unpack(t,n,i[o])}return i},X.clone=function(t,i){if(D(t))return D(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i):new X(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},X.fromArray=X.unpack,X.fromColumnMajorArray=function(t,i){return A.defined("values",t),X.clone(t,i)},X.fromRowMajorArray=function(t,i){return A.defined("values",t),D(i)?(i[0]=t[0],i[1]=t[4],i[2]=t[8],i[3]=t[12],i[4]=t[1],i[5]=t[5],i[6]=t[9],i[7]=t[13],i[8]=t[2],i[9]=t[6],i[10]=t[10],i[11]=t[14],i[12]=t[3],i[13]=t[7],i[14]=t[11],i[15]=t[15],i):new X(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},X.fromRotationTranslation=function(t,i,e){return A.typeOf.object("rotation",t),i=i??k.ZERO,D(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[3],e[5]=t[4],e[6]=t[5],e[7]=0,e[8]=t[6],e[9]=t[7],e[10]=t[8],e[11]=0,e[12]=i.x,e[13]=i.y,e[14]=i.z,e[15]=1,e):new X(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},X.fromTranslationQuaternionRotationScale=function(t,i,e,n){A.typeOf.object("translation",t),A.typeOf.object("rotation",i),A.typeOf.object("scale",e),D(n)||(n=new X);const o=e.x,r=e.y,s=e.z,a=i.x*i.x,c=i.x*i.y,d=i.x*i.z,u=i.x*i.w,p=i.y*i.y,f=i.y*i.z,g=i.y*i.w,m=i.z*i.z,y=i.z*i.w,P=i.w*i.w,S=a-p-m+P,C=2*(c-y),E=2*(d+g),T=2*(c+y),I=-a+p-m+P,b=2*(f-u),x=2*(d-g),z=2*(f+u),W=-a-p+m+P;return n[0]=S*o,n[1]=T*o,n[2]=x*o,n[3]=0,n[4]=C*r,n[5]=I*r,n[6]=z*r,n[7]=0,n[8]=E*s,n[9]=b*s,n[10]=W*s,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n},X.fromTranslationRotationScale=function(t,i){return A.typeOf.object("translationRotationScale",t),X.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,i)},X.fromTranslation=function(t,i){return A.typeOf.object("translation",t),X.fromRotationTranslation(q.IDENTITY,t,i)},X.fromScale=function(t,i){return A.typeOf.object("scale",t),D(i)?(i[0]=t.x,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t.y,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t.z,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i):new X(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},X.fromUniformScale=function(t,i){return A.typeOf.number("scale",t),D(i)?(i[0]=t,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i):new X(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)},X.fromRotation=function(t,i){return A.typeOf.object("rotation",t),D(i)||(i=new X),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};const ar=new k,lr=new k,ys=new k;X.fromCamera=function(t,i){A.typeOf.object("camera",t);const e=t.position,n=t.direction,o=t.up;A.typeOf.object("camera.position",e),A.typeOf.object("camera.direction",n),A.typeOf.object("camera.up",o),k.normalize(n,ar),k.normalize(k.cross(ar,o,lr),lr),k.normalize(k.cross(lr,ar,ys),ys);const r=lr.x,s=lr.y,a=lr.z,c=ar.x,d=ar.y,u=ar.z,p=ys.x,f=ys.y,g=ys.z,m=e.x,y=e.y,P=e.z,S=r*-m+s*-y+a*-P,C=p*-m+f*-y+g*-P,E=c*m+d*y+u*P;return D(i)?(i[0]=r,i[1]=p,i[2]=-c,i[3]=0,i[4]=s,i[5]=f,i[6]=-d,i[7]=0,i[8]=a,i[9]=g,i[10]=-u,i[11]=0,i[12]=S,i[13]=C,i[14]=E,i[15]=1,i):new X(r,s,a,S,p,f,g,C,-c,-d,-u,E,0,0,0,1)},X.computePerspectiveFieldOfView=function(t,i,e,n,o){A.typeOf.number.greaterThan("fovY",t,0),A.typeOf.number.lessThan("fovY",t,Math.PI),A.typeOf.number.greaterThan("near",e,0),A.typeOf.number.greaterThan("far",n,0),A.typeOf.object("result",o);const s=1/Math.tan(t*.5),a=s/i,c=(n+e)/(e-n),d=2*n*e/(e-n);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,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]=d,o[15]=0,o},X.computeOrthographicOffCenter=function(t,i,e,n,o,r,s){A.typeOf.number("left",t),A.typeOf.number("right",i),A.typeOf.number("bottom",e),A.typeOf.number("top",n),A.typeOf.number("near",o),A.typeOf.number("far",r),A.typeOf.object("result",s);let a=1/(i-t),c=1/(n-e),d=1/(r-o);const u=-(i+t)*a,p=-(n+e)*c,f=-(r+o)*d;return a*=2,c*=2,d*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=d,s[11]=0,s[12]=u,s[13]=p,s[14]=f,s[15]=1,s},X.computePerspectiveOffCenter=function(t,i,e,n,o,r,s){A.typeOf.number("left",t),A.typeOf.number("right",i),A.typeOf.number("bottom",e),A.typeOf.number("top",n),A.typeOf.number("near",o),A.typeOf.number("far",r),A.typeOf.object("result",s);const a=2*o/(i-t),c=2*o/(n-e),d=(i+t)/(i-t),u=(n+e)/(n-e),p=-(r+o)/(r-o),f=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=d,s[9]=u,s[10]=p,s[11]=f,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s},X.computeInfinitePerspectiveOffCenter=function(t,i,e,n,o,r){A.typeOf.number("left",t),A.typeOf.number("right",i),A.typeOf.number("bottom",e),A.typeOf.number("top",n),A.typeOf.number("near",o),A.typeOf.object("result",r);const s=2*o/(i-t),a=2*o/(n-e),c=(i+t)/(i-t),d=(n+e)/(n-e),u=-1,p=-1,f=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=d,r[10]=u,r[11]=p,r[12]=0,r[13]=0,r[14]=f,r[15]=0,r},X.computeViewportTransformation=function(t,i,e,n){D(n)||(n=new X),t=t??_i.EMPTY_OBJECT;const o=t.x??0,r=t.y??0,s=t.width??0,a=t.height??0;i=i??0,e=e??1;const c=s*.5,d=a*.5,u=(e-i)*.5,p=c,f=d,g=u,m=o+c,y=r+d,P=i+u,S=1;return n[0]=p,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=f,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=g,n[11]=0,n[12]=m,n[13]=y,n[14]=P,n[15]=S,n},X.computeView=function(t,i,e,n,o){return A.typeOf.object("position",t),A.typeOf.object("direction",i),A.typeOf.object("up",e),A.typeOf.object("right",n),A.typeOf.object("result",o),o[0]=n.x,o[1]=e.x,o[2]=-i.x,o[3]=0,o[4]=n.y,o[5]=e.y,o[6]=-i.y,o[7]=0,o[8]=n.z,o[9]=e.z,o[10]=-i.z,o[11]=0,o[12]=-k.dot(n,t),o[13]=-k.dot(e,t),o[14]=k.dot(i,t),o[15]=1,o},X.toArray=function(t,i){return A.typeOf.object("matrix",t),D(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},X.getElementIndex=function(t,i){return A.typeOf.number.greaterThanOrEquals("row",i,0),A.typeOf.number.lessThanOrEquals("row",i,3),A.typeOf.number.greaterThanOrEquals("column",t,0),A.typeOf.number.lessThanOrEquals("column",t,3),t*4+i},X.getColumn=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,3),A.typeOf.object("result",e);const n=i*4,o=t[n],r=t[n+1],s=t[n+2],a=t[n+3];return e.x=o,e.y=r,e.z=s,e.w=a,e},X.setColumn=function(t,i,e,n){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,3),A.typeOf.object("cartesian",e),A.typeOf.object("result",n),n=X.clone(t,n);const o=i*4;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n[o+3]=e.w,n},X.getRow=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,3),A.typeOf.object("result",e);const n=t[i],o=t[i+4],r=t[i+8],s=t[i+12];return e.x=n,e.y=o,e.z=r,e.w=s,e},X.setRow=function(t,i,e,n){return A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,3),A.typeOf.object("cartesian",e),A.typeOf.object("result",n),n=X.clone(t,n),n[i]=e.x,n[i+4]=e.y,n[i+8]=e.z,n[i+12]=e.w,n},X.setTranslation=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.object("translation",i),A.typeOf.object("result",e),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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=i.x,e[13]=i.y,e[14]=i.z,e[15]=t[15],e};const yE=new k;X.setScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("scale",i),A.typeOf.object("result",e);const n=X.getScale(t,yE),o=i.x/n.x,r=i.y/n.y,s=i.z/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3],e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7],e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const wE=new k;X.setUniformScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number("scale",i),A.typeOf.object("result",e);const n=X.getScale(t,wE),o=i/n.x,r=i/n.y,s=i/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3],e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7],e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const zd=new k;X.getScale=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i.x=k.magnitude(k.fromElements(t[0],t[1],t[2],zd)),i.y=k.magnitude(k.fromElements(t[4],t[5],t[6],zd)),i.z=k.magnitude(k.fromElements(t[8],t[9],t[10],zd)),i};const Fv=new k;X.getMaximumScale=function(t){return X.getScale(t,Fv),k.maximumComponent(Fv)};const CE=new k;X.setRotation=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("result",e);const n=X.getScale(t,CE);return e[0]=i[0]*n.x,e[1]=i[1]*n.x,e[2]=i[2]*n.x,e[3]=t[3],e[4]=i[3]*n.y,e[5]=i[4]*n.y,e[6]=i[5]*n.y,e[7]=t[7],e[8]=i[6]*n.z,e[9]=i[7]*n.z,e[10]=i[8]*n.z,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const _E=new k;X.getRotation=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=X.getScale(t,_E);return i[0]=t[0]/e.x,i[1]=t[1]/e.x,i[2]=t[2]/e.x,i[3]=t[4]/e.y,i[4]=t[5]/e.y,i[5]=t[6]/e.y,i[6]=t[8]/e.z,i[7]=t[9]/e.z,i[8]=t[10]/e.z,i},X.multiply=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t[0],o=t[1],r=t[2],s=t[3],a=t[4],c=t[5],d=t[6],u=t[7],p=t[8],f=t[9],g=t[10],m=t[11],y=t[12],P=t[13],S=t[14],C=t[15],E=i[0],T=i[1],I=i[2],b=i[3],x=i[4],z=i[5],W=i[6],N=i[7],L=i[8],U=i[9],_=i[10],M=i[11],F=i[12],V=i[13],G=i[14],Z=i[15],$=n*E+a*T+p*I+y*b,Y=o*E+c*T+f*I+P*b,K=r*E+d*T+g*I+S*b,te=s*E+u*T+m*I+C*b,re=n*x+a*z+p*W+y*N,ge=o*x+c*z+f*W+P*N,ye=r*x+d*z+g*W+S*N,Te=s*x+u*z+m*W+C*N,Oe=n*L+a*U+p*_+y*M,We=o*L+c*U+f*_+P*M,me=r*L+d*U+g*_+S*M,ne=s*L+u*U+m*_+C*M,he=n*F+a*V+p*G+y*Z,de=o*F+c*V+f*G+P*Z,Me=r*F+d*V+g*G+S*Z,Ne=s*F+u*V+m*G+C*Z;return e[0]=$,e[1]=Y,e[2]=K,e[3]=te,e[4]=re,e[5]=ge,e[6]=ye,e[7]=Te,e[8]=Oe,e[9]=We,e[10]=me,e[11]=ne,e[12]=he,e[13]=de,e[14]=Me,e[15]=Ne,e},X.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e[9]=t[9]+i[9],e[10]=t[10]+i[10],e[11]=t[11]+i[11],e[12]=t[12]+i[12],e[13]=t[13]+i[13],e[14]=t[14]+i[14],e[15]=t[15]+i[15],e},X.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e[9]=t[9]-i[9],e[10]=t[10]-i[10],e[11]=t[11]-i[11],e[12]=t[12]-i[12],e[13]=t[13]-i[13],e[14]=t[14]-i[14],e[15]=t[15]-i[15],e},X.multiplyTransformation=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t[0],o=t[1],r=t[2],s=t[4],a=t[5],c=t[6],d=t[8],u=t[9],p=t[10],f=t[12],g=t[13],m=t[14],y=i[0],P=i[1],S=i[2],C=i[4],E=i[5],T=i[6],I=i[8],b=i[9],x=i[10],z=i[12],W=i[13],N=i[14],L=n*y+s*P+d*S,U=o*y+a*P+u*S,_=r*y+c*P+p*S,M=n*C+s*E+d*T,F=o*C+a*E+u*T,V=r*C+c*E+p*T,G=n*I+s*b+d*x,Z=o*I+a*b+u*x,$=r*I+c*b+p*x,Y=n*z+s*W+d*N+f,K=o*z+a*W+u*N+g,te=r*z+c*W+p*N+m;return e[0]=L,e[1]=U,e[2]=_,e[3]=0,e[4]=M,e[5]=F,e[6]=V,e[7]=0,e[8]=G,e[9]=Z,e[10]=$,e[11]=0,e[12]=Y,e[13]=K,e[14]=te,e[15]=1,e},X.multiplyByMatrix3=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("rotation",i),A.typeOf.object("result",e);const n=t[0],o=t[1],r=t[2],s=t[4],a=t[5],c=t[6],d=t[8],u=t[9],p=t[10],f=i[0],g=i[1],m=i[2],y=i[3],P=i[4],S=i[5],C=i[6],E=i[7],T=i[8],I=n*f+s*g+d*m,b=o*f+a*g+u*m,x=r*f+c*g+p*m,z=n*y+s*P+d*S,W=o*y+a*P+u*S,N=r*y+c*P+p*S,L=n*C+s*E+d*T,U=o*C+a*E+u*T,_=r*C+c*E+p*T;return e[0]=I,e[1]=b,e[2]=x,e[3]=0,e[4]=z,e[5]=W,e[6]=N,e[7]=0,e[8]=L,e[9]=U,e[10]=_,e[11]=0,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},X.multiplyByTranslation=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("translation",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=n*t[0]+o*t[4]+r*t[8]+t[12],a=n*t[1]+o*t[5]+r*t[9]+t[13],c=n*t[2]+o*t[6]+r*t[10]+t[14];return 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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=s,e[13]=a,e[14]=c,e[15]=t[15],e},X.multiplyByScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("scale",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z;return n===1&&o===1&&r===1?X.clone(t,e):(e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=o*t[6],e[7]=t[7],e[8]=r*t[8],e[9]=r*t[9],e[10]=r*t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e)},X.multiplyByUniformScale=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.number("scale",i),A.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3],e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7],e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},X.multiplyByVector=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("cartesian",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=i.w,a=t[0]*n+t[4]*o+t[8]*r+t[12]*s,c=t[1]*n+t[5]*o+t[9]*r+t[13]*s,d=t[2]*n+t[6]*o+t[10]*r+t[14]*s,u=t[3]*n+t[7]*o+t[11]*r+t[15]*s;return e.x=a,e.y=c,e.z=d,e.w=u,e},X.multiplyByPointAsVector=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("cartesian",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=t[0]*n+t[4]*o+t[8]*r,a=t[1]*n+t[5]*o+t[9]*r,c=t[2]*n+t[6]*o+t[10]*r;return e.x=s,e.y=a,e.z=c,e},X.multiplyByPoint=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("cartesian",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=t[0]*n+t[4]*o+t[8]*r+t[12],a=t[1]*n+t[5]*o+t[9]*r+t[13],c=t[2]*n+t[6]*o+t[10]*r+t[14];return e.x=s,e.y=a,e.z=c,e},X.multiplyByScalar=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12]*i,e[13]=t[13]*i,e[14]=t[14]*i,e[15]=t[15]*i,e},X.negate=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=-t[0],i[1]=-t[1],i[2]=-t[2],i[3]=-t[3],i[4]=-t[4],i[5]=-t[5],i[6]=-t[6],i[7]=-t[7],i[8]=-t[8],i[9]=-t[9],i[10]=-t[10],i[11]=-t[11],i[12]=-t[12],i[13]=-t[13],i[14]=-t[14],i[15]=-t[15],i},X.transpose=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[1],n=t[2],o=t[3],r=t[6],s=t[7],a=t[11];return i[0]=t[0],i[1]=t[4],i[2]=t[8],i[3]=t[12],i[4]=e,i[5]=t[5],i[6]=t[9],i[7]=t[13],i[8]=n,i[9]=r,i[10]=t[10],i[11]=t[14],i[12]=o,i[13]=s,i[14]=a,i[15]=t[15],i},X.abs=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=Math.abs(t[0]),i[1]=Math.abs(t[1]),i[2]=Math.abs(t[2]),i[3]=Math.abs(t[3]),i[4]=Math.abs(t[4]),i[5]=Math.abs(t[5]),i[6]=Math.abs(t[6]),i[7]=Math.abs(t[7]),i[8]=Math.abs(t[8]),i[9]=Math.abs(t[9]),i[10]=Math.abs(t[10]),i[11]=Math.abs(t[11]),i[12]=Math.abs(t[12]),i[13]=Math.abs(t[13]),i[14]=Math.abs(t[14]),i[15]=Math.abs(t[15]),i},X.equals=function(t,i){return t===i||D(t)&&D(i)&&t[12]===i[12]&&t[13]===i[13]&&t[14]===i[14]&&t[0]===i[0]&&t[1]===i[1]&&t[2]===i[2]&&t[4]===i[4]&&t[5]===i[5]&&t[6]===i[6]&&t[8]===i[8]&&t[9]===i[9]&&t[10]===i[10]&&t[3]===i[3]&&t[7]===i[7]&&t[11]===i[11]&&t[15]===i[15]},X.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t[0]-i[0])<=e&&Math.abs(t[1]-i[1])<=e&&Math.abs(t[2]-i[2])<=e&&Math.abs(t[3]-i[3])<=e&&Math.abs(t[4]-i[4])<=e&&Math.abs(t[5]-i[5])<=e&&Math.abs(t[6]-i[6])<=e&&Math.abs(t[7]-i[7])<=e&&Math.abs(t[8]-i[8])<=e&&Math.abs(t[9]-i[9])<=e&&Math.abs(t[10]-i[10])<=e&&Math.abs(t[11]-i[11])<=e&&Math.abs(t[12]-i[12])<=e&&Math.abs(t[13]-i[13])<=e&&Math.abs(t[14]-i[14])<=e&&Math.abs(t[15]-i[15])<=e},X.getTranslation=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i.x=t[12],i.y=t[13],i.z=t[14],i},X.getMatrix3=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[4],i[4]=t[5],i[5]=t[6],i[6]=t[8],i[7]=t[9],i[8]=t[10],i};const PE=new q,SE=new q,EE=new B,AE=new B(0,0,0,1);X.inverse=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[0],n=t[4],o=t[8],r=t[12],s=t[1],a=t[5],c=t[9],d=t[13],u=t[2],p=t[6],f=t[10],g=t[14],m=t[3],y=t[7],P=t[11],S=t[15];let C=f*S,E=g*P,T=p*S,I=g*y,b=p*P,x=f*y,z=u*S,W=g*m,N=u*P,L=f*m,U=u*y,_=p*m;const M=C*a+I*c+b*d-(E*a+T*c+x*d),F=E*s+z*c+L*d-(C*s+W*c+N*d),V=T*s+W*a+U*d-(I*s+z*a+_*d),G=x*s+N*a+_*c-(b*s+L*a+U*c),Z=E*n+T*o+x*r-(C*n+I*o+b*r),$=C*e+W*o+N*r-(E*e+z*o+L*r),Y=I*e+z*n+_*r-(T*e+W*n+U*r),K=b*e+L*n+U*o-(x*e+N*n+_*o);C=o*d,E=r*c,T=n*d,I=r*a,b=n*c,x=o*a,z=e*d,W=r*s,N=e*c,L=o*s,U=e*a,_=n*s;const te=C*y+I*P+b*S-(E*y+T*P+x*S),re=E*m+z*P+L*S-(C*m+W*P+N*S),ge=T*m+W*y+U*S-(I*m+z*y+_*S),ye=x*m+N*y+_*P-(b*m+L*y+U*P),Te=T*f+x*g+E*p-(b*g+C*p+I*f),Oe=N*g+C*u+W*f-(z*f+L*g+E*u),We=z*p+_*g+I*u-(U*g+T*u+W*p),me=U*f+b*u+L*p-(N*p+_*f+x*u);let ne=e*M+n*F+o*V+r*G;if(Math.abs(ne)<O.EPSILON21){if(q.equalsEpsilon(X.getMatrix3(t,PE),SE,O.EPSILON7)&&B.equals(X.getRow(t,3,EE),AE))return i[0]=0,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=0,i[11]=0,i[12]=-t[12],i[13]=-t[13],i[14]=-t[14],i[15]=1,i;throw new lt("matrix is not invertible because its determinate is zero.")}return ne=1/ne,i[0]=M*ne,i[1]=F*ne,i[2]=V*ne,i[3]=G*ne,i[4]=Z*ne,i[5]=$*ne,i[6]=Y*ne,i[7]=K*ne,i[8]=te*ne,i[9]=re*ne,i[10]=ge*ne,i[11]=ye*ne,i[12]=Te*ne,i[13]=Oe*ne,i[14]=We*ne,i[15]=me*ne,i},X.inverseTransformation=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[0],n=t[1],o=t[2],r=t[4],s=t[5],a=t[6],c=t[8],d=t[9],u=t[10],p=t[12],f=t[13],g=t[14],m=-e*p-n*f-o*g,y=-r*p-s*f-a*g,P=-c*p-d*f-u*g;return i[0]=e,i[1]=r,i[2]=c,i[3]=0,i[4]=n,i[5]=s,i[6]=d,i[7]=0,i[8]=o,i[9]=a,i[10]=u,i[11]=0,i[12]=m,i[13]=y,i[14]=P,i[15]=1,i};const TE=new X;X.inverseTranspose=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),X.inverse(X.transpose(t,TE),i)},X.IDENTITY=Object.freeze(new X(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),X.ZERO=Object.freeze(new X(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),X.COLUMN0ROW0=0,X.COLUMN0ROW1=1,X.COLUMN0ROW2=2,X.COLUMN0ROW3=3,X.COLUMN1ROW0=4,X.COLUMN1ROW1=5,X.COLUMN1ROW2=6,X.COLUMN1ROW3=7,X.COLUMN2ROW0=8,X.COLUMN2ROW1=9,X.COLUMN2ROW2=10,X.COLUMN2ROW3=11,X.COLUMN3ROW0=12,X.COLUMN3ROW1=13,X.COLUMN3ROW2=14,X.COLUMN3ROW3=15,Object.defineProperties(X.prototype,{length:{get:function(){return X.packedLength}}}),X.prototype.clone=function(t){return X.clone(this,t)},X.prototype.equals=function(t){return X.equals(this,t)},X.equalsArray=function(t,i,e){return t[0]===i[e]&&t[1]===i[e+1]&&t[2]===i[e+2]&&t[3]===i[e+3]&&t[4]===i[e+4]&&t[5]===i[e+5]&&t[6]===i[e+6]&&t[7]===i[e+7]&&t[8]===i[e+8]&&t[9]===i[e+9]&&t[10]===i[e+10]&&t[11]===i[e+11]&&t[12]===i[e+12]&&t[13]===i[e+13]&&t[14]===i[e+14]&&t[15]===i[e+15]},X.prototype.equalsEpsilon=function(t,i){return X.equalsEpsilon(this,t,i)},X.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
|
|
322
|
+
(${this[2]}, ${this[5]}, ${this[8]})`};function lt(t){this.name="RuntimeError",this.message=t;let i;try{throw new Error}catch(e){i=e.stack}this.stack=i}D(Object.create)&&(lt.prototype=Object.create(Error.prototype),lt.prototype.constructor=lt),lt.prototype.toString=function(){let t=`${this.name}: ${this.message}`;return D(this.stack)&&(t+=`
|
|
323
|
+
${this.stack.toString()}`),t};function X(t,i,e,n,o,r,s,a,c,d,u,p,f,g,m,y){this[0]=t??0,this[1]=o??0,this[2]=c??0,this[3]=f??0,this[4]=i??0,this[5]=r??0,this[6]=d??0,this[7]=g??0,this[8]=e??0,this[9]=s??0,this[10]=u??0,this[11]=m??0,this[12]=n??0,this[13]=a??0,this[14]=p??0,this[15]=y??0}X.packedLength=16,X.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t[0],i[e++]=t[1],i[e++]=t[2],i[e++]=t[3],i[e++]=t[4],i[e++]=t[5],i[e++]=t[6],i[e++]=t[7],i[e++]=t[8],i[e++]=t[9],i[e++]=t[10],i[e++]=t[11],i[e++]=t[12],i[e++]=t[13],i[e++]=t[14],i[e]=t[15],i},X.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new X),e[0]=t[i++],e[1]=t[i++],e[2]=t[i++],e[3]=t[i++],e[4]=t[i++],e[5]=t[i++],e[6]=t[i++],e[7]=t[i++],e[8]=t[i++],e[9]=t[i++],e[10]=t[i++],e[11]=t[i++],e[12]=t[i++],e[13]=t[i++],e[14]=t[i++],e[15]=t[i],e},X.packArray=function(t,i){A.defined("array",t);const e=t.length,n=e*16;if(!D(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new H("If result is a typed array, it must have exactly array.length * 16 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)X.pack(t[o],i,o*16);return i},X.unpackArray=function(t,i){if(A.defined("array",t),A.typeOf.number.greaterThanOrEquals("array.length",t.length,16),t.length%16!==0)throw new H("array length must be a multiple of 16.");const e=t.length;D(i)?i.length=e/16:i=new Array(e/16);for(let n=0;n<e;n+=16){const o=n/16;i[o]=X.unpack(t,n,i[o])}return i},X.clone=function(t,i){if(D(t))return D(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i):new X(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},X.fromArray=X.unpack,X.fromColumnMajorArray=function(t,i){return A.defined("values",t),X.clone(t,i)},X.fromRowMajorArray=function(t,i){return A.defined("values",t),D(i)?(i[0]=t[0],i[1]=t[4],i[2]=t[8],i[3]=t[12],i[4]=t[1],i[5]=t[5],i[6]=t[9],i[7]=t[13],i[8]=t[2],i[9]=t[6],i[10]=t[10],i[11]=t[14],i[12]=t[3],i[13]=t[7],i[14]=t[11],i[15]=t[15],i):new X(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},X.fromRotationTranslation=function(t,i,e){return A.typeOf.object("rotation",t),i=i??k.ZERO,D(e)?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=0,e[4]=t[3],e[5]=t[4],e[6]=t[5],e[7]=0,e[8]=t[6],e[9]=t[7],e[10]=t[8],e[11]=0,e[12]=i.x,e[13]=i.y,e[14]=i.z,e[15]=1,e):new X(t[0],t[3],t[6],i.x,t[1],t[4],t[7],i.y,t[2],t[5],t[8],i.z,0,0,0,1)},X.fromTranslationQuaternionRotationScale=function(t,i,e,n){A.typeOf.object("translation",t),A.typeOf.object("rotation",i),A.typeOf.object("scale",e),D(n)||(n=new X);const o=e.x,r=e.y,s=e.z,a=i.x*i.x,c=i.x*i.y,d=i.x*i.z,u=i.x*i.w,p=i.y*i.y,f=i.y*i.z,g=i.y*i.w,m=i.z*i.z,y=i.z*i.w,P=i.w*i.w,S=a-p-m+P,C=2*(c-y),E=2*(d+g),T=2*(c+y),I=-a+p-m+P,b=2*(f-u),x=2*(d-g),z=2*(f+u),W=-a-p+m+P;return n[0]=S*o,n[1]=T*o,n[2]=x*o,n[3]=0,n[4]=C*r,n[5]=I*r,n[6]=z*r,n[7]=0,n[8]=E*s,n[9]=b*s,n[10]=W*s,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n},X.fromTranslationRotationScale=function(t,i){return A.typeOf.object("translationRotationScale",t),X.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,i)},X.fromTranslation=function(t,i){return A.typeOf.object("translation",t),X.fromRotationTranslation(q.IDENTITY,t,i)},X.fromScale=function(t,i){return A.typeOf.object("scale",t),D(i)?(i[0]=t.x,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t.y,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t.z,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i):new X(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},X.fromUniformScale=function(t,i){return A.typeOf.number("scale",t),D(i)?(i[0]=t,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i):new X(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)},X.fromRotation=function(t,i){return A.typeOf.object("rotation",t),D(i)||(i=new X),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i};const ar=new k,lr=new k,ys=new k;X.fromCamera=function(t,i){A.typeOf.object("camera",t);const e=t.position,n=t.direction,o=t.up;A.typeOf.object("camera.position",e),A.typeOf.object("camera.direction",n),A.typeOf.object("camera.up",o),k.normalize(n,ar),k.normalize(k.cross(ar,o,lr),lr),k.normalize(k.cross(lr,ar,ys),ys);const r=lr.x,s=lr.y,a=lr.z,c=ar.x,d=ar.y,u=ar.z,p=ys.x,f=ys.y,g=ys.z,m=e.x,y=e.y,P=e.z,S=r*-m+s*-y+a*-P,C=p*-m+f*-y+g*-P,E=c*m+d*y+u*P;return D(i)?(i[0]=r,i[1]=p,i[2]=-c,i[3]=0,i[4]=s,i[5]=f,i[6]=-d,i[7]=0,i[8]=a,i[9]=g,i[10]=-u,i[11]=0,i[12]=S,i[13]=C,i[14]=E,i[15]=1,i):new X(r,s,a,S,p,f,g,C,-c,-d,-u,E,0,0,0,1)},X.computePerspectiveFieldOfView=function(t,i,e,n,o){A.typeOf.number.greaterThan("fovY",t,0),A.typeOf.number.lessThan("fovY",t,Math.PI),A.typeOf.number.greaterThan("near",e,0),A.typeOf.number.greaterThan("far",n,0),A.typeOf.object("result",o);const s=1/Math.tan(t*.5),a=s/i,c=(n+e)/(e-n),d=2*n*e/(e-n);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,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]=d,o[15]=0,o},X.computeOrthographicOffCenter=function(t,i,e,n,o,r,s){A.typeOf.number("left",t),A.typeOf.number("right",i),A.typeOf.number("bottom",e),A.typeOf.number("top",n),A.typeOf.number("near",o),A.typeOf.number("far",r),A.typeOf.object("result",s);let a=1/(i-t),c=1/(n-e),d=1/(r-o);const u=-(i+t)*a,p=-(n+e)*c,f=-(r+o)*d;return a*=2,c*=2,d*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=d,s[11]=0,s[12]=u,s[13]=p,s[14]=f,s[15]=1,s},X.computePerspectiveOffCenter=function(t,i,e,n,o,r,s){A.typeOf.number("left",t),A.typeOf.number("right",i),A.typeOf.number("bottom",e),A.typeOf.number("top",n),A.typeOf.number("near",o),A.typeOf.number("far",r),A.typeOf.object("result",s);const a=2*o/(i-t),c=2*o/(n-e),d=(i+t)/(i-t),u=(n+e)/(n-e),p=-(r+o)/(r-o),f=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=d,s[9]=u,s[10]=p,s[11]=f,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s},X.computeInfinitePerspectiveOffCenter=function(t,i,e,n,o,r){A.typeOf.number("left",t),A.typeOf.number("right",i),A.typeOf.number("bottom",e),A.typeOf.number("top",n),A.typeOf.number("near",o),A.typeOf.object("result",r);const s=2*o/(i-t),a=2*o/(n-e),c=(i+t)/(i-t),d=(n+e)/(n-e),u=-1,p=-1,f=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=d,r[10]=u,r[11]=p,r[12]=0,r[13]=0,r[14]=f,r[15]=0,r},X.computeViewportTransformation=function(t,i,e,n){D(n)||(n=new X),t=t??_i.EMPTY_OBJECT;const o=t.x??0,r=t.y??0,s=t.width??0,a=t.height??0;i=i??0,e=e??1;const c=s*.5,d=a*.5,u=(e-i)*.5,p=c,f=d,g=u,m=o+c,y=r+d,P=i+u,S=1;return n[0]=p,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=f,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=g,n[11]=0,n[12]=m,n[13]=y,n[14]=P,n[15]=S,n},X.computeView=function(t,i,e,n,o){return A.typeOf.object("position",t),A.typeOf.object("direction",i),A.typeOf.object("up",e),A.typeOf.object("right",n),A.typeOf.object("result",o),o[0]=n.x,o[1]=e.x,o[2]=-i.x,o[3]=0,o[4]=n.y,o[5]=e.y,o[6]=-i.y,o[7]=0,o[8]=n.z,o[9]=e.z,o[10]=-i.z,o[11]=0,o[12]=-k.dot(n,t),o[13]=-k.dot(e,t),o[14]=k.dot(i,t),o[15]=1,o},X.toArray=function(t,i){return A.typeOf.object("matrix",t),D(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},X.getElementIndex=function(t,i){return A.typeOf.number.greaterThanOrEquals("row",i,0),A.typeOf.number.lessThanOrEquals("row",i,3),A.typeOf.number.greaterThanOrEquals("column",t,0),A.typeOf.number.lessThanOrEquals("column",t,3),t*4+i},X.getColumn=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,3),A.typeOf.object("result",e);const n=i*4,o=t[n],r=t[n+1],s=t[n+2],a=t[n+3];return e.x=o,e.y=r,e.z=s,e.w=a,e},X.setColumn=function(t,i,e,n){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,3),A.typeOf.object("cartesian",e),A.typeOf.object("result",n),n=X.clone(t,n);const o=i*4;return n[o]=e.x,n[o+1]=e.y,n[o+2]=e.z,n[o+3]=e.w,n},X.getRow=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,3),A.typeOf.object("result",e);const n=t[i],o=t[i+4],r=t[i+8],s=t[i+12];return e.x=n,e.y=o,e.z=r,e.w=s,e},X.setRow=function(t,i,e,n){return A.typeOf.object("matrix",t),A.typeOf.number.greaterThanOrEquals("index",i,0),A.typeOf.number.lessThanOrEquals("index",i,3),A.typeOf.object("cartesian",e),A.typeOf.object("result",n),n=X.clone(t,n),n[i]=e.x,n[i+4]=e.y,n[i+8]=e.z,n[i+12]=e.w,n},X.setTranslation=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.object("translation",i),A.typeOf.object("result",e),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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=i.x,e[13]=i.y,e[14]=i.z,e[15]=t[15],e};const oE=new k;X.setScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("scale",i),A.typeOf.object("result",e);const n=X.getScale(t,oE),o=i.x/n.x,r=i.y/n.y,s=i.z/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3],e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7],e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const rE=new k;X.setUniformScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.number("scale",i),A.typeOf.object("result",e);const n=X.getScale(t,rE),o=i/n.x,r=i/n.y,s=i/n.z;return e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3],e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7],e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const zd=new k;X.getScale=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i.x=k.magnitude(k.fromElements(t[0],t[1],t[2],zd)),i.y=k.magnitude(k.fromElements(t[4],t[5],t[6],zd)),i.z=k.magnitude(k.fromElements(t[8],t[9],t[10],zd)),i};const Mv=new k;X.getMaximumScale=function(t){return X.getScale(t,Mv),k.maximumComponent(Mv)};const sE=new k;X.setRotation=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("result",e);const n=X.getScale(t,sE);return e[0]=i[0]*n.x,e[1]=i[1]*n.x,e[2]=i[2]*n.x,e[3]=t[3],e[4]=i[3]*n.y,e[5]=i[4]*n.y,e[6]=i[5]*n.y,e[7]=t[7],e[8]=i[6]*n.z,e[9]=i[7]*n.z,e[10]=i[8]*n.z,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e};const aE=new k;X.getRotation=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=X.getScale(t,aE);return i[0]=t[0]/e.x,i[1]=t[1]/e.x,i[2]=t[2]/e.x,i[3]=t[4]/e.y,i[4]=t[5]/e.y,i[5]=t[6]/e.y,i[6]=t[8]/e.z,i[7]=t[9]/e.z,i[8]=t[10]/e.z,i},X.multiply=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t[0],o=t[1],r=t[2],s=t[3],a=t[4],c=t[5],d=t[6],u=t[7],p=t[8],f=t[9],g=t[10],m=t[11],y=t[12],P=t[13],S=t[14],C=t[15],E=i[0],T=i[1],I=i[2],b=i[3],x=i[4],z=i[5],W=i[6],N=i[7],L=i[8],U=i[9],_=i[10],M=i[11],F=i[12],V=i[13],G=i[14],Z=i[15],$=n*E+a*T+p*I+y*b,Y=o*E+c*T+f*I+P*b,K=r*E+d*T+g*I+S*b,te=s*E+u*T+m*I+C*b,re=n*x+a*z+p*W+y*N,ge=o*x+c*z+f*W+P*N,ye=r*x+d*z+g*W+S*N,Te=s*x+u*z+m*W+C*N,Oe=n*L+a*U+p*_+y*M,We=o*L+c*U+f*_+P*M,me=r*L+d*U+g*_+S*M,ne=s*L+u*U+m*_+C*M,he=n*F+a*V+p*G+y*Z,de=o*F+c*V+f*G+P*Z,Me=r*F+d*V+g*G+S*Z,Ne=s*F+u*V+m*G+C*Z;return e[0]=$,e[1]=Y,e[2]=K,e[3]=te,e[4]=re,e[5]=ge,e[6]=ye,e[7]=Te,e[8]=Oe,e[9]=We,e[10]=me,e[11]=ne,e[12]=he,e[13]=de,e[14]=Me,e[15]=Ne,e},X.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e[9]=t[9]+i[9],e[10]=t[10]+i[10],e[11]=t[11]+i[11],e[12]=t[12]+i[12],e[13]=t[13]+i[13],e[14]=t[14]+i[14],e[15]=t[15]+i[15],e},X.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e[9]=t[9]-i[9],e[10]=t[10]-i[10],e[11]=t[11]-i[11],e[12]=t[12]-i[12],e[13]=t[13]-i[13],e[14]=t[14]-i[14],e[15]=t[15]-i[15],e},X.multiplyTransformation=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t[0],o=t[1],r=t[2],s=t[4],a=t[5],c=t[6],d=t[8],u=t[9],p=t[10],f=t[12],g=t[13],m=t[14],y=i[0],P=i[1],S=i[2],C=i[4],E=i[5],T=i[6],I=i[8],b=i[9],x=i[10],z=i[12],W=i[13],N=i[14],L=n*y+s*P+d*S,U=o*y+a*P+u*S,_=r*y+c*P+p*S,M=n*C+s*E+d*T,F=o*C+a*E+u*T,V=r*C+c*E+p*T,G=n*I+s*b+d*x,Z=o*I+a*b+u*x,$=r*I+c*b+p*x,Y=n*z+s*W+d*N+f,K=o*z+a*W+u*N+g,te=r*z+c*W+p*N+m;return e[0]=L,e[1]=U,e[2]=_,e[3]=0,e[4]=M,e[5]=F,e[6]=V,e[7]=0,e[8]=G,e[9]=Z,e[10]=$,e[11]=0,e[12]=Y,e[13]=K,e[14]=te,e[15]=1,e},X.multiplyByMatrix3=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("rotation",i),A.typeOf.object("result",e);const n=t[0],o=t[1],r=t[2],s=t[4],a=t[5],c=t[6],d=t[8],u=t[9],p=t[10],f=i[0],g=i[1],m=i[2],y=i[3],P=i[4],S=i[5],C=i[6],E=i[7],T=i[8],I=n*f+s*g+d*m,b=o*f+a*g+u*m,x=r*f+c*g+p*m,z=n*y+s*P+d*S,W=o*y+a*P+u*S,N=r*y+c*P+p*S,L=n*C+s*E+d*T,U=o*C+a*E+u*T,_=r*C+c*E+p*T;return e[0]=I,e[1]=b,e[2]=x,e[3]=0,e[4]=z,e[5]=W,e[6]=N,e[7]=0,e[8]=L,e[9]=U,e[10]=_,e[11]=0,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},X.multiplyByTranslation=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("translation",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=n*t[0]+o*t[4]+r*t[8]+t[12],a=n*t[1]+o*t[5]+r*t[9]+t[13],c=n*t[2]+o*t[6]+r*t[10]+t[14];return 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],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=s,e[13]=a,e[14]=c,e[15]=t[15],e},X.multiplyByScale=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("scale",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z;return n===1&&o===1&&r===1?X.clone(t,e):(e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=t[3],e[4]=o*t[4],e[5]=o*t[5],e[6]=o*t[6],e[7]=t[7],e[8]=r*t[8],e[9]=r*t[9],e[10]=r*t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e)},X.multiplyByUniformScale=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.number("scale",i),A.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3],e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7],e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},X.multiplyByVector=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("cartesian",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=i.w,a=t[0]*n+t[4]*o+t[8]*r+t[12]*s,c=t[1]*n+t[5]*o+t[9]*r+t[13]*s,d=t[2]*n+t[6]*o+t[10]*r+t[14]*s,u=t[3]*n+t[7]*o+t[11]*r+t[15]*s;return e.x=a,e.y=c,e.z=d,e.w=u,e},X.multiplyByPointAsVector=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("cartesian",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=t[0]*n+t[4]*o+t[8]*r,a=t[1]*n+t[5]*o+t[9]*r,c=t[2]*n+t[6]*o+t[10]*r;return e.x=s,e.y=a,e.z=c,e},X.multiplyByPoint=function(t,i,e){A.typeOf.object("matrix",t),A.typeOf.object("cartesian",i),A.typeOf.object("result",e);const n=i.x,o=i.y,r=i.z,s=t[0]*n+t[4]*o+t[8]*r+t[12],a=t[1]*n+t[5]*o+t[9]*r+t[13],c=t[2]*n+t[6]*o+t[10]*r+t[14];return e.x=s,e.y=a,e.z=c,e},X.multiplyByScalar=function(t,i,e){return A.typeOf.object("matrix",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12]*i,e[13]=t[13]*i,e[14]=t[14]*i,e[15]=t[15]*i,e},X.negate=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=-t[0],i[1]=-t[1],i[2]=-t[2],i[3]=-t[3],i[4]=-t[4],i[5]=-t[5],i[6]=-t[6],i[7]=-t[7],i[8]=-t[8],i[9]=-t[9],i[10]=-t[10],i[11]=-t[11],i[12]=-t[12],i[13]=-t[13],i[14]=-t[14],i[15]=-t[15],i},X.transpose=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[1],n=t[2],o=t[3],r=t[6],s=t[7],a=t[11];return i[0]=t[0],i[1]=t[4],i[2]=t[8],i[3]=t[12],i[4]=e,i[5]=t[5],i[6]=t[9],i[7]=t[13],i[8]=n,i[9]=r,i[10]=t[10],i[11]=t[14],i[12]=o,i[13]=s,i[14]=a,i[15]=t[15],i},X.abs=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=Math.abs(t[0]),i[1]=Math.abs(t[1]),i[2]=Math.abs(t[2]),i[3]=Math.abs(t[3]),i[4]=Math.abs(t[4]),i[5]=Math.abs(t[5]),i[6]=Math.abs(t[6]),i[7]=Math.abs(t[7]),i[8]=Math.abs(t[8]),i[9]=Math.abs(t[9]),i[10]=Math.abs(t[10]),i[11]=Math.abs(t[11]),i[12]=Math.abs(t[12]),i[13]=Math.abs(t[13]),i[14]=Math.abs(t[14]),i[15]=Math.abs(t[15]),i},X.equals=function(t,i){return t===i||D(t)&&D(i)&&t[12]===i[12]&&t[13]===i[13]&&t[14]===i[14]&&t[0]===i[0]&&t[1]===i[1]&&t[2]===i[2]&&t[4]===i[4]&&t[5]===i[5]&&t[6]===i[6]&&t[8]===i[8]&&t[9]===i[9]&&t[10]===i[10]&&t[3]===i[3]&&t[7]===i[7]&&t[11]===i[11]&&t[15]===i[15]},X.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t[0]-i[0])<=e&&Math.abs(t[1]-i[1])<=e&&Math.abs(t[2]-i[2])<=e&&Math.abs(t[3]-i[3])<=e&&Math.abs(t[4]-i[4])<=e&&Math.abs(t[5]-i[5])<=e&&Math.abs(t[6]-i[6])<=e&&Math.abs(t[7]-i[7])<=e&&Math.abs(t[8]-i[8])<=e&&Math.abs(t[9]-i[9])<=e&&Math.abs(t[10]-i[10])<=e&&Math.abs(t[11]-i[11])<=e&&Math.abs(t[12]-i[12])<=e&&Math.abs(t[13]-i[13])<=e&&Math.abs(t[14]-i[14])<=e&&Math.abs(t[15]-i[15])<=e},X.getTranslation=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i.x=t[12],i.y=t[13],i.z=t[14],i},X.getMatrix3=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[4],i[4]=t[5],i[5]=t[6],i[6]=t[8],i[7]=t[9],i[8]=t[10],i};const lE=new q,cE=new q,hE=new B,dE=new B(0,0,0,1);X.inverse=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[0],n=t[4],o=t[8],r=t[12],s=t[1],a=t[5],c=t[9],d=t[13],u=t[2],p=t[6],f=t[10],g=t[14],m=t[3],y=t[7],P=t[11],S=t[15];let C=f*S,E=g*P,T=p*S,I=g*y,b=p*P,x=f*y,z=u*S,W=g*m,N=u*P,L=f*m,U=u*y,_=p*m;const M=C*a+I*c+b*d-(E*a+T*c+x*d),F=E*s+z*c+L*d-(C*s+W*c+N*d),V=T*s+W*a+U*d-(I*s+z*a+_*d),G=x*s+N*a+_*c-(b*s+L*a+U*c),Z=E*n+T*o+x*r-(C*n+I*o+b*r),$=C*e+W*o+N*r-(E*e+z*o+L*r),Y=I*e+z*n+_*r-(T*e+W*n+U*r),K=b*e+L*n+U*o-(x*e+N*n+_*o);C=o*d,E=r*c,T=n*d,I=r*a,b=n*c,x=o*a,z=e*d,W=r*s,N=e*c,L=o*s,U=e*a,_=n*s;const te=C*y+I*P+b*S-(E*y+T*P+x*S),re=E*m+z*P+L*S-(C*m+W*P+N*S),ge=T*m+W*y+U*S-(I*m+z*y+_*S),ye=x*m+N*y+_*P-(b*m+L*y+U*P),Te=T*f+x*g+E*p-(b*g+C*p+I*f),Oe=N*g+C*u+W*f-(z*f+L*g+E*u),We=z*p+_*g+I*u-(U*g+T*u+W*p),me=U*f+b*u+L*p-(N*p+_*f+x*u);let ne=e*M+n*F+o*V+r*G;if(Math.abs(ne)<O.EPSILON21){if(q.equalsEpsilon(X.getMatrix3(t,lE),cE,O.EPSILON7)&&B.equals(X.getRow(t,3,hE),dE))return i[0]=0,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=0,i[11]=0,i[12]=-t[12],i[13]=-t[13],i[14]=-t[14],i[15]=1,i;throw new lt("matrix is not invertible because its determinate is zero.")}return ne=1/ne,i[0]=M*ne,i[1]=F*ne,i[2]=V*ne,i[3]=G*ne,i[4]=Z*ne,i[5]=$*ne,i[6]=Y*ne,i[7]=K*ne,i[8]=te*ne,i[9]=re*ne,i[10]=ge*ne,i[11]=ye*ne,i[12]=Te*ne,i[13]=Oe*ne,i[14]=We*ne,i[15]=me*ne,i},X.inverseTransformation=function(t,i){A.typeOf.object("matrix",t),A.typeOf.object("result",i);const e=t[0],n=t[1],o=t[2],r=t[4],s=t[5],a=t[6],c=t[8],d=t[9],u=t[10],p=t[12],f=t[13],g=t[14],m=-e*p-n*f-o*g,y=-r*p-s*f-a*g,P=-c*p-d*f-u*g;return i[0]=e,i[1]=r,i[2]=c,i[3]=0,i[4]=n,i[5]=s,i[6]=d,i[7]=0,i[8]=o,i[9]=a,i[10]=u,i[11]=0,i[12]=m,i[13]=y,i[14]=P,i[15]=1,i};const uE=new X;X.inverseTranspose=function(t,i){return A.typeOf.object("matrix",t),A.typeOf.object("result",i),X.inverse(X.transpose(t,uE),i)},X.IDENTITY=Object.freeze(new X(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),X.ZERO=Object.freeze(new X(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),X.COLUMN0ROW0=0,X.COLUMN0ROW1=1,X.COLUMN0ROW2=2,X.COLUMN0ROW3=3,X.COLUMN1ROW0=4,X.COLUMN1ROW1=5,X.COLUMN1ROW2=6,X.COLUMN1ROW3=7,X.COLUMN2ROW0=8,X.COLUMN2ROW1=9,X.COLUMN2ROW2=10,X.COLUMN2ROW3=11,X.COLUMN3ROW0=12,X.COLUMN3ROW1=13,X.COLUMN3ROW2=14,X.COLUMN3ROW3=15,Object.defineProperties(X.prototype,{length:{get:function(){return X.packedLength}}}),X.prototype.clone=function(t){return X.clone(this,t)},X.prototype.equals=function(t){return X.equals(this,t)},X.equalsArray=function(t,i,e){return t[0]===i[e]&&t[1]===i[e+1]&&t[2]===i[e+2]&&t[3]===i[e+3]&&t[4]===i[e+4]&&t[5]===i[e+5]&&t[6]===i[e+6]&&t[7]===i[e+7]&&t[8]===i[e+8]&&t[9]===i[e+9]&&t[10]===i[e+10]&&t[11]===i[e+11]&&t[12]===i[e+12]&&t[13]===i[e+13]&&t[14]===i[e+14]&&t[15]===i[e+15]},X.prototype.equalsEpsilon=function(t,i){return X.equalsEpsilon(this,t,i)},X.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
|
|
324
324
|
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
|
|
325
325
|
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
|
|
326
|
-
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};function ws(t,i,e){A.defined("array",t),A.defined("itemToFind",i),A.defined("comparator",e);let n=0,o=t.length-1,r,s;for(;n<=o;){if(r=~~((n+o)/2),s=e(t[r],i),s<0){n=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}function Ld(t,i,e,n,o){this.xPoleWander=t,this.yPoleWander=i,this.xPoleOffset=e,this.yPoleOffset=n,this.ut1MinusUtc=o}function Od(t){if(t===null||isNaN(t))throw new H("year is required and must be a number.");return t%4===0&&t%100!==0||t%400===0}const kv=[31,28,31,30,31,30,31,31,30,31,30,31];function Nd(t,i,e,n,o,r,s,a){t=t??1,i=i??1,e=e??1,n=n??0,o=o??0,r=r??0,s=s??0,a=a??!1,y(),P(),this.year=t,this.month=i,this.day=e,this.hour=n,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function y(){A.typeOf.number.greaterThanOrEquals("Year",t,1),A.typeOf.number.lessThanOrEquals("Year",t,9999),A.typeOf.number.greaterThanOrEquals("Month",i,1),A.typeOf.number.lessThanOrEquals("Month",i,12),A.typeOf.number.greaterThanOrEquals("Day",e,1),A.typeOf.number.lessThanOrEquals("Day",e,31),A.typeOf.number.greaterThanOrEquals("Hour",n,0),A.typeOf.number.lessThanOrEquals("Hour",n,23),A.typeOf.number.greaterThanOrEquals("Minute",o,0),A.typeOf.number.lessThanOrEquals("Minute",o,59),A.typeOf.bool("IsLeapSecond",a),A.typeOf.number.greaterThanOrEquals("Second",r,0),A.typeOf.number.lessThanOrEquals("Second",r,a?60:59),A.typeOf.number.greaterThanOrEquals("Millisecond",s,0),A.typeOf.number.lessThan("Millisecond",s,1e3)}function P(){const S=i===2&&Od(t)?kv[i-1]+1:kv[i-1];if(e>S)throw new H("Month and Day represents invalid date")}}function De(t,i){this.julianDate=t,this.offset=i}const Ue=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}),ve=Object.freeze({UTC:0,TAI:1}),zv=new Nd,Sc=[31,28,31,30,31,30,31,31,30,31,30,31],Ec=29;function Vd(t,i){return J.compare(t.julianDate,i.julianDate)}const cr=new De;function Ac(t){cr.julianDate=t;const i=J.leapSeconds;let e=ws(i,cr,Vd);e<0&&(e=~e),e>=i.length&&(e=i.length-1);let n=i[e].offset;e>0&&J.secondsDifference(i[e].julianDate,t)>n&&(e--,n=i[e].offset),J.addSeconds(t,n,t)}function Lv(t,i){cr.julianDate=t;const e=J.leapSeconds;let n=ws(e,cr,Vd);if(n<0&&(n=~n),n===0)return J.addSeconds(t,-e[0].offset,i);if(n>=e.length)return J.addSeconds(t,-e[n-1].offset,i);const o=J.secondsDifference(e[n].julianDate,t);if(o===0)return J.addSeconds(t,-e[n].offset,i);if(!(o<=1))return J.addSeconds(t,-e[--n].offset,i)}function An(t,i,e){const n=i/Ue.SECONDS_PER_DAY|0;return t+=n,i-=Ue.SECONDS_PER_DAY*n,i<0&&(t--,i+=Ue.SECONDS_PER_DAY),e.dayNumber=t,e.secondsOfDay=i,e}function Ud(t,i,e,n,o,r,s){const a=(i-14)/12|0,c=t+4800+a;let d=(1461*c/4|0)+(367*(i-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+e-32075;n=n-12,n<0&&(n+=24);const u=r+(n*Ue.SECONDS_PER_HOUR+o*Ue.SECONDS_PER_MINUTE+s*Ue.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}const ME=/^(\d{4})$/,IE=/^(\d{4})-(\d{2})$/,DE=/^(\d{4})-?(\d{3})$/,bE=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,RE=/^(\d{4})-?(\d{2})-?(\d{2})$/,Wd=/([Z+\-])?(\d{2})?:?(\d{2})?$/,xE=/^(\d{2})(\.\d+)?/.source+Wd.source,FE=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Wd.source,kE=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Wd.source,hi="Invalid ISO 8601 date.";function J(t,i,e){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,i=i??0,e=e??ve.UTC;const n=t|0;i=i+(t-n)*Ue.SECONDS_PER_DAY,An(n,i,this),e===ve.UTC&&Ac(this)}J.fromGregorianDate=function(t,i){if(!(t instanceof Nd))throw new H("date must be a valid GregorianDate.");const e=Ud(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return D(i)?(An(e[0],e[1],i),Ac(i),i):new J(e[0],e[1],ve.UTC)},J.fromDate=function(t,i){if(!(t instanceof Date)||isNaN(t.getTime()))throw new H("date must be a valid JavaScript Date.");const e=Ud(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return D(i)?(An(e[0],e[1],i),Ac(i),i):new J(e[0],e[1],ve.UTC)},J.fromIso8601=function(t,i){if(typeof t!="string")throw new H(hi);t=t.replace(",",".");let e=t.split("T"),n,o=1,r=1,s=0,a=0,c=0,d=0;const u=e[0],p=e[1];let f,g;if(!D(u))throw new H(hi);let m;if(e=u.match(RE),e!==null){if(m=u.split("-").length-1,m>0&&m!==2)throw new H(hi);n=+e[1],o=+e[2],r=+e[3]}else if(e=u.match(IE),e!==null)n=+e[1],o=+e[2];else if(e=u.match(ME),e!==null)n=+e[1];else{let C;if(e=u.match(DE),e!==null){if(n=+e[1],C=+e[2],g=Od(n),C<1||g&&C>366||!g&&C>365)throw new H(hi)}else if(e=u.match(bE),e!==null){n=+e[1];const E=+e[2],T=+e[3]||0;if(m=u.split("-").length-1,m>0&&(!D(e[3])&&m!==1||D(e[3])&&m!==2))throw new H(hi);const I=new Date(Date.UTC(n,0,4));C=E*7+T-I.getUTCDay()-3}else throw new H(hi);f=new Date(Date.UTC(n,0,1)),f.setUTCDate(C),o=f.getUTCMonth()+1,r=f.getUTCDate()}if(g=Od(n),o<1||o>12||r<1||(o!==2||!g)&&r>Sc[o-1]||g&&o===2&&r>Ec)throw new H(hi);let y;if(D(p)){if(e=p.match(kE),e!==null){if(m=p.split(":").length-1,m>0&&m!==2&&m!==3)throw new H(hi);s=+e[1],a=+e[2],c=+e[3],d=+(e[4]||0)*1e3,y=5}else if(e=p.match(FE),e!==null){if(m=p.split(":").length-1,m>2)throw new H(hi);s=+e[1],a=+e[2],c=+(e[3]||0)*60,y=4}else if(e=p.match(xE),e!==null)s=+e[1],a=+(e[2]||0)*60,y=3;else throw new H(hi);if(a>=60||c>=61||s>24||s===24&&(a>0||c>0||d>0))throw new H(hi);const C=e[y],E=+e[y+1],T=+(e[y+2]||0);switch(C){case"+":s=s-E,a=a-T;break;case"-":s=s+E,a=a+T;break;case"Z":break;default:a=a+new Date(Date.UTC(n,o-1,r,s,a)).getTimezoneOffset();break}}const P=c===60;for(P&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(f=g&&o===2?Ec:Sc[o-1];r>f;)r-=f,o++,o>12&&(o-=12,n++),f=g&&o===2?Ec:Sc[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,n--),f=g&&o===2?Ec:Sc[o-1],r+=f;const S=Ud(n,o,r,s,a,c,d);return D(i)?(An(S[0],S[1],i),Ac(i)):i=new J(S[0],S[1],ve.UTC),P&&J.addSeconds(i,1,i),i},J.now=function(t){return J.fromDate(new Date,t)};const Tc=new J(0,0,ve.TAI);J.toGregorianDate=function(t,i){if(!D(t))throw new H("julianDate is required.");let e=!1,n=Lv(t,Tc);D(n)||(J.addSeconds(t,-1,Tc),n=Lv(Tc,Tc),e=!0);let o=n.dayNumber;const r=n.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0;const a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;const c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;const d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;const p=d+2-12*s|0,f=100*(a-49)+c+s|0;let g=r/Ue.SECONDS_PER_HOUR|0,m=r-g*Ue.SECONDS_PER_HOUR;const y=m/Ue.SECONDS_PER_MINUTE|0;m=m-y*Ue.SECONDS_PER_MINUTE;let P=m|0;const S=(m-P)/Ue.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),e&&(P+=1),D(i)?(i.year=f,i.month=p,i.day=u,i.hour=g,i.minute=y,i.second=P,i.millisecond=S,i.isLeapSecond=e,i):new Nd(f,p,u,g,y,P,S,e)},J.toDate=function(t){if(!D(t))throw new H("julianDate is required.");const i=J.toGregorianDate(t,zv);let e=i.second;return i.isLeapSecond&&(e-=1),new Date(Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,e,i.millisecond))},J.toIso8601=function(t,i){if(!D(t))throw new H("julianDate is required.");const e=J.toGregorianDate(t,zv);let n=e.year,o=e.month,r=e.day,s=e.hour;const a=e.minute,c=e.second,d=e.millisecond;n===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&d===0&&(n=9999,o=12,r=31,s=24);let u;if(!D(i)&&d!==0){const p=d*.01;return u=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`}return!D(i)||i===0?`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(i).replace(".","").slice(0,i),`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)},J.clone=function(t,i){if(D(t))return D(i)?(i.dayNumber=t.dayNumber,i.secondsOfDay=t.secondsOfDay,i):new J(t.dayNumber,t.secondsOfDay,ve.TAI)},J.compare=function(t,i){if(!D(t))throw new H("left is required.");if(!D(i))throw new H("right is required.");const e=t.dayNumber-i.dayNumber;return e!==0?e:t.secondsOfDay-i.secondsOfDay},J.equals=function(t,i){return t===i||D(t)&&D(i)&&t.dayNumber===i.dayNumber&&t.secondsOfDay===i.secondsOfDay},J.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(J.secondsDifference(t,i))<=e},J.totalDays=function(t){if(!D(t))throw new H("julianDate is required.");return t.dayNumber+t.secondsOfDay/Ue.SECONDS_PER_DAY},J.secondsDifference=function(t,i){if(!D(t))throw new H("left is required.");if(!D(i))throw new H("right is required.");return(t.dayNumber-i.dayNumber)*Ue.SECONDS_PER_DAY+(t.secondsOfDay-i.secondsOfDay)},J.daysDifference=function(t,i){if(!D(t))throw new H("left is required.");if(!D(i))throw new H("right is required.");const e=t.dayNumber-i.dayNumber,n=(t.secondsOfDay-i.secondsOfDay)/Ue.SECONDS_PER_DAY;return e+n},J.computeTaiMinusUtc=function(t){cr.julianDate=t;const i=J.leapSeconds;let e=ws(i,cr,Vd);return e<0&&(e=~e,--e,e<0&&(e=0)),i[e].offset},J.addSeconds=function(t,i,e){if(!D(t))throw new H("julianDate is required.");if(!D(i))throw new H("seconds is required.");if(!D(e))throw new H("result is required.");return An(t.dayNumber,t.secondsOfDay+i,e)},J.addMinutes=function(t,i,e){if(!D(t))throw new H("julianDate is required.");if(!D(i))throw new H("minutes is required.");if(!D(e))throw new H("result is required.");const n=t.secondsOfDay+i*Ue.SECONDS_PER_MINUTE;return An(t.dayNumber,n,e)},J.addHours=function(t,i,e){if(!D(t))throw new H("julianDate is required.");if(!D(i))throw new H("hours is required.");if(!D(e))throw new H("result is required.");const n=t.secondsOfDay+i*Ue.SECONDS_PER_HOUR;return An(t.dayNumber,n,e)},J.addDays=function(t,i,e){if(!D(t))throw new H("julianDate is required.");if(!D(i))throw new H("days is required.");if(!D(e))throw new H("result is required.");const n=t.dayNumber+i;return An(n,t.secondsOfDay,e)},J.lessThan=function(t,i){return J.compare(t,i)<0},J.lessThanOrEquals=function(t,i){return J.compare(t,i)<=0},J.greaterThan=function(t,i){return J.compare(t,i)>0},J.greaterThanOrEquals=function(t,i){return J.compare(t,i)>=0},J.prototype.clone=function(t){return J.clone(this,t)},J.prototype.equals=function(t){return J.equals(this,t)},J.prototype.equalsEpsilon=function(t,i){return J.equalsEpsilon(this,t,i)},J.prototype.toString=function(){return J.toIso8601(this)},J.leapSeconds=[new De(new J(2441317,43210,ve.TAI),10),new De(new J(2441499,43211,ve.TAI),11),new De(new J(2441683,43212,ve.TAI),12),new De(new J(2442048,43213,ve.TAI),13),new De(new J(2442413,43214,ve.TAI),14),new De(new J(2442778,43215,ve.TAI),15),new De(new J(2443144,43216,ve.TAI),16),new De(new J(2443509,43217,ve.TAI),17),new De(new J(2443874,43218,ve.TAI),18),new De(new J(2444239,43219,ve.TAI),19),new De(new J(2444786,43220,ve.TAI),20),new De(new J(2445151,43221,ve.TAI),21),new De(new J(2445516,43222,ve.TAI),22),new De(new J(2446247,43223,ve.TAI),23),new De(new J(2447161,43224,ve.TAI),24),new De(new J(2447892,43225,ve.TAI),25),new De(new J(2448257,43226,ve.TAI),26),new De(new J(2448804,43227,ve.TAI),27),new De(new J(2449169,43228,ve.TAI),28),new De(new J(2449534,43229,ve.TAI),29),new De(new J(2450083,43230,ve.TAI),30),new De(new J(2450630,43231,ve.TAI),31),new De(new J(2451179,43232,ve.TAI),32),new De(new J(2453736,43233,ve.TAI),33),new De(new J(2454832,43234,ve.TAI),34),new De(new J(2456109,43235,ve.TAI),35),new De(new J(2457204,43236,ve.TAI),36),new De(new J(2457754,43237,ve.TAI),37)];var Mc={exports:{}},Cs={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */var zE=Cs.exports,Ov;function LE(){return Ov||(Ov=1,function(t,i){(function(e){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,r=typeof yv=="object"&&yv;(r.global===r||r.window===r||r.self===r)&&(e=r);var s,a=2147483647,c=36,d=1,u=26,p=38,f=700,g=72,m=128,y="-",P=/^xn--/,S=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=c-d,I=Math.floor,b=String.fromCharCode,x;function z(Y){throw new RangeError(E[Y])}function W(Y,K){for(var te=Y.length,re=[];te--;)re[te]=K(Y[te]);return re}function N(Y,K){var te=Y.split("@"),re="";te.length>1&&(re=te[0]+"@",Y=te[1]),Y=Y.replace(C,".");var ge=Y.split("."),ye=W(ge,K).join(".");return re+ye}function L(Y){for(var K=[],te=0,re=Y.length,ge,ye;te<re;)ge=Y.charCodeAt(te++),ge>=55296&&ge<=56319&&te<re?(ye=Y.charCodeAt(te++),(ye&64512)==56320?K.push(((ge&1023)<<10)+(ye&1023)+65536):(K.push(ge),te--)):K.push(ge);return K}function U(Y){return W(Y,function(K){var te="";return K>65535&&(K-=65536,te+=b(K>>>10&1023|55296),K=56320|K&1023),te+=b(K),te}).join("")}function _(Y){return Y-48<10?Y-22:Y-65<26?Y-65:Y-97<26?Y-97:c}function M(Y,K){return Y+22+75*(Y<26)-((K!=0)<<5)}function F(Y,K,te){var re=0;for(Y=te?I(Y/f):Y>>1,Y+=I(Y/K);Y>T*u>>1;re+=c)Y=I(Y/T);return I(re+(T+1)*Y/(Y+p))}function V(Y){var K=[],te=Y.length,re,ge=0,ye=m,Te=g,Oe,We,me,ne,he,de,Me,Ne,Ot;for(Oe=Y.lastIndexOf(y),Oe<0&&(Oe=0),We=0;We<Oe;++We)Y.charCodeAt(We)>=128&&z("not-basic"),K.push(Y.charCodeAt(We));for(me=Oe>0?Oe+1:0;me<te;){for(ne=ge,he=1,de=c;me>=te&&z("invalid-input"),Me=_(Y.charCodeAt(me++)),(Me>=c||Me>I((a-ge)/he))&&z("overflow"),ge+=Me*he,Ne=de<=Te?d:de>=Te+u?u:de-Te,!(Me<Ne);de+=c)Ot=c-Ne,he>I(a/Ot)&&z("overflow"),he*=Ot;re=K.length+1,Te=F(ge-ne,re,ne==0),I(ge/re)>a-ye&&z("overflow"),ye+=I(ge/re),ge%=re,K.splice(ge++,0,ye)}return U(K)}function G(Y){var K,te,re,ge,ye,Te,Oe,We,me,ne,he,de=[],Me,Ne,Ot,st;for(Y=L(Y),Me=Y.length,K=m,te=0,ye=g,Te=0;Te<Me;++Te)he=Y[Te],he<128&&de.push(b(he));for(re=ge=de.length,ge&&de.push(y);re<Me;){for(Oe=a,Te=0;Te<Me;++Te)he=Y[Te],he>=K&&he<Oe&&(Oe=he);for(Ne=re+1,Oe-K>I((a-te)/Ne)&&z("overflow"),te+=(Oe-K)*Ne,K=Oe,Te=0;Te<Me;++Te)if(he=Y[Te],he<K&&++te>a&&z("overflow"),he==K){for(We=te,me=c;ne=me<=ye?d:me>=ye+u?u:me-ye,!(We<ne);me+=c)st=We-ne,Ot=c-ne,de.push(b(M(ne+st%Ot,0))),We=I(st/Ot);de.push(b(M(We,0))),ye=F(te,Ne,re==ge),te=0,++re}++te,++K}return de.join("")}function Z(Y){return N(Y,function(K){return P.test(K)?V(K.slice(4).toLowerCase()):K})}function $(Y){return N(Y,function(K){return S.test(K)?"xn--"+G(K):K})}if(s={version:"1.3.2",ucs2:{decode:L,encode:U},decode:V,encode:G,toASCII:$,toUnicode:Z},n&&o)if(t.exports==n)o.exports=s;else for(x in s)s.hasOwnProperty(x)&&(n[x]=s[x]);else e.punycode=s})(zE)}(Cs,Cs.exports)),Cs.exports}var Ic={exports:{}};/*!
|
|
326
|
+
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};function pE(){return!0}function fE(t,i){i=i??"This object was destroyed, i.e., destroy() was called.";function e(){throw new H(i)}for(const n in t)typeof t[n]=="function"&&(t[n]=e);t.isDestroyed=pE}let An;const He={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},bt={};Object.defineProperties(bt,{element:{get:function(){if(bt.supportsFullscreen())return document[He.fullscreenElement]}},changeEventName:{get:function(){if(bt.supportsFullscreen())return He.fullscreenchange}},errorEventName:{get:function(){if(bt.supportsFullscreen())return He.fullscreenerror}},enabled:{get:function(){if(bt.supportsFullscreen())return document[He.fullscreenEnabled]}},fullscreen:{get:function(){if(bt.supportsFullscreen())return bt.element!==null}}}),bt.supportsFullscreen=function(){if(D(An))return An;An=!1;const t=document.body;if(typeof t.requestFullscreen=="function")return He.requestFullscreen="requestFullscreen",He.exitFullscreen="exitFullscreen",He.fullscreenEnabled="fullscreenEnabled",He.fullscreenElement="fullscreenElement",He.fullscreenchange="fullscreenchange",He.fullscreenerror="fullscreenerror",An=!0,An;const i=["webkit","moz","o","ms","khtml"];let e;for(let n=0,o=i.length;n<o;++n){const r=i[n];e=`${r}RequestFullscreen`,typeof t[e]=="function"?(He.requestFullscreen=e,An=!0):(e=`${r}RequestFullScreen`,typeof t[e]=="function"&&(He.requestFullscreen=e,An=!0)),e=`${r}ExitFullscreen`,typeof document[e]=="function"?He.exitFullscreen=e:(e=`${r}CancelFullScreen`,typeof document[e]=="function"&&(He.exitFullscreen=e)),e=`${r}FullscreenEnabled`,document[e]!==void 0?He.fullscreenEnabled=e:(e=`${r}FullScreenEnabled`,document[e]!==void 0&&(He.fullscreenEnabled=e)),e=`${r}FullscreenElement`,document[e]!==void 0?He.fullscreenElement=e:(e=`${r}FullScreenElement`,document[e]!==void 0&&(He.fullscreenElement=e)),e=`${r}fullscreenchange`,document[`on${e}`]!==void 0&&(r==="ms"&&(e="MSFullscreenChange"),He.fullscreenchange=e),e=`${r}fullscreenerror`,document[`on${e}`]!==void 0&&(r==="ms"&&(e="MSFullscreenError"),He.fullscreenerror=e)}return An},bt.requestFullscreen=function(t,i){bt.supportsFullscreen()&&t[He.requestFullscreen]({vrDisplay:i})},bt.exitFullscreen=function(){bt.supportsFullscreen()&&document[He.exitFullscreen]()},bt._names=He;let ft;typeof navigator<"u"?ft=navigator:ft={};function po(t){const i=t.split(".");for(let e=0,n=i.length;e<n;++e)i[e]=parseInt(i[e],10);return i}let Pc,Iv;function Ld(){if(!D(Pc)&&(Pc=!1,!Tc())){const t=/ Chrome\/([\.0-9]+)/.exec(ft.userAgent);t!==null&&(Pc=!0,Iv=po(t[1]))}return Pc}function gE(){return Ld()&&Iv}let Sc,Dv;function bv(){if(!D(Sc)&&(Sc=!1,!Ld()&&!Tc()&&/ Safari\/[\.0-9]+/.test(ft.userAgent))){const t=/ Version\/([\.0-9]+)/.exec(ft.userAgent);t!==null&&(Sc=!0,Dv=po(t[1]))}return Sc}function mE(){return bv()&&Dv}let Ec,Od;function Rv(){if(!D(Ec)){Ec=!1;const t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(ft.userAgent);t!==null&&(Ec=!0,Od=po(t[1]),Od.isNightly=!!t[2])}return Ec}function vE(){return Rv()&&Od}let ws,Nd;function xv(){if(!D(ws)){ws=!1;let t;ft.appName==="Microsoft Internet Explorer"?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(ft.userAgent),t!==null&&(ws=!0,Nd=po(t[1]))):ft.appName==="Netscape"&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(ft.userAgent),t!==null&&(ws=!0,Nd=po(t[1])))}return ws}function yE(){return xv()&&Nd}let Ac,Fv;function Tc(){if(!D(Ac)){Ac=!1;const t=/ Edg\/([\.0-9]+)/.exec(ft.userAgent);t!==null&&(Ac=!0,Fv=po(t[1]))}return Ac}function wE(){return Tc()&&Fv}let Mc,Vd;function Ic(){if(!D(Mc)){Mc=!1;const t=/Firefox\/([\.0-9]+)/.exec(ft.userAgent);t!==null&&(Mc=!0,Vd=po(t[1]))}return Mc}let Ud;function CE(){return D(Ud)||(Ud=/Windows/i.test(ft.appVersion)),Ud}let Wd;function _E(){return D(Wd)||(Wd=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),Wd}function PE(){return Ic()&&Vd}let Gd;function SE(){return D(Gd)||(Gd=!Ic()&&typeof PointerEvent<"u"&&(!D(ft.pointerEnabled)||ft.pointerEnabled)),Gd}let kv,Dc;function zv(){if(!D(Dc)){const t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const i=t.style.imageRendering;Dc=D(i)&&i!=="",Dc&&(kv=i)}return Dc}function EE(){return zv()?kv:void 0}function gt(){if(!gt.initialized)throw new H("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return gt._result}gt._promise=void 0,gt._result=void 0,gt.initialize=function(){return D(gt._promise)||(gt._promise=new Promise(t=>{const i=new Image;i.onload=function(){gt._result=i.width>0&&i.height>0,t(gt._result)},i.onerror=function(){gt._result=!1,t(gt._result)},i.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),gt._promise},Object.defineProperties(gt,{initialized:{get:function(){return D(gt._result)}}});const cr=[];typeof ArrayBuffer<"u"&&(cr.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&cr.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&cr.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&cr.push(BigInt64Array),typeof BigUint64Array<"u"&&cr.push(BigUint64Array));const ct={isChrome:Ld,chromeVersion:gE,isSafari:bv,safariVersion:mE,isWebkit:Rv,webkitVersion:vE,isInternetExplorer:xv,internetExplorerVersion:yE,isEdge:Tc,edgeVersion:wE,isFirefox:Ic,firefoxVersion:PE,isWindows:CE,isIPadOrIOS:_E,hardwareConcurrency:ft.hardwareConcurrency??3,supportsPointerEvents:SE,supportsImageRenderingPixelated:zv,supportsWebP:gt,imageRenderingValue:EE,typedArrayTypes:cr};ct.supportsBasis=function(t){return ct.supportsWebAssembly()&&t.context.supportsBasis},ct.supportsFullscreen=function(){return bt.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(t){return A.defined("scene",t),t.context.webgl2},ct.supportsEsmWebWorkers=function(){return!Ic()||parseInt(Vd)>=114};function ee(t,i){this.x=t??0,this.y=i??0}ee.fromElements=function(t,i,e){return D(e)?(e.x=t,e.y=i,e):new ee(t,i)},ee.clone=function(t,i){if(D(t))return D(i)?(i.x=t.x,i.y=t.y,i):new ee(t.x,t.y)},ee.fromCartesian3=ee.clone,ee.fromCartesian4=ee.clone,ee.packedLength=2,ee.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t.x,i[e]=t.y,i},ee.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new ee),e.x=t[i++],e.y=t[i],e},ee.packArray=function(t,i){A.defined("array",t);const e=t.length,n=e*2;if(!D(i))i=new Array(n);else{if(!Array.isArray(i)&&i.length!==n)throw new H("If result is a typed array, it must have exactly array.length * 2 elements");i.length!==n&&(i.length=n)}for(let o=0;o<e;++o)ee.pack(t[o],i,o*2);return i},ee.unpackArray=function(t,i){if(A.defined("array",t),A.typeOf.number.greaterThanOrEquals("array.length",t.length,2),t.length%2!==0)throw new H("array length must be a multiple of 2.");const e=t.length;D(i)?i.length=e/2:i=new Array(e/2);for(let n=0;n<e;n+=2){const o=n/2;i[o]=ee.unpack(t,n,i[o])}return i},ee.fromArray=ee.unpack,ee.maximumComponent=function(t){return A.typeOf.object("cartesian",t),Math.max(t.x,t.y)},ee.minimumComponent=function(t){return A.typeOf.object("cartesian",t),Math.min(t.x,t.y)},ee.minimumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.min(t.x,i.x),e.y=Math.min(t.y,i.y),e},ee.maximumByComponent=function(t,i,e){return A.typeOf.object("first",t),A.typeOf.object("second",i),A.typeOf.object("result",e),e.x=Math.max(t.x,i.x),e.y=Math.max(t.y,i.y),e},ee.clamp=function(t,i,e,n){A.typeOf.object("value",t),A.typeOf.object("min",i),A.typeOf.object("max",e),A.typeOf.object("result",n);const o=O.clamp(t.x,i.x,e.x),r=O.clamp(t.y,i.y,e.y);return n.x=o,n.y=r,n},ee.magnitudeSquared=function(t){return A.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y},ee.magnitude=function(t){return Math.sqrt(ee.magnitudeSquared(t))};const bc=new ee;ee.distance=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),ee.subtract(t,i,bc),ee.magnitude(bc)},ee.distanceSquared=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),ee.subtract(t,i,bc),ee.magnitudeSquared(bc)},ee.normalize=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=ee.magnitude(t);if(i.x=t.x/e,i.y=t.y/e,isNaN(i.x)||isNaN(i.y))throw new H("normalized result is not a number");return i},ee.dot=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),t.x*i.x+t.y*i.y},ee.cross=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),t.x*i.y-t.y*i.x},ee.multiplyComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x*i.x,e.y=t.y*i.y,e},ee.divideComponents=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x/i.x,e.y=t.y/i.y,e},ee.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e},ee.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e},ee.multiplyByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e},ee.divideByScalar=function(t,i,e){return A.typeOf.object("cartesian",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e},ee.negate=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i},ee.abs=function(t,i){return A.typeOf.object("cartesian",t),A.typeOf.object("result",i),i.x=Math.abs(t.x),i.y=Math.abs(t.y),i};const Lv=new ee;ee.lerp=function(t,i,e,n){return A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n),ee.multiplyByScalar(i,e,Lv),n=ee.multiplyByScalar(t,1-e,n),ee.add(Lv,n,n)};const Ov=new ee,Nv=new ee;ee.angleBetween=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),ee.normalize(t,Ov),ee.normalize(i,Nv),O.acosClamped(ee.dot(Ov,Nv))};const AE=new ee;ee.mostOrthogonalAxis=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=ee.normalize(t,AE);return ee.abs(e,e),e.x<=e.y?i=ee.clone(ee.UNIT_X,i):i=ee.clone(ee.UNIT_Y,i),i},ee.equals=function(t,i){return t===i||D(t)&&D(i)&&t.x===i.x&&t.y===i.y},ee.equalsArray=function(t,i,e){return t.x===i[e]&&t.y===i[e+1]},ee.equalsEpsilon=function(t,i,e,n){return t===i||D(t)&&D(i)&&O.equalsEpsilon(t.x,i.x,e,n)&&O.equalsEpsilon(t.y,i.y,e,n)},ee.ZERO=Object.freeze(new ee(0,0)),ee.ONE=Object.freeze(new ee(1,1)),ee.UNIT_X=Object.freeze(new ee(1,0)),ee.UNIT_Y=Object.freeze(new ee(0,1)),ee.prototype.clone=function(t){return ee.clone(this,t)},ee.prototype.equals=function(t){return ee.equals(this,t)},ee.prototype.equalsEpsilon=function(t,i,e){return ee.equalsEpsilon(this,t,i,e)},ee.prototype.toString=function(){return`(${this.x}, ${this.y})`};const TE=new k,ME=new k;function Vv(t,i,e,n,o){if(!D(t))throw new H("cartesian is required.");if(!D(i))throw new H("oneOverRadii is required.");if(!D(e))throw new H("oneOverRadiiSquared is required.");if(!D(n))throw new H("centerToleranceSquared is required.");const r=t.x,s=t.y,a=t.z,c=i.x,d=i.y,u=i.z,p=r*r*c*c,f=s*s*d*d,g=a*a*u*u,m=p+f+g,y=Math.sqrt(1/m),P=k.multiplyByScalar(t,y,TE);if(m<n)return isFinite(y)?k.clone(P,o):void 0;const S=e.x,C=e.y,E=e.z,T=ME;T.x=P.x*S*2,T.y=P.y*C*2,T.z=P.z*E*2;let I=(1-y)*k.magnitude(t)/(.5*k.magnitude(T)),b=0,x,z,W,N,L,U,_,M,F,V,G;do{I-=b,W=1/(1+I*S),N=1/(1+I*C),L=1/(1+I*E),U=W*W,_=N*N,M=L*L,F=U*W,V=_*N,G=M*L,x=p*U+f*_+g*M-1,z=p*F*S+f*V*C+g*G*E;const Z=-2*z;b=x/Z}while(Math.abs(x)>O.EPSILON12);return D(o)?(o.x=r*W,o.y=s*N,o.z=a*L,o):new k(r*W,s*N,a*L)}function fe(t,i,e){this.longitude=t??0,this.latitude=i??0,this.height=e??0}fe.fromRadians=function(t,i,e,n){return A.typeOf.number("longitude",t),A.typeOf.number("latitude",i),e=e??0,D(n)?(n.longitude=t,n.latitude=i,n.height=e,n):new fe(t,i,e)},fe.fromDegrees=function(t,i,e,n){return A.typeOf.number("longitude",t),A.typeOf.number("latitude",i),t=O.toRadians(t),i=O.toRadians(i),fe.fromRadians(t,i,e,n)};const IE=new k,DE=new k,bE=new k;fe._ellipsoidOneOverRadii=new k(1/6378137,1/6378137,1/6356752314245179e-9),fe._ellipsoidOneOverRadiiSquared=new k(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),fe._ellipsoidCenterToleranceSquared=O.EPSILON1,fe.fromCartesian=function(t,i,e){const n=D(i)?i.oneOverRadii:fe._ellipsoidOneOverRadii,o=D(i)?i.oneOverRadiiSquared:fe._ellipsoidOneOverRadiiSquared,r=D(i)?i._centerToleranceSquared:fe._ellipsoidCenterToleranceSquared,s=Vv(t,n,o,r,DE);if(!D(s))return;let a=k.multiplyComponents(s,o,IE);a=k.normalize(a,a);const c=k.subtract(t,s,bE),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),p=O.sign(k.dot(c,t))*k.magnitude(c);return D(e)?(e.longitude=d,e.latitude=u,e.height=p,e):new fe(d,u,p)},fe.toCartesian=function(t,i,e){return A.defined("cartographic",t),k.fromRadians(t.longitude,t.latitude,t.height,i,e)},fe.clone=function(t,i){if(D(t))return D(i)?(i.longitude=t.longitude,i.latitude=t.latitude,i.height=t.height,i):new fe(t.longitude,t.latitude,t.height)},fe.equals=function(t,i){return t===i||D(t)&&D(i)&&t.longitude===i.longitude&&t.latitude===i.latitude&&t.height===i.height},fe.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t.longitude-i.longitude)<=e&&Math.abs(t.latitude-i.latitude)<=e&&Math.abs(t.height-i.height)<=e},fe.ZERO=Object.freeze(new fe(0,0,0)),fe.prototype.clone=function(t){return fe.clone(this,t)},fe.prototype.equals=function(t){return fe.equals(this,t)},fe.prototype.equalsEpsilon=function(t,i){return fe.equalsEpsilon(this,t,i)},fe.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};function Uv(t,i,e,n){i=i??0,e=e??0,n=n??0,A.typeOf.number.greaterThanOrEquals("x",i,0),A.typeOf.number.greaterThanOrEquals("y",e,0),A.typeOf.number.greaterThanOrEquals("z",n,0),t._radii=new k(i,e,n),t._radiiSquared=new k(i*i,e*e,n*n),t._radiiToTheFourth=new k(i*i*i*i,e*e*e*e,n*n*n*n),t._oneOverRadii=new k(i===0?0:1/i,e===0?0:1/e,n===0?0:1/n),t._oneOverRadiiSquared=new k(i===0?0:1/(i*i),e===0?0:1/(e*e),n===0?0:1/(n*n)),t._minimumRadius=Math.min(i,e,n),t._maximumRadius=Math.max(i,e,n),t._centerToleranceSquared=O.EPSILON1,t._radiiSquared.z!==0&&(t._squaredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function le(t,i,e){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,Uv(this,t,i,e)}Object.defineProperties(le.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}}}),le.clone=function(t,i){if(!D(t))return;const e=t._radii;return D(i)?(k.clone(e,i._radii),k.clone(t._radiiSquared,i._radiiSquared),k.clone(t._radiiToTheFourth,i._radiiToTheFourth),k.clone(t._oneOverRadii,i._oneOverRadii),k.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new le(e.x,e.y,e.z)},le.fromCartesian3=function(t,i){return D(i)||(i=new le),D(t)&&Uv(i,t.x,t.y,t.z),i},le.WGS84=Object.freeze(new le(6378137,6378137,6356752314245179e-9)),le.UNIT_SPHERE=Object.freeze(new le(1,1,1)),le.MOON=Object.freeze(new le(O.LUNAR_RADIUS,O.LUNAR_RADIUS,O.LUNAR_RADIUS)),le.MARS=Object.freeze(new le(3396190,3396190,3376200)),le._default=le.WGS84,Object.defineProperties(le,{default:{get:function(){return le._default},set:function(t){A.typeOf.object("value",t),le._default=t,k._ellipsoidRadiiSquared=t.radiiSquared,fe._ellipsoidOneOverRadii=t.oneOverRadii,fe._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,fe._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}}}),le.prototype.clone=function(t){return le.clone(this,t)},le.packedLength=k.packedLength,le.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,k.pack(t._radii,i,e),i},le.unpack=function(t,i,e){A.defined("array",t),i=i??0;const n=k.unpack(t,i);return le.fromCartesian3(n,e)},le.prototype.geocentricSurfaceNormal=k.normalize,le.prototype.geodeticSurfaceNormalCartographic=function(t,i){A.typeOf.object("cartographic",t);const e=t.longitude,n=t.latitude,o=Math.cos(n),r=o*Math.cos(e),s=o*Math.sin(e),a=Math.sin(n);return D(i)||(i=new k),i.x=r,i.y=s,i.z=a,k.normalize(i,i)},le.prototype.geodeticSurfaceNormal=function(t,i){if(A.typeOf.object("cartesian",t),isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new H("cartesian has a NaN component");if(!k.equalsEpsilon(t,k.ZERO,O.EPSILON14))return D(i)||(i=new k),i=k.multiplyComponents(t,this._oneOverRadiiSquared,i),k.normalize(i,i)};const RE=new k,xE=new k;le.prototype.cartographicToCartesian=function(t,i){const e=RE,n=xE;this.geodeticSurfaceNormalCartographic(t,e),k.multiplyComponents(this._radiiSquared,e,n);const o=Math.sqrt(k.dot(e,n));return k.divideByScalar(n,o,n),k.multiplyByScalar(e,t.height,e),D(i)||(i=new k),k.add(n,e,i)},le.prototype.cartographicArrayToCartesianArray=function(t,i){A.defined("cartographics",t);const e=t.length;D(i)?i.length=e:i=new Array(e);for(let n=0;n<e;n++)i[n]=this.cartographicToCartesian(t[n],i[n]);return i};const FE=new k,kE=new k,zE=new k;le.prototype.cartesianToCartographic=function(t,i){const e=this.scaleToGeodeticSurface(t,kE);if(!D(e))return;const n=this.geodeticSurfaceNormal(e,FE),o=k.subtract(t,e,zE),r=Math.atan2(n.y,n.x),s=Math.asin(n.z),a=O.sign(k.dot(o,t))*k.magnitude(o);return D(i)?(i.longitude=r,i.latitude=s,i.height=a,i):new fe(r,s,a)},le.prototype.cartesianArrayToCartographicArray=function(t,i){A.defined("cartesians",t);const e=t.length;D(i)?i.length=e:i=new Array(e);for(let n=0;n<e;++n)i[n]=this.cartesianToCartographic(t[n],i[n]);return i},le.prototype.scaleToGeodeticSurface=function(t,i){return Vv(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,i)},le.prototype.scaleToGeocentricSurface=function(t,i){A.typeOf.object("cartesian",t),D(i)||(i=new k);const e=t.x,n=t.y,o=t.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(e*e*r.x+n*n*r.y+o*o*r.z);return k.multiplyByScalar(t,s,i)},le.prototype.transformPositionToScaledSpace=function(t,i){return D(i)||(i=new k),k.multiplyComponents(t,this._oneOverRadii,i)},le.prototype.transformPositionFromScaledSpace=function(t,i){return D(i)||(i=new k),k.multiplyComponents(t,this._radii,i)},le.prototype.equals=function(t){return this===t||D(t)&&k.equals(this._radii,t._radii)},le.prototype.toString=function(){return this._radii.toString()},le.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,e){if(A.typeOf.object("position",t),!O.equalsEpsilon(this._radii.x,this._radii.y,O.EPSILON15))throw new H("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");A.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),i=i??0;const n=this._squaredXOverSquaredZ;if(D(e)||(e=new k),e.x=0,e.y=0,e.z=t.z*(1-n),!(Math.abs(e.z)>=this._radii.z-i))return e};const LE=new k;le.prototype.getLocalCurvature=function(t,i){A.typeOf.object("surfacePosition",t),D(i)||(i=new ee);const e=this.getSurfaceNormalIntersectionWithZAxis(t,0,LE),n=k.distance(t,e),o=this.minimumRadius*n/this.maximumRadius**2,r=n*o**2;return ee.fromElements(1/n,1/r,i)};const OE=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],NE=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Wv(t,i,e){A.typeOf.number("a",t),A.typeOf.number("b",i),A.typeOf.func("func",e);const n=.5*(i+t),o=.5*(i-t);let r=0;for(let s=0;s<5;s++){const a=o*OE[s];r+=NE[s]*(e(n+a)+e(n-a))}return r*=o,r}le.prototype.surfaceArea=function(t){A.typeOf.object("rectangle",t);const i=t.west;let e=t.east;const n=t.south,o=t.north;for(;e<i;)e+=O.TWO_PI;const r=this._radiiSquared,s=r.x,a=r.y,c=r.z,d=s*a;return Wv(n,o,function(u){const p=Math.cos(u),f=Math.sin(u);return Math.cos(u)*Wv(i,e,function(g){const m=Math.cos(g),y=Math.sin(g);return Math.sqrt(d*f*f+c*(a*m*m+s*y*y)*p*p)})})};function Cs(t,i,e){A.defined("array",t),A.defined("itemToFind",i),A.defined("comparator",e);let n=0,o=t.length-1,r,s;for(;n<=o;){if(r=~~((n+o)/2),s=e(t[r],i),s<0){n=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}function Hd(t,i,e,n,o){this.xPoleWander=t,this.yPoleWander=i,this.xPoleOffset=e,this.yPoleOffset=n,this.ut1MinusUtc=o}function qd(t){if(t===null||isNaN(t))throw new H("year is required and must be a number.");return t%4===0&&t%100!==0||t%400===0}const Gv=[31,28,31,30,31,30,31,31,30,31,30,31];function $d(t,i,e,n,o,r,s,a){t=t??1,i=i??1,e=e??1,n=n??0,o=o??0,r=r??0,s=s??0,a=a??!1,y(),P(),this.year=t,this.month=i,this.day=e,this.hour=n,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function y(){A.typeOf.number.greaterThanOrEquals("Year",t,1),A.typeOf.number.lessThanOrEquals("Year",t,9999),A.typeOf.number.greaterThanOrEquals("Month",i,1),A.typeOf.number.lessThanOrEquals("Month",i,12),A.typeOf.number.greaterThanOrEquals("Day",e,1),A.typeOf.number.lessThanOrEquals("Day",e,31),A.typeOf.number.greaterThanOrEquals("Hour",n,0),A.typeOf.number.lessThanOrEquals("Hour",n,23),A.typeOf.number.greaterThanOrEquals("Minute",o,0),A.typeOf.number.lessThanOrEquals("Minute",o,59),A.typeOf.bool("IsLeapSecond",a),A.typeOf.number.greaterThanOrEquals("Second",r,0),A.typeOf.number.lessThanOrEquals("Second",r,a?60:59),A.typeOf.number.greaterThanOrEquals("Millisecond",s,0),A.typeOf.number.lessThan("Millisecond",s,1e3)}function P(){const S=i===2&&qd(t)?Gv[i-1]+1:Gv[i-1];if(e>S)throw new H("Month and Day represents invalid date")}}function De(t,i){this.julianDate=t,this.offset=i}const Ue=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}),ve=Object.freeze({UTC:0,TAI:1}),Hv=new $d,Rc=[31,28,31,30,31,30,31,31,30,31,30,31],xc=29;function Xd(t,i){return J.compare(t.julianDate,i.julianDate)}const hr=new De;function Fc(t){hr.julianDate=t;const i=J.leapSeconds;let e=Cs(i,hr,Xd);e<0&&(e=~e),e>=i.length&&(e=i.length-1);let n=i[e].offset;e>0&&J.secondsDifference(i[e].julianDate,t)>n&&(e--,n=i[e].offset),J.addSeconds(t,n,t)}function qv(t,i){hr.julianDate=t;const e=J.leapSeconds;let n=Cs(e,hr,Xd);if(n<0&&(n=~n),n===0)return J.addSeconds(t,-e[0].offset,i);if(n>=e.length)return J.addSeconds(t,-e[n-1].offset,i);const o=J.secondsDifference(e[n].julianDate,t);if(o===0)return J.addSeconds(t,-e[n].offset,i);if(!(o<=1))return J.addSeconds(t,-e[--n].offset,i)}function Tn(t,i,e){const n=i/Ue.SECONDS_PER_DAY|0;return t+=n,i-=Ue.SECONDS_PER_DAY*n,i<0&&(t--,i+=Ue.SECONDS_PER_DAY),e.dayNumber=t,e.secondsOfDay=i,e}function Yd(t,i,e,n,o,r,s){const a=(i-14)/12|0,c=t+4800+a;let d=(1461*c/4|0)+(367*(i-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+e-32075;n=n-12,n<0&&(n+=24);const u=r+(n*Ue.SECONDS_PER_HOUR+o*Ue.SECONDS_PER_MINUTE+s*Ue.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}const VE=/^(\d{4})$/,UE=/^(\d{4})-(\d{2})$/,WE=/^(\d{4})-?(\d{3})$/,GE=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,HE=/^(\d{4})-?(\d{2})-?(\d{2})$/,Zd=/([Z+\-])?(\d{2})?:?(\d{2})?$/,qE=/^(\d{2})(\.\d+)?/.source+Zd.source,$E=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Zd.source,XE=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Zd.source,hi="Invalid ISO 8601 date.";function J(t,i,e){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,i=i??0,e=e??ve.UTC;const n=t|0;i=i+(t-n)*Ue.SECONDS_PER_DAY,Tn(n,i,this),e===ve.UTC&&Fc(this)}J.fromGregorianDate=function(t,i){if(!(t instanceof $d))throw new H("date must be a valid GregorianDate.");const e=Yd(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return D(i)?(Tn(e[0],e[1],i),Fc(i),i):new J(e[0],e[1],ve.UTC)},J.fromDate=function(t,i){if(!(t instanceof Date)||isNaN(t.getTime()))throw new H("date must be a valid JavaScript Date.");const e=Yd(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return D(i)?(Tn(e[0],e[1],i),Fc(i),i):new J(e[0],e[1],ve.UTC)},J.fromIso8601=function(t,i){if(typeof t!="string")throw new H(hi);t=t.replace(",",".");let e=t.split("T"),n,o=1,r=1,s=0,a=0,c=0,d=0;const u=e[0],p=e[1];let f,g;if(!D(u))throw new H(hi);let m;if(e=u.match(HE),e!==null){if(m=u.split("-").length-1,m>0&&m!==2)throw new H(hi);n=+e[1],o=+e[2],r=+e[3]}else if(e=u.match(UE),e!==null)n=+e[1],o=+e[2];else if(e=u.match(VE),e!==null)n=+e[1];else{let C;if(e=u.match(WE),e!==null){if(n=+e[1],C=+e[2],g=qd(n),C<1||g&&C>366||!g&&C>365)throw new H(hi)}else if(e=u.match(GE),e!==null){n=+e[1];const E=+e[2],T=+e[3]||0;if(m=u.split("-").length-1,m>0&&(!D(e[3])&&m!==1||D(e[3])&&m!==2))throw new H(hi);const I=new Date(Date.UTC(n,0,4));C=E*7+T-I.getUTCDay()-3}else throw new H(hi);f=new Date(Date.UTC(n,0,1)),f.setUTCDate(C),o=f.getUTCMonth()+1,r=f.getUTCDate()}if(g=qd(n),o<1||o>12||r<1||(o!==2||!g)&&r>Rc[o-1]||g&&o===2&&r>xc)throw new H(hi);let y;if(D(p)){if(e=p.match(XE),e!==null){if(m=p.split(":").length-1,m>0&&m!==2&&m!==3)throw new H(hi);s=+e[1],a=+e[2],c=+e[3],d=+(e[4]||0)*1e3,y=5}else if(e=p.match($E),e!==null){if(m=p.split(":").length-1,m>2)throw new H(hi);s=+e[1],a=+e[2],c=+(e[3]||0)*60,y=4}else if(e=p.match(qE),e!==null)s=+e[1],a=+(e[2]||0)*60,y=3;else throw new H(hi);if(a>=60||c>=61||s>24||s===24&&(a>0||c>0||d>0))throw new H(hi);const C=e[y],E=+e[y+1],T=+(e[y+2]||0);switch(C){case"+":s=s-E,a=a-T;break;case"-":s=s+E,a=a+T;break;case"Z":break;default:a=a+new Date(Date.UTC(n,o-1,r,s,a)).getTimezoneOffset();break}}const P=c===60;for(P&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(f=g&&o===2?xc:Rc[o-1];r>f;)r-=f,o++,o>12&&(o-=12,n++),f=g&&o===2?xc:Rc[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,n--),f=g&&o===2?xc:Rc[o-1],r+=f;const S=Yd(n,o,r,s,a,c,d);return D(i)?(Tn(S[0],S[1],i),Fc(i)):i=new J(S[0],S[1],ve.UTC),P&&J.addSeconds(i,1,i),i},J.now=function(t){return J.fromDate(new Date,t)};const kc=new J(0,0,ve.TAI);J.toGregorianDate=function(t,i){if(!D(t))throw new H("julianDate is required.");let e=!1,n=qv(t,kc);D(n)||(J.addSeconds(t,-1,kc),n=qv(kc,kc),e=!0);let o=n.dayNumber;const r=n.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0;const a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;const c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;const d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;const p=d+2-12*s|0,f=100*(a-49)+c+s|0;let g=r/Ue.SECONDS_PER_HOUR|0,m=r-g*Ue.SECONDS_PER_HOUR;const y=m/Ue.SECONDS_PER_MINUTE|0;m=m-y*Ue.SECONDS_PER_MINUTE;let P=m|0;const S=(m-P)/Ue.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),e&&(P+=1),D(i)?(i.year=f,i.month=p,i.day=u,i.hour=g,i.minute=y,i.second=P,i.millisecond=S,i.isLeapSecond=e,i):new $d(f,p,u,g,y,P,S,e)},J.toDate=function(t){if(!D(t))throw new H("julianDate is required.");const i=J.toGregorianDate(t,Hv);let e=i.second;return i.isLeapSecond&&(e-=1),new Date(Date.UTC(i.year,i.month-1,i.day,i.hour,i.minute,e,i.millisecond))},J.toIso8601=function(t,i){if(!D(t))throw new H("julianDate is required.");const e=J.toGregorianDate(t,Hv);let n=e.year,o=e.month,r=e.day,s=e.hour;const a=e.minute,c=e.second,d=e.millisecond;n===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&d===0&&(n=9999,o=12,r=31,s=24);let u;if(!D(i)&&d!==0){const p=d*.01;return u=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`}return!D(i)||i===0?`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(i).replace(".","").slice(0,i),`${n.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)},J.clone=function(t,i){if(D(t))return D(i)?(i.dayNumber=t.dayNumber,i.secondsOfDay=t.secondsOfDay,i):new J(t.dayNumber,t.secondsOfDay,ve.TAI)},J.compare=function(t,i){if(!D(t))throw new H("left is required.");if(!D(i))throw new H("right is required.");const e=t.dayNumber-i.dayNumber;return e!==0?e:t.secondsOfDay-i.secondsOfDay},J.equals=function(t,i){return t===i||D(t)&&D(i)&&t.dayNumber===i.dayNumber&&t.secondsOfDay===i.secondsOfDay},J.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(J.secondsDifference(t,i))<=e},J.totalDays=function(t){if(!D(t))throw new H("julianDate is required.");return t.dayNumber+t.secondsOfDay/Ue.SECONDS_PER_DAY},J.secondsDifference=function(t,i){if(!D(t))throw new H("left is required.");if(!D(i))throw new H("right is required.");return(t.dayNumber-i.dayNumber)*Ue.SECONDS_PER_DAY+(t.secondsOfDay-i.secondsOfDay)},J.daysDifference=function(t,i){if(!D(t))throw new H("left is required.");if(!D(i))throw new H("right is required.");const e=t.dayNumber-i.dayNumber,n=(t.secondsOfDay-i.secondsOfDay)/Ue.SECONDS_PER_DAY;return e+n},J.computeTaiMinusUtc=function(t){hr.julianDate=t;const i=J.leapSeconds;let e=Cs(i,hr,Xd);return e<0&&(e=~e,--e,e<0&&(e=0)),i[e].offset},J.addSeconds=function(t,i,e){if(!D(t))throw new H("julianDate is required.");if(!D(i))throw new H("seconds is required.");if(!D(e))throw new H("result is required.");return Tn(t.dayNumber,t.secondsOfDay+i,e)},J.addMinutes=function(t,i,e){if(!D(t))throw new H("julianDate is required.");if(!D(i))throw new H("minutes is required.");if(!D(e))throw new H("result is required.");const n=t.secondsOfDay+i*Ue.SECONDS_PER_MINUTE;return Tn(t.dayNumber,n,e)},J.addHours=function(t,i,e){if(!D(t))throw new H("julianDate is required.");if(!D(i))throw new H("hours is required.");if(!D(e))throw new H("result is required.");const n=t.secondsOfDay+i*Ue.SECONDS_PER_HOUR;return Tn(t.dayNumber,n,e)},J.addDays=function(t,i,e){if(!D(t))throw new H("julianDate is required.");if(!D(i))throw new H("days is required.");if(!D(e))throw new H("result is required.");const n=t.dayNumber+i;return Tn(n,t.secondsOfDay,e)},J.lessThan=function(t,i){return J.compare(t,i)<0},J.lessThanOrEquals=function(t,i){return J.compare(t,i)<=0},J.greaterThan=function(t,i){return J.compare(t,i)>0},J.greaterThanOrEquals=function(t,i){return J.compare(t,i)>=0},J.prototype.clone=function(t){return J.clone(this,t)},J.prototype.equals=function(t){return J.equals(this,t)},J.prototype.equalsEpsilon=function(t,i){return J.equalsEpsilon(this,t,i)},J.prototype.toString=function(){return J.toIso8601(this)},J.leapSeconds=[new De(new J(2441317,43210,ve.TAI),10),new De(new J(2441499,43211,ve.TAI),11),new De(new J(2441683,43212,ve.TAI),12),new De(new J(2442048,43213,ve.TAI),13),new De(new J(2442413,43214,ve.TAI),14),new De(new J(2442778,43215,ve.TAI),15),new De(new J(2443144,43216,ve.TAI),16),new De(new J(2443509,43217,ve.TAI),17),new De(new J(2443874,43218,ve.TAI),18),new De(new J(2444239,43219,ve.TAI),19),new De(new J(2444786,43220,ve.TAI),20),new De(new J(2445151,43221,ve.TAI),21),new De(new J(2445516,43222,ve.TAI),22),new De(new J(2446247,43223,ve.TAI),23),new De(new J(2447161,43224,ve.TAI),24),new De(new J(2447892,43225,ve.TAI),25),new De(new J(2448257,43226,ve.TAI),26),new De(new J(2448804,43227,ve.TAI),27),new De(new J(2449169,43228,ve.TAI),28),new De(new J(2449534,43229,ve.TAI),29),new De(new J(2450083,43230,ve.TAI),30),new De(new J(2450630,43231,ve.TAI),31),new De(new J(2451179,43232,ve.TAI),32),new De(new J(2453736,43233,ve.TAI),33),new De(new J(2454832,43234,ve.TAI),34),new De(new J(2456109,43235,ve.TAI),35),new De(new J(2457204,43236,ve.TAI),36),new De(new J(2457754,43237,ve.TAI),37)];var zc={exports:{}},_s={exports:{}};/*! https://mths.be/punycode v1.4.0 by @mathias */var YE=_s.exports,$v;function ZE(){return $v||($v=1,(function(t,i){(function(e){var n=i&&!i.nodeType&&i,o=t&&!t.nodeType&&t,r=typeof yv=="object"&&yv;(r.global===r||r.window===r||r.self===r)&&(e=r);var s,a=2147483647,c=36,d=1,u=26,p=38,f=700,g=72,m=128,y="-",P=/^xn--/,S=/[^\x20-\x7E]/,C=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},T=c-d,I=Math.floor,b=String.fromCharCode,x;function z(Y){throw new RangeError(E[Y])}function W(Y,K){for(var te=Y.length,re=[];te--;)re[te]=K(Y[te]);return re}function N(Y,K){var te=Y.split("@"),re="";te.length>1&&(re=te[0]+"@",Y=te[1]),Y=Y.replace(C,".");var ge=Y.split("."),ye=W(ge,K).join(".");return re+ye}function L(Y){for(var K=[],te=0,re=Y.length,ge,ye;te<re;)ge=Y.charCodeAt(te++),ge>=55296&&ge<=56319&&te<re?(ye=Y.charCodeAt(te++),(ye&64512)==56320?K.push(((ge&1023)<<10)+(ye&1023)+65536):(K.push(ge),te--)):K.push(ge);return K}function U(Y){return W(Y,function(K){var te="";return K>65535&&(K-=65536,te+=b(K>>>10&1023|55296),K=56320|K&1023),te+=b(K),te}).join("")}function _(Y){return Y-48<10?Y-22:Y-65<26?Y-65:Y-97<26?Y-97:c}function M(Y,K){return Y+22+75*(Y<26)-((K!=0)<<5)}function F(Y,K,te){var re=0;for(Y=te?I(Y/f):Y>>1,Y+=I(Y/K);Y>T*u>>1;re+=c)Y=I(Y/T);return I(re+(T+1)*Y/(Y+p))}function V(Y){var K=[],te=Y.length,re,ge=0,ye=m,Te=g,Oe,We,me,ne,he,de,Me,Ne,Ot;for(Oe=Y.lastIndexOf(y),Oe<0&&(Oe=0),We=0;We<Oe;++We)Y.charCodeAt(We)>=128&&z("not-basic"),K.push(Y.charCodeAt(We));for(me=Oe>0?Oe+1:0;me<te;){for(ne=ge,he=1,de=c;me>=te&&z("invalid-input"),Me=_(Y.charCodeAt(me++)),(Me>=c||Me>I((a-ge)/he))&&z("overflow"),ge+=Me*he,Ne=de<=Te?d:de>=Te+u?u:de-Te,!(Me<Ne);de+=c)Ot=c-Ne,he>I(a/Ot)&&z("overflow"),he*=Ot;re=K.length+1,Te=F(ge-ne,re,ne==0),I(ge/re)>a-ye&&z("overflow"),ye+=I(ge/re),ge%=re,K.splice(ge++,0,ye)}return U(K)}function G(Y){var K,te,re,ge,ye,Te,Oe,We,me,ne,he,de=[],Me,Ne,Ot,st;for(Y=L(Y),Me=Y.length,K=m,te=0,ye=g,Te=0;Te<Me;++Te)he=Y[Te],he<128&&de.push(b(he));for(re=ge=de.length,ge&&de.push(y);re<Me;){for(Oe=a,Te=0;Te<Me;++Te)he=Y[Te],he>=K&&he<Oe&&(Oe=he);for(Ne=re+1,Oe-K>I((a-te)/Ne)&&z("overflow"),te+=(Oe-K)*Ne,K=Oe,Te=0;Te<Me;++Te)if(he=Y[Te],he<K&&++te>a&&z("overflow"),he==K){for(We=te,me=c;ne=me<=ye?d:me>=ye+u?u:me-ye,!(We<ne);me+=c)st=We-ne,Ot=c-ne,de.push(b(M(ne+st%Ot,0))),We=I(st/Ot);de.push(b(M(We,0))),ye=F(te,Ne,re==ge),te=0,++re}++te,++K}return de.join("")}function Z(Y){return N(Y,function(K){return P.test(K)?V(K.slice(4).toLowerCase()):K})}function $(Y){return N(Y,function(K){return S.test(K)?"xn--"+G(K):K})}if(s={version:"1.3.2",ucs2:{decode:L,encode:U},decode:V,encode:G,toASCII:$,toUnicode:Z},n&&o)if(t.exports==n)o.exports=s;else for(x in s)s.hasOwnProperty(x)&&(n[x]=s[x]);else e.punycode=s})(YE)})(_s,_s.exports)),_s.exports}var Lc={exports:{}};/*!
|
|
327
327
|
* URI.js - Mutating URLs
|
|
328
328
|
* IPv6 Support
|
|
329
329
|
*
|
|
@@ -335,7 +335,7 @@ ${this.stack.toString()}`),t};function X(t,i,e,n,o,r,s,a,c,d,u,p,f,g,m,y){this[0
|
|
|
335
335
|
* Licensed under
|
|
336
336
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
337
337
|
*
|
|
338
|
-
*/var
|
|
338
|
+
*/var QE=Lc.exports,Xv;function KE(){return Xv||(Xv=1,(function(t){(function(i,e){t.exports?t.exports=e():i.IPv6=e(i)})(QE,function(i){var e=i&&i.IPv6;function n(r){var s=r.toLowerCase(),a=s.split(":"),c=a.length,d=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[c-1]===""&&a[c-2]===""&&a.pop(),c=a.length,a[c-1].indexOf(".")!==-1&&(d=7);var u;for(u=0;u<c&&a[u]!=="";u++);if(u<d)for(a.splice(u,1,"0000");a.length<d;)a.splice(u,0,"0000");for(var p,f=0;f<d;f++){p=a[f].split("");for(var g=0;g<3&&(p[0]==="0"&&p.length>1);g++)p.splice(0,1);a[f]=p.join("")}var m=-1,y=0,P=0,S=-1,C=!1;for(f=0;f<d;f++)C?a[f]==="0"?P+=1:(C=!1,P>y&&(m=S,y=P)):a[f]==="0"&&(C=!0,S=f,P=1);P>y&&(m=S,y=P),y>1&&a.splice(m,y,""),c=a.length;var E="";for(a[0]===""&&(E=":"),f=0;f<c&&(E+=a[f],f!==c-1);f++)E+=":";return a[c-1]===""&&(E+=":"),E}function o(){return i.IPv6===this&&(i.IPv6=e),this}return{best:n,noConflict:o}})})(Lc)),Lc.exports}var Oc={exports:{}};/*!
|
|
339
339
|
* URI.js - Mutating URLs
|
|
340
340
|
* Second Level Domain (SLD) Support
|
|
341
341
|
*
|
|
@@ -347,7 +347,7 @@ ${this.stack.toString()}`),t};function X(t,i,e,n,o,r,s,a,c,d,u,p,f,g,m,y){this[0
|
|
|
347
347
|
* Licensed under
|
|
348
348
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
349
349
|
*
|
|
350
|
-
*/var
|
|
350
|
+
*/var JE=Oc.exports,Yv;function BE(){return Yv||(Yv=1,(function(t){(function(i,e){t.exports?t.exports=e():i.SecondLevelDomains=e(i)})(JE,function(i){var e=i&&i.SecondLevelDomains,n={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 r=o.lastIndexOf(".");if(r<=0||r>=o.length-1)return!1;var s=o.lastIndexOf(".",r-1);if(s<=0||s>=r-1)return!1;var a=n.list[o.slice(r+1)];return a?a.indexOf(" "+o.slice(s+1,r)+" ")>=0:!1},is:function(o){var r=o.lastIndexOf(".");if(r<=0||r>=o.length-1)return!1;var s=o.lastIndexOf(".",r-1);if(s>=0)return!1;var a=n.list[o.slice(r+1)];return a?a.indexOf(" "+o.slice(0,r)+" ")>=0:!1},get:function(o){var r=o.lastIndexOf(".");if(r<=0||r>=o.length-1)return null;var s=o.lastIndexOf(".",r-1);if(s<=0||s>=r-1)return null;var a=n.list[o.slice(r+1)];return!a||a.indexOf(" "+o.slice(s+1,r)+" ")<0?null:o.slice(s+1)},noConflict:function(){return i.SecondLevelDomains===this&&(i.SecondLevelDomains=e),this}};return n})})(Oc)),Oc.exports}/*!
|
|
351
351
|
* URI.js - Mutating URLs
|
|
352
352
|
*
|
|
353
353
|
* Version: 1.19.11
|
|
@@ -358,11 +358,11 @@ ${this.stack.toString()}`),t};function X(t,i,e,n,o,r,s,a,c,d,u,p,f,g,m,y){this[0
|
|
|
358
358
|
* Licensed under
|
|
359
359
|
* MIT License http://www.opensource.org/licenses/mit-license
|
|
360
360
|
*
|
|
361
|
-
*/var WE=Mc.exports,Uv;function GE(){return Uv||(Uv=1,function(t){(function(i,e){t.exports?t.exports=e(LE(),NE(),UE()):i.URI=e(i.punycode,i.IPv6,i.SecondLevelDomains,i)})(WE,function(i,e,n,o){var r=o&&o.URI;function s(_,M){var F=arguments.length>=1,V=arguments.length>=2;if(!(this instanceof s))return F?V?new s(_,M):new s(_):new s;if(_===void 0){if(F)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?_=location.href+"":_=""}if(_===null&&F)throw new TypeError("null is not a valid argument for URI");return this.href(_),M!==void 0?this.absoluteTo(M):this}function a(_){return/^[0-9]+$/.test(_)}s.version="1.19.11";var c=s.prototype,d=Object.prototype.hasOwnProperty;function u(_){return _.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function p(_){return _===void 0?"Undefined":String(Object.prototype.toString.call(_)).slice(8,-1)}function f(_){return p(_)==="Array"}function g(_,M){var F={},V,G;if(p(M)==="RegExp")F=null;else if(f(M))for(V=0,G=M.length;V<G;V++)F[M[V]]=!0;else F[M]=!0;for(V=0,G=_.length;V<G;V++){var Z=F&&F[_[V]]!==void 0||!F&&M.test(_[V]);Z&&(_.splice(V,1),G--,V--)}return _}function m(_,M){var F,V;if(f(M)){for(F=0,V=M.length;F<V;F++)if(!m(_,M[F]))return!1;return!0}var G=p(M);for(F=0,V=_.length;F<V;F++)if(G==="RegExp"){if(typeof _[F]=="string"&&_[F].match(M))return!0}else if(_[F]===M)return!0;return!1}function y(_,M){if(!f(_)||!f(M)||_.length!==M.length)return!1;_.sort(),M.sort();for(var F=0,V=_.length;F<V;F++)if(_[F]!==M[F])return!1;return!0}function P(_){var M=/^\/+|\/+$/g;return _.replace(M,"")}s._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:s.preventInvalidHostname,duplicateQueryParameters:s.duplicateQueryParameters,escapeQuerySpace:s.escapeQuerySpace}},s.preventInvalidHostname=!1,s.duplicateQueryParameters=!1,s.escapeQuerySpace=!0,s.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,s.idn_expression=/[^a-z0-9\._-]/i,s.punycode_expression=/(xn--)/i,s.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,s.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*$/,s.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,s.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},s.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,s.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},s.hostProtocols=["http","https"],s.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,s.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"},s.getDomAttribute=function(_){if(!(!_||!_.nodeName)){var M=_.nodeName.toLowerCase();if(!(M==="input"&&_.type!=="image"))return s.domAttributes[M]}};function S(_){return escape(_)}function C(_){return encodeURIComponent(_).replace(/[!'()*]/g,S).replace(/\*/g,"%2A")}s.encode=C,s.decode=decodeURIComponent,s.iso8859=function(){s.encode=escape,s.decode=unescape},s.unicode=function(){s.encode=C,s.decode=decodeURIComponent},s.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"}}}},s.encodeQuery=function(_,M){var F=s.encode(_+"");return M===void 0&&(M=s.escapeQuerySpace),M?F.replace(/%20/g,"+"):F},s.decodeQuery=function(_,M){_+="",M===void 0&&(M=s.escapeQuerySpace);try{return s.decode(M?_.replace(/\+/g,"%20"):_)}catch{return _}};var E={encode:"encode",decode:"decode"},T,I=function(_,M){return function(F){try{return s[M](F+"").replace(s.characters[_][M].expression,function(V){return s.characters[_][M].map[V]})}catch{return F}}};for(T in E)s[T+"PathSegment"]=I("pathname",E[T]),s[T+"UrnPathSegment"]=I("urnpath",E[T]);var b=function(_,M,F){return function(V){var G;F?G=function(K){return s[M](s[F](K))}:G=s[M];for(var Z=(V+"").split(_),$=0,Y=Z.length;$<Y;$++)Z[$]=G(Z[$]);return Z.join(_)}};s.decodePath=b("/","decodePathSegment"),s.decodeUrnPath=b(":","decodeUrnPathSegment"),s.recodePath=b("/","encodePathSegment","decode"),s.recodeUrnPath=b(":","encodeUrnPathSegment","decode"),s.encodeReserved=I("reserved","encode"),s.parse=function(_,M){var F;return M||(M={preventInvalidHostname:s.preventInvalidHostname}),_=_.replace(s.leading_whitespace_expression,""),_=_.replace(s.ascii_tab_whitespace,""),F=_.indexOf("#"),F>-1&&(M.fragment=_.substring(F+1)||null,_=_.substring(0,F)),F=_.indexOf("?"),F>-1&&(M.query=_.substring(F+1)||null,_=_.substring(0,F)),_=_.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),_=_.replace(/^[/\\]{2,}/i,"//"),_.substring(0,2)==="//"?(M.protocol=null,_=_.substring(2),_=s.parseAuthority(_,M)):(F=_.indexOf(":"),F>-1&&(M.protocol=_.substring(0,F)||null,M.protocol&&!M.protocol.match(s.protocol_expression)?M.protocol=void 0:_.substring(F+1,F+3).replace(/\\/g,"/")==="//"?(_=_.substring(F+3),_=s.parseAuthority(_,M)):(_=_.substring(F+1),M.urn=!0))),M.path=_,M},s.parseHost=function(_,M){_||(_=""),_=_.replace(/\\/g,"/");var F=_.indexOf("/"),V,G;if(F===-1&&(F=_.length),_.charAt(0)==="[")V=_.indexOf("]"),M.hostname=_.substring(1,V)||null,M.port=_.substring(V+2,F)||null,M.port==="/"&&(M.port=null);else{var Z=_.indexOf(":"),$=_.indexOf("/"),Y=_.indexOf(":",Z+1);Y!==-1&&($===-1||Y<$)?(M.hostname=_.substring(0,F)||null,M.port=null):(G=_.substring(0,F).split(":"),M.hostname=G[0]||null,M.port=G[1]||null)}return M.hostname&&_.substring(F).charAt(0)!=="/"&&(F++,_="/"+_),M.preventInvalidHostname&&s.ensureValidHostname(M.hostname,M.protocol),M.port&&s.ensureValidPort(M.port),_.substring(F)||"/"},s.parseAuthority=function(_,M){return _=s.parseUserinfo(_,M),s.parseHost(_,M)},s.parseUserinfo=function(_,M){var F=_,V=_.indexOf("\\");V!==-1&&(_=_.replace(/\\/g,"/"));var G=_.indexOf("/"),Z=_.lastIndexOf("@",G>-1?G:_.length-1),$;return Z>-1&&(G===-1||Z<G)?($=_.substring(0,Z).split(":"),M.username=$[0]?s.decode($[0]):null,$.shift(),M.password=$[0]?s.decode($.join(":")):null,_=F.substring(Z+1)):(M.username=null,M.password=null),_},s.parseQuery=function(_,M){if(!_)return{};if(_=_.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!_)return{};for(var F={},V=_.split("&"),G=V.length,Z,$,Y,K=0;K<G;K++)Z=V[K].split("="),$=s.decodeQuery(Z.shift(),M),Y=Z.length?s.decodeQuery(Z.join("="),M):null,$!=="__proto__"&&(d.call(F,$)?((typeof F[$]=="string"||F[$]===null)&&(F[$]=[F[$]]),F[$].push(Y)):F[$]=Y);return F},s.build=function(_){var M="",F=!1;return _.protocol&&(M+=_.protocol+":"),!_.urn&&(M||_.hostname)&&(M+="//",F=!0),M+=s.buildAuthority(_)||"",typeof _.path=="string"&&(_.path.charAt(0)!=="/"&&F&&(M+="/"),M+=_.path),typeof _.query=="string"&&_.query&&(M+="?"+_.query),typeof _.fragment=="string"&&_.fragment&&(M+="#"+_.fragment),M},s.buildHost=function(_){var M="";if(_.hostname)s.ip6_expression.test(_.hostname)?M+="["+_.hostname+"]":M+=_.hostname;else return"";return _.port&&(M+=":"+_.port),M},s.buildAuthority=function(_){return s.buildUserinfo(_)+s.buildHost(_)},s.buildUserinfo=function(_){var M="";return _.username&&(M+=s.encode(_.username)),_.password&&(M+=":"+s.encode(_.password)),M&&(M+="@"),M},s.buildQuery=function(_,M,F){var V="",G,Z,$,Y;for(Z in _)if(Z!=="__proto__"&&d.call(_,Z))if(f(_[Z]))for(G={},$=0,Y=_[Z].length;$<Y;$++)_[Z][$]!==void 0&&G[_[Z][$]+""]===void 0&&(V+="&"+s.buildQueryParameter(Z,_[Z][$],F),M!==!0&&(G[_[Z][$]+""]=!0));else _[Z]!==void 0&&(V+="&"+s.buildQueryParameter(Z,_[Z],F));return V.substring(1)},s.buildQueryParameter=function(_,M,F){return s.encodeQuery(_,F)+(M!==null?"="+s.encodeQuery(M,F):"")},s.addQuery=function(_,M,F){if(typeof M=="object")for(var V in M)d.call(M,V)&&s.addQuery(_,V,M[V]);else if(typeof M=="string"){if(_[M]===void 0){_[M]=F;return}else typeof _[M]=="string"&&(_[M]=[_[M]]);f(F)||(F=[F]),_[M]=(_[M]||[]).concat(F)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},s.setQuery=function(_,M,F){if(typeof M=="object")for(var V in M)d.call(M,V)&&s.setQuery(_,V,M[V]);else if(typeof M=="string")_[M]=F===void 0?null:F;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},s.removeQuery=function(_,M,F){var V,G,Z;if(f(M))for(V=0,G=M.length;V<G;V++)_[M[V]]=void 0;else if(p(M)==="RegExp")for(Z in _)M.test(Z)&&(_[Z]=void 0);else if(typeof M=="object")for(Z in M)d.call(M,Z)&&s.removeQuery(_,Z,M[Z]);else if(typeof M=="string")F!==void 0?p(F)==="RegExp"?!f(_[M])&&F.test(_[M])?_[M]=void 0:_[M]=g(_[M],F):_[M]===String(F)&&(!f(F)||F.length===1)?_[M]=void 0:f(_[M])&&(_[M]=g(_[M],F)):_[M]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},s.hasQuery=function(_,M,F,V){switch(p(M)){case"String":break;case"RegExp":for(var G in _)if(d.call(_,G)&&M.test(G)&&(F===void 0||s.hasQuery(_,G,F)))return!0;return!1;case"Object":for(var Z in M)if(d.call(M,Z)&&!s.hasQuery(_,Z,M[Z]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(p(F)){case"Undefined":return M in _;case"Boolean":var $=!!(f(_[M])?_[M].length:_[M]);return F===$;case"Function":return!!F(_[M],M,_);case"Array":if(!f(_[M]))return!1;var Y=V?m:y;return Y(_[M],F);case"RegExp":return f(_[M])?V?m(_[M],F):!1:!!(_[M]&&_[M].match(F));case"Number":F=String(F);case"String":return f(_[M])?V?m(_[M],F):!1:_[M]===F;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},s.joinPaths=function(){for(var _=[],M=[],F=0,V=0;V<arguments.length;V++){var G=new s(arguments[V]);_.push(G);for(var Z=G.segment(),$=0;$<Z.length;$++)typeof Z[$]=="string"&&M.push(Z[$]),Z[$]&&F++}if(!M.length||!F)return new s("");var Y=new s("").segment(M);return(_[0].path()===""||_[0].path().slice(0,1)==="/")&&Y.path("/"+Y.path()),Y.normalize()},s.commonPath=function(_,M){var F=Math.min(_.length,M.length),V;for(V=0;V<F;V++)if(_.charAt(V)!==M.charAt(V)){V--;break}return V<1?_.charAt(0)===M.charAt(0)&&_.charAt(0)==="/"?"/":"":((_.charAt(V)!=="/"||M.charAt(V)!=="/")&&(V=_.substring(0,V).lastIndexOf("/")),_.substring(0,V+1))},s.withinString=function(_,M,F){F||(F={});var V=F.start||s.findUri.start,G=F.end||s.findUri.end,Z=F.trim||s.findUri.trim,$=F.parens||s.findUri.parens,Y=/[a-z0-9-]=["']?$/i;for(V.lastIndex=0;;){var K=V.exec(_);if(!K)break;var te=K.index;if(F.ignoreHtml){var re=_.slice(Math.max(te-3,0),te);if(re&&Y.test(re))continue}for(var ge=te+_.slice(te).search(G),ye=_.slice(te,ge),Te=-1;;){var Oe=$.exec(ye);if(!Oe)break;var We=Oe.index+Oe[0].length;Te=Math.max(Te,We)}if(Te>-1?ye=ye.slice(0,Te)+ye.slice(Te).replace(Z,""):ye=ye.replace(Z,""),!(ye.length<=K[0].length)&&!(F.ignore&&F.ignore.test(ye))){ge=te+ye.length;var me=M(ye,te,ge,_);if(me===void 0){V.lastIndex=ge;continue}me=String(me),_=_.slice(0,te)+me+_.slice(ge),V.lastIndex=te+me.length}}return V.lastIndex=0,_},s.ensureValidHostname=function(_,M){var F=!!_,V=!!M,G=!1;if(V&&(G=m(s.hostProtocols,M)),G&&!F)throw new TypeError("Hostname cannot be empty, if protocol is "+M);if(_&&_.match(s.invalid_hostname_characters)){if(!i)throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(i.toASCII(_).match(s.invalid_hostname_characters))throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-:_]')}},s.ensureValidPort=function(_){if(_){var M=Number(_);if(!(a(M)&&M>0&&M<65536))throw new TypeError('Port "'+_+'" is not a valid port')}},s.noConflict=function(_){if(_){var M={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(M.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(M.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(M.SecondLevelDomains=o.SecondLevelDomains.noConflict()),M}else o.URI===this&&(o.URI=r);return this},c.build=function(_){return _===!0?this._deferred_build=!0:(_===void 0||this._deferred_build)&&(this._string=s.build(this._parts),this._deferred_build=!1),this},c.clone=function(){return new s(this)},c.valueOf=c.toString=function(){return this.build(!1)._string};function x(_){return function(M,F){return M===void 0?this._parts[_]||"":(this._parts[_]=M||null,this.build(!F),this)}}function z(_,M){return function(F,V){return F===void 0?this._parts[_]||"":(F!==null&&(F=F+"",F.charAt(0)===M&&(F=F.substring(1))),this._parts[_]=F,this.build(!V),this)}}c.protocol=x("protocol"),c.username=x("username"),c.password=x("password"),c.hostname=x("hostname"),c.port=x("port"),c.query=z("query","?"),c.fragment=z("fragment","#"),c.search=function(_,M){var F=this.query(_,M);return typeof F=="string"&&F.length?"?"+F:F},c.hash=function(_,M){var F=this.fragment(_,M);return typeof F=="string"&&F.length?"#"+F:F},c.pathname=function(_,M){if(_===void 0||_===!0){var F=this._parts.path||(this._parts.hostname?"/":"");return _?(this._parts.urn?s.decodeUrnPath:s.decodePath)(F):F}else return this._parts.urn?this._parts.path=_?s.recodeUrnPath(_):"":this._parts.path=_?s.recodePath(_):"/",this.build(!M),this},c.path=c.pathname,c.href=function(_,M){var F;if(_===void 0)return this.toString();this._string="",this._parts=s._parts();var V=_ instanceof s,G=typeof _=="object"&&(_.hostname||_.path||_.pathname);if(_.nodeName){var Z=s.getDomAttribute(_);_=_[Z]||"",G=!1}if(!V&&G&&_.pathname!==void 0&&(_=_.toString()),typeof _=="string"||_ instanceof String)this._parts=s.parse(String(_),this._parts);else if(V||G){var $=V?_._parts:_;for(F in $)F!=="query"&&d.call(this._parts,F)&&(this._parts[F]=$[F]);$.query&&this.query($.query,!1)}else throw new TypeError("invalid input");return this.build(!M),this},c.is=function(_){var M=!1,F=!1,V=!1,G=!1,Z=!1,$=!1,Y=!1,K=!this._parts.urn;switch(this._parts.hostname&&(K=!1,F=s.ip4_expression.test(this._parts.hostname),V=s.ip6_expression.test(this._parts.hostname),M=F||V,G=!M,Z=G&&n&&n.has(this._parts.hostname),$=G&&s.idn_expression.test(this._parts.hostname),Y=G&&s.punycode_expression.test(this._parts.hostname)),_.toLowerCase()){case"relative":return K;case"absolute":return!K;case"domain":case"name":return G;case"sld":return Z;case"ip":return M;case"ip4":case"ipv4":case"inet4":return F;case"ip6":case"ipv6":case"inet6":return V;case"idn":return $;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return Y}return null};var W=c.protocol,N=c.port,L=c.hostname;c.protocol=function(_,M){if(_&&(_=_.replace(/:(\/\/)?$/,""),!_.match(s.protocol_expression)))throw new TypeError('Protocol "'+_+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return W.call(this,_,M)},c.scheme=c.protocol,c.port=function(_,M){return this._parts.urn?_===void 0?"":this:(_!==void 0&&(_===0&&(_=null),_&&(_+="",_.charAt(0)===":"&&(_=_.substring(1)),s.ensureValidPort(_))),N.call(this,_,M))},c.hostname=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_!==void 0){var F={preventInvalidHostname:this._parts.preventInvalidHostname},V=s.parseHost(_,F);if(V!=="/")throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-]');_=F.hostname,this._parts.preventInvalidHostname&&s.ensureValidHostname(_,this._parts.protocol)}return L.call(this,_,M)},c.origin=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0){var F=this.protocol(),V=this.authority();return V?(F?F+"://":"")+this.authority():""}else{var G=s(_);return this.protocol(G.protocol()).authority(G.authority()).build(!M),this}},c.host=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0)return this._parts.hostname?s.buildHost(this._parts):"";var F=s.parseHost(_,this._parts);if(F!=="/")throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-]');return this.build(!M),this},c.authority=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0)return this._parts.hostname?s.buildAuthority(this._parts):"";var F=s.parseAuthority(_,this._parts);if(F!=="/")throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-]');return this.build(!M),this},c.userinfo=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0){var F=s.buildUserinfo(this._parts);return F&&F.substring(0,F.length-1)}else return _[_.length-1]!=="@"&&(_+="@"),s.parseUserinfo(_,this._parts),this.build(!M),this},c.resource=function(_,M){var F;return _===void 0?this.path()+this.search()+this.hash():(F=s.parse(_),this._parts.path=F.path,this._parts.query=F.query,this._parts.fragment=F.fragment,this.build(!M),this)},c.subdomain=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0){if(!this._parts.hostname||this.is("IP"))return"";var F=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,F)||""}else{var V=this._parts.hostname.length-this.domain().length,G=this._parts.hostname.substring(0,V),Z=new RegExp("^"+u(G));if(_&&_.charAt(_.length-1)!=="."&&(_+="."),_.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return _&&s.ensureValidHostname(_,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(Z,_),this.build(!M),this}},c.domain=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(typeof _=="boolean"&&(M=_,_=void 0),_===void 0){if(!this._parts.hostname||this.is("IP"))return"";var F=this._parts.hostname.match(/\./g);if(F&&F.length<2)return this._parts.hostname;var V=this._parts.hostname.length-this.tld(M).length-1;return V=this._parts.hostname.lastIndexOf(".",V-1)+1,this._parts.hostname.substring(V)||""}else{if(!_)throw new TypeError("cannot set domain empty");if(_.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(s.ensureValidHostname(_,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=_;else{var G=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(G,_)}return this.build(!M),this}},c.tld=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(typeof _=="boolean"&&(M=_,_=void 0),_===void 0){if(!this._parts.hostname||this.is("IP"))return"";var F=this._parts.hostname.lastIndexOf("."),V=this._parts.hostname.substring(F+1);return M!==!0&&n&&n.list[V.toLowerCase()]&&n.get(this._parts.hostname)||V}else{var G;if(_)if(_.match(/[^a-zA-Z0-9-]/))if(n&&n.is(_))G=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(G,_);else throw new TypeError('TLD "'+_+'" 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");G=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(G,_)}else throw new TypeError("cannot set TLD empty");return this.build(!M),this}},c.directory=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0||_===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var F=this._parts.path.length-this.filename().length-1,V=this._parts.path.substring(0,F)||(this._parts.hostname?"/":"");return _?s.decodePath(V):V}else{var G=this._parts.path.length-this.filename().length,Z=this._parts.path.substring(0,G),$=new RegExp("^"+u(Z));return this.is("relative")||(_||(_="/"),_.charAt(0)!=="/"&&(_="/"+_)),_&&_.charAt(_.length-1)!=="/"&&(_+="/"),_=s.recodePath(_),this._parts.path=this._parts.path.replace($,_),this.build(!M),this}},c.filename=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(typeof _!="string"){if(!this._parts.path||this._parts.path==="/")return"";var F=this._parts.path.lastIndexOf("/"),V=this._parts.path.substring(F+1);return _?s.decodePathSegment(V):V}else{var G=!1;_.charAt(0)==="/"&&(_=_.substring(1)),_.match(/\.?\//)&&(G=!0);var Z=new RegExp(u(this.filename())+"$");return _=s.recodePath(_),this._parts.path=this._parts.path.replace(Z,_),G?this.normalizePath(M):this.build(!M),this}},c.suffix=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0||_===!0){if(!this._parts.path||this._parts.path==="/")return"";var F=this.filename(),V=F.lastIndexOf("."),G,Z;return V===-1?"":(G=F.substring(V+1),Z=/^[a-z0-9%]+$/i.test(G)?G:"",_?s.decodePathSegment(Z):Z)}else{_.charAt(0)==="."&&(_=_.substring(1));var $=this.suffix(),Y;if($)_?Y=new RegExp(u($)+"$"):Y=new RegExp(u("."+$)+"$");else{if(!_)return this;this._parts.path+="."+s.recodePath(_)}return Y&&(_=s.recodePath(_),this._parts.path=this._parts.path.replace(Y,_)),this.build(!M),this}},c.segment=function(_,M,F){var V=this._parts.urn?":":"/",G=this.path(),Z=G.substring(0,1)==="/",$=G.split(V);if(_!==void 0&&typeof _!="number"&&(F=M,M=_,_=void 0),_!==void 0&&typeof _!="number")throw new Error('Bad segment "'+_+'", must be 0-based integer');if(Z&&$.shift(),_<0&&(_=Math.max($.length+_,0)),M===void 0)return _===void 0?$:$[_];if(_===null||$[_]===void 0)if(f(M)){$=[];for(var Y=0,K=M.length;Y<K;Y++)!M[Y].length&&(!$.length||!$[$.length-1].length)||($.length&&!$[$.length-1].length&&$.pop(),$.push(P(M[Y])))}else(M||typeof M=="string")&&(M=P(M),$[$.length-1]===""?$[$.length-1]=M:$.push(M));else M?$[_]=P(M):$.splice(_,1);return Z&&$.unshift(""),this.path($.join(V),F)},c.segmentCoded=function(_,M,F){var V,G,Z;if(typeof _!="number"&&(F=M,M=_,_=void 0),M===void 0){if(V=this.segment(_,M,F),!f(V))V=V!==void 0?s.decode(V):void 0;else for(G=0,Z=V.length;G<Z;G++)V[G]=s.decode(V[G]);return V}if(!f(M))M=typeof M=="string"||M instanceof String?s.encode(M):M;else for(G=0,Z=M.length;G<Z;G++)M[G]=s.encode(M[G]);return this.segment(_,M,F)};var U=c.query;return c.query=function(_,M){if(_===!0)return s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof _=="function"){var F=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace),V=_.call(this,F);return this._parts.query=s.buildQuery(V||F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!M),this}else return _!==void 0&&typeof _!="string"?(this._parts.query=s.buildQuery(_,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!M),this):U.call(this,_,M)},c.setQuery=function(_,M,F){var V=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof _=="string"||_ instanceof String)V[_]=M!==void 0?M:null;else if(typeof _=="object")for(var G in _)d.call(_,G)&&(V[G]=_[G]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=s.buildQuery(V,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof _!="string"&&(F=M),this.build(!F),this},c.addQuery=function(_,M,F){var V=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.addQuery(V,_,M===void 0?null:M),this._parts.query=s.buildQuery(V,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof _!="string"&&(F=M),this.build(!F),this},c.removeQuery=function(_,M,F){var V=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.removeQuery(V,_,M),this._parts.query=s.buildQuery(V,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof _!="string"&&(F=M),this.build(!F),this},c.hasQuery=function(_,M,F){var V=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.hasQuery(V,_,M,F)},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(_){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!_)),this},c.normalizeHostname=function(_){return this._parts.hostname&&(this.is("IDN")&&i?this._parts.hostname=i.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!_)),this},c.normalizePort=function(_){return typeof this._parts.protocol=="string"&&this._parts.port===s.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!_)),this},c.normalizePath=function(_){var M=this._parts.path;if(!M)return this;if(this._parts.urn)return this._parts.path=s.recodeUrnPath(this._parts.path),this.build(!_),this;if(this._parts.path==="/")return this;M=s.recodePath(M);var F,V="",G,Z;for(M.charAt(0)!=="/"&&(F=!0,M="/"+M),(M.slice(-3)==="/.."||M.slice(-2)==="/.")&&(M+="/"),M=M.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),F&&(V=M.substring(1).match(/^(\.\.\/)+/)||"",V&&(V=V[0]));G=M.search(/\/\.\.(\/|$)/),G!==-1;){if(G===0){M=M.substring(3);continue}Z=M.substring(0,G).lastIndexOf("/"),Z===-1&&(Z=G),M=M.substring(0,Z)+M.substring(G+3)}return F&&this.is("relative")&&(M=V+M.substring(1)),this._parts.path=M,this.build(!_),this},c.normalizePathname=c.normalizePath,c.normalizeQuery=function(_){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(s.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!_)),this},c.normalizeFragment=function(_){return this._parts.fragment||(this._parts.fragment=null,this.build(!_)),this},c.normalizeSearch=c.normalizeQuery,c.normalizeHash=c.normalizeFragment,c.iso8859=function(){var _=s.encode,M=s.decode;s.encode=escape,s.decode=decodeURIComponent;try{this.normalize()}finally{s.encode=_,s.decode=M}return this},c.unicode=function(){var _=s.encode,M=s.decode;s.encode=C,s.decode=unescape;try{this.normalize()}finally{s.encode=_,s.decode=M}return this},c.readable=function(){var _=this.clone();_.username("").password("").normalize();var M="";if(_._parts.protocol&&(M+=_._parts.protocol+"://"),_._parts.hostname&&(_.is("punycode")&&i?(M+=i.toUnicode(_._parts.hostname),_._parts.port&&(M+=":"+_._parts.port)):M+=_.host()),_._parts.hostname&&_._parts.path&&_._parts.path.charAt(0)!=="/"&&(M+="/"),M+=_.path(!0),_._parts.query){for(var F="",V=0,G=_._parts.query.split("&"),Z=G.length;V<Z;V++){var $=(G[V]||"").split("=");F+="&"+s.decodeQuery($[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),$[1]!==void 0&&(F+="="+s.decodeQuery($[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}M+="?"+F.substring(1)}return M+=s.decodeQuery(_.hash(),!0),M},c.absoluteTo=function(_){var M=this.clone(),F=["protocol","username","password","hostname","port"],V,G,Z;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(_ instanceof s||(_=new s(_)),M._parts.protocol||(M._parts.protocol=_._parts.protocol,this._parts.hostname))return M;for(G=0;Z=F[G];G++)M._parts[Z]=_._parts[Z];return M._parts.path?(M._parts.path.substring(-2)===".."&&(M._parts.path+="/"),M.path().charAt(0)!=="/"&&(V=_.directory(),V=V||(_.path().indexOf("/")===0?"/":""),M._parts.path=(V?V+"/":"")+M._parts.path,M.normalizePath())):(M._parts.path=_._parts.path,M._parts.query||(M._parts.query=_._parts.query)),M.build(),M},c.relativeTo=function(_){var M=this.clone().normalize(),F,V,G,Z,$;if(M._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(_=new s(_).normalize(),F=M._parts,V=_._parts,Z=M.path(),$=_.path(),Z.charAt(0)!=="/")throw new Error("URI is already relative");if($.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(F.protocol===V.protocol&&(F.protocol=null),F.username!==V.username||F.password!==V.password||F.protocol!==null||F.username!==null||F.password!==null)return M.build();if(F.hostname===V.hostname&&F.port===V.port)F.hostname=null,F.port=null;else return M.build();if(Z===$)return F.path="",M.build();if(G=s.commonPath(Z,$),!G)return M.build();var Y=V.path.substring(G.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return F.path=Y+F.path.substring(G.length)||"./",M.build()},c.equals=function(_){var M=this.clone(),F=new s(_),V={},G={},Z={},$,Y,K;if(M.normalize(),F.normalize(),M.toString()===F.toString())return!0;if($=M.query(),Y=F.query(),M.query(""),F.query(""),M.toString()!==F.toString()||$.length!==Y.length)return!1;V=s.parseQuery($,this._parts.escapeQuerySpace),G=s.parseQuery(Y,this._parts.escapeQuerySpace);for(K in V)if(d.call(V,K)){if(f(V[K])){if(!y(V[K],G[K]))return!1}else if(V[K]!==G[K])return!1;Z[K]=!0}for(K in G)if(d.call(G,K)&&!Z[K])return!1;return!0},c.preventInvalidHostname=function(_){return this._parts.preventInvalidHostname=!!_,this},c.duplicateQueryParameters=function(_){return this._parts.duplicateQueryParameters=!!_,this},c.escapeQuerySpace=function(_){return this._parts.escapeQuerySpace=!!_,this},s})}(Mc)),Mc.exports}var HE=GE();const qi=mc(HE);function qE(t){return(t.length===0||t[t.length-1]!=="/")&&(t=`${t}/`),t}function hr(t,i){if(t===null||typeof t!="object")return t;i=i??!1;const e=new t.constructor;for(const n in t)if(t.hasOwnProperty(n)){let o=t[n];i&&(o=hr(o,i)),e[n]=o}return e}function Tn(t,i,e){e=e??!1;const n={},o=D(t),r=D(i);let s,a,c;if(o)for(s in t)t.hasOwnProperty(s)&&(a=t[s],r&&e&&typeof a=="object"&&i.hasOwnProperty(s)?(c=i[s],typeof c=="object"?n[s]=Tn(a,c,e):n[s]=a):n[s]=a);if(r)for(s in i)i.hasOwnProperty(s)&&!n.hasOwnProperty(s)&&(c=i[s],n[s]=c);return n}function _s(){let t,i;const e=new Promise(function(n,o){t=n,i=o});return{resolve:t,reject:i,promise:e}}function Ps(t,i){let e;return typeof document<"u"&&(e=document),Ps._implementation(t,i,e)}Ps._implementation=function(t,i,e){if(!D(t))throw new H("relative uri is required.");if(!D(i)){if(typeof e>"u")return t;i=e.baseURI??e.location.href}const n=new qi(t);return n.scheme()!==""?n.toString():n.absoluteTo(i).toString()};function $E(t,i){if(!D(t))throw new H("uri is required.");let e="";const n=t.lastIndexOf("/");return n!==-1&&(e=t.substring(0,n+1)),i&&(t=new qi(t),t.query().length!==0&&(e+=`?${t.query()}`),t.fragment().length!==0&&(e+=`#${t.fragment()}`)),e}function XE(t){if(!D(t))throw new H("uri is required.");const i=new qi(t);i.normalize();let e=i.path(),n=e.lastIndexOf("/");return n!==-1&&(e=e.substr(n+1)),n=e.lastIndexOf("."),n===-1?e="":e=e.substr(n+1),e}const Wv={};function Gv(t,i,e){D(i)||(i=t.width),D(e)||(e=t.height);let n=Wv[i];D(n)||(n={},Wv[i]=n);let o=n[e];if(!D(o)){const r=document.createElement("canvas");r.width=i,r.height=e,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",n[e]=o}return o.drawImage(t,0,0,i,e),o.getImageData(0,0,i,e).data}const YE=/^blob:/i;function Hv(t){return A.typeOf.string("uri",t),YE.test(t)}let Pi;function Gd(t){D(Pi)||(Pi=document.createElement("a")),Pi.href=window.location.href;const i=Pi.host,e=Pi.protocol;return Pi.href=t,Pi.href=Pi.href,e!==Pi.protocol||i!==Pi.host}const ZE=/^data:/i;function qv(t){return A.typeOf.string("uri",t),ZE.test(t)}function QE(t){const i=document.createElement("script");return i.async=!0,i.src=t,new Promise((e,n)=>{window.crossOriginIsolated&&i.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,o.removeChild(i),e()},i.onerror=function(r){n(r)},o.appendChild(i)})}function KE(t){if(!D(t))throw new H("obj is required.");let i="";for(const e in t)if(t.hasOwnProperty(e)){const n=t[e],o=`${encodeURIComponent(e)}=`;if(Array.isArray(n))for(let r=0,s=n.length;r<s;++r)i+=`${o+encodeURIComponent(n[r])}&`;else i+=`${o+encodeURIComponent(n)}&`}return i=i.slice(0,-1),i}function JE(t){if(!D(t))throw new H("queryString is required.");const i={};if(t==="")return i;const e=t.replace(/\+/g,"%20").split(/[&;]/);for(let n=0,o=e.length;n<o;++n){const r=e[n].split("="),s=decodeURIComponent(r[0]);let a=r[1];D(a)?a=decodeURIComponent(a):a="";const c=i[s];typeof c=="string"?i[s]=[c,a]:Array.isArray(c)?c.push(a):i[s]=a}return i}const Xe=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),BE=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function bc(t){t=t??_i.EMPTY_OBJECT;const i=t.throttleByServer??!1,e=t.throttle??!1;this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=t.priority??0,this.throttle=e,this.throttleByServer=i,this.type=t.type??BE.OTHER,this.serverKey=t.serverKey,this.state=Xe.UNISSUED,this.deferred=void 0,this.cancelled=!1}bc.prototype.cancel=function(){this.cancelled=!0},bc.prototype.clone=function(t){return D(t)?(t.url=this.url,t.requestFunction=this.requestFunction,t.cancelFunction=this.cancelFunction,t.priorityFunction=this.priorityFunction,t.priority=this.priority,t.throttle=this.throttle,t.throttleByServer=this.throttleByServer,t.type=this.type,t.serverKey=this.serverKey,t.state=Xe.UNISSUED,t.deferred=void 0,t.cancelled=!1,t):new bc(this)};function jE(t){const i={};if(!t)return i;const e=t.split(`\r
|
|
362
|
-
`);for(let n=0;n<e.length;++n){const o=e[n],r=o.indexOf(": ");if(r>0){const s=o.substring(0,r),a=o.substring(r+2);i[s]=a}}return i}function Ss(t,i,e){this.statusCode=t,this.response=i,this.responseHeaders=e,typeof this.responseHeaders=="string"&&(this.responseHeaders=jE(this.responseHeaders))}Ss.prototype.toString=function(){let t="Request has failed.";return D(this.statusCode)&&(t+=` Status Code: ${this.statusCode}`),t};function dr(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(dr.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),dr.prototype.addEventListener=function(t,i){A.typeOf.func("listener",t),this._listeners.push(t),this._scopes.push(i);const e=this;return function(){e.removeEventListener(t,i)}},dr.prototype.removeEventListener=function(t,i){A.typeOf.func("listener",t);const e=this._listeners,n=this._scopes;let o=-1;for(let r=0;r<e.length;r++)if(e[r]===t&&n[r]===i){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),e[o]=void 0,n[o]=void 0):(e.splice(o,1),n.splice(o,1)),!0):!1};function eA(t,i){return i-t}dr.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let t;const i=this._listeners,e=this._scopes;let n=i.length;for(t=0;t<n;t++){const r=i[t];D(r)&&i[t].apply(e[t],arguments)}const o=this._toRemove;if(n=o.length,n>0){for(o.sort(eA),t=0;t<n;t++){const r=o[t];i.splice(r,1),e.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};function po(t){A.typeOf.object("options",t),A.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(po.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){A.typeOf.number.greaterThanOrEquals("maximumLength",t,0);const i=this._length;if(t<i){const e=this._array;for(let n=t;n<i;++n)e[n]=void 0;this._length=t,e.length=t}this._maximumLength=t}},comparator:{get:function(){return this._comparator}}});function Hd(t,i,e){const n=t[i];t[i]=t[e],t[e]=n}po.prototype.reserve=function(t){t=t??this._length,this._array.length=t},po.prototype.heapify=function(t){t=t??0;const i=this._length,e=this._comparator,n=this._array;let o=-1,r=!0;for(;r;){const s=2*(t+1),a=s-1;a<i&&e(n[a],n[t])<0?o=a:o=t,s<i&&e(n[s],n[o])<0&&(o=s),o!==t?(Hd(n,o,t),t=o):r=!1}},po.prototype.resort=function(){const t=this._length;for(let i=Math.ceil(t/2);i>=0;--i)this.heapify(i)},po.prototype.insert=function(t){A.defined("element",t);const i=this._array,e=this._comparator,n=this._maximumLength;let o=this._length++;for(o<i.length?i[o]=t:i.push(t);o!==0;){const s=Math.floor((o-1)/2);if(e(i[o],i[s])<0)Hd(i,o,s),o=s;else break}let r;return D(n)&&this._length>n&&(r=i[n],this._length=n),r},po.prototype.pop=function(t){if(t=t??0,this._length===0)return;A.typeOf.number.lessThan("index",t,this._length);const i=this._array,e=i[t];return Hd(i,t,--this._length),this.heapify(t),i[this._length]=void 0,e};function tA(t,i){return t.priority-i.priority}const Se={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let ur=20;const ft=new po({comparator:tA});ft.maximumLength=ur,ft.reserve(ur);const Si=[];let $i={};const iA=typeof document<"u"?new qi(document.location.href):new qi,Rc=new dr;function xe(){}xe.maximumRequests=50,xe.maximumRequestsPerServer=18,xe.requestsByServer={},xe.throttleRequests=!0,xe.debugShowStatistics=!1,xe.requestCompletedEvent=Rc,Object.defineProperties(xe,{statistics:{get:function(){return Se}},priorityHeapLength:{get:function(){return ur},set:function(t){if(t<ur)for(;ft.length>t;){const i=ft.pop();fo(i)}ur=t,ft.maximumLength=t,ft.reserve(t)}}});function $v(t){D(t.priorityFunction)&&(t.priority=t.priorityFunction())}xe.serverHasOpenSlots=function(t,i){i=i??1;const e=xe.requestsByServer[t]??xe.maximumRequestsPerServer;return $i[t]+i<=e},xe.heapHasOpenSlots=function(t){return ft.length+t<=ur};function Xv(t){return t.state===Xe.UNISSUED&&(t.state=Xe.ISSUED,t.deferred=_s()),t.deferred.promise}function nA(t){return function(i){if(t.state===Xe.CANCELLED)return;const e=t.deferred;--Se.numberOfActiveRequests,--$i[t.serverKey],Rc.raiseEvent(),t.state=Xe.RECEIVED,t.deferred=void 0,e.resolve(i)}}function oA(t){return function(i){t.state!==Xe.CANCELLED&&(++Se.numberOfFailedRequests,--Se.numberOfActiveRequests,--$i[t.serverKey],Rc.raiseEvent(i),t.state=Xe.FAILED,t.deferred.reject(i))}}function Yv(t){const i=Xv(t);return t.state=Xe.ACTIVE,Si.push(t),++Se.numberOfActiveRequests,++Se.numberOfActiveRequestsEver,++$i[t.serverKey],t.requestFunction().then(nA(t)).catch(oA(t)),i}function fo(t){const i=t.state===Xe.ACTIVE;if(t.state=Xe.CANCELLED,++Se.numberOfCancelledRequests,D(t.deferred)){const e=t.deferred;t.deferred=void 0,e.reject()}i&&(--Se.numberOfActiveRequests,--$i[t.serverKey],++Se.numberOfCancelledActiveRequests),D(t.cancelFunction)&&t.cancelFunction()}xe.update=function(){let t,i,e=0;const n=Si.length;for(t=0;t<n;++t){if(i=Si[t],i.cancelled&&fo(i),i.state!==Xe.ACTIVE){++e;continue}e>0&&(Si[t-e]=i)}Si.length-=e;const o=ft.internalArray,r=ft.length;for(t=0;t<r;++t)$v(o[t]);ft.resort();const s=Math.max(xe.maximumRequests-Si.length,0);let a=0;for(;a<s&&ft.length>0;){if(i=ft.pop(),i.cancelled){fo(i);continue}if(i.throttleByServer&&!xe.serverHasOpenSlots(i.serverKey)){fo(i);continue}Yv(i),++a}rA()},xe.getServerKey=function(t){A.typeOf.string("url",t);let i=new qi(t);i.scheme()===""&&(i=i.absoluteTo(iA),i.normalize());let e=i.authority();/:/.test(e)||(e=`${e}:${i.scheme()==="https"?"443":"80"}`);const n=$i[e];return D(n)||($i[e]=0),e},xe.request=function(t){if(A.typeOf.object("request",t),A.typeOf.string("request.url",t.url),A.typeOf.func("request.requestFunction",t.requestFunction),qv(t.url)||Hv(t.url))return Rc.raiseEvent(),t.state=Xe.RECEIVED,t.requestFunction();if(++Se.numberOfAttemptedRequests,D(t.serverKey)||(t.serverKey=xe.getServerKey(t.url)),xe.throttleRequests&&t.throttleByServer&&!xe.serverHasOpenSlots(t.serverKey))return;if(!xe.throttleRequests||!t.throttle)return Yv(t);if(Si.length>=xe.maximumRequests)return;$v(t);const i=ft.insert(t);if(D(i)){if(i===t)return;fo(i)}return Xv(t)};function rA(){xe.debugShowStatistics&&(Se.numberOfActiveRequests===0&&Se.lastNumberOfActiveRequests>0&&(Se.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Se.numberOfAttemptedRequests}`),Se.numberOfAttemptedRequests=0),Se.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Se.numberOfCancelledRequests}`),Se.numberOfCancelledRequests=0),Se.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Se.numberOfCancelledActiveRequests}`),Se.numberOfCancelledActiveRequests=0),Se.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Se.numberOfFailedRequests}`),Se.numberOfFailedRequests=0)),Se.lastNumberOfActiveRequests=Se.numberOfActiveRequests)}xe.clearForSpecs=function(){for(;ft.length>0;){const i=ft.pop();fo(i)}const t=Si.length;for(let i=0;i<t;++i)fo(Si[i]);Si.length=0,$i={},Se.numberOfAttemptedRequests=0,Se.numberOfActiveRequests=0,Se.numberOfCancelledRequests=0,Se.numberOfCancelledActiveRequests=0,Se.numberOfFailedRequests=0,Se.numberOfActiveRequestsEver=0,Se.lastNumberOfActiveRequests=0},xe.numberOfActiveRequestsByServer=function(t){return $i[t]},xe.requestHeap=ft;const pr={};let fr={};pr.add=function(t,i){if(!D(t))throw new H("host is required.");if(!D(i)||i<=0)throw new H("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;D(fr[e])||(fr[e]=!0)},pr.remove=function(t,i){if(!D(t))throw new H("host is required.");if(!D(i)||i<=0)throw new H("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;D(fr[e])&&delete fr[e]};function sA(t){const i=new qi(t);i.normalize();let e=i.authority();if(e.length!==0){if(i.authority(e),e.indexOf("@")!==-1&&(e=e.split("@")[1]),e.indexOf(":")===-1){let n=i.scheme();if(n.length===0&&(n=window.location.protocol,n=n.substring(0,n.length-1)),n==="http")e+=":80";else if(n==="https")e+=":443";else return}return e}}pr.contains=function(t){if(!D(t))throw new H("url is required.");const i=sA(t);return!!(D(i)&&D(fr[i]))},pr.clear=function(){fr={}};const Zv=function(){try{const t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob",t.responseType==="blob"}catch{return!1}}();function j(t){t=t??_i.EMPTY_OBJECT,typeof t=="string"&&(t={url:t}),A.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=Ei(t.templateValues,{}),this._queryParameters=Ei(t.queryParameters,{}),this.headers=Ei(t.headers,{}),this.request=t.request??new bc,this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=t.retryAttempts??0,this._retryCount=0,t.parseUrl??!0?this.parseUrl(t.url,!0,!0):this._url=t.url,this._credits=t.credits}function Ei(t,i){return D(t)?hr(t):i}j.createIfNeeded=function(t){return t instanceof j?t.getDerivedResource({request:t.request}):typeof t!="string"?t:new j({url:t})};let gr;j.supportsImageBitmapOptions=function(){return D(gr)?gr:typeof createImageBitmap!="function"?(gr=Promise.resolve(!1),gr):(gr=j.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(i){const e={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(i,e),createImageBitmap(i)])}).then(function(i){const e=Gv(i[0]),n=Gv(i[1]);return e[1]!==n[1]}).catch(function(){return!1}),gr)},Object.defineProperties(j,{isBlobSupported:{get:function(){return Zv}}}),Object.defineProperties(j.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){this.parseUrl(t,!1,!1)}},extension:{get:function(){return XE(this._url)}},isDataUri:{get:function(){return qv(this._url)}},isBlobUri:{get:function(){return Hv(this._url)}},isCrossOriginUrl:{get:function(){return Gd(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),j.prototype.toString=function(){return this.getUrlComponent(!0,!0)},j.prototype.parseUrl=function(t,i,e,n){let o=new qi(t);const r=aA(o.query());this._queryParameters=i?xc(r,this.queryParameters,e):r,o.search(""),o.fragment(""),D(n)&&o.scheme()===""&&(o=o.absoluteTo(Ps(n))),this._url=o.toString()};function aA(t){return t.length===0?{}:t.indexOf("=")===-1?{[t]:void 0}:JE(t)}function xc(t,i,e){if(!e)return Tn(t,i);const n=hr(t,!0);for(const o in i)if(i.hasOwnProperty(o)){let r=n[o];const s=i[o];D(r)?(Array.isArray(r)||(r=n[o]=[r]),n[o]=r.concat(s)):n[o]=Array.isArray(s)?s.slice():s}return n}j.prototype.getUrlComponent=function(t,i){if(this.isDataUri)return this._url;let e=this._url;t&&(e=`${e}${lA(this.queryParameters)}`),e=e.replace(/%7B/g,"{").replace(/%7D/g,"}");const n=this._templateValues;return Object.keys(n).length>0&&(e=e.replace(/{(.*?)}/g,function(o,r){const s=n[r];return D(s)?encodeURIComponent(s):o})),i&&D(this.proxy)&&(e=this.proxy.getURL(e)),e};function lA(t){const i=Object.keys(t);return i.length===0?"":i.length===1&&!D(t[i[0]])?`?${i[0]}`:`?${KE(t)}`}j.prototype.setQueryParameters=function(t,i){i?this._queryParameters=xc(this._queryParameters,t,!1):this._queryParameters=xc(t,this._queryParameters,!1)},j.prototype.appendQueryParameters=function(t){this._queryParameters=xc(t,this._queryParameters,!0)},j.prototype.setTemplateValues=function(t,i){i?this._templateValues=Tn(this._templateValues,t):this._templateValues=Tn(t,this._templateValues)},j.prototype.getDerivedResource=function(t){const i=this.clone();if(i._retryCount=0,D(t.url)){const e=t.preserveQueryParameters??!1;i.parseUrl(t.url,!0,e,this._url)}return D(t.queryParameters)&&(i._queryParameters=Tn(t.queryParameters,i.queryParameters)),D(t.templateValues)&&(i._templateValues=Tn(t.templateValues,i.templateValues)),D(t.headers)&&(i.headers=Tn(t.headers,i.headers)),D(t.proxy)&&(i.proxy=t.proxy),D(t.request)&&(i.request=t.request),D(t.retryCallback)&&(i.retryCallback=t.retryCallback),D(t.retryAttempts)&&(i.retryAttempts=t.retryAttempts),i},j.prototype.retryOnError=function(t){const i=this.retryCallback;if(typeof i!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const e=this;return Promise.resolve(i(this,t)).then(function(n){return++e._retryCount,n})},j.prototype.clone=function(t){return D(t)?(t._url=this._url,t._queryParameters=hr(this._queryParameters),t._templateValues=hr(this._templateValues),t.headers=hr(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t):new j({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:D(this.credits)?this.credits.slice():void 0})},j.prototype.getBaseUri=function(t){return $E(this.getUrlComponent(t),t)},j.prototype.appendForwardSlash=function(){this._url=qE(this._url)},j.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},j.fetchArrayBuffer=function(t){return new j(t).fetchArrayBuffer()},j.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},j.fetchBlob=function(t){return new j(t).fetchBlob()},j.prototype.fetchImage=function(t){t=t??_i.EMPTY_OBJECT;const i=t.preferImageBitmap??!1,e=t.preferBlob??!1,n=t.flipY??!1,o=t.skipColorSpaceConversion??!1;if($d(this.request),!Zv||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!e)return qd({resource:this,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i});const r=this.fetchBlob();if(!D(r))return;let s,a,c,d;return j.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&i,r}).then(function(u){if(!D(u))return;if(d=u,a)return j.createImageBitmapFromBlob(u,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=window.URL.createObjectURL(u);return c=new j({url:p}),qd({resource:c,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(D(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return D(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};function qd(t){const i=t.resource,e=t.flipY,n=t.skipColorSpaceConversion,o=t.preferImageBitmap,r=i.request;r.url=i.url,r.requestFunction=function(){let a=!1;!i.isDataUri&&!i.isBlobUri&&(a=i.isCrossOriginUrl);const c=_s();return j._Implementations.createImage(r,a,c,e,n,o),c.promise};const s=xe.request(r);if(D(s))return s.catch(function(a){return r.state!==Xe.FAILED?Promise.reject(a):i.retryOnError(a).then(function(c){return c?(r.state=Xe.UNISSUED,r.deferred=void 0,qd({resource:i,flipY:e,skipColorSpaceConversion:n,preferImageBitmap:o})):Promise.reject(a)})})}j.fetchImage=function(t){return new j(t).fetchImage({flipY:t.flipY,skipColorSpaceConversion:t.skipColorSpaceConversion,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})},j.prototype.fetchText=function(){return this.fetch({responseType:"text"})},j.fetchText=function(t){return new j(t).fetchText()},j.prototype.fetchJson=function(){const t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(D(t))return t.then(function(i){if(D(i))return JSON.parse(i)})},j.fetchJson=function(t){return new j(t).fetchJson()},j.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},j.fetchXML=function(t){return new j(t).fetchXML()},j.prototype.fetchJsonp=function(t){t=t??"callback",$d(this.request);let i;do i=`loadJsonp${O.nextRandomNumber().toString().substring(2,8)}`;while(D(window[i]));return Qv(this,t,i)};function Qv(t,i,e){const n={};n[i]=e,t.setQueryParameters(n);const o=t.request,r=t.url;o.url=r,o.requestFunction=function(){const a=_s();return window[e]=function(c){a.resolve(c);try{delete window[e]}catch{window[e]=void 0}},j._Implementations.loadAndExecuteScript(r,e,a),a.promise};const s=xe.request(o);if(D(s))return s.catch(function(a){return o.state!==Xe.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=Xe.UNISSUED,o.deferred=void 0,Qv(t,i,e)):Promise.reject(a)})})}j.fetchJsonp=function(t){return new j(t).fetchJsonp(t.callbackParameterName)},j.prototype._makeRequest=function(t){const i=this;$d(i.request);const e=i.request,n=i.url;e.url=n,e.requestFunction=function(){const r=t.responseType,s=Tn(t.headers,i.headers),a=t.overrideMimeType,c=t.method,d=t.data,u=_s(),p=j._Implementations.loadWithXhr(n,r,c,d,s,u,a);return D(p)&&D(p.abort)&&(e.cancelFunction=function(){p.abort()}),u.promise};const o=xe.request(e);if(D(o))return o.then(function(r){return e.cancelFunction=void 0,r}).catch(function(r){return e.cancelFunction=void 0,e.state!==Xe.FAILED?Promise.reject(r):i.retryOnError(r).then(function(s){return s?(e.state=Xe.UNISSUED,e.deferred=void 0,i.fetch(t)):Promise.reject(r)})})};function $d(t){if(t.state===Xe.ISSUED||t.state===Xe.ACTIVE)throw new lt("The Resource is already being fetched.");t.state=Xe.UNISSUED,t.deferred=void 0}const cA=/^data:(.*?)(;base64)?,(.*)$/;function Fc(t,i){const e=decodeURIComponent(i);return t?atob(e):e}function Kv(t,i){const e=Fc(t,i),n=new ArrayBuffer(e.length),o=new Uint8Array(n);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r);return n}function hA(t,i){i=i??"";const e=t[1],n=!!t[2],o=t[3];let r,s;switch(i){case"":case"text":return Fc(n,o);case"arraybuffer":return Kv(n,o);case"blob":return r=Kv(n,o),new Blob([r],{type:e});case"document":return s=new DOMParser,s.parseFromString(Fc(n,o),e);case"json":return JSON.parse(Fc(n,o));default:throw new H(`Unhandled responseType: ${i}`)}}j.prototype.fetch=function(t){return t=Ei(t,{}),t.method="GET",this._makeRequest(t)},j.fetch=function(t){return new j(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.delete=function(t){return t=Ei(t,{}),t.method="DELETE",this._makeRequest(t)},j.delete=function(t){return new j(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})},j.prototype.head=function(t){return t=Ei(t,{}),t.method="HEAD",this._makeRequest(t)},j.head=function(t){return new j(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.options=function(t){return t=Ei(t,{}),t.method="OPTIONS",this._makeRequest(t)},j.options=function(t){return new j(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.post=function(t,i){return A.defined("data",t),i=Ei(i,{}),i.method="POST",i.data=t,this._makeRequest(i)},j.post=function(t){return new j(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.put=function(t,i){return A.defined("data",t),i=Ei(i,{}),i.method="PUT",i.data=t,this._makeRequest(i)},j.put=function(t){return new j(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.patch=function(t,i){return A.defined("data",t),i=Ei(i,{}),i.method="PATCH",i.data=t,this._makeRequest(i)},j.patch=function(t){return new j(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j._Implementations={},j._Implementations.loadImageElement=function(t,i,e){const n=new Image;n.onload=function(){n.naturalWidth===0&&n.naturalHeight===0&&n.width===0&&n.height===0&&(n.width=300,n.height=150),e.resolve(n)},n.onerror=function(o){e.reject(o)},i&&(pr.contains(t)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=t},j._Implementations.createImage=function(t,i,e,n,o,r){const s=t.url;j.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){j._Implementations.loadImageElement(s,i,e);return}const c="blob",d="GET",u=_s(),p=j._Implementations.loadWithXhr(s,c,d,void 0,void 0,u,void 0,void 0,void 0);return D(p)&&D(p.abort)&&(t.cancelFunction=function(){p.abort()}),u.promise.then(function(f){if(!D(f)){e.reject(new lt(`Successfully retrieved ${s} but it contained no content.`));return}return j.createImageBitmapFromBlob(f,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(f){e.resolve(f)})}).catch(function(a){e.reject(a)})},j.createImageBitmapFromBlob=function(t,i){return A.defined("options",i),A.typeOf.bool("options.flipY",i.flipY),A.typeOf.bool("options.premultiplyAlpha",i.premultiplyAlpha),A.typeOf.bool("options.skipColorSpaceConversion",i.skipColorSpaceConversion),createImageBitmap(t,{imageOrientation:i.flipY?"flipY":"from-image",premultiplyAlpha:i.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:i.skipColorSpaceConversion?"none":"default"})};function dA(t,i,e,n,o,r,s){fetch(t,{method:e,headers:o}).then(async a=>{if(!a.ok){const c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new Ss(a.status,a,c));return}switch(i){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new Ss)})}const uA=typeof XMLHttpRequest>"u";j._Implementations.loadWithXhr=function(t,i,e,n,o,r,s){const a=cA.exec(t);if(a!==null){r.resolve(hA(a,i));return}if(uA){dA(t,i,e,n,o,r);return}const c=new XMLHttpRequest;if(pr.contains(t)&&(c.withCredentials=!0),c.open(e,t,!0),D(s)&&D(c.overrideMimeType)&&c.overrideMimeType(s),D(o))for(const u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);D(i)&&(c.responseType=i);let d=!1;return typeof t=="string"&&(d=t.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new Ss(c.status,c.response,c.getAllResponseHeaders()));return}const u=c.response,p=c.responseType;if(e==="HEAD"||e==="OPTIONS"){const g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){const P=y.split(": "),S=P.shift();m[S]=P.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(D(u)&&(!D(i)||p===i))r.resolve(u);else if(i==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(f){r.reject(f)}else(p===""||p==="document")&&D(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(p===""||p==="text")&&D(c.responseText)?r.resolve(c.responseText):r.reject(new lt("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Ss)},c.send(n),c},j._Implementations.loadAndExecuteScript=function(t,i,e){return QE(t).catch(function(n){e.reject(n)})},j._DefaultImplementations={},j._DefaultImplementations.createImage=j._Implementations.createImage,j._DefaultImplementations.loadWithXhr=j._Implementations.loadWithXhr,j._DefaultImplementations.loadAndExecuteScript=j._Implementations.loadAndExecuteScript,j.DEFAULT=Object.freeze(new j({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function Es(t){t=t??_i.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=t.addNewLeapSeconds??!0,D(t.data)?Jv(this,t.data):Jv(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Es.fromUrl=async function(t,i){A.defined("url",t),i=i??_i.EMPTY_OBJECT;const e=j.createIfNeeded(t);let n;try{n=await e.fetchJson()}catch{throw new lt(`An error occurred while retrieving the EOP data from the URL ${e.url}.`)}return new Es({addNewLeapSeconds:i.addNewLeapSeconds,data:n})},Es.NONE=Object.freeze({compute:function(t,i){return D(i)?(i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0):i=new Ld(0,0,0,0,0),i}}),Es.prototype.compute=function(t,i){if(!D(this._samples))return;if(D(i)||(i=new Ld(0,0,0,0,0)),this._samples.length===0)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;const e=this._dates,n=this._lastIndex;let o=0,r=0;if(D(n)){const a=e[n],c=e[n+1],d=J.lessThanOrEquals(a,t),u=!D(c),p=u||J.greaterThanOrEquals(c,t);if(d&&p)return o=n,!u&&c.equals(t)&&++o,r=o+1,jv(this,e,this._samples,t,o,r,i),i}let s=ws(e,t,J.compare,this._dateColumn);return s>=0?(s<e.length-1&&e[s+1].equals(t)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,jv(this,e,this._samples,t,o,r,i),i};function pA(t,i){return J.compare(t.julianDate,i)}function Jv(t,i){if(!D(i.columnNames))throw new lt("Error in loaded EOP data: The columnNames property is required.");if(!D(i.samples))throw new lt("Error in loaded EOP data: The samples property is required.");const e=i.columnNames.indexOf("modifiedJulianDateUtc"),n=i.columnNames.indexOf("xPoleWanderRadians"),o=i.columnNames.indexOf("yPoleWanderRadians"),r=i.columnNames.indexOf("ut1MinusUtcSeconds"),s=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=i.columnNames.indexOf("taiMinusUtcSeconds");if(e<0||n<0||o<0||r<0||s<0||a<0||c<0)throw new lt("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const d=t._samples=i.samples,u=t._dates=[];t._dateColumn=e,t._xPoleWanderRadiansColumn=n,t._yPoleWanderRadiansColumn=o,t._ut1MinusUtcSecondsColumn=r,t._xCelestialPoleOffsetRadiansColumn=s,t._yCelestialPoleOffsetRadiansColumn=a,t._taiMinusUtcSecondsColumn=c,t._columnCount=i.columnNames.length,t._lastIndex=void 0;let p;const f=t._addNewLeapSeconds;for(let g=0,m=d.length;g<m;g+=t._columnCount){const y=d[g+e],P=d[g+c],S=y+Ue.MODIFIED_JULIAN_DATE_DIFFERENCE,C=new J(S,P,ve.TAI);if(u.push(C),f){if(P!==p&&D(p)){const E=J.leapSeconds,T=ws(E,C,pA);if(T<0){const I=new De(C,P);E.splice(~T,0,I)}}p=P}}}function Bv(t,i,e,n,o){const r=e*n;o.xPoleWander=i[r+t._xPoleWanderRadiansColumn],o.yPoleWander=i[r+t._yPoleWanderRadiansColumn],o.xPoleOffset=i[r+t._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=i[r+t._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=i[r+t._ut1MinusUtcSecondsColumn]}function As(t,i,e){return i+t*(e-i)}function jv(t,i,e,n,o,r,s){const a=t._columnCount;if(r>i.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;const c=i[o],d=i[r];if(c.equals(d)||n.equals(c))return Bv(t,e,o,a,s),s;if(n.equals(d))return Bv(t,e,r,a,s),s;const u=J.secondsDifference(n,c)/J.secondsDifference(d,c),p=o*a,f=r*a;let g=e[p+t._ut1MinusUtcSecondsColumn],m=e[f+t._ut1MinusUtcSecondsColumn];const y=m-g;if(y>.5||y<-.5){const P=e[p+t._taiMinusUtcSecondsColumn],S=e[f+t._taiMinusUtcSecondsColumn];P!==S&&(d.equals(n)?g=m:m-=S-P)}return s.xPoleWander=As(u,e[p+t._xPoleWanderRadiansColumn],e[f+t._xPoleWanderRadiansColumn]),s.yPoleWander=As(u,e[p+t._yPoleWanderRadiansColumn],e[f+t._yPoleWanderRadiansColumn]),s.xPoleOffset=As(u,e[p+t._xCelestialPoleOffsetRadiansColumn],e[f+t._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=As(u,e[p+t._yCelestialPoleOffsetRadiansColumn],e[f+t._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=As(u,g,m),s}function tt(t,i,e){this.heading=t??0,this.pitch=i??0,this.roll=e??0}tt.fromQuaternion=function(t,i){if(!D(t))throw new H("quaternion is required");D(i)||(i=new tt);const e=2*(t.w*t.y-t.z*t.x),n=1-2*(t.x*t.x+t.y*t.y),o=2*(t.w*t.x+t.y*t.z),r=1-2*(t.y*t.y+t.z*t.z),s=2*(t.w*t.z+t.x*t.y);return i.heading=-Math.atan2(s,r),i.roll=Math.atan2(o,n),i.pitch=-O.asinClamped(e),i},tt.fromDegrees=function(t,i,e,n){if(!D(t))throw new H("heading is required");if(!D(i))throw new H("pitch is required");if(!D(e))throw new H("roll is required");return D(n)||(n=new tt),n.heading=t*O.RADIANS_PER_DEGREE,n.pitch=i*O.RADIANS_PER_DEGREE,n.roll=e*O.RADIANS_PER_DEGREE,n},tt.clone=function(t,i){if(D(t))return D(i)?(i.heading=t.heading,i.pitch=t.pitch,i.roll=t.roll,i):new tt(t.heading,t.pitch,t.roll)},tt.equals=function(t,i){return t===i||D(t)&&D(i)&&t.heading===i.heading&&t.pitch===i.pitch&&t.roll===i.roll},tt.equalsEpsilon=function(t,i,e,n){return t===i||D(t)&&D(i)&&O.equalsEpsilon(t.heading,i.heading,e,n)&&O.equalsEpsilon(t.pitch,i.pitch,e,n)&&O.equalsEpsilon(t.roll,i.roll,e,n)},tt.prototype.clone=function(t){return tt.clone(this,t)},tt.prototype.equals=function(t){return tt.equals(this,t)},tt.prototype.equalsEpsilon=function(t,i,e){return tt.equalsEpsilon(this,t,i,e)},tt.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const ey=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function fA(){const t=document.getElementsByTagName("script");for(let i=0,e=t.length;i<e;++i){const n=t[i].getAttribute("src"),o=ey.exec(n);if(o!==null)return o[1]}}let kc;function ty(t){return typeof document>"u"?t:(D(kc)||(kc=document.createElement("a")),kc.href=t,kc.href)}let go;function iy(){if(D(go))return go;let t;if(typeof CESIUM_BASE_URL<"u"?t=CESIUM_BASE_URL:D(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ho&&Ho.tagName.toUpperCase()==="SCRIPT"&&Ho.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href)?t=Ps(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ho&&Ho.tagName.toUpperCase()==="SCRIPT"&&Ho.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href):typeof define=="object"&&D(define.amd)&&!define.amd.toUrlUndefined&&D(require.toUrl)?t=Ps("..",ei("Core/buildModuleUrl.js")):t=fA(),!D(t))throw new H("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return go=new j({url:ty(t)}),go.appendForwardSlash(),go}function gA(t){return ty(require.toUrl(`../${t}`))}function ny(t){return iy().getDerivedResource({url:t}).url}let zc;function ei(t){return D(zc)||(typeof define=="object"&&D(define.amd)&&!define.amd.toUrlUndefined&&D(require.toUrl)?zc=gA:zc=ny),zc(t)}ei._cesiumScriptRegex=ey,ei._buildModuleUrlFromBaseUrl=ny,ei._clearBaseResource=function(){go=void 0},ei.setBaseUrl=function(t){go=j.DEFAULT.getDerivedResource({url:t})},ei.getCesiumBaseUrl=iy;function oy(t,i,e){this.x=t,this.y=i,this.s=e}function Xd(t){t=t??_i.EMPTY_OBJECT,this._xysFileUrlTemplate=j.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=t.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=t.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new J(this._sampleZeroJulianEphemerisDate,0,ve.TAI),this._stepSizeDays=t.stepSizeDays??1,this._samplesPerXysFile=t.samplesPerXysFile??1e3,this._totalSamples=t.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const i=this._interpolationOrder,e=this._denominators=new Array(i+1),n=this._xTable=new Array(i+1),o=Math.pow(this._stepSizeDays,i);for(let r=0;r<=i;++r){e[r]=o,n[r]=r*this._stepSizeDays;for(let s=0;s<=i;++s)s!==r&&(e[r]*=r-s);e[r]=1/e[r]}this._work=new Array(i+1),this._coef=new Array(i+1)}const mA=new J(0,0,ve.TAI);function Yd(t,i,e){const n=mA;return n.dayNumber=i,n.secondsOfDay=e,J.daysDifference(n,t._sampleZeroDateTT)}Xd.prototype.preload=function(t,i,e,n){const o=Yd(this,t,i),r=Yd(this,e,n);let s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);const c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let p=c;p<=d;++p)u.push(Zd(this,p));return Promise.all(u)},Xd.prototype.computeXysRadians=function(t,i,e){const n=Yd(this,t,i);if(n<0)return;const o=n/this._stepSizeDays|0;if(o>=this._totalSamples)return;const r=this._interpolationOrder;let s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1;const d=this._samples;if(D(d[s*3])||(Zd(this,s/this._samplesPerXysFile|0),c=!0),D(d[a*3])||(Zd(this,a/this._samplesPerXysFile|0),c=!0),c)return;D(e)?(e.x=0,e.y=0,e.s=0):e=new oy(0,0,0);const u=n-s*this._stepSizeDays,p=this._work,f=this._denominators,g=this._coef,m=this._xTable;let y,P;for(y=0;y<=r;++y)p[y]=u-m[y];for(y=0;y<=r;++y){for(g[y]=1,P=0;P<=r;++P)P!==y&&(g[y]*=p[P]);g[y]*=f[y];let S=(s+y)*3;e.x+=g[y]*d[S++],e.y+=g[y]*d[S++],e.s+=g[y]*d[S]}return e};function Zd(t,i){if(t._chunkDownloadsInProgress[i])return t._chunkDownloadsInProgress[i];let e;const n=t._xysFileUrlTemplate;D(n)?e=n.getDerivedResource({templateValues:{0:i}}):e=new j({url:ei(`Assets/IAU2006_XYS/IAU2006_XYS_${i}.json`)});const o=e.fetchJson().then(function(r){t._chunkDownloadsInProgress[i]=!1;const s=t._samples,a=r.samples,c=i*t._samplesPerXysFile*3;for(let d=0,u=a.length;d<u;++d)s[c+d]=a[d]});return t._chunkDownloadsInProgress[i]=o,o}let Mn;const He={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},bt={};Object.defineProperties(bt,{element:{get:function(){if(bt.supportsFullscreen())return document[He.fullscreenElement]}},changeEventName:{get:function(){if(bt.supportsFullscreen())return He.fullscreenchange}},errorEventName:{get:function(){if(bt.supportsFullscreen())return He.fullscreenerror}},enabled:{get:function(){if(bt.supportsFullscreen())return document[He.fullscreenEnabled]}},fullscreen:{get:function(){if(bt.supportsFullscreen())return bt.element!==null}}}),bt.supportsFullscreen=function(){if(D(Mn))return Mn;Mn=!1;const t=document.body;if(typeof t.requestFullscreen=="function")return He.requestFullscreen="requestFullscreen",He.exitFullscreen="exitFullscreen",He.fullscreenEnabled="fullscreenEnabled",He.fullscreenElement="fullscreenElement",He.fullscreenchange="fullscreenchange",He.fullscreenerror="fullscreenerror",Mn=!0,Mn;const i=["webkit","moz","o","ms","khtml"];let e;for(let n=0,o=i.length;n<o;++n){const r=i[n];e=`${r}RequestFullscreen`,typeof t[e]=="function"?(He.requestFullscreen=e,Mn=!0):(e=`${r}RequestFullScreen`,typeof t[e]=="function"&&(He.requestFullscreen=e,Mn=!0)),e=`${r}ExitFullscreen`,typeof document[e]=="function"?He.exitFullscreen=e:(e=`${r}CancelFullScreen`,typeof document[e]=="function"&&(He.exitFullscreen=e)),e=`${r}FullscreenEnabled`,document[e]!==void 0?He.fullscreenEnabled=e:(e=`${r}FullScreenEnabled`,document[e]!==void 0&&(He.fullscreenEnabled=e)),e=`${r}FullscreenElement`,document[e]!==void 0?He.fullscreenElement=e:(e=`${r}FullScreenElement`,document[e]!==void 0&&(He.fullscreenElement=e)),e=`${r}fullscreenchange`,document[`on${e}`]!==void 0&&(r==="ms"&&(e="MSFullscreenChange"),He.fullscreenchange=e),e=`${r}fullscreenerror`,document[`on${e}`]!==void 0&&(r==="ms"&&(e="MSFullscreenError"),He.fullscreenerror=e)}return Mn},bt.requestFullscreen=function(t,i){bt.supportsFullscreen()&&t[He.requestFullscreen]({vrDisplay:i})},bt.exitFullscreen=function(){bt.supportsFullscreen()&&document[He.exitFullscreen]()},bt._names=He;let gt;typeof navigator<"u"?gt=navigator:gt={};function mo(t){const i=t.split(".");for(let e=0,n=i.length;e<n;++e)i[e]=parseInt(i[e],10);return i}let Lc,ry;function Qd(){if(!D(Lc)&&(Lc=!1,!Uc())){const t=/ Chrome\/([\.0-9]+)/.exec(gt.userAgent);t!==null&&(Lc=!0,ry=mo(t[1]))}return Lc}function vA(){return Qd()&&ry}let Oc,sy;function ay(){if(!D(Oc)&&(Oc=!1,!Qd()&&!Uc()&&/ Safari\/[\.0-9]+/.test(gt.userAgent))){const t=/ Version\/([\.0-9]+)/.exec(gt.userAgent);t!==null&&(Oc=!0,sy=mo(t[1]))}return Oc}function yA(){return ay()&&sy}let Nc,Kd;function ly(){if(!D(Nc)){Nc=!1;const t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(gt.userAgent);t!==null&&(Nc=!0,Kd=mo(t[1]),Kd.isNightly=!!t[2])}return Nc}function wA(){return ly()&&Kd}let Ts,Jd;function cy(){if(!D(Ts)){Ts=!1;let t;gt.appName==="Microsoft Internet Explorer"?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(gt.userAgent),t!==null&&(Ts=!0,Jd=mo(t[1]))):gt.appName==="Netscape"&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(gt.userAgent),t!==null&&(Ts=!0,Jd=mo(t[1])))}return Ts}function CA(){return cy()&&Jd}let Vc,hy;function Uc(){if(!D(Vc)){Vc=!1;const t=/ Edg\/([\.0-9]+)/.exec(gt.userAgent);t!==null&&(Vc=!0,hy=mo(t[1]))}return Vc}function _A(){return Uc()&&hy}let Wc,Bd;function Gc(){if(!D(Wc)){Wc=!1;const t=/Firefox\/([\.0-9]+)/.exec(gt.userAgent);t!==null&&(Wc=!0,Bd=mo(t[1]))}return Wc}let jd;function PA(){return D(jd)||(jd=/Windows/i.test(gt.appVersion)),jd}let eu;function SA(){return D(eu)||(eu=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),eu}function EA(){return Gc()&&Bd}let tu;function AA(){return D(tu)||(tu=!Gc()&&typeof PointerEvent<"u"&&(!D(gt.pointerEnabled)||gt.pointerEnabled)),tu}let dy,Hc;function uy(){if(!D(Hc)){const t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const i=t.style.imageRendering;Hc=D(i)&&i!=="",Hc&&(dy=i)}return Hc}function TA(){return uy()?dy:void 0}function mt(){if(!mt.initialized)throw new H("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return mt._result}mt._promise=void 0,mt._result=void 0,mt.initialize=function(){return D(mt._promise)||(mt._promise=new Promise(t=>{const i=new Image;i.onload=function(){mt._result=i.width>0&&i.height>0,t(mt._result)},i.onerror=function(){mt._result=!1,t(mt._result)},i.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),mt._promise},Object.defineProperties(mt,{initialized:{get:function(){return D(mt._result)}}});const mr=[];typeof ArrayBuffer<"u"&&(mr.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&mr.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&mr.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&mr.push(BigInt64Array),typeof BigUint64Array<"u"&&mr.push(BigUint64Array));const ct={isChrome:Qd,chromeVersion:vA,isSafari:ay,safariVersion:yA,isWebkit:ly,webkitVersion:wA,isInternetExplorer:cy,internetExplorerVersion:CA,isEdge:Uc,edgeVersion:_A,isFirefox:Gc,firefoxVersion:EA,isWindows:PA,isIPadOrIOS:SA,hardwareConcurrency:gt.hardwareConcurrency??3,supportsPointerEvents:AA,supportsImageRenderingPixelated:uy,supportsWebP:mt,imageRenderingValue:TA,typedArrayTypes:mr};ct.supportsBasis=function(t){return ct.supportsWebAssembly()&&t.context.supportsBasis},ct.supportsFullscreen=function(){return bt.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(t){return A.defined("scene",t),t.context.webgl2},ct.supportsEsmWebWorkers=function(){return!Gc()||parseInt(Bd)>=114};function Q(t,i,e,n){this.x=t??0,this.y=i??0,this.z=e??0,this.w=n??0}let Ms=new k;Q.fromAxisAngle=function(t,i,e){A.typeOf.object("axis",t),A.typeOf.number("angle",i);const n=i/2,o=Math.sin(n);Ms=k.normalize(t,Ms);const r=Ms.x*o,s=Ms.y*o,a=Ms.z*o,c=Math.cos(n);return D(e)?(e.x=r,e.y=s,e.z=a,e.w=c,e):new Q(r,s,a,c)};const MA=[1,2,0],IA=new Array(3);Q.fromRotationMatrix=function(t,i){A.typeOf.object("matrix",t);let e,n,o,r,s;const a=t[q.COLUMN0ROW0],c=t[q.COLUMN1ROW1],d=t[q.COLUMN2ROW2],u=a+c+d;if(u>0)e=Math.sqrt(u+1),s=.5*e,e=.5/e,n=(t[q.COLUMN1ROW2]-t[q.COLUMN2ROW1])*e,o=(t[q.COLUMN2ROW0]-t[q.COLUMN0ROW2])*e,r=(t[q.COLUMN0ROW1]-t[q.COLUMN1ROW0])*e;else{const p=MA;let f=0;c>a&&(f=1),d>a&&d>c&&(f=2);const g=p[f],m=p[g];e=Math.sqrt(t[q.getElementIndex(f,f)]-t[q.getElementIndex(g,g)]-t[q.getElementIndex(m,m)]+1);const y=IA;y[f]=.5*e,e=.5/e,s=(t[q.getElementIndex(m,g)]-t[q.getElementIndex(g,m)])*e,y[g]=(t[q.getElementIndex(g,f)]+t[q.getElementIndex(f,g)])*e,y[m]=(t[q.getElementIndex(m,f)]+t[q.getElementIndex(f,m)])*e,n=-y[0],o=-y[1],r=-y[2]}return D(i)?(i.x=n,i.y=o,i.z=r,i.w=s,i):new Q(n,o,r,s)};const py=new Q;let fy=new Q,iu=new Q,gy=new Q;Q.fromHeadingPitchRoll=function(t,i){return A.typeOf.object("headingPitchRoll",t),gy=Q.fromAxisAngle(k.UNIT_X,t.roll,py),iu=Q.fromAxisAngle(k.UNIT_Y,-t.pitch,i),i=Q.multiply(iu,gy,iu),fy=Q.fromAxisAngle(k.UNIT_Z,-t.heading,py),Q.multiply(fy,i,i)};const qc=new k,nu=new k,di=new Q,my=new Q,$c=new Q;Q.packedLength=4,Q.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e++]=t.z,i[e]=t.w,i},Q.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new Q),e.x=t[i],e.y=t[i+1],e.z=t[i+2],e.w=t[i+3],e},Q.packedInterpolationLength=3,Q.convertPackedArrayForInterpolation=function(t,i,e,n){Q.unpack(t,e*4,$c),Q.conjugate($c,$c);for(let o=0,r=e-i+1;o<r;o++){const s=o*3;Q.unpack(t,(i+o)*4,di),Q.multiply(di,$c,di),di.w<0&&Q.negate(di,di),Q.computeAxis(di,qc);const a=Q.computeAngle(di);D(n)||(n=[]),n[s]=qc.x*a,n[s+1]=qc.y*a,n[s+2]=qc.z*a}},Q.unpackInterpolationResult=function(t,i,e,n,o){D(o)||(o=new Q),k.fromArray(t,0,nu);const r=k.magnitude(nu);return Q.unpack(i,n*4,my),r===0?Q.clone(Q.IDENTITY,di):Q.fromAxisAngle(nu,r,di),Q.multiply(di,my,o)},Q.clone=function(t,i){if(D(t))return D(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i.w=t.w,i):new Q(t.x,t.y,t.z,t.w)},Q.conjugate=function(t,i){return A.typeOf.object("quaternion",t),A.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=t.w,i},Q.magnitudeSquared=function(t){return A.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},Q.magnitude=function(t){return Math.sqrt(Q.magnitudeSquared(t))},Q.normalize=function(t,i){A.typeOf.object("result",i);const e=1/Q.magnitude(t),n=t.x*e,o=t.y*e,r=t.z*e,s=t.w*e;return i.x=n,i.y=o,i.z=r,i.w=s,i},Q.inverse=function(t,i){A.typeOf.object("result",i);const e=Q.magnitudeSquared(t);return i=Q.conjugate(t,i),Q.multiplyByScalar(i,1/e,i)},Q.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e.w=t.w+i.w,e},Q.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e.w=t.w-i.w,e},Q.negate=function(t,i){return A.typeOf.object("quaternion",t),A.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=-t.w,i},Q.dot=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w},Q.multiply=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t.x,o=t.y,r=t.z,s=t.w,a=i.x,c=i.y,d=i.z,u=i.w,p=s*a+n*u+o*d-r*c,f=s*c-n*d+o*u+r*a,g=s*d+n*c-o*a+r*u,m=s*u-n*a-o*c-r*d;return e.x=p,e.y=f,e.z=g,e.w=m,e},Q.multiplyByScalar=function(t,i,e){return A.typeOf.object("quaternion",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},Q.divideByScalar=function(t,i,e){return A.typeOf.object("quaternion",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e.w=t.w/i,e},Q.computeAxis=function(t,i){A.typeOf.object("quaternion",t),A.typeOf.object("result",i);const e=t.w;if(Math.abs(e-1)<O.EPSILON6||Math.abs(e+1)<O.EPSILON6)return i.x=1,i.y=i.z=0,i;const n=1/Math.sqrt(1-e*e);return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i},Q.computeAngle=function(t){return A.typeOf.object("quaternion",t),Math.abs(t.w-1)<O.EPSILON6?0:2*Math.acos(t.w)};let ou=new Q;Q.lerp=function(t,i,e,n){return A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n),ou=Q.multiplyByScalar(i,e,ou),n=Q.multiplyByScalar(t,1-e,n),Q.add(ou,n,n)};let vy=new Q,ru=new Q,su=new Q;Q.slerp=function(t,i,e,n){A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n);let o=Q.dot(t,i),r=i;if(o<0&&(o=-o,r=vy=Q.negate(i,vy)),1-o<O.EPSILON6)return Q.lerp(t,r,e,n);const s=Math.acos(o);return ru=Q.multiplyByScalar(t,Math.sin((1-e)*s),ru),su=Q.multiplyByScalar(r,Math.sin(e*s),su),n=Q.add(ru,su,n),Q.multiplyByScalar(n,1/Math.sin(s),n)},Q.log=function(t,i){A.typeOf.object("quaternion",t),A.typeOf.object("result",i);const e=O.acosClamped(t.w);let n=0;return e!==0&&(n=e/Math.sin(e)),k.multiplyByScalar(t,n,i)},Q.exp=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=k.magnitude(t);let n=0;return e!==0&&(n=Math.sin(e)/e),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(e),i};const DA=new k,bA=new k,Is=new Q,vr=new Q;Q.computeInnerQuadrangle=function(t,i,e,n){A.typeOf.object("q0",t),A.typeOf.object("q1",i),A.typeOf.object("q2",e),A.typeOf.object("result",n);const o=Q.conjugate(i,Is);Q.multiply(o,e,vr);const r=Q.log(vr,DA);Q.multiply(o,t,vr);const s=Q.log(vr,bA);return k.add(r,s,r),k.multiplyByScalar(r,.25,r),k.negate(r,r),Q.exp(r,Is),Q.multiply(i,Is,n)},Q.squad=function(t,i,e,n,o,r){A.typeOf.object("q0",t),A.typeOf.object("q1",i),A.typeOf.object("s0",e),A.typeOf.object("s1",n),A.typeOf.number("t",o),A.typeOf.object("result",r);const s=Q.slerp(t,i,o,Is),a=Q.slerp(e,n,o,vr);return Q.slerp(s,a,2*o*(1-o),r)};const RA=new Q,yy=1.9011074535173003,Xc=ct.supportsTypedArrays()?new Float32Array(8):[],Yc=ct.supportsTypedArrays()?new Float32Array(8):[],Xi=ct.supportsTypedArrays()?new Float32Array(8):[],Yi=ct.supportsTypedArrays()?new Float32Array(8):[];for(let t=0;t<7;++t){const i=t+1,e=2*i+1;Xc[t]=1/(i*e),Yc[t]=i/e}Xc[7]=yy/(8*17),Yc[7]=yy*8/17,Q.fastSlerp=function(t,i,e,n){A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n);let o=Q.dot(t,i),r;o>=0?r=1:(r=-1,o=-o);const s=o-1,a=1-e,c=e*e,d=a*a;for(let g=7;g>=0;--g)Xi[g]=(Xc[g]*c-Yc[g])*s,Yi[g]=(Xc[g]*d-Yc[g])*s;const u=r*e*(1+Xi[0]*(1+Xi[1]*(1+Xi[2]*(1+Xi[3]*(1+Xi[4]*(1+Xi[5]*(1+Xi[6]*(1+Xi[7])))))))),p=a*(1+Yi[0]*(1+Yi[1]*(1+Yi[2]*(1+Yi[3]*(1+Yi[4]*(1+Yi[5]*(1+Yi[6]*(1+Yi[7])))))))),f=Q.multiplyByScalar(t,p,RA);return Q.multiplyByScalar(i,u,n),Q.add(f,n,n)},Q.fastSquad=function(t,i,e,n,o,r){A.typeOf.object("q0",t),A.typeOf.object("q1",i),A.typeOf.object("s0",e),A.typeOf.object("s1",n),A.typeOf.number("t",o),A.typeOf.object("result",r);const s=Q.fastSlerp(t,i,o,Is),a=Q.fastSlerp(e,n,o,vr);return Q.fastSlerp(s,a,2*o*(1-o),r)},Q.equals=function(t,i){return t===i||D(t)&&D(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z&&t.w===i.w},Q.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t.x-i.x)<=e&&Math.abs(t.y-i.y)<=e&&Math.abs(t.z-i.z)<=e&&Math.abs(t.w-i.w)<=e},Q.ZERO=Object.freeze(new Q(0,0,0,0)),Q.IDENTITY=Object.freeze(new Q(0,0,0,1)),Q.prototype.clone=function(t){return Q.clone(this,t)},Q.prototype.equals=function(t){return Q.equals(this,t)},Q.prototype.equalsEpsilon=function(t,i){return Q.equalsEpsilon(this,t,i)},Q.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const pe={},au={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"}},yr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},lu={},Rt={east:new k,north:new k,up:new k,west:new k,south:new k,down:new k};let In=new k,Dn=new k,bn=new k;pe.localFrameToFixedFrameGenerator=function(t,i){if(!au.hasOwnProperty(t)||!au[t].hasOwnProperty(i))throw new H("firstAxis and secondAxis must be east, north, up, west, south or down.");const e=au[t][i];let n;const o=t+i;return D(lu[o])?n=lu[o]:(n=function(r,s,a){if(!D(r))throw new H("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new H("origin has a NaN component");if(D(a)||(a=new X),k.equalsEpsilon(r,k.ZERO,O.EPSILON14))k.unpack(yr[t],0,In),k.unpack(yr[i],0,Dn),k.unpack(yr[e],0,bn);else if(O.equalsEpsilon(r.x,0,O.EPSILON14)&&O.equalsEpsilon(r.y,0,O.EPSILON14)){const c=O.sign(r.z);k.unpack(yr[t],0,In),t!=="east"&&t!=="west"&&k.multiplyByScalar(In,c,In),k.unpack(yr[i],0,Dn),i!=="east"&&i!=="west"&&k.multiplyByScalar(Dn,c,Dn),k.unpack(yr[e],0,bn),e!=="east"&&e!=="west"&&k.multiplyByScalar(bn,c,bn)}else{s=s??le.default,s.geodeticSurfaceNormal(r,Rt.up);const c=Rt.up,d=Rt.east;d.x=-r.y,d.y=r.x,d.z=0,k.normalize(d,Rt.east),k.cross(c,d,Rt.north),k.multiplyByScalar(Rt.up,-1,Rt.down),k.multiplyByScalar(Rt.east,-1,Rt.west),k.multiplyByScalar(Rt.north,-1,Rt.south),In=Rt[t],Dn=Rt[i],bn=Rt[e]}return a[0]=In.x,a[1]=In.y,a[2]=In.z,a[3]=0,a[4]=Dn.x,a[5]=Dn.y,a[6]=Dn.z,a[7]=0,a[8]=bn.x,a[9]=bn.y,a[10]=bn.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},lu[o]=n),n},pe.eastNorthUpToFixedFrame=pe.localFrameToFixedFrameGenerator("east","north"),pe.northEastDownToFixedFrame=pe.localFrameToFixedFrameGenerator("north","east"),pe.northUpEastToFixedFrame=pe.localFrameToFixedFrameGenerator("north","up"),pe.northWestUpToFixedFrame=pe.localFrameToFixedFrameGenerator("north","west");const xA=new Q,FA=new k(1,1,1),kA=new X;pe.headingPitchRollToFixedFrame=function(t,i,e,n,o){A.typeOf.object("HeadingPitchRoll",i),n=n??pe.eastNorthUpToFixedFrame;const r=Q.fromHeadingPitchRoll(i,xA),s=X.fromTranslationQuaternionRotationScale(k.ZERO,r,FA,kA);return o=n(t,e,o),X.multiply(o,s,o)};const zA=new X,LA=new q;pe.headingPitchRollQuaternion=function(t,i,e,n,o){A.typeOf.object("HeadingPitchRoll",i);const r=pe.headingPitchRollToFixedFrame(t,i,e,n,zA),s=X.getMatrix3(r,LA);return Q.fromRotationMatrix(s,o)};const OA=new k(1,1,1),NA=new k,wy=new X,VA=new X,UA=new q,WA=new Q;pe.fixedFrameToHeadingPitchRoll=function(t,i,e,n){A.defined("transform",t),i=i??le.default,e=e??pe.eastNorthUpToFixedFrame,D(n)||(n=new tt);const o=X.getTranslation(t,NA);if(k.equals(o,k.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;let r=X.inverseTransformation(e(o,i,wy),wy),s=X.setScale(t,OA,VA);s=X.setTranslation(s,k.ZERO,s),r=X.multiply(r,s,r);let a=Q.fromRotationMatrix(X.getMatrix3(r,UA),WA);return a=Q.normalize(a,a),tt.fromQuaternion(a,n)};const GA=6*3600+41*60+50.54841,HA=8640184812866e-6,qA=.093104,$A=-62e-7,XA=11772758384668e-32,YA=72921158553e-15,ZA=O.TWO_PI/86400;let Zc=new J;pe.computeIcrfToCentralBodyFixedMatrix=function(t,i){let e=pe.computeIcrfToFixedMatrix(t,i);return D(e)||(e=pe.computeTemeToPseudoFixedMatrix(t,i)),e},pe.computeTemeToPseudoFixedMatrix=function(t,i){if(!D(t))throw new H("date is required.");Zc=J.addSeconds(t,-J.computeTaiMinusUtc(t),Zc);const e=Zc.dayNumber,n=Zc.secondsOfDay;let o;const r=e-2451545;n>=43200?o=(r+.5)/Ue.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Ue.DAYS_PER_JULIAN_CENTURY;const a=(GA+o*(HA+o*(qA+o*$A)))*ZA%O.TWO_PI,c=YA+XA*(e-24515455e-1),d=(n+Ue.SECONDS_PER_DAY*.5)%Ue.SECONDS_PER_DAY,u=a+c*d,p=Math.cos(u),f=Math.sin(u);return D(i)?(i[0]=p,i[1]=-f,i[2]=0,i[3]=f,i[4]=p,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new q(p,f,0,-f,p,0,0,0,1)},pe.iau2006XysData=new Xd,pe.earthOrientationParameters=Es.NONE;const cu=32.184,QA=2451545;pe.preloadIcrfFixed=function(t){const i=t.start.dayNumber,e=t.start.secondsOfDay+cu,n=t.stop.dayNumber,o=t.stop.secondsOfDay+cu;return pe.iau2006XysData.preload(i,e,n,o)},pe.computeIcrfToFixedMatrix=function(t,i){if(!D(t))throw new H("date is required.");D(i)||(i=new q);const e=pe.computeFixedToIcrfMatrix(t,i);if(D(e))return q.transpose(e,i)};const KA=32.184,JA=2451545,Qc=new tt,BA=new q,jA=new J;pe.computeMoonFixedToIcrfMatrix=function(t,i){if(!D(t))throw new H("date is required.");const e=J.addSeconds(t,KA,jA),n=J.totalDays(e)-JA,o=O.toRadians(12.112)-O.toRadians(.052992)*n,r=O.toRadians(24.224)-O.toRadians(.105984)*n,s=O.toRadians(227.645)+O.toRadians(13.012)*n,a=O.toRadians(261.105)+O.toRadians(13.340716)*n,c=O.toRadians(358)+O.toRadians(.9856)*n;return Qc.pitch=O.toRadians(180)-O.toRadians(3.878)*Math.sin(o)-O.toRadians(.12)*Math.sin(r)+O.toRadians(.07)*Math.sin(s)-O.toRadians(.017)*Math.sin(a),Qc.roll=O.toRadians(66.53-90)+O.toRadians(1.543)*Math.cos(o)+O.toRadians(.24)*Math.cos(r)-O.toRadians(.028)*Math.cos(s)+O.toRadians(.007)*Math.cos(a),Qc.heading=O.toRadians(244.375-90)+O.toRadians(13.17635831)*n+O.toRadians(3.558)*Math.sin(o)+O.toRadians(.121)*Math.sin(r)-O.toRadians(.064)*Math.sin(s)+O.toRadians(.016)*Math.sin(a)+O.toRadians(.025)*Math.sin(c),q.fromHeadingPitchRoll(Qc,BA)},pe.computeIcrfToMoonFixedMatrix=function(t,i){if(!D(t))throw new H("date is required.");D(i)||(i=new q);const e=pe.computeMoonFixedToIcrfMatrix(t,i);if(D(e))return q.transpose(e,i)};const eT=new oy(0,0,0),tT=new Ld(0,0,0,0,0),hu=new q,du=new q;pe.computeFixedToIcrfMatrix=function(t,i){if(!D(t))throw new H("date is required.");D(i)||(i=new q);const e=pe.earthOrientationParameters.compute(t,tT);if(!D(e))return;const n=t.dayNumber,o=t.secondsOfDay+cu,r=pe.iau2006XysData.computeXysRadians(n,o,eT);if(!D(r))return;const s=r.x+e.xPoleOffset,a=r.y+e.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=hu;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);const u=q.fromRotationZ(-r.s,du),p=q.multiply(d,u,hu),f=t.dayNumber,g=t.secondsOfDay-J.computeTaiMinusUtc(t)+e.ut1MinusUtc,m=f-2451545,y=g/Ue.SECONDS_PER_DAY;let P=.779057273264+y+.00273781191135448*(m+y);P=P%1*O.TWO_PI;const S=q.fromRotationZ(P,du),C=q.multiply(p,S,hu),E=Math.cos(e.xPoleWander),T=Math.cos(e.yPoleWander),I=Math.sin(e.xPoleWander),b=Math.sin(e.yPoleWander);let x=n-QA+o/Ue.SECONDS_PER_DAY;x/=36525;const z=-47e-6*x*O.RADIANS_PER_DEGREE/3600,W=Math.cos(z),N=Math.sin(z),L=du;return L[0]=E*W,L[1]=E*N,L[2]=I,L[3]=-T*N+b*I*W,L[4]=T*W+b*I*N,L[5]=-b*E,L[6]=-b*N-T*I*W,L[7]=b*W-T*I*N,L[8]=T*E,q.multiply(C,L,i)};const iT=new B;pe.pointToWindowCoordinates=function(t,i,e,n){return n=pe.pointToGLWindowCoordinates(t,i,e,n),n.y=2*i[5]-n.y,n},pe.pointToGLWindowCoordinates=function(t,i,e,n){if(!D(t))throw new H("modelViewProjectionMatrix is required.");if(!D(i))throw new H("viewportTransformation is required.");if(!D(e))throw new H("point is required.");D(n)||(n=new ee);const o=iT;return X.multiplyByVector(t,B.fromElements(e.x,e.y,e.z,1,o),o),B.multiplyByScalar(o,1/o.w,o),X.multiplyByVector(i,o,o),ee.fromCartesian4(o,n)};const nT=new k,oT=new k,rT=new k;pe.rotationMatrixFromPositionVelocity=function(t,i,e,n){if(!D(t))throw new H("position is required.");if(!D(i))throw new H("velocity is required.");const o=(e??le.default).geodeticSurfaceNormal(t,nT);let r=k.cross(i,o,oT);k.equalsEpsilon(r,k.ZERO,O.EPSILON6)&&(r=k.clone(k.UNIT_X,r));const s=k.cross(r,i,rT);return k.normalize(s,s),k.cross(i,s,r),k.negate(r,r),k.normalize(r,r),D(n)||(n=new q),n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=r.x,n[4]=r.y,n[5]=r.z,n[6]=s.x,n[7]=s.y,n[8]=s.z,n};const Cy=new X(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),_y=new fe,uu=new k,sT=new k,aT=new q,pu=new X,Py=new X;pe.basisTo2D=function(t,i,e){if(!D(t))throw new H("projection is required.");if(!D(i))throw new H("matrix is required.");if(!D(e))throw new H("result is required.");const n=X.getTranslation(i,sT),o=t.ellipsoid;let r;if(k.equals(n,k.ZERO))r=k.clone(k.ZERO,uu);else{const u=o.cartesianToCartographic(n,_y);r=t.project(u,uu),k.fromElements(r.z,r.x,r.y,r)}const s=pe.eastNorthUpToFixedFrame(n,o,pu),a=X.inverseTransformation(s,Py),c=X.getMatrix3(i,aT),d=X.multiplyByMatrix3(a,c,e);return X.multiply(Cy,d,e),X.setTranslation(e,r,e),e},pe.ellipsoidTo2DModelMatrix=function(t,i,e){if(!D(t))throw new H("projection is required.");if(!D(i))throw new H("center is required.");if(!D(e))throw new H("result is required.");const n=t.ellipsoid,o=pe.eastNorthUpToFixedFrame(i,n,pu),r=X.inverseTransformation(o,Py),s=n.cartesianToCartographic(i,_y),a=t.project(s,uu);k.fromElements(a.z,a.x,a.y,a);const c=X.fromTranslation(a,pu);return X.multiply(Cy,r,e),X.multiply(c,e,e),e};function oe(t,i,e,n){this.west=t??0,this.south=i??0,this.east=e??0,this.north=n??0}Object.defineProperties(oe.prototype,{width:{get:function(){return oe.computeWidth(this)}},height:{get:function(){return oe.computeHeight(this)}}}),oe.packedLength=4,oe.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t.west,i[e++]=t.south,i[e++]=t.east,i[e]=t.north,i},oe.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new oe),e.west=t[i++],e.south=t[i++],e.east=t[i++],e.north=t[i],e},oe.computeWidth=function(t){A.typeOf.object("rectangle",t);let i=t.east;const e=t.west;return i<e&&(i+=O.TWO_PI),i-e},oe.computeHeight=function(t){return A.typeOf.object("rectangle",t),t.north-t.south},oe.fromDegrees=function(t,i,e,n,o){return t=O.toRadians(t??0),i=O.toRadians(i??0),e=O.toRadians(e??0),n=O.toRadians(n??0),D(o)?(o.west=t,o.south=i,o.east=e,o.north=n,o):new oe(t,i,e,n)},oe.fromRadians=function(t,i,e,n,o){return D(o)?(o.west=t??0,o.south=i??0,o.east=e??0,o.north=n??0,o):new oe(t,i,e,n)},oe.fromCartographicArray=function(t,i){A.defined("cartographics",t);let e=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,d=t.length;c<d;c++){const u=t[c];e=Math.min(e,u.longitude),n=Math.max(n,u.longitude),s=Math.min(s,u.latitude),a=Math.max(a,u.latitude);const p=u.longitude>=0?u.longitude:u.longitude+O.TWO_PI;o=Math.min(o,p),r=Math.max(r,p)}return n-e>r-o&&(e=o,n=r,n>O.PI&&(n=n-O.TWO_PI),e>O.PI&&(e=e-O.TWO_PI)),D(i)?(i.west=e,i.south=s,i.east=n,i.north=a,i):new oe(e,s,n,a)},oe.fromCartesianArray=function(t,i,e){A.defined("cartesians",t),i=i??le.default;let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let d=0,u=t.length;d<u;d++){const p=i.cartesianToCartographic(t[d]);n=Math.min(n,p.longitude),o=Math.max(o,p.longitude),a=Math.min(a,p.latitude),c=Math.max(c,p.latitude);const f=p.longitude>=0?p.longitude:p.longitude+O.TWO_PI;r=Math.min(r,f),s=Math.max(s,f)}return o-n>s-r&&(n=r,o=s,o>O.PI&&(o=o-O.TWO_PI),n>O.PI&&(n=n-O.TWO_PI)),D(e)?(e.west=n,e.south=a,e.east=o,e.north=c,e):new oe(n,a,o,c)};const lT=new k,cT=new k,hT=new k,dT=new k,uT=new k,fu=new Array(5);for(let t=0;t<fu.length;++t)fu[t]=new k;oe.fromBoundingSphere=function(t,i,e){A.typeOf.object("boundingSphere",t);const n=t.center,o=t.radius;if(D(i)||(i=le.default),D(e)||(e=new oe),k.equals(n,k.ZERO))return oe.clone(oe.MAX_VALUE,e),e;const r=pe.eastNorthUpToFixedFrame(n,i,lT),s=X.multiplyByPointAsVector(r,k.UNIT_X,cT);k.normalize(s,s);const a=X.multiplyByPointAsVector(r,k.UNIT_Y,hT);k.normalize(a,a),k.multiplyByScalar(a,o,a),k.multiplyByScalar(s,o,s);const c=k.negate(a,uT),d=k.negate(s,dT),u=fu;let p=u[0];return k.add(n,a,p),p=u[1],k.add(n,d,p),p=u[2],k.add(n,c,p),p=u[3],k.add(n,s,p),u[4]=n,oe.fromCartesianArray(u,i,e)},oe.clone=function(t,i){if(D(t))return D(i)?(i.west=t.west,i.south=t.south,i.east=t.east,i.north=t.north,i):new oe(t.west,t.south,t.east,t.north)},oe.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t.west-i.west)<=e&&Math.abs(t.south-i.south)<=e&&Math.abs(t.east-i.east)<=e&&Math.abs(t.north-i.north)<=e},oe.prototype.clone=function(t){return oe.clone(this,t)},oe.prototype.equals=function(t){return oe.equals(this,t)},oe.equals=function(t,i){return t===i||D(t)&&D(i)&&t.west===i.west&&t.south===i.south&&t.east===i.east&&t.north===i.north},oe.prototype.equalsEpsilon=function(t,i){return oe.equalsEpsilon(this,t,i)},oe._validate=function(t){A.typeOf.object("rectangle",t);const i=t.north;A.typeOf.number.greaterThanOrEquals("north",i,-O.PI_OVER_TWO),A.typeOf.number.lessThanOrEquals("north",i,O.PI_OVER_TWO);const e=t.south;A.typeOf.number.greaterThanOrEquals("south",e,-O.PI_OVER_TWO),A.typeOf.number.lessThanOrEquals("south",e,O.PI_OVER_TWO);const n=t.west;A.typeOf.number.greaterThanOrEquals("west",n,-Math.PI),A.typeOf.number.lessThanOrEquals("west",n,Math.PI);const o=t.east;A.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),A.typeOf.number.lessThanOrEquals("east",o,Math.PI)},oe.southwest=function(t,i){return A.typeOf.object("rectangle",t),D(i)?(i.longitude=t.west,i.latitude=t.south,i.height=0,i):new fe(t.west,t.south)},oe.northwest=function(t,i){return A.typeOf.object("rectangle",t),D(i)?(i.longitude=t.west,i.latitude=t.north,i.height=0,i):new fe(t.west,t.north)},oe.northeast=function(t,i){return A.typeOf.object("rectangle",t),D(i)?(i.longitude=t.east,i.latitude=t.north,i.height=0,i):new fe(t.east,t.north)},oe.southeast=function(t,i){return A.typeOf.object("rectangle",t),D(i)?(i.longitude=t.east,i.latitude=t.south,i.height=0,i):new fe(t.east,t.south)},oe.center=function(t,i){A.typeOf.object("rectangle",t);let e=t.east;const n=t.west;e<n&&(e+=O.TWO_PI);const o=O.negativePiToPi((n+e)*.5),r=(t.south+t.north)*.5;return D(i)?(i.longitude=o,i.latitude=r,i.height=0,i):new fe(o,r)},oe.intersection=function(t,i,e){A.typeOf.object("rectangle",t),A.typeOf.object("otherRectangle",i);let n=t.east,o=t.west,r=i.east,s=i.west;n<o&&r>0?n+=O.TWO_PI:r<s&&n>0&&(r+=O.TWO_PI),n<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);const a=O.negativePiToPi(Math.max(o,s)),c=O.negativePiToPi(Math.min(n,r));if((t.west<t.east||i.west<i.east)&&c<=a)return;const d=Math.max(t.south,i.south),u=Math.min(t.north,i.north);if(!(d>=u))return D(e)?(e.west=a,e.south=d,e.east=c,e.north=u,e):new oe(a,d,c,u)},oe.simpleIntersection=function(t,i,e){A.typeOf.object("rectangle",t),A.typeOf.object("otherRectangle",i);const n=Math.max(t.west,i.west),o=Math.max(t.south,i.south),r=Math.min(t.east,i.east),s=Math.min(t.north,i.north);if(!(o>=s||n>=r))return D(e)?(e.west=n,e.south=o,e.east=r,e.north=s,e):new oe(n,o,r,s)},oe.union=function(t,i,e){A.typeOf.object("rectangle",t),A.typeOf.object("otherRectangle",i),D(e)||(e=new oe);let n=t.east,o=t.west,r=i.east,s=i.west;n<o&&r>0?n+=O.TWO_PI:r<s&&n>0&&(r+=O.TWO_PI),n<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);const a=O.negativePiToPi(Math.min(o,s)),c=O.negativePiToPi(Math.max(n,r));return e.west=a,e.south=Math.min(t.south,i.south),e.east=c,e.north=Math.max(t.north,i.north),e},oe.expand=function(t,i,e){return A.typeOf.object("rectangle",t),A.typeOf.object("cartographic",i),D(e)||(e=new oe),e.west=Math.min(t.west,i.longitude),e.south=Math.min(t.south,i.latitude),e.east=Math.max(t.east,i.longitude),e.north=Math.max(t.north,i.latitude),e},oe.contains=function(t,i){A.typeOf.object("rectangle",t),A.typeOf.object("cartographic",i);let e=i.longitude;const n=i.latitude,o=t.west;let r=t.east;return r<o&&(r+=O.TWO_PI,e<0&&(e+=O.TWO_PI)),(e>o||O.equalsEpsilon(e,o,O.EPSILON14))&&(e<r||O.equalsEpsilon(e,r,O.EPSILON14))&&n>=t.south&&n<=t.north};const pT=new fe;oe.subsample=function(t,i,e,n){A.typeOf.object("rectangle",t),i=i??le.default,e=e??0,D(n)||(n=[]);let o=0;const r=t.north,s=t.south,a=t.east,c=t.west,d=pT;d.height=e,d.longitude=c,d.latitude=r,n[o]=i.cartographicToCartesian(d,n[o]),o++,d.longitude=a,n[o]=i.cartographicToCartesian(d,n[o]),o++,d.latitude=s,n[o]=i.cartographicToCartesian(d,n[o]),o++,d.longitude=c,n[o]=i.cartographicToCartesian(d,n[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*O.PI_OVER_TWO,oe.contains(t,d)&&(n[o]=i.cartographicToCartesian(d,n[o]),o++);return d.latitude===0&&(d.longitude=c,n[o]=i.cartographicToCartesian(d,n[o]),o++,d.longitude=a,n[o]=i.cartographicToCartesian(d,n[o]),o++),n.length=o,n},oe.subsection=function(t,i,e,n,o,r){if(A.typeOf.object("rectangle",t),A.typeOf.number.greaterThanOrEquals("westLerp",i,0),A.typeOf.number.lessThanOrEquals("westLerp",i,1),A.typeOf.number.greaterThanOrEquals("southLerp",e,0),A.typeOf.number.lessThanOrEquals("southLerp",e,1),A.typeOf.number.greaterThanOrEquals("eastLerp",n,0),A.typeOf.number.lessThanOrEquals("eastLerp",n,1),A.typeOf.number.greaterThanOrEquals("northLerp",o,0),A.typeOf.number.lessThanOrEquals("northLerp",o,1),A.typeOf.number.lessThanOrEquals("westLerp",i,n),A.typeOf.number.lessThanOrEquals("southLerp",e,o),D(r)||(r=new oe),t.west<=t.east){const a=t.east-t.west;r.west=t.west+i*a,r.east=t.west+n*a}else{const a=O.TWO_PI+t.east-t.west;r.west=O.negativePiToPi(t.west+i*a),r.east=O.negativePiToPi(t.west+n*a)}const s=t.north-t.south;return r.south=t.south+e*s,r.north=t.south+o*s,i===1&&(r.west=t.east),n===1&&(r.east=t.east),e===1&&(r.south=t.north),o===1&&(r.north=t.north),r},oe.MAX_VALUE=Object.freeze(new oe(-Math.PI,-O.PI_OVER_TWO,Math.PI,O.PI_OVER_TWO));function xt(t){this._ellipsoid=t??le.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(xt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),xt.mercatorAngleToGeodeticLatitude=function(t){return O.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},xt.geodeticLatitudeToMercatorAngle=function(t){t>xt.MaximumLatitude?t=xt.MaximumLatitude:t<-xt.MaximumLatitude&&(t=-xt.MaximumLatitude);const i=Math.sin(t);return .5*Math.log((1+i)/(1-i))},xt.MaximumLatitude=xt.mercatorAngleToGeodeticLatitude(Math.PI),xt.prototype.project=function(t,i){const e=this._semimajorAxis,n=t.longitude*e,o=xt.geodeticLatitudeToMercatorAngle(t.latitude)*e,r=t.height;return D(i)?(i.x=n,i.y=o,i.z=r,i):new k(n,o,r)},xt.prototype.unproject=function(t,i){if(!D(t))throw new H("cartesian is required");const e=this._oneOverSemimajorAxis,n=t.x*e,o=xt.mercatorAngleToGeodeticLatitude(t.y*e),r=t.z;return D(i)?(i.longitude=n,i.latitude=o,i.height=r,i):new fe(n,o,r)};function fT(){return!0}function gT(t,i){i=i??"This object was destroyed, i.e., destroy() was called.";function e(){throw new H(i)}for(const n in t)typeof t[n]=="function"&&(t[n]=e);t.isDestroyed=fT}function Sy(){if(!D(it._canTransferArrayBuffer)){const t=vu("transferTypedArrayTest");t.postMessage=t.webkitPostMessage??t.postMessage;const i=99,e=new Int8Array([i]);try{t.postMessage({array:e},[e.buffer])}catch{return it._canTransferArrayBuffer=!1,it._canTransferArrayBuffer}it._canTransferArrayBuffer=new Promise(n=>{t.onmessage=function(o){const r=o.data.array,s=D(r)&&r[0]===i;n(s),t.terminate(),it._canTransferArrayBuffer=s}})}return it._canTransferArrayBuffer}const gu=new dr;function mu(t){let i;try{i=new Blob([t],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(t),i=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(i)}function vu(t){const i=new qi(t),e=i.scheme().length!==0&&i.fragment().length===0,n=t.replace(/\.js$/,""),o={};let r,s;if(Gd(t))s=t;else if(!e){const a=ei(`${it._workerModulePrefix}/${n}.js`);Gd(a)&&(s=a)}if(s){const a=`import "${s}";`;return r=mu(a),o.type="module",new Worker(r,o)}if(!e&&typeof CESIUM_WORKERS<"u"){const a=`
|
|
361
|
+
*/var jE=zc.exports,Zv;function eA(){return Zv||(Zv=1,(function(t){(function(i,e){t.exports?t.exports=e(ZE(),KE(),BE()):i.URI=e(i.punycode,i.IPv6,i.SecondLevelDomains,i)})(jE,function(i,e,n,o){var r=o&&o.URI;function s(_,M){var F=arguments.length>=1,V=arguments.length>=2;if(!(this instanceof s))return F?V?new s(_,M):new s(_):new s;if(_===void 0){if(F)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?_=location.href+"":_=""}if(_===null&&F)throw new TypeError("null is not a valid argument for URI");return this.href(_),M!==void 0?this.absoluteTo(M):this}function a(_){return/^[0-9]+$/.test(_)}s.version="1.19.11";var c=s.prototype,d=Object.prototype.hasOwnProperty;function u(_){return _.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function p(_){return _===void 0?"Undefined":String(Object.prototype.toString.call(_)).slice(8,-1)}function f(_){return p(_)==="Array"}function g(_,M){var F={},V,G;if(p(M)==="RegExp")F=null;else if(f(M))for(V=0,G=M.length;V<G;V++)F[M[V]]=!0;else F[M]=!0;for(V=0,G=_.length;V<G;V++){var Z=F&&F[_[V]]!==void 0||!F&&M.test(_[V]);Z&&(_.splice(V,1),G--,V--)}return _}function m(_,M){var F,V;if(f(M)){for(F=0,V=M.length;F<V;F++)if(!m(_,M[F]))return!1;return!0}var G=p(M);for(F=0,V=_.length;F<V;F++)if(G==="RegExp"){if(typeof _[F]=="string"&&_[F].match(M))return!0}else if(_[F]===M)return!0;return!1}function y(_,M){if(!f(_)||!f(M)||_.length!==M.length)return!1;_.sort(),M.sort();for(var F=0,V=_.length;F<V;F++)if(_[F]!==M[F])return!1;return!0}function P(_){var M=/^\/+|\/+$/g;return _.replace(M,"")}s._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:s.preventInvalidHostname,duplicateQueryParameters:s.duplicateQueryParameters,escapeQuerySpace:s.escapeQuerySpace}},s.preventInvalidHostname=!1,s.duplicateQueryParameters=!1,s.escapeQuerySpace=!0,s.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,s.idn_expression=/[^a-z0-9\._-]/i,s.punycode_expression=/(xn--)/i,s.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,s.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*$/,s.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,s.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},s.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,s.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},s.hostProtocols=["http","https"],s.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,s.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"},s.getDomAttribute=function(_){if(!(!_||!_.nodeName)){var M=_.nodeName.toLowerCase();if(!(M==="input"&&_.type!=="image"))return s.domAttributes[M]}};function S(_){return escape(_)}function C(_){return encodeURIComponent(_).replace(/[!'()*]/g,S).replace(/\*/g,"%2A")}s.encode=C,s.decode=decodeURIComponent,s.iso8859=function(){s.encode=escape,s.decode=unescape},s.unicode=function(){s.encode=C,s.decode=decodeURIComponent},s.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"}}}},s.encodeQuery=function(_,M){var F=s.encode(_+"");return M===void 0&&(M=s.escapeQuerySpace),M?F.replace(/%20/g,"+"):F},s.decodeQuery=function(_,M){_+="",M===void 0&&(M=s.escapeQuerySpace);try{return s.decode(M?_.replace(/\+/g,"%20"):_)}catch{return _}};var E={encode:"encode",decode:"decode"},T,I=function(_,M){return function(F){try{return s[M](F+"").replace(s.characters[_][M].expression,function(V){return s.characters[_][M].map[V]})}catch{return F}}};for(T in E)s[T+"PathSegment"]=I("pathname",E[T]),s[T+"UrnPathSegment"]=I("urnpath",E[T]);var b=function(_,M,F){return function(V){var G;F?G=function(K){return s[M](s[F](K))}:G=s[M];for(var Z=(V+"").split(_),$=0,Y=Z.length;$<Y;$++)Z[$]=G(Z[$]);return Z.join(_)}};s.decodePath=b("/","decodePathSegment"),s.decodeUrnPath=b(":","decodeUrnPathSegment"),s.recodePath=b("/","encodePathSegment","decode"),s.recodeUrnPath=b(":","encodeUrnPathSegment","decode"),s.encodeReserved=I("reserved","encode"),s.parse=function(_,M){var F;return M||(M={preventInvalidHostname:s.preventInvalidHostname}),_=_.replace(s.leading_whitespace_expression,""),_=_.replace(s.ascii_tab_whitespace,""),F=_.indexOf("#"),F>-1&&(M.fragment=_.substring(F+1)||null,_=_.substring(0,F)),F=_.indexOf("?"),F>-1&&(M.query=_.substring(F+1)||null,_=_.substring(0,F)),_=_.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),_=_.replace(/^[/\\]{2,}/i,"//"),_.substring(0,2)==="//"?(M.protocol=null,_=_.substring(2),_=s.parseAuthority(_,M)):(F=_.indexOf(":"),F>-1&&(M.protocol=_.substring(0,F)||null,M.protocol&&!M.protocol.match(s.protocol_expression)?M.protocol=void 0:_.substring(F+1,F+3).replace(/\\/g,"/")==="//"?(_=_.substring(F+3),_=s.parseAuthority(_,M)):(_=_.substring(F+1),M.urn=!0))),M.path=_,M},s.parseHost=function(_,M){_||(_=""),_=_.replace(/\\/g,"/");var F=_.indexOf("/"),V,G;if(F===-1&&(F=_.length),_.charAt(0)==="[")V=_.indexOf("]"),M.hostname=_.substring(1,V)||null,M.port=_.substring(V+2,F)||null,M.port==="/"&&(M.port=null);else{var Z=_.indexOf(":"),$=_.indexOf("/"),Y=_.indexOf(":",Z+1);Y!==-1&&($===-1||Y<$)?(M.hostname=_.substring(0,F)||null,M.port=null):(G=_.substring(0,F).split(":"),M.hostname=G[0]||null,M.port=G[1]||null)}return M.hostname&&_.substring(F).charAt(0)!=="/"&&(F++,_="/"+_),M.preventInvalidHostname&&s.ensureValidHostname(M.hostname,M.protocol),M.port&&s.ensureValidPort(M.port),_.substring(F)||"/"},s.parseAuthority=function(_,M){return _=s.parseUserinfo(_,M),s.parseHost(_,M)},s.parseUserinfo=function(_,M){var F=_,V=_.indexOf("\\");V!==-1&&(_=_.replace(/\\/g,"/"));var G=_.indexOf("/"),Z=_.lastIndexOf("@",G>-1?G:_.length-1),$;return Z>-1&&(G===-1||Z<G)?($=_.substring(0,Z).split(":"),M.username=$[0]?s.decode($[0]):null,$.shift(),M.password=$[0]?s.decode($.join(":")):null,_=F.substring(Z+1)):(M.username=null,M.password=null),_},s.parseQuery=function(_,M){if(!_)return{};if(_=_.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!_)return{};for(var F={},V=_.split("&"),G=V.length,Z,$,Y,K=0;K<G;K++)Z=V[K].split("="),$=s.decodeQuery(Z.shift(),M),Y=Z.length?s.decodeQuery(Z.join("="),M):null,$!=="__proto__"&&(d.call(F,$)?((typeof F[$]=="string"||F[$]===null)&&(F[$]=[F[$]]),F[$].push(Y)):F[$]=Y);return F},s.build=function(_){var M="",F=!1;return _.protocol&&(M+=_.protocol+":"),!_.urn&&(M||_.hostname)&&(M+="//",F=!0),M+=s.buildAuthority(_)||"",typeof _.path=="string"&&(_.path.charAt(0)!=="/"&&F&&(M+="/"),M+=_.path),typeof _.query=="string"&&_.query&&(M+="?"+_.query),typeof _.fragment=="string"&&_.fragment&&(M+="#"+_.fragment),M},s.buildHost=function(_){var M="";if(_.hostname)s.ip6_expression.test(_.hostname)?M+="["+_.hostname+"]":M+=_.hostname;else return"";return _.port&&(M+=":"+_.port),M},s.buildAuthority=function(_){return s.buildUserinfo(_)+s.buildHost(_)},s.buildUserinfo=function(_){var M="";return _.username&&(M+=s.encode(_.username)),_.password&&(M+=":"+s.encode(_.password)),M&&(M+="@"),M},s.buildQuery=function(_,M,F){var V="",G,Z,$,Y;for(Z in _)if(Z!=="__proto__"&&d.call(_,Z))if(f(_[Z]))for(G={},$=0,Y=_[Z].length;$<Y;$++)_[Z][$]!==void 0&&G[_[Z][$]+""]===void 0&&(V+="&"+s.buildQueryParameter(Z,_[Z][$],F),M!==!0&&(G[_[Z][$]+""]=!0));else _[Z]!==void 0&&(V+="&"+s.buildQueryParameter(Z,_[Z],F));return V.substring(1)},s.buildQueryParameter=function(_,M,F){return s.encodeQuery(_,F)+(M!==null?"="+s.encodeQuery(M,F):"")},s.addQuery=function(_,M,F){if(typeof M=="object")for(var V in M)d.call(M,V)&&s.addQuery(_,V,M[V]);else if(typeof M=="string"){if(_[M]===void 0){_[M]=F;return}else typeof _[M]=="string"&&(_[M]=[_[M]]);f(F)||(F=[F]),_[M]=(_[M]||[]).concat(F)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},s.setQuery=function(_,M,F){if(typeof M=="object")for(var V in M)d.call(M,V)&&s.setQuery(_,V,M[V]);else if(typeof M=="string")_[M]=F===void 0?null:F;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},s.removeQuery=function(_,M,F){var V,G,Z;if(f(M))for(V=0,G=M.length;V<G;V++)_[M[V]]=void 0;else if(p(M)==="RegExp")for(Z in _)M.test(Z)&&(_[Z]=void 0);else if(typeof M=="object")for(Z in M)d.call(M,Z)&&s.removeQuery(_,Z,M[Z]);else if(typeof M=="string")F!==void 0?p(F)==="RegExp"?!f(_[M])&&F.test(_[M])?_[M]=void 0:_[M]=g(_[M],F):_[M]===String(F)&&(!f(F)||F.length===1)?_[M]=void 0:f(_[M])&&(_[M]=g(_[M],F)):_[M]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},s.hasQuery=function(_,M,F,V){switch(p(M)){case"String":break;case"RegExp":for(var G in _)if(d.call(_,G)&&M.test(G)&&(F===void 0||s.hasQuery(_,G,F)))return!0;return!1;case"Object":for(var Z in M)if(d.call(M,Z)&&!s.hasQuery(_,Z,M[Z]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(p(F)){case"Undefined":return M in _;case"Boolean":var $=!!(f(_[M])?_[M].length:_[M]);return F===$;case"Function":return!!F(_[M],M,_);case"Array":if(!f(_[M]))return!1;var Y=V?m:y;return Y(_[M],F);case"RegExp":return f(_[M])?V?m(_[M],F):!1:!!(_[M]&&_[M].match(F));case"Number":F=String(F);case"String":return f(_[M])?V?m(_[M],F):!1:_[M]===F;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},s.joinPaths=function(){for(var _=[],M=[],F=0,V=0;V<arguments.length;V++){var G=new s(arguments[V]);_.push(G);for(var Z=G.segment(),$=0;$<Z.length;$++)typeof Z[$]=="string"&&M.push(Z[$]),Z[$]&&F++}if(!M.length||!F)return new s("");var Y=new s("").segment(M);return(_[0].path()===""||_[0].path().slice(0,1)==="/")&&Y.path("/"+Y.path()),Y.normalize()},s.commonPath=function(_,M){var F=Math.min(_.length,M.length),V;for(V=0;V<F;V++)if(_.charAt(V)!==M.charAt(V)){V--;break}return V<1?_.charAt(0)===M.charAt(0)&&_.charAt(0)==="/"?"/":"":((_.charAt(V)!=="/"||M.charAt(V)!=="/")&&(V=_.substring(0,V).lastIndexOf("/")),_.substring(0,V+1))},s.withinString=function(_,M,F){F||(F={});var V=F.start||s.findUri.start,G=F.end||s.findUri.end,Z=F.trim||s.findUri.trim,$=F.parens||s.findUri.parens,Y=/[a-z0-9-]=["']?$/i;for(V.lastIndex=0;;){var K=V.exec(_);if(!K)break;var te=K.index;if(F.ignoreHtml){var re=_.slice(Math.max(te-3,0),te);if(re&&Y.test(re))continue}for(var ge=te+_.slice(te).search(G),ye=_.slice(te,ge),Te=-1;;){var Oe=$.exec(ye);if(!Oe)break;var We=Oe.index+Oe[0].length;Te=Math.max(Te,We)}if(Te>-1?ye=ye.slice(0,Te)+ye.slice(Te).replace(Z,""):ye=ye.replace(Z,""),!(ye.length<=K[0].length)&&!(F.ignore&&F.ignore.test(ye))){ge=te+ye.length;var me=M(ye,te,ge,_);if(me===void 0){V.lastIndex=ge;continue}me=String(me),_=_.slice(0,te)+me+_.slice(ge),V.lastIndex=te+me.length}}return V.lastIndex=0,_},s.ensureValidHostname=function(_,M){var F=!!_,V=!!M,G=!1;if(V&&(G=m(s.hostProtocols,M)),G&&!F)throw new TypeError("Hostname cannot be empty, if protocol is "+M);if(_&&_.match(s.invalid_hostname_characters)){if(!i)throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(i.toASCII(_).match(s.invalid_hostname_characters))throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-:_]')}},s.ensureValidPort=function(_){if(_){var M=Number(_);if(!(a(M)&&M>0&&M<65536))throw new TypeError('Port "'+_+'" is not a valid port')}},s.noConflict=function(_){if(_){var M={URI:this.noConflict()};return o.URITemplate&&typeof o.URITemplate.noConflict=="function"&&(M.URITemplate=o.URITemplate.noConflict()),o.IPv6&&typeof o.IPv6.noConflict=="function"&&(M.IPv6=o.IPv6.noConflict()),o.SecondLevelDomains&&typeof o.SecondLevelDomains.noConflict=="function"&&(M.SecondLevelDomains=o.SecondLevelDomains.noConflict()),M}else o.URI===this&&(o.URI=r);return this},c.build=function(_){return _===!0?this._deferred_build=!0:(_===void 0||this._deferred_build)&&(this._string=s.build(this._parts),this._deferred_build=!1),this},c.clone=function(){return new s(this)},c.valueOf=c.toString=function(){return this.build(!1)._string};function x(_){return function(M,F){return M===void 0?this._parts[_]||"":(this._parts[_]=M||null,this.build(!F),this)}}function z(_,M){return function(F,V){return F===void 0?this._parts[_]||"":(F!==null&&(F=F+"",F.charAt(0)===M&&(F=F.substring(1))),this._parts[_]=F,this.build(!V),this)}}c.protocol=x("protocol"),c.username=x("username"),c.password=x("password"),c.hostname=x("hostname"),c.port=x("port"),c.query=z("query","?"),c.fragment=z("fragment","#"),c.search=function(_,M){var F=this.query(_,M);return typeof F=="string"&&F.length?"?"+F:F},c.hash=function(_,M){var F=this.fragment(_,M);return typeof F=="string"&&F.length?"#"+F:F},c.pathname=function(_,M){if(_===void 0||_===!0){var F=this._parts.path||(this._parts.hostname?"/":"");return _?(this._parts.urn?s.decodeUrnPath:s.decodePath)(F):F}else return this._parts.urn?this._parts.path=_?s.recodeUrnPath(_):"":this._parts.path=_?s.recodePath(_):"/",this.build(!M),this},c.path=c.pathname,c.href=function(_,M){var F;if(_===void 0)return this.toString();this._string="",this._parts=s._parts();var V=_ instanceof s,G=typeof _=="object"&&(_.hostname||_.path||_.pathname);if(_.nodeName){var Z=s.getDomAttribute(_);_=_[Z]||"",G=!1}if(!V&&G&&_.pathname!==void 0&&(_=_.toString()),typeof _=="string"||_ instanceof String)this._parts=s.parse(String(_),this._parts);else if(V||G){var $=V?_._parts:_;for(F in $)F!=="query"&&d.call(this._parts,F)&&(this._parts[F]=$[F]);$.query&&this.query($.query,!1)}else throw new TypeError("invalid input");return this.build(!M),this},c.is=function(_){var M=!1,F=!1,V=!1,G=!1,Z=!1,$=!1,Y=!1,K=!this._parts.urn;switch(this._parts.hostname&&(K=!1,F=s.ip4_expression.test(this._parts.hostname),V=s.ip6_expression.test(this._parts.hostname),M=F||V,G=!M,Z=G&&n&&n.has(this._parts.hostname),$=G&&s.idn_expression.test(this._parts.hostname),Y=G&&s.punycode_expression.test(this._parts.hostname)),_.toLowerCase()){case"relative":return K;case"absolute":return!K;case"domain":case"name":return G;case"sld":return Z;case"ip":return M;case"ip4":case"ipv4":case"inet4":return F;case"ip6":case"ipv6":case"inet6":return V;case"idn":return $;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return Y}return null};var W=c.protocol,N=c.port,L=c.hostname;c.protocol=function(_,M){if(_&&(_=_.replace(/:(\/\/)?$/,""),!_.match(s.protocol_expression)))throw new TypeError('Protocol "'+_+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return W.call(this,_,M)},c.scheme=c.protocol,c.port=function(_,M){return this._parts.urn?_===void 0?"":this:(_!==void 0&&(_===0&&(_=null),_&&(_+="",_.charAt(0)===":"&&(_=_.substring(1)),s.ensureValidPort(_))),N.call(this,_,M))},c.hostname=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_!==void 0){var F={preventInvalidHostname:this._parts.preventInvalidHostname},V=s.parseHost(_,F);if(V!=="/")throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-]');_=F.hostname,this._parts.preventInvalidHostname&&s.ensureValidHostname(_,this._parts.protocol)}return L.call(this,_,M)},c.origin=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0){var F=this.protocol(),V=this.authority();return V?(F?F+"://":"")+this.authority():""}else{var G=s(_);return this.protocol(G.protocol()).authority(G.authority()).build(!M),this}},c.host=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0)return this._parts.hostname?s.buildHost(this._parts):"";var F=s.parseHost(_,this._parts);if(F!=="/")throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-]');return this.build(!M),this},c.authority=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0)return this._parts.hostname?s.buildAuthority(this._parts):"";var F=s.parseAuthority(_,this._parts);if(F!=="/")throw new TypeError('Hostname "'+_+'" contains characters other than [A-Z0-9.-]');return this.build(!M),this},c.userinfo=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0){var F=s.buildUserinfo(this._parts);return F&&F.substring(0,F.length-1)}else return _[_.length-1]!=="@"&&(_+="@"),s.parseUserinfo(_,this._parts),this.build(!M),this},c.resource=function(_,M){var F;return _===void 0?this.path()+this.search()+this.hash():(F=s.parse(_),this._parts.path=F.path,this._parts.query=F.query,this._parts.fragment=F.fragment,this.build(!M),this)},c.subdomain=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0){if(!this._parts.hostname||this.is("IP"))return"";var F=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,F)||""}else{var V=this._parts.hostname.length-this.domain().length,G=this._parts.hostname.substring(0,V),Z=new RegExp("^"+u(G));if(_&&_.charAt(_.length-1)!=="."&&(_+="."),_.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return _&&s.ensureValidHostname(_,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(Z,_),this.build(!M),this}},c.domain=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(typeof _=="boolean"&&(M=_,_=void 0),_===void 0){if(!this._parts.hostname||this.is("IP"))return"";var F=this._parts.hostname.match(/\./g);if(F&&F.length<2)return this._parts.hostname;var V=this._parts.hostname.length-this.tld(M).length-1;return V=this._parts.hostname.lastIndexOf(".",V-1)+1,this._parts.hostname.substring(V)||""}else{if(!_)throw new TypeError("cannot set domain empty");if(_.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(s.ensureValidHostname(_,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=_;else{var G=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(G,_)}return this.build(!M),this}},c.tld=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(typeof _=="boolean"&&(M=_,_=void 0),_===void 0){if(!this._parts.hostname||this.is("IP"))return"";var F=this._parts.hostname.lastIndexOf("."),V=this._parts.hostname.substring(F+1);return M!==!0&&n&&n.list[V.toLowerCase()]&&n.get(this._parts.hostname)||V}else{var G;if(_)if(_.match(/[^a-zA-Z0-9-]/))if(n&&n.is(_))G=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(G,_);else throw new TypeError('TLD "'+_+'" 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");G=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(G,_)}else throw new TypeError("cannot set TLD empty");return this.build(!M),this}},c.directory=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0||_===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var F=this._parts.path.length-this.filename().length-1,V=this._parts.path.substring(0,F)||(this._parts.hostname?"/":"");return _?s.decodePath(V):V}else{var G=this._parts.path.length-this.filename().length,Z=this._parts.path.substring(0,G),$=new RegExp("^"+u(Z));return this.is("relative")||(_||(_="/"),_.charAt(0)!=="/"&&(_="/"+_)),_&&_.charAt(_.length-1)!=="/"&&(_+="/"),_=s.recodePath(_),this._parts.path=this._parts.path.replace($,_),this.build(!M),this}},c.filename=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(typeof _!="string"){if(!this._parts.path||this._parts.path==="/")return"";var F=this._parts.path.lastIndexOf("/"),V=this._parts.path.substring(F+1);return _?s.decodePathSegment(V):V}else{var G=!1;_.charAt(0)==="/"&&(_=_.substring(1)),_.match(/\.?\//)&&(G=!0);var Z=new RegExp(u(this.filename())+"$");return _=s.recodePath(_),this._parts.path=this._parts.path.replace(Z,_),G?this.normalizePath(M):this.build(!M),this}},c.suffix=function(_,M){if(this._parts.urn)return _===void 0?"":this;if(_===void 0||_===!0){if(!this._parts.path||this._parts.path==="/")return"";var F=this.filename(),V=F.lastIndexOf("."),G,Z;return V===-1?"":(G=F.substring(V+1),Z=/^[a-z0-9%]+$/i.test(G)?G:"",_?s.decodePathSegment(Z):Z)}else{_.charAt(0)==="."&&(_=_.substring(1));var $=this.suffix(),Y;if($)_?Y=new RegExp(u($)+"$"):Y=new RegExp(u("."+$)+"$");else{if(!_)return this;this._parts.path+="."+s.recodePath(_)}return Y&&(_=s.recodePath(_),this._parts.path=this._parts.path.replace(Y,_)),this.build(!M),this}},c.segment=function(_,M,F){var V=this._parts.urn?":":"/",G=this.path(),Z=G.substring(0,1)==="/",$=G.split(V);if(_!==void 0&&typeof _!="number"&&(F=M,M=_,_=void 0),_!==void 0&&typeof _!="number")throw new Error('Bad segment "'+_+'", must be 0-based integer');if(Z&&$.shift(),_<0&&(_=Math.max($.length+_,0)),M===void 0)return _===void 0?$:$[_];if(_===null||$[_]===void 0)if(f(M)){$=[];for(var Y=0,K=M.length;Y<K;Y++)!M[Y].length&&(!$.length||!$[$.length-1].length)||($.length&&!$[$.length-1].length&&$.pop(),$.push(P(M[Y])))}else(M||typeof M=="string")&&(M=P(M),$[$.length-1]===""?$[$.length-1]=M:$.push(M));else M?$[_]=P(M):$.splice(_,1);return Z&&$.unshift(""),this.path($.join(V),F)},c.segmentCoded=function(_,M,F){var V,G,Z;if(typeof _!="number"&&(F=M,M=_,_=void 0),M===void 0){if(V=this.segment(_,M,F),!f(V))V=V!==void 0?s.decode(V):void 0;else for(G=0,Z=V.length;G<Z;G++)V[G]=s.decode(V[G]);return V}if(!f(M))M=typeof M=="string"||M instanceof String?s.encode(M):M;else for(G=0,Z=M.length;G<Z;G++)M[G]=s.encode(M[G]);return this.segment(_,M,F)};var U=c.query;return c.query=function(_,M){if(_===!0)return s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof _=="function"){var F=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace),V=_.call(this,F);return this._parts.query=s.buildQuery(V||F,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!M),this}else return _!==void 0&&typeof _!="string"?(this._parts.query=s.buildQuery(_,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!M),this):U.call(this,_,M)},c.setQuery=function(_,M,F){var V=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof _=="string"||_ instanceof String)V[_]=M!==void 0?M:null;else if(typeof _=="object")for(var G in _)d.call(_,G)&&(V[G]=_[G]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=s.buildQuery(V,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof _!="string"&&(F=M),this.build(!F),this},c.addQuery=function(_,M,F){var V=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.addQuery(V,_,M===void 0?null:M),this._parts.query=s.buildQuery(V,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof _!="string"&&(F=M),this.build(!F),this},c.removeQuery=function(_,M,F){var V=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.removeQuery(V,_,M),this._parts.query=s.buildQuery(V,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof _!="string"&&(F=M),this.build(!F),this},c.hasQuery=function(_,M,F){var V=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.hasQuery(V,_,M,F)},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(_){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!_)),this},c.normalizeHostname=function(_){return this._parts.hostname&&(this.is("IDN")&&i?this._parts.hostname=i.toASCII(this._parts.hostname):this.is("IPv6")&&e&&(this._parts.hostname=e.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!_)),this},c.normalizePort=function(_){return typeof this._parts.protocol=="string"&&this._parts.port===s.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!_)),this},c.normalizePath=function(_){var M=this._parts.path;if(!M)return this;if(this._parts.urn)return this._parts.path=s.recodeUrnPath(this._parts.path),this.build(!_),this;if(this._parts.path==="/")return this;M=s.recodePath(M);var F,V="",G,Z;for(M.charAt(0)!=="/"&&(F=!0,M="/"+M),(M.slice(-3)==="/.."||M.slice(-2)==="/.")&&(M+="/"),M=M.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),F&&(V=M.substring(1).match(/^(\.\.\/)+/)||"",V&&(V=V[0]));G=M.search(/\/\.\.(\/|$)/),G!==-1;){if(G===0){M=M.substring(3);continue}Z=M.substring(0,G).lastIndexOf("/"),Z===-1&&(Z=G),M=M.substring(0,Z)+M.substring(G+3)}return F&&this.is("relative")&&(M=V+M.substring(1)),this._parts.path=M,this.build(!_),this},c.normalizePathname=c.normalizePath,c.normalizeQuery=function(_){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(s.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!_)),this},c.normalizeFragment=function(_){return this._parts.fragment||(this._parts.fragment=null,this.build(!_)),this},c.normalizeSearch=c.normalizeQuery,c.normalizeHash=c.normalizeFragment,c.iso8859=function(){var _=s.encode,M=s.decode;s.encode=escape,s.decode=decodeURIComponent;try{this.normalize()}finally{s.encode=_,s.decode=M}return this},c.unicode=function(){var _=s.encode,M=s.decode;s.encode=C,s.decode=unescape;try{this.normalize()}finally{s.encode=_,s.decode=M}return this},c.readable=function(){var _=this.clone();_.username("").password("").normalize();var M="";if(_._parts.protocol&&(M+=_._parts.protocol+"://"),_._parts.hostname&&(_.is("punycode")&&i?(M+=i.toUnicode(_._parts.hostname),_._parts.port&&(M+=":"+_._parts.port)):M+=_.host()),_._parts.hostname&&_._parts.path&&_._parts.path.charAt(0)!=="/"&&(M+="/"),M+=_.path(!0),_._parts.query){for(var F="",V=0,G=_._parts.query.split("&"),Z=G.length;V<Z;V++){var $=(G[V]||"").split("=");F+="&"+s.decodeQuery($[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),$[1]!==void 0&&(F+="="+s.decodeQuery($[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}M+="?"+F.substring(1)}return M+=s.decodeQuery(_.hash(),!0),M},c.absoluteTo=function(_){var M=this.clone(),F=["protocol","username","password","hostname","port"],V,G,Z;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(_ instanceof s||(_=new s(_)),M._parts.protocol||(M._parts.protocol=_._parts.protocol,this._parts.hostname))return M;for(G=0;Z=F[G];G++)M._parts[Z]=_._parts[Z];return M._parts.path?(M._parts.path.substring(-2)===".."&&(M._parts.path+="/"),M.path().charAt(0)!=="/"&&(V=_.directory(),V=V||(_.path().indexOf("/")===0?"/":""),M._parts.path=(V?V+"/":"")+M._parts.path,M.normalizePath())):(M._parts.path=_._parts.path,M._parts.query||(M._parts.query=_._parts.query)),M.build(),M},c.relativeTo=function(_){var M=this.clone().normalize(),F,V,G,Z,$;if(M._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(_=new s(_).normalize(),F=M._parts,V=_._parts,Z=M.path(),$=_.path(),Z.charAt(0)!=="/")throw new Error("URI is already relative");if($.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(F.protocol===V.protocol&&(F.protocol=null),F.username!==V.username||F.password!==V.password||F.protocol!==null||F.username!==null||F.password!==null)return M.build();if(F.hostname===V.hostname&&F.port===V.port)F.hostname=null,F.port=null;else return M.build();if(Z===$)return F.path="",M.build();if(G=s.commonPath(Z,$),!G)return M.build();var Y=V.path.substring(G.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return F.path=Y+F.path.substring(G.length)||"./",M.build()},c.equals=function(_){var M=this.clone(),F=new s(_),V={},G={},Z={},$,Y,K;if(M.normalize(),F.normalize(),M.toString()===F.toString())return!0;if($=M.query(),Y=F.query(),M.query(""),F.query(""),M.toString()!==F.toString()||$.length!==Y.length)return!1;V=s.parseQuery($,this._parts.escapeQuerySpace),G=s.parseQuery(Y,this._parts.escapeQuerySpace);for(K in V)if(d.call(V,K)){if(f(V[K])){if(!y(V[K],G[K]))return!1}else if(V[K]!==G[K])return!1;Z[K]=!0}for(K in G)if(d.call(G,K)&&!Z[K])return!1;return!0},c.preventInvalidHostname=function(_){return this._parts.preventInvalidHostname=!!_,this},c.duplicateQueryParameters=function(_){return this._parts.duplicateQueryParameters=!!_,this},c.escapeQuerySpace=function(_){return this._parts.escapeQuerySpace=!!_,this},s})})(zc)),zc.exports}var tA=eA();const qi=mc(tA);function iA(t){return(t.length===0||t[t.length-1]!=="/")&&(t=`${t}/`),t}function dr(t,i){if(t===null||typeof t!="object")return t;i=i??!1;const e=new t.constructor;for(const n in t)if(t.hasOwnProperty(n)){let o=t[n];i&&(o=dr(o,i)),e[n]=o}return e}function Mn(t,i,e){e=e??!1;const n={},o=D(t),r=D(i);let s,a,c;if(o)for(s in t)t.hasOwnProperty(s)&&(a=t[s],r&&e&&typeof a=="object"&&i.hasOwnProperty(s)?(c=i[s],typeof c=="object"?n[s]=Mn(a,c,e):n[s]=a):n[s]=a);if(r)for(s in i)i.hasOwnProperty(s)&&!n.hasOwnProperty(s)&&(c=i[s],n[s]=c);return n}function Ps(){let t,i;const e=new Promise(function(n,o){t=n,i=o});return{resolve:t,reject:i,promise:e}}function Ss(t,i){let e;return typeof document<"u"&&(e=document),Ss._implementation(t,i,e)}Ss._implementation=function(t,i,e){if(!D(t))throw new H("relative uri is required.");if(!D(i)){if(typeof e>"u")return t;i=e.baseURI??e.location.href}const n=new qi(t);return n.scheme()!==""?n.toString():n.absoluteTo(i).toString()};function nA(t,i){if(!D(t))throw new H("uri is required.");let e="";const n=t.lastIndexOf("/");return n!==-1&&(e=t.substring(0,n+1)),i&&(t=new qi(t),t.query().length!==0&&(e+=`?${t.query()}`),t.fragment().length!==0&&(e+=`#${t.fragment()}`)),e}function oA(t){if(!D(t))throw new H("uri is required.");const i=new qi(t);i.normalize();let e=i.path(),n=e.lastIndexOf("/");return n!==-1&&(e=e.substr(n+1)),n=e.lastIndexOf("."),n===-1?e="":e=e.substr(n+1),e}const Qv={};function Kv(t,i,e){D(i)||(i=t.width),D(e)||(e=t.height);let n=Qv[i];D(n)||(n={},Qv[i]=n);let o=n[e];if(!D(o)){const r=document.createElement("canvas");r.width=i,r.height=e,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",n[e]=o}return o.drawImage(t,0,0,i,e),o.getImageData(0,0,i,e).data}const rA=/^blob:/i;function Jv(t){return A.typeOf.string("uri",t),rA.test(t)}let Pi;function Qd(t){D(Pi)||(Pi=document.createElement("a")),Pi.href=window.location.href;const i=Pi.host,e=Pi.protocol;return Pi.href=t,Pi.href=Pi.href,e!==Pi.protocol||i!==Pi.host}const sA=/^data:/i;function Bv(t){return A.typeOf.string("uri",t),sA.test(t)}function aA(t){const i=document.createElement("script");return i.async=!0,i.src=t,new Promise((e,n)=>{window.crossOriginIsolated&&i.setAttribute("crossorigin","anonymous");const o=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,o.removeChild(i),e()},i.onerror=function(r){n(r)},o.appendChild(i)})}function lA(t){if(!D(t))throw new H("obj is required.");let i="";for(const e in t)if(t.hasOwnProperty(e)){const n=t[e],o=`${encodeURIComponent(e)}=`;if(Array.isArray(n))for(let r=0,s=n.length;r<s;++r)i+=`${o+encodeURIComponent(n[r])}&`;else i+=`${o+encodeURIComponent(n)}&`}return i=i.slice(0,-1),i}function cA(t){if(!D(t))throw new H("queryString is required.");const i={};if(t==="")return i;const e=t.replace(/\+/g,"%20").split(/[&;]/);for(let n=0,o=e.length;n<o;++n){const r=e[n].split("="),s=decodeURIComponent(r[0]);let a=r[1];D(a)?a=decodeURIComponent(a):a="";const c=i[s];typeof c=="string"?i[s]=[c,a]:Array.isArray(c)?c.push(a):i[s]=a}return i}const Xe=Object.freeze({UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5}),hA=Object.freeze({TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3});function Nc(t){t=t??_i.EMPTY_OBJECT;const i=t.throttleByServer??!1,e=t.throttle??!1;this.url=t.url,this.requestFunction=t.requestFunction,this.cancelFunction=t.cancelFunction,this.priorityFunction=t.priorityFunction,this.priority=t.priority??0,this.throttle=e,this.throttleByServer=i,this.type=t.type??hA.OTHER,this.serverKey=t.serverKey,this.state=Xe.UNISSUED,this.deferred=void 0,this.cancelled=!1}Nc.prototype.cancel=function(){this.cancelled=!0},Nc.prototype.clone=function(t){return D(t)?(t.url=this.url,t.requestFunction=this.requestFunction,t.cancelFunction=this.cancelFunction,t.priorityFunction=this.priorityFunction,t.priority=this.priority,t.throttle=this.throttle,t.throttleByServer=this.throttleByServer,t.type=this.type,t.serverKey=this.serverKey,t.state=Xe.UNISSUED,t.deferred=void 0,t.cancelled=!1,t):new Nc(this)};function dA(t){const i={};if(!t)return i;const e=t.split(`\r
|
|
362
|
+
`);for(let n=0;n<e.length;++n){const o=e[n],r=o.indexOf(": ");if(r>0){const s=o.substring(0,r),a=o.substring(r+2);i[s]=a}}return i}function Es(t,i,e){this.statusCode=t,this.response=i,this.responseHeaders=e,typeof this.responseHeaders=="string"&&(this.responseHeaders=dA(this.responseHeaders))}Es.prototype.toString=function(){let t="Request has failed.";return D(this.statusCode)&&(t+=` Status Code: ${this.statusCode}`),t};function ur(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(ur.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),ur.prototype.addEventListener=function(t,i){A.typeOf.func("listener",t),this._listeners.push(t),this._scopes.push(i);const e=this;return function(){e.removeEventListener(t,i)}},ur.prototype.removeEventListener=function(t,i){A.typeOf.func("listener",t);const e=this._listeners,n=this._scopes;let o=-1;for(let r=0;r<e.length;r++)if(e[r]===t&&n[r]===i){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),e[o]=void 0,n[o]=void 0):(e.splice(o,1),n.splice(o,1)),!0):!1};function uA(t,i){return i-t}ur.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let t;const i=this._listeners,e=this._scopes;let n=i.length;for(t=0;t<n;t++){const r=i[t];D(r)&&i[t].apply(e[t],arguments)}const o=this._toRemove;if(n=o.length,n>0){for(o.sort(uA),t=0;t<n;t++){const r=o[t];i.splice(r,1),e.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};function fo(t){A.typeOf.object("options",t),A.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(fo.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){A.typeOf.number.greaterThanOrEquals("maximumLength",t,0);const i=this._length;if(t<i){const e=this._array;for(let n=t;n<i;++n)e[n]=void 0;this._length=t,e.length=t}this._maximumLength=t}},comparator:{get:function(){return this._comparator}}});function Kd(t,i,e){const n=t[i];t[i]=t[e],t[e]=n}fo.prototype.reserve=function(t){t=t??this._length,this._array.length=t},fo.prototype.heapify=function(t){t=t??0;const i=this._length,e=this._comparator,n=this._array;let o=-1,r=!0;for(;r;){const s=2*(t+1),a=s-1;a<i&&e(n[a],n[t])<0?o=a:o=t,s<i&&e(n[s],n[o])<0&&(o=s),o!==t?(Kd(n,o,t),t=o):r=!1}},fo.prototype.resort=function(){const t=this._length;for(let i=Math.ceil(t/2);i>=0;--i)this.heapify(i)},fo.prototype.insert=function(t){A.defined("element",t);const i=this._array,e=this._comparator,n=this._maximumLength;let o=this._length++;for(o<i.length?i[o]=t:i.push(t);o!==0;){const s=Math.floor((o-1)/2);if(e(i[o],i[s])<0)Kd(i,o,s),o=s;else break}let r;return D(n)&&this._length>n&&(r=i[n],this._length=n),r},fo.prototype.pop=function(t){if(t=t??0,this._length===0)return;A.typeOf.number.lessThan("index",t,this._length);const i=this._array,e=i[t];return Kd(i,t,--this._length),this.heapify(t),i[this._length]=void 0,e};function pA(t,i){return t.priority-i.priority}const Se={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let pr=20;const mt=new fo({comparator:pA});mt.maximumLength=pr,mt.reserve(pr);const Si=[];let $i={};const fA=typeof document<"u"?new qi(document.location.href):new qi,Vc=new ur;function xe(){}xe.maximumRequests=50,xe.maximumRequestsPerServer=18,xe.requestsByServer={},xe.throttleRequests=!0,xe.debugShowStatistics=!1,xe.requestCompletedEvent=Vc,Object.defineProperties(xe,{statistics:{get:function(){return Se}},priorityHeapLength:{get:function(){return pr},set:function(t){if(t<pr)for(;mt.length>t;){const i=mt.pop();go(i)}pr=t,mt.maximumLength=t,mt.reserve(t)}}});function jv(t){D(t.priorityFunction)&&(t.priority=t.priorityFunction())}xe.serverHasOpenSlots=function(t,i){i=i??1;const e=xe.requestsByServer[t]??xe.maximumRequestsPerServer;return $i[t]+i<=e},xe.heapHasOpenSlots=function(t){return mt.length+t<=pr};function ey(t){return t.state===Xe.UNISSUED&&(t.state=Xe.ISSUED,t.deferred=Ps()),t.deferred.promise}function gA(t){return function(i){if(t.state===Xe.CANCELLED)return;const e=t.deferred;--Se.numberOfActiveRequests,--$i[t.serverKey],Vc.raiseEvent(),t.state=Xe.RECEIVED,t.deferred=void 0,e.resolve(i)}}function mA(t){return function(i){t.state!==Xe.CANCELLED&&(++Se.numberOfFailedRequests,--Se.numberOfActiveRequests,--$i[t.serverKey],Vc.raiseEvent(i),t.state=Xe.FAILED,t.deferred.reject(i))}}function ty(t){const i=ey(t);return t.state=Xe.ACTIVE,Si.push(t),++Se.numberOfActiveRequests,++Se.numberOfActiveRequestsEver,++$i[t.serverKey],t.requestFunction().then(gA(t)).catch(mA(t)),i}function go(t){const i=t.state===Xe.ACTIVE;if(t.state=Xe.CANCELLED,++Se.numberOfCancelledRequests,D(t.deferred)){const e=t.deferred;t.deferred=void 0,e.reject()}i&&(--Se.numberOfActiveRequests,--$i[t.serverKey],++Se.numberOfCancelledActiveRequests),D(t.cancelFunction)&&t.cancelFunction()}xe.update=function(){let t,i,e=0;const n=Si.length;for(t=0;t<n;++t){if(i=Si[t],i.cancelled&&go(i),i.state!==Xe.ACTIVE){++e;continue}e>0&&(Si[t-e]=i)}Si.length-=e;const o=mt.internalArray,r=mt.length;for(t=0;t<r;++t)jv(o[t]);mt.resort();const s=Math.max(xe.maximumRequests-Si.length,0);let a=0;for(;a<s&&mt.length>0;){if(i=mt.pop(),i.cancelled){go(i);continue}if(i.throttleByServer&&!xe.serverHasOpenSlots(i.serverKey)){go(i);continue}ty(i),++a}vA()},xe.getServerKey=function(t){A.typeOf.string("url",t);let i=new qi(t);i.scheme()===""&&(i=i.absoluteTo(fA),i.normalize());let e=i.authority();/:/.test(e)||(e=`${e}:${i.scheme()==="https"?"443":"80"}`);const n=$i[e];return D(n)||($i[e]=0),e},xe.request=function(t){if(A.typeOf.object("request",t),A.typeOf.string("request.url",t.url),A.typeOf.func("request.requestFunction",t.requestFunction),Bv(t.url)||Jv(t.url))return Vc.raiseEvent(),t.state=Xe.RECEIVED,t.requestFunction();if(++Se.numberOfAttemptedRequests,D(t.serverKey)||(t.serverKey=xe.getServerKey(t.url)),xe.throttleRequests&&t.throttleByServer&&!xe.serverHasOpenSlots(t.serverKey))return;if(!xe.throttleRequests||!t.throttle)return ty(t);if(Si.length>=xe.maximumRequests)return;jv(t);const i=mt.insert(t);if(D(i)){if(i===t)return;go(i)}return ey(t)};function vA(){xe.debugShowStatistics&&(Se.numberOfActiveRequests===0&&Se.lastNumberOfActiveRequests>0&&(Se.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Se.numberOfAttemptedRequests}`),Se.numberOfAttemptedRequests=0),Se.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Se.numberOfCancelledRequests}`),Se.numberOfCancelledRequests=0),Se.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Se.numberOfCancelledActiveRequests}`),Se.numberOfCancelledActiveRequests=0),Se.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Se.numberOfFailedRequests}`),Se.numberOfFailedRequests=0)),Se.lastNumberOfActiveRequests=Se.numberOfActiveRequests)}xe.clearForSpecs=function(){for(;mt.length>0;){const i=mt.pop();go(i)}const t=Si.length;for(let i=0;i<t;++i)go(Si[i]);Si.length=0,$i={},Se.numberOfAttemptedRequests=0,Se.numberOfActiveRequests=0,Se.numberOfCancelledRequests=0,Se.numberOfCancelledActiveRequests=0,Se.numberOfFailedRequests=0,Se.numberOfActiveRequestsEver=0,Se.lastNumberOfActiveRequests=0},xe.numberOfActiveRequestsByServer=function(t){return $i[t]},xe.requestHeap=mt;const fr={};let gr={};fr.add=function(t,i){if(!D(t))throw new H("host is required.");if(!D(i)||i<=0)throw new H("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;D(gr[e])||(gr[e]=!0)},fr.remove=function(t,i){if(!D(t))throw new H("host is required.");if(!D(i)||i<=0)throw new H("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;D(gr[e])&&delete gr[e]};function yA(t){const i=new qi(t);i.normalize();let e=i.authority();if(e.length!==0){if(i.authority(e),e.indexOf("@")!==-1&&(e=e.split("@")[1]),e.indexOf(":")===-1){let n=i.scheme();if(n.length===0&&(n=window.location.protocol,n=n.substring(0,n.length-1)),n==="http")e+=":80";else if(n==="https")e+=":443";else return}return e}}fr.contains=function(t){if(!D(t))throw new H("url is required.");const i=yA(t);return!!(D(i)&&D(gr[i]))},fr.clear=function(){gr={}};const iy=(function(){try{const t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob",t.responseType==="blob"}catch{return!1}})();function j(t){t=t??_i.EMPTY_OBJECT,typeof t=="string"&&(t={url:t}),A.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=Ei(t.templateValues,{}),this._queryParameters=Ei(t.queryParameters,{}),this.headers=Ei(t.headers,{}),this.request=t.request??new Nc,this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=t.retryAttempts??0,this._retryCount=0,t.parseUrl??!0?this.parseUrl(t.url,!0,!0):this._url=t.url,this._credits=t.credits}function Ei(t,i){return D(t)?dr(t):i}j.createIfNeeded=function(t){return t instanceof j?t.getDerivedResource({request:t.request}):typeof t!="string"?t:new j({url:t})};let mr;j.supportsImageBitmapOptions=function(){return D(mr)?mr:typeof createImageBitmap!="function"?(mr=Promise.resolve(!1),mr):(mr=j.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(i){const e={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(i,e),createImageBitmap(i)])}).then(function(i){const e=Kv(i[0]),n=Kv(i[1]);return e[1]!==n[1]}).catch(function(){return!1}),mr)},Object.defineProperties(j,{isBlobSupported:{get:function(){return iy}}}),Object.defineProperties(j.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){this.parseUrl(t,!1,!1)}},extension:{get:function(){return oA(this._url)}},isDataUri:{get:function(){return Bv(this._url)}},isBlobUri:{get:function(){return Jv(this._url)}},isCrossOriginUrl:{get:function(){return Qd(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),j.prototype.toString=function(){return this.getUrlComponent(!0,!0)},j.prototype.parseUrl=function(t,i,e,n){let o=new qi(t);const r=wA(o.query());this._queryParameters=i?Uc(r,this.queryParameters,e):r,o.search(""),o.fragment(""),D(n)&&o.scheme()===""&&(o=o.absoluteTo(Ss(n))),this._url=o.toString()};function wA(t){return t.length===0?{}:t.indexOf("=")===-1?{[t]:void 0}:cA(t)}function Uc(t,i,e){if(!e)return Mn(t,i);const n=dr(t,!0);for(const o in i)if(i.hasOwnProperty(o)){let r=n[o];const s=i[o];D(r)?(Array.isArray(r)||(r=n[o]=[r]),n[o]=r.concat(s)):n[o]=Array.isArray(s)?s.slice():s}return n}j.prototype.getUrlComponent=function(t,i){if(this.isDataUri)return this._url;let e=this._url;t&&(e=`${e}${CA(this.queryParameters)}`),e=e.replace(/%7B/g,"{").replace(/%7D/g,"}");const n=this._templateValues;return Object.keys(n).length>0&&(e=e.replace(/{(.*?)}/g,function(o,r){const s=n[r];return D(s)?encodeURIComponent(s):o})),i&&D(this.proxy)&&(e=this.proxy.getURL(e)),e};function CA(t){const i=Object.keys(t);return i.length===0?"":i.length===1&&!D(t[i[0]])?`?${i[0]}`:`?${lA(t)}`}j.prototype.setQueryParameters=function(t,i){i?this._queryParameters=Uc(this._queryParameters,t,!1):this._queryParameters=Uc(t,this._queryParameters,!1)},j.prototype.appendQueryParameters=function(t){this._queryParameters=Uc(t,this._queryParameters,!0)},j.prototype.setTemplateValues=function(t,i){i?this._templateValues=Mn(this._templateValues,t):this._templateValues=Mn(t,this._templateValues)},j.prototype.getDerivedResource=function(t){const i=this.clone();if(i._retryCount=0,D(t.url)){const e=t.preserveQueryParameters??!1;i.parseUrl(t.url,!0,e,this._url)}return D(t.queryParameters)&&(i._queryParameters=Mn(t.queryParameters,i.queryParameters)),D(t.templateValues)&&(i._templateValues=Mn(t.templateValues,i.templateValues)),D(t.headers)&&(i.headers=Mn(t.headers,i.headers)),D(t.proxy)&&(i.proxy=t.proxy),D(t.request)&&(i.request=t.request),D(t.retryCallback)&&(i.retryCallback=t.retryCallback),D(t.retryAttempts)&&(i.retryAttempts=t.retryAttempts),i},j.prototype.retryOnError=function(t){const i=this.retryCallback;if(typeof i!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const e=this;return Promise.resolve(i(this,t)).then(function(n){return++e._retryCount,n})},j.prototype.clone=function(t){return D(t)?(t._url=this._url,t._queryParameters=dr(this._queryParameters),t._templateValues=dr(this._templateValues),t.headers=dr(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t):new j({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:D(this.credits)?this.credits.slice():void 0})},j.prototype.getBaseUri=function(t){return nA(this.getUrlComponent(t),t)},j.prototype.appendForwardSlash=function(){this._url=iA(this._url)},j.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},j.fetchArrayBuffer=function(t){return new j(t).fetchArrayBuffer()},j.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},j.fetchBlob=function(t){return new j(t).fetchBlob()},j.prototype.fetchImage=function(t){t=t??_i.EMPTY_OBJECT;const i=t.preferImageBitmap??!1,e=t.preferBlob??!1,n=t.flipY??!1,o=t.skipColorSpaceConversion??!1;if(Bd(this.request),!iy||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!e)return Jd({resource:this,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i});const r=this.fetchBlob();if(!D(r))return;let s,a,c,d;return j.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&i,r}).then(function(u){if(!D(u))return;if(d=u,a)return j.createImageBitmapFromBlob(u,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=window.URL.createObjectURL(u);return c=new j({url:p}),Jd({resource:c,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(D(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return D(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};function Jd(t){const i=t.resource,e=t.flipY,n=t.skipColorSpaceConversion,o=t.preferImageBitmap,r=i.request;r.url=i.url,r.requestFunction=function(){let a=!1;!i.isDataUri&&!i.isBlobUri&&(a=i.isCrossOriginUrl);const c=Ps();return j._Implementations.createImage(r,a,c,e,n,o),c.promise};const s=xe.request(r);if(D(s))return s.catch(function(a){return r.state!==Xe.FAILED?Promise.reject(a):i.retryOnError(a).then(function(c){return c?(r.state=Xe.UNISSUED,r.deferred=void 0,Jd({resource:i,flipY:e,skipColorSpaceConversion:n,preferImageBitmap:o})):Promise.reject(a)})})}j.fetchImage=function(t){return new j(t).fetchImage({flipY:t.flipY,skipColorSpaceConversion:t.skipColorSpaceConversion,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})},j.prototype.fetchText=function(){return this.fetch({responseType:"text"})},j.fetchText=function(t){return new j(t).fetchText()},j.prototype.fetchJson=function(){const t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(D(t))return t.then(function(i){if(D(i))return JSON.parse(i)})},j.fetchJson=function(t){return new j(t).fetchJson()},j.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},j.fetchXML=function(t){return new j(t).fetchXML()},j.prototype.fetchJsonp=function(t){t=t??"callback",Bd(this.request);let i;do i=`loadJsonp${O.nextRandomNumber().toString().substring(2,8)}`;while(D(window[i]));return ny(this,t,i)};function ny(t,i,e){const n={};n[i]=e,t.setQueryParameters(n);const o=t.request,r=t.url;o.url=r,o.requestFunction=function(){const a=Ps();return window[e]=function(c){a.resolve(c);try{delete window[e]}catch{window[e]=void 0}},j._Implementations.loadAndExecuteScript(r,e,a),a.promise};const s=xe.request(o);if(D(s))return s.catch(function(a){return o.state!==Xe.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=Xe.UNISSUED,o.deferred=void 0,ny(t,i,e)):Promise.reject(a)})})}j.fetchJsonp=function(t){return new j(t).fetchJsonp(t.callbackParameterName)},j.prototype._makeRequest=function(t){const i=this;Bd(i.request);const e=i.request,n=i.url;e.url=n,e.requestFunction=function(){const r=t.responseType,s=Mn(t.headers,i.headers),a=t.overrideMimeType,c=t.method,d=t.data,u=Ps(),p=j._Implementations.loadWithXhr(n,r,c,d,s,u,a);return D(p)&&D(p.abort)&&(e.cancelFunction=function(){p.abort()}),u.promise};const o=xe.request(e);if(D(o))return o.then(function(r){return e.cancelFunction=void 0,r}).catch(function(r){return e.cancelFunction=void 0,e.state!==Xe.FAILED?Promise.reject(r):i.retryOnError(r).then(function(s){return s?(e.state=Xe.UNISSUED,e.deferred=void 0,i.fetch(t)):Promise.reject(r)})})};function Bd(t){if(t.state===Xe.ISSUED||t.state===Xe.ACTIVE)throw new lt("The Resource is already being fetched.");t.state=Xe.UNISSUED,t.deferred=void 0}const _A=/^data:(.*?)(;base64)?,(.*)$/;function Wc(t,i){const e=decodeURIComponent(i);return t?atob(e):e}function oy(t,i){const e=Wc(t,i),n=new ArrayBuffer(e.length),o=new Uint8Array(n);for(let r=0;r<e.length;r++)o[r]=e.charCodeAt(r);return n}function PA(t,i){i=i??"";const e=t[1],n=!!t[2],o=t[3];let r,s;switch(i){case"":case"text":return Wc(n,o);case"arraybuffer":return oy(n,o);case"blob":return r=oy(n,o),new Blob([r],{type:e});case"document":return s=new DOMParser,s.parseFromString(Wc(n,o),e);case"json":return JSON.parse(Wc(n,o));default:throw new H(`Unhandled responseType: ${i}`)}}j.prototype.fetch=function(t){return t=Ei(t,{}),t.method="GET",this._makeRequest(t)},j.fetch=function(t){return new j(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.delete=function(t){return t=Ei(t,{}),t.method="DELETE",this._makeRequest(t)},j.delete=function(t){return new j(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})},j.prototype.head=function(t){return t=Ei(t,{}),t.method="HEAD",this._makeRequest(t)},j.head=function(t){return new j(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.options=function(t){return t=Ei(t,{}),t.method="OPTIONS",this._makeRequest(t)},j.options=function(t){return new j(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.post=function(t,i){return A.defined("data",t),i=Ei(i,{}),i.method="POST",i.data=t,this._makeRequest(i)},j.post=function(t){return new j(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.put=function(t,i){return A.defined("data",t),i=Ei(i,{}),i.method="PUT",i.data=t,this._makeRequest(i)},j.put=function(t){return new j(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j.prototype.patch=function(t,i){return A.defined("data",t),i=Ei(i,{}),i.method="PATCH",i.data=t,this._makeRequest(i)},j.patch=function(t){return new j(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},j._Implementations={},j._Implementations.loadImageElement=function(t,i,e){const n=new Image;n.onload=function(){n.naturalWidth===0&&n.naturalHeight===0&&n.width===0&&n.height===0&&(n.width=300,n.height=150),e.resolve(n)},n.onerror=function(o){e.reject(o)},i&&(fr.contains(t)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=t},j._Implementations.createImage=function(t,i,e,n,o,r){const s=t.url;j.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){j._Implementations.loadImageElement(s,i,e);return}const c="blob",d="GET",u=Ps(),p=j._Implementations.loadWithXhr(s,c,d,void 0,void 0,u,void 0,void 0,void 0);return D(p)&&D(p.abort)&&(t.cancelFunction=function(){p.abort()}),u.promise.then(function(f){if(!D(f)){e.reject(new lt(`Successfully retrieved ${s} but it contained no content.`));return}return j.createImageBitmapFromBlob(f,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(f){e.resolve(f)})}).catch(function(a){e.reject(a)})},j.createImageBitmapFromBlob=function(t,i){return A.defined("options",i),A.typeOf.bool("options.flipY",i.flipY),A.typeOf.bool("options.premultiplyAlpha",i.premultiplyAlpha),A.typeOf.bool("options.skipColorSpaceConversion",i.skipColorSpaceConversion),createImageBitmap(t,{imageOrientation:i.flipY?"flipY":"from-image",premultiplyAlpha:i.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:i.skipColorSpaceConversion?"none":"default"})};function SA(t,i,e,n,o,r,s){fetch(t,{method:e,headers:o}).then(async a=>{if(!a.ok){const c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new Es(a.status,a,c));return}switch(i){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new Es)})}const EA=typeof XMLHttpRequest>"u";j._Implementations.loadWithXhr=function(t,i,e,n,o,r,s){const a=_A.exec(t);if(a!==null){r.resolve(PA(a,i));return}if(EA){SA(t,i,e,n,o,r);return}const c=new XMLHttpRequest;if(fr.contains(t)&&(c.withCredentials=!0),c.open(e,t,!0),D(s)&&D(c.overrideMimeType)&&c.overrideMimeType(s),D(o))for(const u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);D(i)&&(c.responseType=i);let d=!1;return typeof t=="string"&&(d=t.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new Es(c.status,c.response,c.getAllResponseHeaders()));return}const u=c.response,p=c.responseType;if(e==="HEAD"||e==="OPTIONS"){const g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){const P=y.split(": "),S=P.shift();m[S]=P.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(D(u)&&(!D(i)||p===i))r.resolve(u);else if(i==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(f){r.reject(f)}else(p===""||p==="document")&&D(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(p===""||p==="text")&&D(c.responseText)?r.resolve(c.responseText):r.reject(new lt("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Es)},c.send(n),c},j._Implementations.loadAndExecuteScript=function(t,i,e){return aA(t).catch(function(n){e.reject(n)})},j._DefaultImplementations={},j._DefaultImplementations.createImage=j._Implementations.createImage,j._DefaultImplementations.loadWithXhr=j._Implementations.loadWithXhr,j._DefaultImplementations.loadAndExecuteScript=j._Implementations.loadAndExecuteScript,j.DEFAULT=Object.freeze(new j({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function As(t){t=t??_i.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=t.addNewLeapSeconds??!0,D(t.data)?ry(this,t.data):ry(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}As.fromUrl=async function(t,i){A.defined("url",t),i=i??_i.EMPTY_OBJECT;const e=j.createIfNeeded(t);let n;try{n=await e.fetchJson()}catch{throw new lt(`An error occurred while retrieving the EOP data from the URL ${e.url}.`)}return new As({addNewLeapSeconds:i.addNewLeapSeconds,data:n})},As.NONE=Object.freeze({compute:function(t,i){return D(i)?(i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0):i=new Hd(0,0,0,0,0),i}}),As.prototype.compute=function(t,i){if(!D(this._samples))return;if(D(i)||(i=new Hd(0,0,0,0,0)),this._samples.length===0)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;const e=this._dates,n=this._lastIndex;let o=0,r=0;if(D(n)){const a=e[n],c=e[n+1],d=J.lessThanOrEquals(a,t),u=!D(c),p=u||J.greaterThanOrEquals(c,t);if(d&&p)return o=n,!u&&c.equals(t)&&++o,r=o+1,ay(this,e,this._samples,t,o,r,i),i}let s=Cs(e,t,J.compare,this._dateColumn);return s>=0?(s<e.length-1&&e[s+1].equals(t)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,ay(this,e,this._samples,t,o,r,i),i};function AA(t,i){return J.compare(t.julianDate,i)}function ry(t,i){if(!D(i.columnNames))throw new lt("Error in loaded EOP data: The columnNames property is required.");if(!D(i.samples))throw new lt("Error in loaded EOP data: The samples property is required.");const e=i.columnNames.indexOf("modifiedJulianDateUtc"),n=i.columnNames.indexOf("xPoleWanderRadians"),o=i.columnNames.indexOf("yPoleWanderRadians"),r=i.columnNames.indexOf("ut1MinusUtcSeconds"),s=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=i.columnNames.indexOf("taiMinusUtcSeconds");if(e<0||n<0||o<0||r<0||s<0||a<0||c<0)throw new lt("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const d=t._samples=i.samples,u=t._dates=[];t._dateColumn=e,t._xPoleWanderRadiansColumn=n,t._yPoleWanderRadiansColumn=o,t._ut1MinusUtcSecondsColumn=r,t._xCelestialPoleOffsetRadiansColumn=s,t._yCelestialPoleOffsetRadiansColumn=a,t._taiMinusUtcSecondsColumn=c,t._columnCount=i.columnNames.length,t._lastIndex=void 0;let p;const f=t._addNewLeapSeconds;for(let g=0,m=d.length;g<m;g+=t._columnCount){const y=d[g+e],P=d[g+c],S=y+Ue.MODIFIED_JULIAN_DATE_DIFFERENCE,C=new J(S,P,ve.TAI);if(u.push(C),f){if(P!==p&&D(p)){const E=J.leapSeconds,T=Cs(E,C,AA);if(T<0){const I=new De(C,P);E.splice(~T,0,I)}}p=P}}}function sy(t,i,e,n,o){const r=e*n;o.xPoleWander=i[r+t._xPoleWanderRadiansColumn],o.yPoleWander=i[r+t._yPoleWanderRadiansColumn],o.xPoleOffset=i[r+t._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=i[r+t._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=i[r+t._ut1MinusUtcSecondsColumn]}function Ts(t,i,e){return i+t*(e-i)}function ay(t,i,e,n,o,r,s){const a=t._columnCount;if(r>i.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;const c=i[o],d=i[r];if(c.equals(d)||n.equals(c))return sy(t,e,o,a,s),s;if(n.equals(d))return sy(t,e,r,a,s),s;const u=J.secondsDifference(n,c)/J.secondsDifference(d,c),p=o*a,f=r*a;let g=e[p+t._ut1MinusUtcSecondsColumn],m=e[f+t._ut1MinusUtcSecondsColumn];const y=m-g;if(y>.5||y<-.5){const P=e[p+t._taiMinusUtcSecondsColumn],S=e[f+t._taiMinusUtcSecondsColumn];P!==S&&(d.equals(n)?g=m:m-=S-P)}return s.xPoleWander=Ts(u,e[p+t._xPoleWanderRadiansColumn],e[f+t._xPoleWanderRadiansColumn]),s.yPoleWander=Ts(u,e[p+t._yPoleWanderRadiansColumn],e[f+t._yPoleWanderRadiansColumn]),s.xPoleOffset=Ts(u,e[p+t._xCelestialPoleOffsetRadiansColumn],e[f+t._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=Ts(u,e[p+t._yCelestialPoleOffsetRadiansColumn],e[f+t._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=Ts(u,g,m),s}function tt(t,i,e){this.heading=t??0,this.pitch=i??0,this.roll=e??0}tt.fromQuaternion=function(t,i){if(!D(t))throw new H("quaternion is required");D(i)||(i=new tt);const e=2*(t.w*t.y-t.z*t.x),n=1-2*(t.x*t.x+t.y*t.y),o=2*(t.w*t.x+t.y*t.z),r=1-2*(t.y*t.y+t.z*t.z),s=2*(t.w*t.z+t.x*t.y);return i.heading=-Math.atan2(s,r),i.roll=Math.atan2(o,n),i.pitch=-O.asinClamped(e),i},tt.fromDegrees=function(t,i,e,n){if(!D(t))throw new H("heading is required");if(!D(i))throw new H("pitch is required");if(!D(e))throw new H("roll is required");return D(n)||(n=new tt),n.heading=t*O.RADIANS_PER_DEGREE,n.pitch=i*O.RADIANS_PER_DEGREE,n.roll=e*O.RADIANS_PER_DEGREE,n},tt.clone=function(t,i){if(D(t))return D(i)?(i.heading=t.heading,i.pitch=t.pitch,i.roll=t.roll,i):new tt(t.heading,t.pitch,t.roll)},tt.equals=function(t,i){return t===i||D(t)&&D(i)&&t.heading===i.heading&&t.pitch===i.pitch&&t.roll===i.roll},tt.equalsEpsilon=function(t,i,e,n){return t===i||D(t)&&D(i)&&O.equalsEpsilon(t.heading,i.heading,e,n)&&O.equalsEpsilon(t.pitch,i.pitch,e,n)&&O.equalsEpsilon(t.roll,i.roll,e,n)},tt.prototype.clone=function(t){return tt.clone(this,t)},tt.prototype.equals=function(t){return tt.equals(this,t)},tt.prototype.equalsEpsilon=function(t,i,e){return tt.equalsEpsilon(this,t,i,e)},tt.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const ly=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function TA(){const t=document.getElementsByTagName("script");for(let i=0,e=t.length;i<e;++i){const n=t[i].getAttribute("src"),o=ly.exec(n);if(o!==null)return o[1]}}let Gc;function cy(t){return typeof document>"u"?t:(D(Gc)||(Gc=document.createElement("a")),Gc.href=t,Gc.href)}let mo;function hy(){if(D(mo))return mo;let t;if(typeof CESIUM_BASE_URL<"u"?t=CESIUM_BASE_URL:D(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ho&&Ho.tagName.toUpperCase()==="SCRIPT"&&Ho.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href)?t=Ss(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Ho&&Ho.tagName.toUpperCase()==="SCRIPT"&&Ho.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href):typeof define=="object"&&D(define.amd)&&!define.amd.toUrlUndefined&&D(require.toUrl)?t=Ss("..",ei("Core/buildModuleUrl.js")):t=TA(),!D(t))throw new H("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return mo=new j({url:cy(t)}),mo.appendForwardSlash(),mo}function MA(t){return cy(require.toUrl(`../${t}`))}function dy(t){return hy().getDerivedResource({url:t}).url}let Hc;function ei(t){return D(Hc)||(typeof define=="object"&&D(define.amd)&&!define.amd.toUrlUndefined&&D(require.toUrl)?Hc=MA:Hc=dy),Hc(t)}ei._cesiumScriptRegex=ly,ei._buildModuleUrlFromBaseUrl=dy,ei._clearBaseResource=function(){mo=void 0},ei.setBaseUrl=function(t){mo=j.DEFAULT.getDerivedResource({url:t})},ei.getCesiumBaseUrl=hy;function uy(t,i,e){this.x=t,this.y=i,this.s=e}function jd(t){t=t??_i.EMPTY_OBJECT,this._xysFileUrlTemplate=j.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=t.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=t.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new J(this._sampleZeroJulianEphemerisDate,0,ve.TAI),this._stepSizeDays=t.stepSizeDays??1,this._samplesPerXysFile=t.samplesPerXysFile??1e3,this._totalSamples=t.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const i=this._interpolationOrder,e=this._denominators=new Array(i+1),n=this._xTable=new Array(i+1),o=Math.pow(this._stepSizeDays,i);for(let r=0;r<=i;++r){e[r]=o,n[r]=r*this._stepSizeDays;for(let s=0;s<=i;++s)s!==r&&(e[r]*=r-s);e[r]=1/e[r]}this._work=new Array(i+1),this._coef=new Array(i+1)}const IA=new J(0,0,ve.TAI);function eu(t,i,e){const n=IA;return n.dayNumber=i,n.secondsOfDay=e,J.daysDifference(n,t._sampleZeroDateTT)}jd.prototype.preload=function(t,i,e,n){const o=eu(this,t,i),r=eu(this,e,n);let s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);const c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let p=c;p<=d;++p)u.push(tu(this,p));return Promise.all(u)},jd.prototype.computeXysRadians=function(t,i,e){const n=eu(this,t,i);if(n<0)return;const o=n/this._stepSizeDays|0;if(o>=this._totalSamples)return;const r=this._interpolationOrder;let s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1;const d=this._samples;if(D(d[s*3])||(tu(this,s/this._samplesPerXysFile|0),c=!0),D(d[a*3])||(tu(this,a/this._samplesPerXysFile|0),c=!0),c)return;D(e)?(e.x=0,e.y=0,e.s=0):e=new uy(0,0,0);const u=n-s*this._stepSizeDays,p=this._work,f=this._denominators,g=this._coef,m=this._xTable;let y,P;for(y=0;y<=r;++y)p[y]=u-m[y];for(y=0;y<=r;++y){for(g[y]=1,P=0;P<=r;++P)P!==y&&(g[y]*=p[P]);g[y]*=f[y];let S=(s+y)*3;e.x+=g[y]*d[S++],e.y+=g[y]*d[S++],e.s+=g[y]*d[S]}return e};function tu(t,i){if(t._chunkDownloadsInProgress[i])return t._chunkDownloadsInProgress[i];let e;const n=t._xysFileUrlTemplate;D(n)?e=n.getDerivedResource({templateValues:{0:i}}):e=new j({url:ei(`Assets/IAU2006_XYS/IAU2006_XYS_${i}.json`)});const o=e.fetchJson().then(function(r){t._chunkDownloadsInProgress[i]=!1;const s=t._samples,a=r.samples,c=i*t._samplesPerXysFile*3;for(let d=0,u=a.length;d<u;++d)s[c+d]=a[d]});return t._chunkDownloadsInProgress[i]=o,o}function Q(t,i,e,n){this.x=t??0,this.y=i??0,this.z=e??0,this.w=n??0}let Ms=new k;Q.fromAxisAngle=function(t,i,e){A.typeOf.object("axis",t),A.typeOf.number("angle",i);const n=i/2,o=Math.sin(n);Ms=k.normalize(t,Ms);const r=Ms.x*o,s=Ms.y*o,a=Ms.z*o,c=Math.cos(n);return D(e)?(e.x=r,e.y=s,e.z=a,e.w=c,e):new Q(r,s,a,c)};const DA=[1,2,0],bA=new Array(3);Q.fromRotationMatrix=function(t,i){A.typeOf.object("matrix",t);let e,n,o,r,s;const a=t[q.COLUMN0ROW0],c=t[q.COLUMN1ROW1],d=t[q.COLUMN2ROW2],u=a+c+d;if(u>0)e=Math.sqrt(u+1),s=.5*e,e=.5/e,n=(t[q.COLUMN1ROW2]-t[q.COLUMN2ROW1])*e,o=(t[q.COLUMN2ROW0]-t[q.COLUMN0ROW2])*e,r=(t[q.COLUMN0ROW1]-t[q.COLUMN1ROW0])*e;else{const p=DA;let f=0;c>a&&(f=1),d>a&&d>c&&(f=2);const g=p[f],m=p[g];e=Math.sqrt(t[q.getElementIndex(f,f)]-t[q.getElementIndex(g,g)]-t[q.getElementIndex(m,m)]+1);const y=bA;y[f]=.5*e,e=.5/e,s=(t[q.getElementIndex(m,g)]-t[q.getElementIndex(g,m)])*e,y[g]=(t[q.getElementIndex(g,f)]+t[q.getElementIndex(f,g)])*e,y[m]=(t[q.getElementIndex(m,f)]+t[q.getElementIndex(f,m)])*e,n=-y[0],o=-y[1],r=-y[2]}return D(i)?(i.x=n,i.y=o,i.z=r,i.w=s,i):new Q(n,o,r,s)};const py=new Q;let fy=new Q,iu=new Q,gy=new Q;Q.fromHeadingPitchRoll=function(t,i){return A.typeOf.object("headingPitchRoll",t),gy=Q.fromAxisAngle(k.UNIT_X,t.roll,py),iu=Q.fromAxisAngle(k.UNIT_Y,-t.pitch,i),i=Q.multiply(iu,gy,iu),fy=Q.fromAxisAngle(k.UNIT_Z,-t.heading,py),Q.multiply(fy,i,i)};const qc=new k,nu=new k,di=new Q,my=new Q,$c=new Q;Q.packedLength=4,Q.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e++]=t.z,i[e]=t.w,i},Q.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new Q),e.x=t[i],e.y=t[i+1],e.z=t[i+2],e.w=t[i+3],e},Q.packedInterpolationLength=3,Q.convertPackedArrayForInterpolation=function(t,i,e,n){Q.unpack(t,e*4,$c),Q.conjugate($c,$c);for(let o=0,r=e-i+1;o<r;o++){const s=o*3;Q.unpack(t,(i+o)*4,di),Q.multiply(di,$c,di),di.w<0&&Q.negate(di,di),Q.computeAxis(di,qc);const a=Q.computeAngle(di);D(n)||(n=[]),n[s]=qc.x*a,n[s+1]=qc.y*a,n[s+2]=qc.z*a}},Q.unpackInterpolationResult=function(t,i,e,n,o){D(o)||(o=new Q),k.fromArray(t,0,nu);const r=k.magnitude(nu);return Q.unpack(i,n*4,my),r===0?Q.clone(Q.IDENTITY,di):Q.fromAxisAngle(nu,r,di),Q.multiply(di,my,o)},Q.clone=function(t,i){if(D(t))return D(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i.w=t.w,i):new Q(t.x,t.y,t.z,t.w)},Q.conjugate=function(t,i){return A.typeOf.object("quaternion",t),A.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=t.w,i},Q.magnitudeSquared=function(t){return A.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},Q.magnitude=function(t){return Math.sqrt(Q.magnitudeSquared(t))},Q.normalize=function(t,i){A.typeOf.object("result",i);const e=1/Q.magnitude(t),n=t.x*e,o=t.y*e,r=t.z*e,s=t.w*e;return i.x=n,i.y=o,i.z=r,i.w=s,i},Q.inverse=function(t,i){A.typeOf.object("result",i);const e=Q.magnitudeSquared(t);return i=Q.conjugate(t,i),Q.multiplyByScalar(i,1/e,i)},Q.add=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e.w=t.w+i.w,e},Q.subtract=function(t,i,e){return A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e.w=t.w-i.w,e},Q.negate=function(t,i){return A.typeOf.object("quaternion",t),A.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=-t.w,i},Q.dot=function(t,i){return A.typeOf.object("left",t),A.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w},Q.multiply=function(t,i,e){A.typeOf.object("left",t),A.typeOf.object("right",i),A.typeOf.object("result",e);const n=t.x,o=t.y,r=t.z,s=t.w,a=i.x,c=i.y,d=i.z,u=i.w,p=s*a+n*u+o*d-r*c,f=s*c-n*d+o*u+r*a,g=s*d+n*c-o*a+r*u,m=s*u-n*a-o*c-r*d;return e.x=p,e.y=f,e.z=g,e.w=m,e},Q.multiplyByScalar=function(t,i,e){return A.typeOf.object("quaternion",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},Q.divideByScalar=function(t,i,e){return A.typeOf.object("quaternion",t),A.typeOf.number("scalar",i),A.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e.w=t.w/i,e},Q.computeAxis=function(t,i){A.typeOf.object("quaternion",t),A.typeOf.object("result",i);const e=t.w;if(Math.abs(e-1)<O.EPSILON6||Math.abs(e+1)<O.EPSILON6)return i.x=1,i.y=i.z=0,i;const n=1/Math.sqrt(1-e*e);return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i},Q.computeAngle=function(t){return A.typeOf.object("quaternion",t),Math.abs(t.w-1)<O.EPSILON6?0:2*Math.acos(t.w)};let ou=new Q;Q.lerp=function(t,i,e,n){return A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n),ou=Q.multiplyByScalar(i,e,ou),n=Q.multiplyByScalar(t,1-e,n),Q.add(ou,n,n)};let vy=new Q,ru=new Q,su=new Q;Q.slerp=function(t,i,e,n){A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n);let o=Q.dot(t,i),r=i;if(o<0&&(o=-o,r=vy=Q.negate(i,vy)),1-o<O.EPSILON6)return Q.lerp(t,r,e,n);const s=Math.acos(o);return ru=Q.multiplyByScalar(t,Math.sin((1-e)*s),ru),su=Q.multiplyByScalar(r,Math.sin(e*s),su),n=Q.add(ru,su,n),Q.multiplyByScalar(n,1/Math.sin(s),n)},Q.log=function(t,i){A.typeOf.object("quaternion",t),A.typeOf.object("result",i);const e=O.acosClamped(t.w);let n=0;return e!==0&&(n=e/Math.sin(e)),k.multiplyByScalar(t,n,i)},Q.exp=function(t,i){A.typeOf.object("cartesian",t),A.typeOf.object("result",i);const e=k.magnitude(t);let n=0;return e!==0&&(n=Math.sin(e)/e),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(e),i};const RA=new k,xA=new k,Is=new Q,vr=new Q;Q.computeInnerQuadrangle=function(t,i,e,n){A.typeOf.object("q0",t),A.typeOf.object("q1",i),A.typeOf.object("q2",e),A.typeOf.object("result",n);const o=Q.conjugate(i,Is);Q.multiply(o,e,vr);const r=Q.log(vr,RA);Q.multiply(o,t,vr);const s=Q.log(vr,xA);return k.add(r,s,r),k.multiplyByScalar(r,.25,r),k.negate(r,r),Q.exp(r,Is),Q.multiply(i,Is,n)},Q.squad=function(t,i,e,n,o,r){A.typeOf.object("q0",t),A.typeOf.object("q1",i),A.typeOf.object("s0",e),A.typeOf.object("s1",n),A.typeOf.number("t",o),A.typeOf.object("result",r);const s=Q.slerp(t,i,o,Is),a=Q.slerp(e,n,o,vr);return Q.slerp(s,a,2*o*(1-o),r)};const FA=new Q,yy=1.9011074535173003,Xc=ct.supportsTypedArrays()?new Float32Array(8):[],Yc=ct.supportsTypedArrays()?new Float32Array(8):[],Xi=ct.supportsTypedArrays()?new Float32Array(8):[],Yi=ct.supportsTypedArrays()?new Float32Array(8):[];for(let t=0;t<7;++t){const i=t+1,e=2*i+1;Xc[t]=1/(i*e),Yc[t]=i/e}Xc[7]=yy/136,Yc[7]=yy*8/17,Q.fastSlerp=function(t,i,e,n){A.typeOf.object("start",t),A.typeOf.object("end",i),A.typeOf.number("t",e),A.typeOf.object("result",n);let o=Q.dot(t,i),r;o>=0?r=1:(r=-1,o=-o);const s=o-1,a=1-e,c=e*e,d=a*a;for(let g=7;g>=0;--g)Xi[g]=(Xc[g]*c-Yc[g])*s,Yi[g]=(Xc[g]*d-Yc[g])*s;const u=r*e*(1+Xi[0]*(1+Xi[1]*(1+Xi[2]*(1+Xi[3]*(1+Xi[4]*(1+Xi[5]*(1+Xi[6]*(1+Xi[7])))))))),p=a*(1+Yi[0]*(1+Yi[1]*(1+Yi[2]*(1+Yi[3]*(1+Yi[4]*(1+Yi[5]*(1+Yi[6]*(1+Yi[7])))))))),f=Q.multiplyByScalar(t,p,FA);return Q.multiplyByScalar(i,u,n),Q.add(f,n,n)},Q.fastSquad=function(t,i,e,n,o,r){A.typeOf.object("q0",t),A.typeOf.object("q1",i),A.typeOf.object("s0",e),A.typeOf.object("s1",n),A.typeOf.number("t",o),A.typeOf.object("result",r);const s=Q.fastSlerp(t,i,o,Is),a=Q.fastSlerp(e,n,o,vr);return Q.fastSlerp(s,a,2*o*(1-o),r)},Q.equals=function(t,i){return t===i||D(t)&&D(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z&&t.w===i.w},Q.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t.x-i.x)<=e&&Math.abs(t.y-i.y)<=e&&Math.abs(t.z-i.z)<=e&&Math.abs(t.w-i.w)<=e},Q.ZERO=Object.freeze(new Q(0,0,0,0)),Q.IDENTITY=Object.freeze(new Q(0,0,0,1)),Q.prototype.clone=function(t){return Q.clone(this,t)},Q.prototype.equals=function(t){return Q.equals(this,t)},Q.prototype.equalsEpsilon=function(t,i){return Q.equalsEpsilon(this,t,i)},Q.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const pe={},au={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"}},yr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},lu={},Rt={east:new k,north:new k,up:new k,west:new k,south:new k,down:new k};let In=new k,Dn=new k,bn=new k;pe.localFrameToFixedFrameGenerator=function(t,i){if(!au.hasOwnProperty(t)||!au[t].hasOwnProperty(i))throw new H("firstAxis and secondAxis must be east, north, up, west, south or down.");const e=au[t][i];let n;const o=t+i;return D(lu[o])?n=lu[o]:(n=function(r,s,a){if(!D(r))throw new H("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new H("origin has a NaN component");if(D(a)||(a=new X),k.equalsEpsilon(r,k.ZERO,O.EPSILON14))k.unpack(yr[t],0,In),k.unpack(yr[i],0,Dn),k.unpack(yr[e],0,bn);else if(O.equalsEpsilon(r.x,0,O.EPSILON14)&&O.equalsEpsilon(r.y,0,O.EPSILON14)){const c=O.sign(r.z);k.unpack(yr[t],0,In),t!=="east"&&t!=="west"&&k.multiplyByScalar(In,c,In),k.unpack(yr[i],0,Dn),i!=="east"&&i!=="west"&&k.multiplyByScalar(Dn,c,Dn),k.unpack(yr[e],0,bn),e!=="east"&&e!=="west"&&k.multiplyByScalar(bn,c,bn)}else{s=s??le.default,s.geodeticSurfaceNormal(r,Rt.up);const c=Rt.up,d=Rt.east;d.x=-r.y,d.y=r.x,d.z=0,k.normalize(d,Rt.east),k.cross(c,d,Rt.north),k.multiplyByScalar(Rt.up,-1,Rt.down),k.multiplyByScalar(Rt.east,-1,Rt.west),k.multiplyByScalar(Rt.north,-1,Rt.south),In=Rt[t],Dn=Rt[i],bn=Rt[e]}return a[0]=In.x,a[1]=In.y,a[2]=In.z,a[3]=0,a[4]=Dn.x,a[5]=Dn.y,a[6]=Dn.z,a[7]=0,a[8]=bn.x,a[9]=bn.y,a[10]=bn.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},lu[o]=n),n},pe.eastNorthUpToFixedFrame=pe.localFrameToFixedFrameGenerator("east","north"),pe.northEastDownToFixedFrame=pe.localFrameToFixedFrameGenerator("north","east"),pe.northUpEastToFixedFrame=pe.localFrameToFixedFrameGenerator("north","up"),pe.northWestUpToFixedFrame=pe.localFrameToFixedFrameGenerator("north","west");const kA=new Q,zA=new k(1,1,1),LA=new X;pe.headingPitchRollToFixedFrame=function(t,i,e,n,o){A.typeOf.object("HeadingPitchRoll",i),n=n??pe.eastNorthUpToFixedFrame;const r=Q.fromHeadingPitchRoll(i,kA),s=X.fromTranslationQuaternionRotationScale(k.ZERO,r,zA,LA);return o=n(t,e,o),X.multiply(o,s,o)};const OA=new X,NA=new q;pe.headingPitchRollQuaternion=function(t,i,e,n,o){A.typeOf.object("HeadingPitchRoll",i);const r=pe.headingPitchRollToFixedFrame(t,i,e,n,OA),s=X.getMatrix3(r,NA);return Q.fromRotationMatrix(s,o)};const VA=new k(1,1,1),UA=new k,wy=new X,WA=new X,GA=new q,HA=new Q;pe.fixedFrameToHeadingPitchRoll=function(t,i,e,n){A.defined("transform",t),i=i??le.default,e=e??pe.eastNorthUpToFixedFrame,D(n)||(n=new tt);const o=X.getTranslation(t,UA);if(k.equals(o,k.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;let r=X.inverseTransformation(e(o,i,wy),wy),s=X.setScale(t,VA,WA);s=X.setTranslation(s,k.ZERO,s),r=X.multiply(r,s,r);let a=Q.fromRotationMatrix(X.getMatrix3(r,GA),HA);return a=Q.normalize(a,a),tt.fromQuaternion(a,n)};const qA=6*3600+2460+50.54841,$A=8640184812866e-6,XA=.093104,YA=-62e-7,ZA=11772758384668e-32,QA=72921158553e-15,KA=O.TWO_PI/86400;let Zc=new J;pe.computeIcrfToCentralBodyFixedMatrix=function(t,i){let e=pe.computeIcrfToFixedMatrix(t,i);return D(e)||(e=pe.computeTemeToPseudoFixedMatrix(t,i)),e},pe.computeTemeToPseudoFixedMatrix=function(t,i){if(!D(t))throw new H("date is required.");Zc=J.addSeconds(t,-J.computeTaiMinusUtc(t),Zc);const e=Zc.dayNumber,n=Zc.secondsOfDay;let o;const r=e-2451545;n>=43200?o=(r+.5)/Ue.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/Ue.DAYS_PER_JULIAN_CENTURY;const a=(qA+o*($A+o*(XA+o*YA)))*KA%O.TWO_PI,c=QA+ZA*(e-24515455e-1),d=(n+Ue.SECONDS_PER_DAY*.5)%Ue.SECONDS_PER_DAY,u=a+c*d,p=Math.cos(u),f=Math.sin(u);return D(i)?(i[0]=p,i[1]=-f,i[2]=0,i[3]=f,i[4]=p,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new q(p,f,0,-f,p,0,0,0,1)},pe.iau2006XysData=new jd,pe.earthOrientationParameters=As.NONE;const cu=32.184,JA=2451545;pe.preloadIcrfFixed=function(t){const i=t.start.dayNumber,e=t.start.secondsOfDay+cu,n=t.stop.dayNumber,o=t.stop.secondsOfDay+cu;return pe.iau2006XysData.preload(i,e,n,o)},pe.computeIcrfToFixedMatrix=function(t,i){if(!D(t))throw new H("date is required.");D(i)||(i=new q);const e=pe.computeFixedToIcrfMatrix(t,i);if(D(e))return q.transpose(e,i)};const BA=32.184,jA=2451545,Qc=new tt,eT=new q,tT=new J;pe.computeMoonFixedToIcrfMatrix=function(t,i){if(!D(t))throw new H("date is required.");const e=J.addSeconds(t,BA,tT),n=J.totalDays(e)-jA,o=O.toRadians(12.112)-O.toRadians(.052992)*n,r=O.toRadians(24.224)-O.toRadians(.105984)*n,s=O.toRadians(227.645)+O.toRadians(13.012)*n,a=O.toRadians(261.105)+O.toRadians(13.340716)*n,c=O.toRadians(358)+O.toRadians(.9856)*n;return Qc.pitch=O.toRadians(180)-O.toRadians(3.878)*Math.sin(o)-O.toRadians(.12)*Math.sin(r)+O.toRadians(.07)*Math.sin(s)-O.toRadians(.017)*Math.sin(a),Qc.roll=O.toRadians(66.53-90)+O.toRadians(1.543)*Math.cos(o)+O.toRadians(.24)*Math.cos(r)-O.toRadians(.028)*Math.cos(s)+O.toRadians(.007)*Math.cos(a),Qc.heading=O.toRadians(244.375-90)+O.toRadians(13.17635831)*n+O.toRadians(3.558)*Math.sin(o)+O.toRadians(.121)*Math.sin(r)-O.toRadians(.064)*Math.sin(s)+O.toRadians(.016)*Math.sin(a)+O.toRadians(.025)*Math.sin(c),q.fromHeadingPitchRoll(Qc,eT)},pe.computeIcrfToMoonFixedMatrix=function(t,i){if(!D(t))throw new H("date is required.");D(i)||(i=new q);const e=pe.computeMoonFixedToIcrfMatrix(t,i);if(D(e))return q.transpose(e,i)};const iT=new uy(0,0,0),nT=new Hd(0,0,0,0,0),hu=new q,du=new q;pe.computeFixedToIcrfMatrix=function(t,i){if(!D(t))throw new H("date is required.");D(i)||(i=new q);const e=pe.earthOrientationParameters.compute(t,nT);if(!D(e))return;const n=t.dayNumber,o=t.secondsOfDay+cu,r=pe.iau2006XysData.computeXysRadians(n,o,iT);if(!D(r))return;const s=r.x+e.xPoleOffset,a=r.y+e.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=hu;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);const u=q.fromRotationZ(-r.s,du),p=q.multiply(d,u,hu),f=t.dayNumber,g=t.secondsOfDay-J.computeTaiMinusUtc(t)+e.ut1MinusUtc,m=f-2451545,y=g/Ue.SECONDS_PER_DAY;let P=.779057273264+y+.00273781191135448*(m+y);P=P%1*O.TWO_PI;const S=q.fromRotationZ(P,du),C=q.multiply(p,S,hu),E=Math.cos(e.xPoleWander),T=Math.cos(e.yPoleWander),I=Math.sin(e.xPoleWander),b=Math.sin(e.yPoleWander);let x=n-JA+o/Ue.SECONDS_PER_DAY;x/=36525;const z=-47e-6*x*O.RADIANS_PER_DEGREE/3600,W=Math.cos(z),N=Math.sin(z),L=du;return L[0]=E*W,L[1]=E*N,L[2]=I,L[3]=-T*N+b*I*W,L[4]=T*W+b*I*N,L[5]=-b*E,L[6]=-b*N-T*I*W,L[7]=b*W-T*I*N,L[8]=T*E,q.multiply(C,L,i)};const oT=new B;pe.pointToWindowCoordinates=function(t,i,e,n){return n=pe.pointToGLWindowCoordinates(t,i,e,n),n.y=2*i[5]-n.y,n},pe.pointToGLWindowCoordinates=function(t,i,e,n){if(!D(t))throw new H("modelViewProjectionMatrix is required.");if(!D(i))throw new H("viewportTransformation is required.");if(!D(e))throw new H("point is required.");D(n)||(n=new ee);const o=oT;return X.multiplyByVector(t,B.fromElements(e.x,e.y,e.z,1,o),o),B.multiplyByScalar(o,1/o.w,o),X.multiplyByVector(i,o,o),ee.fromCartesian4(o,n)};const rT=new k,sT=new k,aT=new k;pe.rotationMatrixFromPositionVelocity=function(t,i,e,n){if(!D(t))throw new H("position is required.");if(!D(i))throw new H("velocity is required.");const o=(e??le.default).geodeticSurfaceNormal(t,rT);let r=k.cross(i,o,sT);k.equalsEpsilon(r,k.ZERO,O.EPSILON6)&&(r=k.clone(k.UNIT_X,r));const s=k.cross(r,i,aT);return k.normalize(s,s),k.cross(i,s,r),k.negate(r,r),k.normalize(r,r),D(n)||(n=new q),n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=r.x,n[4]=r.y,n[5]=r.z,n[6]=s.x,n[7]=s.y,n[8]=s.z,n};const Cy=new X(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),_y=new fe,uu=new k,lT=new k,cT=new q,pu=new X,Py=new X;pe.basisTo2D=function(t,i,e){if(!D(t))throw new H("projection is required.");if(!D(i))throw new H("matrix is required.");if(!D(e))throw new H("result is required.");const n=X.getTranslation(i,lT),o=t.ellipsoid;let r;if(k.equals(n,k.ZERO))r=k.clone(k.ZERO,uu);else{const u=o.cartesianToCartographic(n,_y);r=t.project(u,uu),k.fromElements(r.z,r.x,r.y,r)}const s=pe.eastNorthUpToFixedFrame(n,o,pu),a=X.inverseTransformation(s,Py),c=X.getMatrix3(i,cT),d=X.multiplyByMatrix3(a,c,e);return X.multiply(Cy,d,e),X.setTranslation(e,r,e),e},pe.ellipsoidTo2DModelMatrix=function(t,i,e){if(!D(t))throw new H("projection is required.");if(!D(i))throw new H("center is required.");if(!D(e))throw new H("result is required.");const n=t.ellipsoid,o=pe.eastNorthUpToFixedFrame(i,n,pu),r=X.inverseTransformation(o,Py),s=n.cartesianToCartographic(i,_y),a=t.project(s,uu);k.fromElements(a.z,a.x,a.y,a);const c=X.fromTranslation(a,pu);return X.multiply(Cy,r,e),X.multiply(c,e,e),e};function oe(t,i,e,n){this.west=t??0,this.south=i??0,this.east=e??0,this.north=n??0}Object.defineProperties(oe.prototype,{width:{get:function(){return oe.computeWidth(this)}},height:{get:function(){return oe.computeHeight(this)}}}),oe.packedLength=4,oe.pack=function(t,i,e){return A.typeOf.object("value",t),A.defined("array",i),e=e??0,i[e++]=t.west,i[e++]=t.south,i[e++]=t.east,i[e]=t.north,i},oe.unpack=function(t,i,e){return A.defined("array",t),i=i??0,D(e)||(e=new oe),e.west=t[i++],e.south=t[i++],e.east=t[i++],e.north=t[i],e},oe.computeWidth=function(t){A.typeOf.object("rectangle",t);let i=t.east;const e=t.west;return i<e&&(i+=O.TWO_PI),i-e},oe.computeHeight=function(t){return A.typeOf.object("rectangle",t),t.north-t.south},oe.fromDegrees=function(t,i,e,n,o){return t=O.toRadians(t??0),i=O.toRadians(i??0),e=O.toRadians(e??0),n=O.toRadians(n??0),D(o)?(o.west=t,o.south=i,o.east=e,o.north=n,o):new oe(t,i,e,n)},oe.fromRadians=function(t,i,e,n,o){return D(o)?(o.west=t??0,o.south=i??0,o.east=e??0,o.north=n??0,o):new oe(t,i,e,n)},oe.fromCartographicArray=function(t,i){A.defined("cartographics",t);let e=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,d=t.length;c<d;c++){const u=t[c];e=Math.min(e,u.longitude),n=Math.max(n,u.longitude),s=Math.min(s,u.latitude),a=Math.max(a,u.latitude);const p=u.longitude>=0?u.longitude:u.longitude+O.TWO_PI;o=Math.min(o,p),r=Math.max(r,p)}return n-e>r-o&&(e=o,n=r,n>O.PI&&(n=n-O.TWO_PI),e>O.PI&&(e=e-O.TWO_PI)),D(i)?(i.west=e,i.south=s,i.east=n,i.north=a,i):new oe(e,s,n,a)},oe.fromCartesianArray=function(t,i,e){A.defined("cartesians",t),i=i??le.default;let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let d=0,u=t.length;d<u;d++){const p=i.cartesianToCartographic(t[d]);n=Math.min(n,p.longitude),o=Math.max(o,p.longitude),a=Math.min(a,p.latitude),c=Math.max(c,p.latitude);const f=p.longitude>=0?p.longitude:p.longitude+O.TWO_PI;r=Math.min(r,f),s=Math.max(s,f)}return o-n>s-r&&(n=r,o=s,o>O.PI&&(o=o-O.TWO_PI),n>O.PI&&(n=n-O.TWO_PI)),D(e)?(e.west=n,e.south=a,e.east=o,e.north=c,e):new oe(n,a,o,c)};const hT=new k,dT=new k,uT=new k,pT=new k,fT=new k,fu=new Array(5);for(let t=0;t<fu.length;++t)fu[t]=new k;oe.fromBoundingSphere=function(t,i,e){A.typeOf.object("boundingSphere",t);const n=t.center,o=t.radius;if(D(i)||(i=le.default),D(e)||(e=new oe),k.equals(n,k.ZERO))return oe.clone(oe.MAX_VALUE,e),e;const r=pe.eastNorthUpToFixedFrame(n,i,hT),s=X.multiplyByPointAsVector(r,k.UNIT_X,dT);k.normalize(s,s);const a=X.multiplyByPointAsVector(r,k.UNIT_Y,uT);k.normalize(a,a),k.multiplyByScalar(a,o,a),k.multiplyByScalar(s,o,s);const c=k.negate(a,fT),d=k.negate(s,pT),u=fu;let p=u[0];return k.add(n,a,p),p=u[1],k.add(n,d,p),p=u[2],k.add(n,c,p),p=u[3],k.add(n,s,p),u[4]=n,oe.fromCartesianArray(u,i,e)},oe.clone=function(t,i){if(D(t))return D(i)?(i.west=t.west,i.south=t.south,i.east=t.east,i.north=t.north,i):new oe(t.west,t.south,t.east,t.north)},oe.equalsEpsilon=function(t,i,e){return e=e??0,t===i||D(t)&&D(i)&&Math.abs(t.west-i.west)<=e&&Math.abs(t.south-i.south)<=e&&Math.abs(t.east-i.east)<=e&&Math.abs(t.north-i.north)<=e},oe.prototype.clone=function(t){return oe.clone(this,t)},oe.prototype.equals=function(t){return oe.equals(this,t)},oe.equals=function(t,i){return t===i||D(t)&&D(i)&&t.west===i.west&&t.south===i.south&&t.east===i.east&&t.north===i.north},oe.prototype.equalsEpsilon=function(t,i){return oe.equalsEpsilon(this,t,i)},oe._validate=function(t){A.typeOf.object("rectangle",t);const i=t.north;A.typeOf.number.greaterThanOrEquals("north",i,-O.PI_OVER_TWO),A.typeOf.number.lessThanOrEquals("north",i,O.PI_OVER_TWO);const e=t.south;A.typeOf.number.greaterThanOrEquals("south",e,-O.PI_OVER_TWO),A.typeOf.number.lessThanOrEquals("south",e,O.PI_OVER_TWO);const n=t.west;A.typeOf.number.greaterThanOrEquals("west",n,-Math.PI),A.typeOf.number.lessThanOrEquals("west",n,Math.PI);const o=t.east;A.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),A.typeOf.number.lessThanOrEquals("east",o,Math.PI)},oe.southwest=function(t,i){return A.typeOf.object("rectangle",t),D(i)?(i.longitude=t.west,i.latitude=t.south,i.height=0,i):new fe(t.west,t.south)},oe.northwest=function(t,i){return A.typeOf.object("rectangle",t),D(i)?(i.longitude=t.west,i.latitude=t.north,i.height=0,i):new fe(t.west,t.north)},oe.northeast=function(t,i){return A.typeOf.object("rectangle",t),D(i)?(i.longitude=t.east,i.latitude=t.north,i.height=0,i):new fe(t.east,t.north)},oe.southeast=function(t,i){return A.typeOf.object("rectangle",t),D(i)?(i.longitude=t.east,i.latitude=t.south,i.height=0,i):new fe(t.east,t.south)},oe.center=function(t,i){A.typeOf.object("rectangle",t);let e=t.east;const n=t.west;e<n&&(e+=O.TWO_PI);const o=O.negativePiToPi((n+e)*.5),r=(t.south+t.north)*.5;return D(i)?(i.longitude=o,i.latitude=r,i.height=0,i):new fe(o,r)},oe.intersection=function(t,i,e){A.typeOf.object("rectangle",t),A.typeOf.object("otherRectangle",i);let n=t.east,o=t.west,r=i.east,s=i.west;n<o&&r>0?n+=O.TWO_PI:r<s&&n>0&&(r+=O.TWO_PI),n<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);const a=O.negativePiToPi(Math.max(o,s)),c=O.negativePiToPi(Math.min(n,r));if((t.west<t.east||i.west<i.east)&&c<=a)return;const d=Math.max(t.south,i.south),u=Math.min(t.north,i.north);if(!(d>=u))return D(e)?(e.west=a,e.south=d,e.east=c,e.north=u,e):new oe(a,d,c,u)},oe.simpleIntersection=function(t,i,e){A.typeOf.object("rectangle",t),A.typeOf.object("otherRectangle",i);const n=Math.max(t.west,i.west),o=Math.max(t.south,i.south),r=Math.min(t.east,i.east),s=Math.min(t.north,i.north);if(!(o>=s||n>=r))return D(e)?(e.west=n,e.south=o,e.east=r,e.north=s,e):new oe(n,o,r,s)},oe.union=function(t,i,e){A.typeOf.object("rectangle",t),A.typeOf.object("otherRectangle",i),D(e)||(e=new oe);let n=t.east,o=t.west,r=i.east,s=i.west;n<o&&r>0?n+=O.TWO_PI:r<s&&n>0&&(r+=O.TWO_PI),n<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);const a=O.negativePiToPi(Math.min(o,s)),c=O.negativePiToPi(Math.max(n,r));return e.west=a,e.south=Math.min(t.south,i.south),e.east=c,e.north=Math.max(t.north,i.north),e},oe.expand=function(t,i,e){return A.typeOf.object("rectangle",t),A.typeOf.object("cartographic",i),D(e)||(e=new oe),e.west=Math.min(t.west,i.longitude),e.south=Math.min(t.south,i.latitude),e.east=Math.max(t.east,i.longitude),e.north=Math.max(t.north,i.latitude),e},oe.contains=function(t,i){A.typeOf.object("rectangle",t),A.typeOf.object("cartographic",i);let e=i.longitude;const n=i.latitude,o=t.west;let r=t.east;return r<o&&(r+=O.TWO_PI,e<0&&(e+=O.TWO_PI)),(e>o||O.equalsEpsilon(e,o,O.EPSILON14))&&(e<r||O.equalsEpsilon(e,r,O.EPSILON14))&&n>=t.south&&n<=t.north};const gT=new fe;oe.subsample=function(t,i,e,n){A.typeOf.object("rectangle",t),i=i??le.default,e=e??0,D(n)||(n=[]);let o=0;const r=t.north,s=t.south,a=t.east,c=t.west,d=gT;d.height=e,d.longitude=c,d.latitude=r,n[o]=i.cartographicToCartesian(d,n[o]),o++,d.longitude=a,n[o]=i.cartographicToCartesian(d,n[o]),o++,d.latitude=s,n[o]=i.cartographicToCartesian(d,n[o]),o++,d.longitude=c,n[o]=i.cartographicToCartesian(d,n[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*O.PI_OVER_TWO,oe.contains(t,d)&&(n[o]=i.cartographicToCartesian(d,n[o]),o++);return d.latitude===0&&(d.longitude=c,n[o]=i.cartographicToCartesian(d,n[o]),o++,d.longitude=a,n[o]=i.cartographicToCartesian(d,n[o]),o++),n.length=o,n},oe.subsection=function(t,i,e,n,o,r){if(A.typeOf.object("rectangle",t),A.typeOf.number.greaterThanOrEquals("westLerp",i,0),A.typeOf.number.lessThanOrEquals("westLerp",i,1),A.typeOf.number.greaterThanOrEquals("southLerp",e,0),A.typeOf.number.lessThanOrEquals("southLerp",e,1),A.typeOf.number.greaterThanOrEquals("eastLerp",n,0),A.typeOf.number.lessThanOrEquals("eastLerp",n,1),A.typeOf.number.greaterThanOrEquals("northLerp",o,0),A.typeOf.number.lessThanOrEquals("northLerp",o,1),A.typeOf.number.lessThanOrEquals("westLerp",i,n),A.typeOf.number.lessThanOrEquals("southLerp",e,o),D(r)||(r=new oe),t.west<=t.east){const a=t.east-t.west;r.west=t.west+i*a,r.east=t.west+n*a}else{const a=O.TWO_PI+t.east-t.west;r.west=O.negativePiToPi(t.west+i*a),r.east=O.negativePiToPi(t.west+n*a)}const s=t.north-t.south;return r.south=t.south+e*s,r.north=t.south+o*s,i===1&&(r.west=t.east),n===1&&(r.east=t.east),e===1&&(r.south=t.north),o===1&&(r.north=t.north),r},oe.MAX_VALUE=Object.freeze(new oe(-Math.PI,-O.PI_OVER_TWO,Math.PI,O.PI_OVER_TWO));function wr(t,i,e,n,o){this._format=t,this._datatype=i,this._width=e,this._height=n,this._buffer=o}Object.defineProperties(wr.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}}}),wr.clone=function(t){if(D(t))return new wr(t._format,t._datatype,t._width,t._height,t._buffer)},wr.prototype.clone=function(){return wr.clone(this)};function Sy(){if(!D(it._canTransferArrayBuffer)){const t=vu("transferTypedArrayTest");t.postMessage=t.webkitPostMessage??t.postMessage;const i=99,e=new Int8Array([i]);try{t.postMessage({array:e},[e.buffer])}catch{return it._canTransferArrayBuffer=!1,it._canTransferArrayBuffer}it._canTransferArrayBuffer=new Promise(n=>{t.onmessage=function(o){const r=o.data.array,s=D(r)&&r[0]===i;n(s),t.terminate(),it._canTransferArrayBuffer=s}})}return it._canTransferArrayBuffer}const gu=new ur;function mu(t){let i;try{i=new Blob([t],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(t),i=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(i)}function vu(t){const i=new qi(t),e=i.scheme().length!==0&&i.fragment().length===0,n=t.replace(/\.js$/,""),o={};let r,s;if(Qd(t))s=t;else if(!e){const a=ei(`${it._workerModulePrefix}/${n}.js`);Qd(a)&&(s=a)}if(s){const a=`import "${s}";`;return r=mu(a),o.type="module",new Worker(r,o)}if(!e&&typeof CESIUM_WORKERS<"u"){const a=`
|
|
363
363
|
importScripts("${mu(CESIUM_WORKERS)}");
|
|
364
364
|
CesiumWorkers["${n}"]();
|
|
365
|
-
`;return r=mu(a),new Worker(r,o)}if(r=t,e||(r=ei(`${it._workerModulePrefix+n}.js`)),!ct.supportsEsmWebWorkers())throw new lt("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function mT(t,i){const e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!ct.supportsWebAssembly()){if(!D(i.fallbackModulePath))throw new lt(`This browser does not support Web Assembly, and no backup module was provided for ${t._workerPath}`);return e.modulePath=ei(i.fallbackModulePath),e}e.wasmBinaryFile=ei(i.wasmBinaryFile);const n=await j.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=n,e}function it(t,i){this._workerPath=t,this._maximumActiveTasks=i??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const vT=(t,i,e,n)=>{const o=({data:r})=>{if(r.id===i){if(D(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new lt(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new H(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),gu.raiseEvent(s),n(s)}else gu.raiseEvent(),e(r.result);t.removeEventListener("message",o)}};return o},yT=[];async function wT(t,i,e){const n=await Promise.resolve(Sy());D(e)?n||(e.length=0):e=yT;const o=t._nextID++,r=new Promise((s,a)=>{t._worker.addEventListener("message",vT(t._worker,o,s,a))});return t._worker.postMessage({id:o,baseUrl:ei.getCesiumBaseUrl().url,parameters:i,canTransferArrayBuffer:n},e),r}async function CT(t,i,e){++t._activeTasks;try{const n=await wT(t,i,e);return--t._activeTasks,n}catch(n){throw--t._activeTasks,n}}it.prototype.scheduleTask=function(t,i){if(D(this._worker)||(this._worker=vu(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return CT(this,t,i)},it.prototype.initWebAssemblyModule=async function(t){if(D(this._webAssemblyPromise))return this._webAssemblyPromise;const i=async()=>{const e=this._worker=vu(this._workerPath),n=await mT(this,t),o=await Promise.resolve(Sy());let r;const s=n.wasmBinary;D(s)&&o&&(r=[s]);const a=new Promise((c,d)=>{e.onmessage=function({data:u}){D(u)?c(u.result):d(new lt("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:n}},r),a};return this._webAssemblyPromise=i(),this._webAssemblyPromise},it.prototype.isDestroyed=function(){return!1},it.prototype.destroy=function(){return D(this._worker)&&this._worker.terminate(),gT(this)},it.taskCompletedEvent=gu,it._defaultWorkerModulePrefix="Workers/",it._workerModulePrefix=it._defaultWorkerModulePrefix,it._canTransferArrayBuffer=void 0;function wr(t,i,e,n,o){this._format=t,this._datatype=i,this._width=e,this._height=n,this._buffer=o}Object.defineProperties(wr.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}}}),wr.clone=function(t){if(D(t))return new wr(t._format,t._datatype,t._width,t._height,t._buffer)},wr.prototype.clone=function(){return wr.clone(this)};const Ey={};function Ds(t,i){if(!D(t))throw new H("identifier is required.");D(Ey[t])||(Ey[t]=!0,console.warn(i??t))}Ds.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.",Ds.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",Ds.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",Ds.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function Zi(){}Zi._transcodeTaskProcessor=new it("transcodeKTX2",Number.POSITIVE_INFINITY),Zi._readyPromise=void 0;function _T(){const t=Zi._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(i){if(i)return Zi._transcodeTaskProcessor;throw new lt("KTX2 transcoder could not be initialized.")});Zi._readyPromise=t}Zi.transcode=function(t,i){return A.defined("supportedTargetFormats",i),D(Zi._readyPromise)||_T(),Zi._readyPromise.then(function(e){let n=t;t instanceof ArrayBuffer&&(n=new Uint8Array(t));const o={supportedTargetFormats:i,ktx2Buffer:n};return e.scheduleTask(o,[n.buffer])}).then(function(e){const n=e.length,o=Object.keys(e[0]);for(let r=0;r<n;r++){const s=e[r];for(let a=0;a<o.length;a++){const c=s[o[a]];s[o[a]]=new wr(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<n;++r)e[r]=e[r][o[0]];n===1&&(e=e[0])}return e}).catch(function(e){throw e})};function Ay(t,i){if(!D(t)||!D(i))throw new H("identifier and message are required.");Ds(t,i)}function Ty(t,i){return Ay("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),t??i}Object.defineProperty(Ty,"EMPTY_OBJECT",{get:function(){return Ay("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),_i.EMPTY_OBJECT}});let My;Iy.setKTX2SupportedFormats=function(t,i,e,n,o,r){My={s3tc:t,pvrtc:i,astc:e,etc:n,etc1:o,bc7:r}};function Iy(t){A.defined("resourceOrUrlOrBuffer",t);let i;return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?i=Promise.resolve(t):i=j.createIfNeeded(t).fetchArrayBuffer(),i.then(function(e){return Zi.transcode(e,My)})}function Cr(){H.throwInstantiationError()}Object.defineProperties(Cr.prototype,{rectangle:{get:H.throwInstantiationError},tileWidth:{get:H.throwInstantiationError},tileHeight:{get:H.throwInstantiationError},maximumLevel:{get:H.throwInstantiationError},minimumLevel:{get:H.throwInstantiationError},tilingScheme:{get:H.throwInstantiationError},tileDiscardPolicy:{get:H.throwInstantiationError},errorEvent:{get:H.throwInstantiationError},credit:{get:H.throwInstantiationError},proxy:{get:H.throwInstantiationError},hasAlphaChannel:{get:H.throwInstantiationError}}),Cr.prototype.getTileCredits=function(t,i,e){H.throwInstantiationError()},Cr.prototype.requestImage=function(t,i,e,n){H.throwInstantiationError()},Cr.prototype.pickFeatures=function(t,i,e,n,o){H.throwInstantiationError()};const PT=/\.ktx2$/i;Cr.loadImage=function(t,i){A.defined("url",i);const e=j.createIfNeeded(i);return PT.test(e.url)?Iy(e):D(t)&&D(t.tileDiscardPolicy)?e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):e.fetchImage({preferImageBitmap:!0,flipY:!0})};var Kc=3.141592653589793*3e3/180,nt=3.141592653589793,Jc=6378245,Bc=.006693421622965943,Dy=function(n,o){var n=+n,o=+o,r=n-.0065,s=o-.006,a=Math.sqrt(r*r+s*s)-2e-5*Math.sin(s*Kc),c=Math.atan2(s,r)-3e-6*Math.cos(r*Kc),d=a*Math.cos(c),u=a*Math.sin(c);return[d,u]},by=function(o,n){var n=+n,o=+o,r=Math.sqrt(o*o+n*n)+2e-5*Math.sin(n*Kc),s=Math.atan2(n,o)+3e-6*Math.cos(o*Kc),a=r*Math.cos(s)+.0065,c=r*Math.sin(s)+.006;return[a,c]},yu=function(o,n){var n=+n,o=+o;if(Fy(o,n))return[o,n];var r=Ry(o-105,n-35),s=xy(o-105,n-35),a=n/180*nt,c=Math.sin(a);c=1-Bc*c*c;var d=Math.sqrt(c);r=r*180/(Jc*(1-Bc)/(c*d)*nt),s=s*180/(Jc/d*Math.cos(a)*nt);var u=n+r,p=o+s;return[p,u]},wu=function(o,n){var n=+n,o=+o;if(Fy(o,n))return[o,n];var r=Ry(o-105,n-35),s=xy(o-105,n-35),a=n/180*nt,c=Math.sin(a);c=1-Bc*c*c;var d=Math.sqrt(c);r=r*180/(Jc*(1-Bc)/(c*d)*nt),s=s*180/(Jc/d*Math.cos(a)*nt);var u=n+r,p=o+s;return[o*2-p,n*2-u]},Ry=function(o,n){var n=+n,o=+o,r=-100+2*o+3*n+.2*n*n+.1*o*n+.2*Math.sqrt(Math.abs(o));return r+=(20*Math.sin(6*o*nt)+20*Math.sin(2*o*nt))*2/3,r+=(20*Math.sin(n*nt)+40*Math.sin(n/3*nt))*2/3,r+=(160*Math.sin(n/12*nt)+320*Math.sin(n*nt/30))*2/3,r},xy=function(o,n){var n=+n,o=+o,r=300+o+2*n+.1*o*o+.1*o*n+.1*Math.sqrt(Math.abs(o));return r+=(20*Math.sin(6*o*nt)+20*Math.sin(2*o*nt))*2/3,r+=(20*Math.sin(o*nt)+40*Math.sin(o/3*nt))*2/3,r+=(150*Math.sin(o/12*nt)+300*Math.sin(o/30*nt))*2/3,r},Fy=function(o,n){var n=+n,o=+o;return!(o>73.66&&o<135.05&&n>3.86&&n<53.55)};function Cu(t,i){this.x=t||0,this.y=i||0,this.x=this.x,this.y=this.y}Cu.prototype.equals=function(t){return t&&t.x==this.x&&t.y==this.y};function ui(t,i){isNaN(t)&&(t=decode64(t),t=isNaN(t)?0:t),typeof t=="string"&&(t=parseFloat(t)),isNaN(i)&&(i=decode64(i),i=isNaN(i)?0:i),typeof t=="lat"&&(i=parseFloat(i)),this.lng=t,this.lat=i}ui.isInRange=function(t){return t&&t.lng<=180&&t.lng>=-180&&t.lat<=74&&t.lat>=-74},ui.prototype.equals=function(t){return t&&this.lat==t.lat&&this.lng==t.lng};function ze(){}ze.EARTHRADIUS=637099681e-2,ze.MCBAND=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],ze.LLBAND=[75,60,45,30,15,0],ze.MC2LL=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],ze.LL2MC=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],ze.getDistanceByMC=function(t,i){if(!t||!i)return 0;var e,n,o,r;return t=this.convertMC2LL(t),!t||(e=this.toRadians(t.lng),n=this.toRadians(t.lat),i=this.convertMC2LL(i),!i)?0:(o=this.toRadians(i.lng),r=this.toRadians(i.lat),this.getDistance(e,o,n,r))},ze.getDistanceByLL=function(t,i){if(!t||!i)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),i.lng=this.getLoop(i.lng,-180,180),i.lat=this.getRange(i.lat,-74,74);var e,n,o,r;return e=this.toRadians(t.lng),o=this.toRadians(t.lat),n=this.toRadians(i.lng),r=this.toRadians(i.lat),this.getDistance(e,n,o,r)},ze.convertMC2LL=function(r){var i,e;i=new ui(Math.abs(r.lng),Math.abs(r.lat));for(var n=0;n<this.MCBAND.length;n++)if(i.lat>=this.MCBAND[n]){e=this.MC2LL[n];break}var o=this.convertor(r,e),r=new ui(o.lng.toFixed(6),o.lat.toFixed(6));return r},ze.convertLL2MC=function(r){var i,e;r.lng=this.getLoop(r.lng,-180,180),r.lat=this.getRange(r.lat,-74,74),i=new ui(r.lng,r.lat);for(var n=0;n<this.LLBAND.length;n++)if(i.lat>=this.LLBAND[n]){e=this.LL2MC[n];break}if(!e){for(var n=this.LLBAND.length-1;n>=0;n--)if(i.lat<=-this.LLBAND[n]){e=this.LL2MC[n];break}}var o=this.convertor(r,e),r=new ui(o.lng.toFixed(2),o.lat.toFixed(2));return r},ze.convertor=function(t,i){if(!(!t||!i)){var e=i[0]+i[1]*Math.abs(t.lng),n=Math.abs(t.lat)/i[9],o=i[2]+i[3]*n+i[4]*n*n+i[5]*n*n*n+i[6]*n*n*n*n+i[7]*n*n*n*n*n+i[8]*n*n*n*n*n*n;return e*=t.lng<0?-1:1,o*=t.lat<0?-1:1,new ui(e,o)}},ze.getDistance=function(t,i,e,n){return this.EARTHRADIUS*Math.acos(Math.sin(e)*Math.sin(n)+Math.cos(e)*Math.cos(n)*Math.cos(i-t))},ze.toRadians=function(t){return Math.PI*t/180},ze.toDegrees=function(t){return 180*t/Math.PI},ze.getRange=function(t,i,e){return i!=null&&(t=Math.max(t,i)),e!=null&&(t=Math.min(t,e)),t},ze.getLoop=function(t,i,e){for(;t>e;)t-=e-i;for(;t<i;)t+=e-i;return t},ze.prototype.lngLatToMercator=function(t){return ze.convertLL2MC(t)},ze.prototype.lngLatToPoint=function(t){var i=ze.convertLL2MC(t);return new Cu(i.lng,i.lat)},ze.prototype.mercatorToLngLat=function(t){return ze.convertMC2LL(t)},ze.prototype.PointToLngLat=function(t){var i=new ui(t.x,t.y);return ze.convertMC2LL(i)},ze.prototype.PointToPixel=function(t,i,e,n,o){if(t){t=this.lngLatToMercator(t,o);var r=this.getZoomUnits(i),s=Math.round((t.lng-e.lng)/r+n[Twidth]/2),a=Math.round((e.lat-t.lat)/r+n[Theight]/2);return new Cu(s,a)}},ze.prototype.PixelToPoint=function(t,i,e,n,o){if(t){var r=this.getZoomUnits(i),s=e.lng+r*(t.x-n[Twidth]/2),a=e.lat-r*(t.y-n[Theight]/2),c=new ui(s,a);return this.mercatorToLngLat(c,o)}},ze.prototype.getZoomUnits=function(t){return Math.pow(2,18-t)};function Rn(t){t=t||{},this._ellipsoid=Ty(t.ellipsoid,le.WGS84);var i=!0;D(t.wgs84)&&(i=t.wgs84),this._projection=new xt(this._ellipsoid);var e=new ze;this._projection.project=function(s){var a={};return i?(a=yu(O.toDegrees(s.longitude),O.toDegrees(s.latitude)),a=by(a[0],a[1])):a=by(O.toDegrees(s.longitude),O.toDegrees(s.latitude)),a[0]=Math.min(a[0],180),a[0]=Math.max(a[0],-180),a[1]=Math.min(a[1],74.000022),a[1]=Math.max(a[1],-71.988531),a=e.lngLatToPoint(new ui(a[0],a[1])),new ee(a.x,a.y)},this._projection.unproject=function(s){var a=e.mercatorToLngLat(new ui(s.x,s.y));return a[0]=(a[0]+180)%360-180,i?(a=Dy(a.lng,a.lat),a=wu(a[0],a[1])):a=Dy(a.lng,a.lat),new fe(O.toRadians(a[0]),O.toRadians(a[1]))},this._rectangleSouthwestInMeters=new ee(-2003772637e-2,-1170804166e-2),this._rectangleNortheastInMeters=new ee(2003772637e-2,1247410417e-2);var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new oe(n.longitude,n.latitude,o.longitude,o.latitude),this.levelWidth=[];for(var r=0;r<19;r++)this.levelWidth[r]=Math.pow(2,18-r)*256}Object.defineProperties(Rn.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Rn.prototype.getNumberOfXTilesAtLevel=function(t){return(1<<t)*.7},Rn.prototype.getNumberOfYTilesAtLevel=function(t){return 1<<t},Rn.prototype.rectangleToNativeRectangle=function(t,i){var e=this._projection,n=e.project(oe.southwest(t)),o=e.project(oe.northeast(t));return D(i)?(i.west=n.x,i.south=n.y,i.east=o.x,i.north=o.y,i):new oe(n.x,n.y,o.x,o.y)},Rn.prototype.tileXYToNativeRectangle=function(t,i,e,n){var o=this.levelWidth[e],r=t*o,s=(t+1)*o;i=-i;var a=(i+1)*o,c=i*o;return D(n)?(n.west=r,n.south=c,n.east=s,n.north=a,n):new oe(r,c,s,a)},Rn.prototype.tileXYToRectangle=function(t,i,e,n){var o=this.tileXYToNativeRectangle(t,i,e,n),r=this._projection,s=r.unproject(new ee(o.west,o.south)),a=r.unproject(new ee(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o},Rn.prototype.positionToTileXY=function(t,i,e){var n=this._rectangle;if(oe.contains(n,t)){var o=this._projection,r=o.project(t);if(D(r)){var s=this.levelWidth[i],a=Math.floor(r.x/s),c=-Math.floor(r.y/s);return D(e)?(e.x=a,e.y=c,e):new ee(a,c)}}};function jc(t){this._url=t.url||"http://online2.map.bdimg.com/onlinelabel/?qt=tile&styles=pl&x={x}&y={y}&z={z}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new Rn(t),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function ST(t,i,e,n){var o=t._url;return o=o.replace("{x}",i).replace("{y}",-e).replace("{z}",n),o}Object.defineProperties(jc.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 3}},tilingScheme:{get:function(){if(!this._ready)throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),jc.prototype.getTileCredits=function(t,i,e){},jc.prototype.requestImage=function(t,i,e){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=ST(this,t,i,e);return Cr.loadImage(this,n)};class ET extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTime",0);e.url="https://tileser.giiiis.com/timetile/",e.minimumLevel=1,e.maximumLevel=18,e.tilingScheme=new h.GeographicTilingScheme,this.indexTime=e.indexTime||0}get indexTime(){return this._indexTime}set indexTime(e){this._indexTime=e}async requestImage(e,n,o,r){try{let s=this.buildImageUrl(this.indexTime,e,n,o);return h.ImageryProvider.loadImage(this,s)}catch{return}}buildImageUrl(e,n,o,r){return`https://tileser.giiiis.com/timetile/${e}/${r}/${n}/${o}.jpg`}}class AT extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTimeID",0);e.url="https://wayback.maptiles.arcgis.com/",e.minimumLevel=1,e.maximumLevel=18,this.indexTimeID=e.indexTimeID||0}get indexTimeID(){return this._indexTimeID}set indexTimeID(e){this._indexTimeID=e}async requestImage(e,n,o,r){try{let s;return this.indexTimeID!==0?s=this.buildImageUrl(this.indexTimeID,e,n,o):s=`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${o}/${n}/${e}`,h.ImageryProvider.loadImage(this,s)}catch{return}}buildImageUrl(e,n,o,r){return`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${e}/${r}/${o}/${n}`}}const TT=document.createElement("canvas");class _u{constructor(i){v(this,"mapboxRenderer");v(this,"ready");v(this,"readyPromise");v(this,"rectangle");v(this,"tileSize");v(this,"tileWidth");v(this,"tileHeight");v(this,"maximumLevel");v(this,"minimumLevel");v(this,"tileDiscardPolicy");v(this,"credit");v(this,"proxy");v(this,"layerStyle");v(this,"hasAlphaChannel");v(this,"sourceFilter");v(this,"tilingScheme");v(this,"_destroyed",!1);v(this,"_error");v(this,"_style");v(this,"_accessToken");v(this,"_enablePickFeatures");this.ready=!1,this.tilingScheme=i.tilingScheme??new _e.WebMercatorTilingScheme,this.rectangle=i.rectangle??this.tilingScheme.rectangle,this.rectangle=_e.Rectangle.intersection(this.rectangle,this.tilingScheme.rectangle),this.tileSize=this.tileWidth=this.tileHeight=i.tileSize||256,this.maximumLevel=i.maximumLevel??18,this.minimumLevel=i.minimumLevel??0,this.tileDiscardPolicy=void 0,this._error=new _e.Event,this.credit=new _e.Credit(i.credit||"",!1),this.proxy=new _e.DefaultProxy(""),this.hasAlphaChannel=i.hasAlphaChannel??!0,this.sourceFilter=i.sourceFilter,this._accessToken=i.accessToken,this._enablePickFeatures=i.enablePickFeatures??!0,this.layerStyle=i.layerStyle??[],_e.defined(i.style)&&(this.readyPromise=this._build(i.style,i).then(()=>!0))}get style(){return this._style}get isDestroyed(){return this._destroyed}get errorEvent(){return this._error}async _build(i,e={}){const n=await this._preLoad(i,e.scheme??"tms");n.layers=this.layerStyle.length!=0?this.layerStyle:n.layers,this._style=n,this.mapboxRenderer=new $_.BasicRenderer({style:n,canvas:TT,token:e.accessToken,transformRequest:e.transformRequest}),e.showCanvas&&this.mapboxRenderer.showCanvasForDebug(),await this.mapboxRenderer._style.loadedPromise,this.readyPromise=Promise.resolve(!0),this.ready=!0}static async fromUrl(i,e={}){const n=new _u(e);return await n._build(i,e),n}_preLoad(i,e){let n=i;if(typeof i=="string"&&(i.endsWith(".json")||i.startsWith("mapbox://")?i=new _e.Resource({url:i}):(i={version:8,sources:{customSource:{type:"vector",scheme:e,tiles:[i]}},layers:this.layerStyle},n=i)),i instanceof _e.Resource){const o="https://api.mapbox.com/";i.url.startsWith("mapbox://")&&(i.url=i.url.replace("mapbox://",o)),this._accessToken&&i.appendQueryParameters({access_token:this._accessToken}),n=i.fetchJson()}return Promise.resolve(n).catch(o=>{throw this._error.raiseEvent(o),o})}_createTile(){const i=document.createElement("canvas");return i.width=this.tileSize,i.height=this.tileSize,i.style.imageRendering="pixelated",i}_resetTileCache(){Object.values(this.mapboxRenderer._style.sourceCaches).forEach(i=>i._tileCache.reset())}_getTilesSpec(i,e){const{x:n,y:o,level:r}=i,s=this.tileSize,a=[],c=this.tilingScheme.getNumberOfXTilesAtLevel(r)-1,d=this.tilingScheme.getNumberOfYTilesAtLevel(r)-1;for(let u=-1;u<=1;u++){let p=n+u;p<0&&(p=c),p>c&&(p=0);for(let f=-1;f<=1;f++){let g=o+f;g<0||g>d||a.push({source:e,z:r,x:p,y:g,left:0+u*s,top:0+f*s,size:s})}}return a}requestImage(i,e,n,o=!0){if(n<this.minimumLevel||n>this.maximumLevel)return;this.mapboxRenderer.filterForZoom(n);const r=this.mapboxRenderer.getVisibleSources(n).reduce((s,a)=>s.concat(this._getTilesSpec({x:i,y:e,level:n},a)),[]);return new Promise((s,a)=>{const c=this._createTile(),d=c.getContext("2d");d&&(d.globalCompositeOperation="copy");const u=this.mapboxRenderer.renderTiles(d,{srcLeft:0,srcTop:0,width:this.tileSize,height:this.tileSize,destLeft:0,destTop:0},r,p=>{typeof p=="string"&&!p.endsWith("tiles not available")?a(void 0):o?(u.consumer.ctx=null,s(c),this.mapboxRenderer.releaseRender(u),this._resetTileCache()):s(u)})})}pickFeatures(i,e,n,o,r){var s;if(this._enablePickFeatures)return(s=this.requestImage(i,e,n,!1))==null?void 0:s.then(a=>{let c=this.mapboxRenderer.getVisibleSources(n);c=this.sourceFilter?this.sourceFilter(c):c;const d=[],u=_e.Math.toDegrees(o),p=_e.Math.toDegrees(r);return c.forEach(f=>{const g=new _e.ImageryLayerFeatureInfo;g.data=this.mapboxRenderer.queryRenderedFeatures({source:f,renderedZoom:n,lng:u,lat:p,tileZ:n});const m=Object.keys(g.data)[0];g.name=m;const y=g.data[m];y&&(g.configureDescriptionFromProperties((y==null?void 0:y.length)===1?y[0]:y),d.push(g))}),a.consumer.ctx=void 0,this.mapboxRenderer.releaseRender(a),this._resetTileCache(),d.length?d:void 0})}destroy(){this.mapboxRenderer._cancelAllPendingRenders(),this._resetTileCache(),this._destroyed=!0}}function MT(t,i){let e;return i===0?e=h.JulianDate.toIso8601(t.stop):e=h.JulianDate.toIso8601(t.start),{Time:e}}function ky(t){if(t.type==="fromIso8601")return h.TimeIntervalCollection.fromIso8601({iso8601:t.iso8601,isStartIncluded:t.isStartIncluded,isStopIncluded:t.isStopIncluded,leadingInterval:t.leadingInterval,trailingInterval:t.trailingInterval,dataCallback:MT})}const{getStrFromEnv:eh}=w.ESSceneObject.context;function IT(t){const i=Object.entries(t).map(([e,n])=>{try{const o=n&&Function(`"use strict";return (${n})`)();return[e,o]}catch(o){console.error(`getCustomTagsFromJson error: ${o}`,o);return}}).filter(e=>!!e);return Object.fromEntries(i)}async function DT(t,i){var e,n;if(t.type==="WebMapTileServiceImageryProvider")return new h.WebMapTileServiceImageryProvider({url:Wt(t.url),format:t.format??"image/jpeg",layer:t.layer,style:t.style,tileMatrixSetID:t.tileMatrixSetID,tileMatrixLabels:t.tileMatrixLabels,clock:t.times&&((e=i.viewer)==null?void 0:e.clock),times:t.times&&ky(t.times),dimensions:t.dimensions,tileWidth:t.tileWidth??256,tileHeight:t.tileHeight??256,tilingScheme:t.tilingScheme&&gi(t.tilingScheme),rectangle:t.rectangle&&Ge(t.rectangle),minimumLevel:t.minimumLevel??0,maximumLevel:t.maximumLevel,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),credit:t.credit,subdomains:t.subdomains});if(t.type==="TileMapServiceImageryProvider")return t.url?await h.TileMapServiceImageryProvider.fromUrl(Wt(t.url),{fileExtension:t.fileExtension,credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ge(t.rectangle),tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,flipXY:t.flipXY}):void 0;if(t.type==="UrlTemplateImageryProvider"){const o=t.customTags&&IT(t.customTags);return console.log(Wt(t.url),"111"),new h.UrlTemplateImageryProvider({url:Wt(t.url),credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ge(t.rectangle),tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,subdomains:t.subdomains,hasAlphaChannel:t.hasAlphaChannel,pickFeaturesUrl:t.pickFeaturesUrl,enablePickFeatures:t.enablePickFeatures,urlSchemeZeroPadding:t.urlSchemeZeroPadding,customTags:o})}else{if(t.type==="GridImageryProvider")return new h.GridImageryProvider({tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,cells:t.cells,color:t.color&&ie(t.color),glowColor:t.glowColor&&ie(t.glowColor),backgroundColor:t.backgroundColor&&ie(t.backgroundColor),canvasSize:t.canvasSize,glowWidth:t.glowWidth});if(t.type==="ArcGisMapServerImageryProvider")return t.url?await h.ArcGisMapServerImageryProvider.fromUrl(Wt(t.url),{token:t.token,usePreCachedTilesIfAvailable:t.usePreCachedTilesIfAvailable,layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ge(t.rectangle),tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),credit:t.credit,tileWidth:t.tileWidth,tileHeight:t.tileHeight,maximumLevel:t.maximumLevel}):void 0;if(t.type==="BingMapsImageryProvider")return t.url?await h.BingMapsImageryProvider.fromUrl(Wt(t.url),{key:t.key,tileProtocol:t.tileProtocol,mapStyle:t.mapStyle&&h.BingMapsStyle[t.mapStyle],culture:t.culture,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid)}):void 0;if(t.type==="GoogleEarthEnterpriseImageryProvider"){if(!t.url)return;const o=await h.GoogleEarthEnterpriseMetadata.fromUrl(Wt(t.url));return await h.GoogleEarthEnterpriseImageryProvider.fromMetadata(o,{ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),credit:t.credit})}else{if(t.type==="IonImageryProvider")return await h.IonImageryProvider.fromAssetId(t.assetId,{accessToken:t.accessToken,server:t.server});if(t.type==="MapboxImageryProvider")return new h.MapboxImageryProvider({url:t.url&&eh(t.url),mapId:t.mapId,accessToken:t.accessToken,format:t.format,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ge(t.rectangle),credit:t.credit});if(t.type==="MapboxStyleImageryProvider")return new h.MapboxStyleImageryProvider({url:t.url&&eh(t.url),username:t.username,styleId:t.styleId,accessToken:t.accessToken,tilesize:t.tilesize,scaleFactor:t.scaleFactor,rectangle:t.rectangle&&Ge(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel});if(t.type==="OpenStreetMapImageryProvider")return new h.OpenStreetMapImageryProvider({url:eh(t.url),rectangle:t.rectangle&&Ge(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,fileExtension:t.fileExtension});if(t.type==="SingleTileImageryProvider")return new h.SingleTileImageryProvider({url:Wt(t.url),rectangle:t.rectangle&&Ge(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid)});if(t.type==="TileCoordinatesImageryProvider")return new h.TileCoordinatesImageryProvider({tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),color:t.color&&ie(t.color),tileWidth:t.tileWidth,tileHeight:t.tileHeight});if(t.type==="WebMapServiceImageryProvider")return new h.WebMapServiceImageryProvider({url:Wt(t.url),layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ge(t.rectangle),tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,tileWidth:t.tileWidth,tileHeight:t.tileHeight,crs:t.crs,srs:t.srs,credit:t.credit,subdomains:t.subdomains,clock:t.times&&((n=i.viewer)==null?void 0:n.clock),times:t.times&&ky(t.times),parameters:t.parameters,getFeatureInfoParameters:t.getFeatureInfoParameters});if(t.type==="BDImageryProvider")return new jc({url:t.url&&eh(t.url),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),wgs84:t.wgs84});if(t.type==="GeHistoryImagery")return new ET({indexTime:t.indexTime});if(t.type==="ArcgisHistoryImagery")return new AT({indexTimeID:t.indexTimeID});if(t.type==="MVTImageryProvider")return t.url?await _u.fromUrl(t.url,{maximumLevel:t.maximumLevel,minimumLevel:t.minimumLevel,tileSize:t.tileSize,accessToken:t.accessToken,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ge(t.rectangle),layerStyle:t.style,scheme:t.scheme}):void 0}}}function bT(t,i){i.type}class zy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(r){var s={};return s=wu(h.Math.toDegrees(r.longitude),h.Math.toDegrees(r.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(s[0]),h.Math.toRadians(s[1])))},e.s_unproject=e.unproject,e.unproject=function(r){var s=e.s_unproject(r),a={};return a=yu(h.Math.toDegrees(s.longitude),h.Math.toDegrees(s.latitude)),new h.Cartographic(h.Math.toRadians(a[0]),h.Math.toRadians(a[1]))};var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new h.Rectangle(n.longitude,n.latitude,o.longitude,o.latitude)}}class Ly extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(n){var o={};return o=yu(h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(o[0]),h.Math.toRadians(o[1])))},e.s_unproject=e.unproject,e.unproject=function(n){var o=e.s_unproject(n),r={};return r=wu(h.Math.toDegrees(o.longitude),h.Math.toDegrees(o.latitude)),new h.Cartographic(h.Math.toRadians(r[0]),h.Math.toRadians(r[1]))}}}function RT(t){if(t.type==="GeographicTilingScheme")return"new Cesium.GeographicTilingScheme()";if(t.type==="WebMercatorTilingScheme")return"new Cesium.WebMercatorTilingScheme()"}class xn extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_innerImageryProvider",this.disposeVar(l.react(void 0)));v(this,"_layer",this.disposeVar(l.react(void 0)));const o=e.viewer;if(!o)return;const r=Yt(o);if(!r)return;const{imageriesManager:s}=r;s.add(this),this.dispose(()=>{s.has(this)&&s.delete(this)});const a=()=>{this.layer&&(this.layer=void 0)};this.dispose(a);const c=()=>{this.layer&&(this.layer.alpha=this.alpha??1,this.layer.nightAlpha=this.nightAlpha??1,this.layer.dayAlpha=this.dayAlpha??1,this.layer.brightness=this.brightness??1,this.layer.contrast=this.contrast??1,this.layer.hue=this.hue??0,this.layer.saturation=this.saturation??1,this.layer.gamma=this.gamma??1,this.layer.splitDirection=this.splitDirection&&h.SplitDirection[this.splitDirection]||h.SplitDirection.NONE,this.layer.minificationFilter=this.minificationFilter&&h.TextureMinificationFilter[this.minificationFilter]||h.TextureMinificationFilter.LINEAR,this.layer.magnificationFilter=this.magnificationFilter&&h.TextureMagnificationFilter[this.magnificationFilter]||h.TextureMagnificationFilter.LINEAR,this.layer.show=this.show??!0,this.layer.maximumAnisotropy=this.maximumAnisotropy,this.layer.minimumTerrainLevel=this.minimumTerrainLevel,this.layer.maximumTerrainLevel=this.maximumTerrainLevel,this.layer.colorToAlpha=this.colorToAlpha&&toColor(this.colorToAlpha),this.layer.colorToAlphaThreshold=this.colorToAlphaThreshold??.004,this.imageryProvider&&bT(this.layer.imageryProvider,this.imageryProvider))};let d=!1;const u=this.disposeVar(l.createProcessingFromAsyncFunc(async(y,P)=>{if(P){if(d=!0,a(),!this.innerImageryProvider)return;const S=await y.promise(DT(this.innerImageryProvider,e));if(!S){console.error("createImageryProviderFromJson error!");return}this.layer=new h.ImageryLayer(S),h.ImageryLayer.prototype&&(this.layer.ESSceneObjectID=n),d=!1}c()}));u.restart(void 0,!0);const p=this.disposeVar(new l.Event),f=this.disposeVar(new l.Event);this.ad(this.layerChanged.don(()=>{if(!this.innerImageryProvider||!this.layer||!Reflect.has(this.innerImageryProvider,"rectangle")||this.innerImageryProvider.rectangle[0]!=this.imageryProvider.rectangle[0]||this.innerImageryProvider.rectangle[1]!=this.imageryProvider.rectangle[1]||this.innerImageryProvider.rectangle[2]!=this.imageryProvider.rectangle[2]||this.innerImageryProvider.rectangle[3]!=this.imageryProvider.rectangle[3])return;const y=this.layer.imageryProvider.tilingScheme.rectangle,P=this.innerImageryProvider.rectangle&&Ge(this.innerImageryProvider.rectangle);(P.west<y.west||P.south<y.south||P.east>y.east||P.north>y.north)&&(this.innerImageryProvider.rectangle=[h.Math.toDegrees(Math.max(y.west,P.west)),h.Math.toDegrees(Math.max(y.south,P.south)),h.Math.toDegrees(Math.min(y.east,P.east)),h.Math.toDegrees(Math.min(y.north,P.north))],p.emit())})),this.dispose(this.imageryProviderChanged.disposableOn(()=>{this.innerImageryProvider=structuredClone(this.imageryProvider),p.emit()})),this.dispose(w.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{p.emit()}));const g=this.disposeVar(l.createNextAnimateFrameEvent(this.rectangleChanged,p));this.dispose(g.disposableOn(()=>{u.restart(void 0,!0)}));const m=this.disposeVar(l.createNextAnimateFrameEvent(this.alphaChanged,this.nightAlphaChanged,this.dayAlphaChanged,this.brightnessChanged,this.contrastChanged,this.hueChanged,this.saturationChanged,this.gammaChanged,this.splitDirectionChanged,this.minificationFilterChanged,this.magnificationFilterChanged,this.showChanged,this.maximumAnisotropyChanged,this.minimumTerrainLevelChanged,this.maximumTerrainLevelChanged,this.cutoutRectangleChanged,this.colorToAlphaChanged,this.colorToAlphaThresholdChanged,f));this.dispose(m.disposableOn(()=>{d||u.restart(void 0,!1)})),this.dispose(this.flyToEvent.disposableOn(y=>{if(!e.actived)return;const{viewer:P}=e;P&&P.camera.flyTo({destination:this.rectangle&&!pd(this.rectangle)?Ge(this.rectangle):h.Camera.DEFAULT_VIEW_RECTANGLE,duration:y})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get innerImageryProvider(){return this._innerImageryProvider.value}set innerImageryProvider(e){this._innerImageryProvider.value=e}get innerImageryProviderChanged(){return this._innerImageryProvider.changed}get layer(){return this._layer.value}set layer(e){this._layer.value=e}get layerChanged(){return this._layer.changed}}v(xn,"defaults",{show:!0,rectangle:[-180,-90,180,90],alpha:1,nightAlpha:1,dayAlpha:1,brightness:1,contrast:1,hue:0,saturation:1,gamma:1,splitDirection:"NONE",minificationFilter:"LINEAR",magnificationFilter:"LINEAR",maximumAnisotropy:0,minimumTerrainLevel:0,maximumTerrainLevel:0,cutoutRectangle:[1,1,1,1],colorToAlpha:[1,1,1,.5],colorToAlphaThreshold:.004,imageryProvider:{type:"TileMapServiceImageryProvider"},zIndex:0,hasAlphaChannel:!0,pickFeaturesUrl:""}),(t=>{t.createDefaultProps=()=>({show:void 0,rectangle:l.reactArrayWithUndefined(void 0),alpha:void 0,nightAlpha:void 0,dayAlpha:void 0,brightness:void 0,contrast:void 0,hue:void 0,saturation:void 0,gamma:void 0,splitDirection:void 0,minificationFilter:void 0,magnificationFilter:void 0,maximumAnisotropy:void 0,minimumTerrainLevel:void 0,maximumTerrainLevel:void 0,cutoutRectangle:l.reactArrayWithUndefined(void 0),colorToAlpha:l.reactArrayWithUndefined(void 0),colorToAlphaThreshold:void 0,imageryProvider:l.reactJsonWithUndefined(void 0),zIndex:0,hasAlphaChannel:void 0,pickFeaturesUrl:void 0,targetID:void 0})})(xn||(xn={})),l.extendClassProps(xn.prototype,xn.createDefaultProps);const Pu=h.ApproximateTerrainHeights,xT=h.ComponentDatatype,Ai=h.defaultValue,ht=h.defined,FT=h.destroyObject,Su=h.DeveloperError,kT=h.deprecationWarning,zT=h.GeometryInstance,LT=h.GeometryInstanceAttribute,OT=h.GroundPolylineGeometry,bs=h.DrawCommand,Oy=h.Pass,Ny=h.RenderState,NT=h.ShaderProgram,Rs=h.ShaderSource;let Eu=h._shadersPolylineShadowVolumeFS;const VT=h._shadersPolylineShadowVolumeMorphFS,UT=h._shadersPolylineShadowVolumeMorphVS;let Au=h._shadersPolylineShadowVolumeVS;const Vy=h.BlendingState,Tu=h.ClassificationType,WT=h.CullFace,Uy=h.PolylineColorAppearance,GT=h.PolylineMaterialAppearance,Fn=h.Primitive,_r=h.SceneMode,Wy=h.StencilConstants,Gy=h.StencilFunction,Pr=h.StencilOperation;Au=Au.replace("width = width * max(0.0, czm_metersPerPixel(positionEC));",""),Eu=Eu.replace("float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);","float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w;");function Ti(t){t=Ai(t,Ai.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let i=t.appearance;ht(i)||(i=new GT),this.appearance=i,this.show=Ai(t.show,!0),this.classificationType=Ai(t.classificationType,Tu.BOTH),this.debugShowBoundingVolume=Ai(t.debugShowBoundingVolume,!1),this._debugShowShadowVolume=Ai(t.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:Ai(t.interleave,!1),releaseGeometryInstances:Ai(t.releaseGeometryInstances,!0),allowPicking:Ai(t.allowPicking,!0),asynchronous:Ai(t.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;const e=this;this._readyPromise=new Promise((n,o)=>{e._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const r=this._error;ht(r)?o(r):n(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Hy(!1),this._renderState3DTiles=Hy(!0),this._renderStateMorph=Ny.fromCache({cull:{enabled:!0,face:WT.FRONT},depthTest:{enabled:!0},blending:Vy.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Ti.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}},readyPromise:{get:function(){return kT("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),Ti.initializeTerrainHeights=function(){return Pu.initialize()};function HT(t,i,e){const n=i.context,o=t._primitive,r=o._attributeLocations;let s=o._batchTable.getVertexShaderCallback()(Au);s=Fn._appendShowToShader(o,s),s=Fn._appendDistanceDisplayConditionToShader(o,s),s=Fn._modifyShaderPosition(t,s,i.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(UT);a=Fn._appendShowToShader(o,a),a=Fn._appendDistanceDisplayConditionToShader(o,a),a=Fn._modifyShaderPosition(t,a,i.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Eu);const d=[`GLOBE_MINIMUM_ALTITUDE ${i.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let u="",p="";ht(e.material)?(p=ht(e.material)?e.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);const f=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],g=new Rs({defines:d,sources:[s]}),m=new Rs({defines:f,sources:[p,c]});t._sp=NT.replaceCache({context:n,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:r});let y=n.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!ht(y)){const S=new Rs({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=n.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:n,shaderProgram:t._sp2D,vertexShaderSource:S,fragmentShaderSource:m,attributeLocations:r})}t._sp2D=y;let P=n.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!ht(P)){const S=new Rs({defines:d.concat([`MAX_TERRAIN_HEIGHT ${Pu._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(VT);const C=new Rs({defines:f,sources:[p,c]});P=n.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:n,shaderProgram:t._spMorph,vertexShaderSource:S,fragmentShaderSource:C,attributeLocations:r})}t._spMorph=P}function Hy(t){return Ny.fromCache({cull:{enabled:!0},blending:Vy.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:Gy.EQUAL,frontOperation:{fail:Pr.KEEP,zFail:Pr.KEEP,zPass:Pr.KEEP},backFunction:Gy.EQUAL,backOperation:{fail:Pr.KEEP,zFail:Pr.KEEP,zPass:Pr.KEEP},reference:Wy.CESIUM_3D_TILE_MASK,mask:Wy.CESIUM_3D_TILE_MASK}})}function qT(t,i,e,n,o,r){const s=t._primitive,a=s._va.length;o.length=a,r.length=a;const d=i instanceof Uy?{}:e._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let p=0;p<a;p++){const f=s._va[p];let g=o[p];ht(g)||(g=o[p]=new bs({owner:t,primitiveType:s._primitiveType})),g.vertexArray=f,g.renderState=t._renderState,g.shaderProgram=t._sp,g.uniformMap=u,g.pass=Oy.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const m=bs.shallowClone(g,g.derivedCommands.tileset);m.renderState=t._renderState3DTiles,m.pass=Oy.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;const y=bs.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=t._sp2D,g.derivedCommands.color2D=y;const P=bs.shallowClone(m,m.derivedCommands.color2D);P.shaderProgram=t._sp2D,m.derivedCommands.color2D=P;const S=bs.shallowClone(g,g.derivedCommands.colorMorph);S.renderState=t._renderStateMorph,S.shaderProgram=t._spMorph,S.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=S}}function qy(t,i,e,n,o,r,s){e.mode===_r.MORPHING?i=i.derivedCommands.colorMorph:e.mode!==_r.SCENE3D&&(i=i.derivedCommands.color2D),i.modelMatrix=n,i.boundingVolume=r,i.cull=o,i.debugShowBoundingVolume=s,e.commandList.push(i)}function $T(t,i,e,n,o,r,s){const a=t._primitive;Fn._updateBoundingVolumes(a,i,o);let c;i.mode===_r.SCENE3D?c=a._boundingSphereWC:i.mode===_r.COLUMBUS_VIEW?c=a._boundingSphereCV:i.mode===_r.SCENE2D&&ht(a._boundingSphere2D)?c=a._boundingSphere2D:ht(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);const d=i.mode===_r.MORPHING,u=t.classificationType,p=u!==Tu.CESIUM_3D_TILE,f=u!==Tu.TERRAIN&&!d;let g;const m=i.passes;if(m.render||m.pick&&a.allowPicking){const y=e.length;for(let P=0;P<y;++P){const S=c[P];p&&(g=e[P],qy(t,g,i,o,r,S,s)),f&&(g=e[P].derivedCommands.tileset,qy(t,g,i,o,r,S,s))}}}Ti.prototype.update=function(t){if(!ht(this._primitive)&&!ht(this.geometryInstances))return;if(!Pu.initialized){if(!this.asynchronous)throw new Su("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");Ti.initializeTerrainHeights();return}let i;const e=this,n=this._primitiveOptions;if(!ht(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r);let a;for(i=0;i<r;++i)if(a=o[i].attributes,!ht(a)||!ht(a.color)){this._hasPerInstanceColors=!1;break}for(i=0;i<r;++i){const c=o[i];a={};const d=c.attributes;for(const u in d)d.hasOwnProperty(u)&&(a[u]=d[u]);ht(a.width)||(a.width=new LT({componentDatatype:xT.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=t.scene3DOnly,OT.setProjectionAndEllipsoid(c.geometry,t.mapProjection),s[i]=new zT({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:e})}n.geometryInstances=s,n.appearance=this.appearance,n._createShaderProgramFunction=function(c,d,u){HT(e,d,u)},n._createCommandsFunction=function(c,d,u,p,f,g,m){qT(e,d,u,p,g,m)},n._updateAndQueueCommandsFunction=function(c,d,u,p,f,g,m,y){$T(e,d,u,p,f,g,m)},this._primitive=new Fn(n)}if(this.appearance instanceof Uy&&!this._hasPerInstanceColors)throw new Su("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(t),t.afterRender.push(()=>{!this._ready&&ht(this._primitive)&&this._primitive.ready&&this._completeLoad()})},Ti.prototype.getGeometryInstanceAttributes=function(t){if(!ht(this._primitive))throw new Su("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},Ti.isSupported=function(t){return t.frameState.context.depthTexture},Ti.prototype.isDestroyed=function(){return!1},Ti.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,FT(this)};class vo extends l.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.globe,o=-414,r=8777;let s={};const a=()=>{var p,f,g,m,y;if(!e)return;let d;const u=this.shadingMode||"none";if((this.show??!0)&&!(u==="none"&&!this.enableContour)){let P;this.enableContour?(u==="elevation"?(d=XT(),P=d.materials.elevationRampMaterial.uniforms,P.minimumHeight=((p=this.elevationParam)==null?void 0:p.minHeight)??o,P.maximumHeight=((f=this.elevationParam)==null?void 0:f.maxHeight)??r,s=d.materials.contourMaterial.uniforms):u==="slope"?(d=YT(),P=d.materials.slopeRampMaterial.uniforms,s=d.materials.contourMaterial.uniforms):u==="aspect"?(d=ZT(),P=d.materials.aspectRampMaterial.uniforms,s=d.materials.contourMaterial.uniforms):(d=h.Material.fromType("ElevationContour"),s=d.uniforms),s.width=this.contourWidth,s.spacing=this.contourSpacing,s.color=h.Color.fromCartesian4(h.Cartesian4.fromArray(this.contourColor))):u==="elevation"?(d=h.Material.fromType("ElevationRamp"),P=d.uniforms,P.minimumHeight=((g=this.elevationParam)==null?void 0:g.minHeight)??o,P.maximumHeight=((m=this.elevationParam)==null?void 0:m.maxHeight)??r):u==="slope"?(d=h.Material.fromType("SlopeRamp"),P=d.uniforms):u==="aspect"&&(d=h.Material.fromType("AspectRamp"),P=d.uniforms),u!=="none"&&(P.image=$y(u),u==="elevation"&&((y=this.elevationParam)==null?void 0:y.color)!==void 0&&(P.image=Array.isArray(this.elevationParam.color)?$y(u,this.elevationParam.color):this.elevationParam.color))}n.material=d};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(this.contourColorChanged,this.contourSpacingChanged,this.contourWidthChanged,this.enableContourChanged,this.shadingModeChanged,this.showChanged,this.elevationParamChanged));this.dispose(c.disposableOn(a)),this.dispose(()=>n.material=void 0)}}v(vo,"defaults",{show:!1,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],shadingMode:"none"}),(t=>{t.createDefaultProps=()=>({show:void 0,shadingMode:void 0,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],elevationParam:l.reactJsonWithUndefined(void 0)})})(vo||(vo={})),l.extendClassProps(vo.prototype,vo.createDefaultProps);function XT(){return new h.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1})}function YT(){return new h.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1})}function ZT(){return new h.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1})}const QT=[0,.045,.1,.15,.37,.54,1],KT=[0,.29,.5,Math.sqrt(2)/2,.87,.91,1],JT=[0,.2,.4,.6,.8,.9,1];function $y(t,i){const e=document.createElement("canvas");e.width=100,e.height=1;const n=e.getContext("2d");let o;if(t==="elevation")o=QT;else if(t==="slope")o=KT;else if(t==="aspect")o=JT;else throw new Error("values未赋值!");const r=n.createLinearGradient(0,0,100,0);return r.addColorStop(o[0],i!=null&&i[0]?mn(i==null?void 0:i[0]):"#000000"),r.addColorStop(o[1],i!=null&&i[1]?mn(i==null?void 0:i[1]):"#2747E0"),r.addColorStop(o[2],i!=null&&i[2]?mn(i==null?void 0:i[2]):"#D33B7D"),r.addColorStop(o[3],i!=null&&i[3]?mn(i==null?void 0:i[3]):"#D33038"),r.addColorStop(o[4],i!=null&&i[4]?mn(i==null?void 0:i[4]):"#FF9742"),r.addColorStop(o[5],i!=null&&i[5]?mn(i==null?void 0:i[5]):"#ffd700"),r.addColorStop(o[6],i!=null&&i[6]?mn(i==null?void 0:i[6]):"#ffffff"),n.fillStyle=r,n.fillRect(0,0,100,1),e}class Sr extends l.Destroyable{constructor(e){super();v(this,"_geoPath");v(this,"_geoPolyline");v(this,"_geoCanvasPointPoi");v(this,"_player");v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_currentDistance",this.disposeVar(l.react(0)));v(this,"_ratio",this.disposeVar(w.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new w.ESPathImpl),this._geoPolyline=this.disposeVar(new Ie(e)),this._geoCanvasPointPoi=this.disposeVar(new yn(e)),this._player=this.disposeVar(new w.Player),this._geoPolyline.show=!1,this.dispose(l.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(l.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(l.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(l.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(l.track([this._geoPath,"show"],[this,"show"])),this.dispose(l.track([this._geoPath,"polylineShow"],[this,"polylineShow"])),this.dispose(l.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(l.track([this._geoPath,"width"],[this,"width"])),this.dispose(l.track([this._geoPath,"ground"],[this,"ground"])),this.dispose(l.track([this._geoPath,"color"],[this,"color"])),this.dispose(l.track([this._geoPath,"hasDash"],[this,"hasDash"])),this.dispose(l.track([this._geoPath,"gapColor"],[this,"gapColor"])),this.dispose(l.track([this._geoPath,"dashLength"],[this,"dashLength"])),this.dispose(l.track([this._geoPath,"dashPattern"],[this,"dashPattern"])),this.dispose(l.track([this._geoPath,"hasArrow"],[this,"hasArrow"])),this.dispose(l.track([this._geoPath,"depthTest"],[this,"depthTest"])),this.dispose(l.track([this._geoPath,"arcType"],[this,"arcType"])),this.dispose(l.track([this._geoPath,"allowPicking"],[this,"allowPicking"]));{const n=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};n(),this.dispose(this.showChanged.disposableOn(n)),this.dispose(this.currentPoiShowChanged.disposableOn(n))}this.dispose(l.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const n=()=>{if(this.positions){const r=this.granularity*Math.PI/180,s=sd(this.positions,this.arcType??"GEODESIC",r);if(s){this._geoPath.timePosRots=s.timePosRots,this.rotationRadius.some(a=>a>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};n();const o=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(o.disposableOn(n))}{const n=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const o=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(o-this.currentDistance)>.01&&(this.currentDistance=o)};n(),this.dispose(this._player.currentTimeChanged.disposableOn(n))}{const n=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const o=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(o-(this._player.currentTime??0))>.01&&(this._player.currentTime=o)};n(),this.dispose(this.currentDistanceChanged.disposableOn(n))}this.dispose(l.bind([this._player,"loop"],[this,"loop"])),this.dispose(l.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(l.bind([this._player,"duration"],[this,"duration"])),this.dispose(l.bind([this._player,"playing"],[this,"playing"])),this.dispose(l.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(n=>{this._geoPolyline.flyTo(n)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(r=>r[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:l.reactPositions(void 0),width:1,ground:!1,color:l.reactArray([1,1,1,1]),hasDash:!1,gapColor:l.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Sr||(Sr={})),l.extendClassProps(Sr.prototype,Sr.createDefaultProps);class Ce extends Qt{constructor(e,n){super(e,n);v(this,"_smoothMoving");if(this._smoothMoving=this.disposeVar(new w.SmoothMoveController(this.czmViewer)),this.d(this._smoothMoving.currentPositionChanged.don(r=>{r&&(this.sceneObject.position=r)})),this.d(this._smoothMoving.currentRotationChanged.don(r=>{r&&this._smoothMoving.isRotating&&(this.sceneObject.rotation=r)})),this.d(this._smoothMoving.currentHeadingChanged.don(r=>{if(r!==void 0&&!this._smoothMoving.isRotating){const s=this.sceneObject.rotation;this.sceneObject.rotation=[r-90,s[1],s[2]]}})),!n.viewer){console.warn("viewer is undefined!");return}this.d(e.smoothMoveEvent.don((r,s)=>{this.smoothMove(r,s*1e3)})),this.d(e.smoothMoveWithRotationEvent.don((r,s,a)=>{this.smoothMoveWithRotation(r,s,a*1e3)})),this.d(e.smoothMoveOnGroundEvent.don((r,s,a)=>{this.smoothMoveOnGround(r,s,a*1e3)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((r,s,a,c)=>{this.smoothMoveWithRotationOnGround(r,s,a,c*1e3)})),this.d(e.calcFlyToParamEvent.don(()=>{if(!e.useCalcFlyToParamInESObjectWithLocation)return;if(!e.position){console.warn(`!sceneObject(${e.name}-${e.id}).position`);return}const r=n.calcFlyToParam(e.position);if(!r){console.warn("czmViewer.calcFlyToParam error.");return}e.flyToParam=r})),this.d(e.automaticLandingEvent.don(async r=>{const s=[e.position[0],e.position[1]],a=await n.getTerrainHeight(s);a?e.position=[...s,a]:console.warn("不存在相交"),e.collision=r}));{const r=this.dv(l.createNextAnimateFrameEvent(e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(r.don(()=>this.visibleDistance(e,n))),this.d(n.cameraChanged.don(()=>this.visibleDistance(e,n)))}}smoothMove(e,n){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,this.sceneObject.rotation,n)}smoothMoveWithRotation(e,n,o){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,n,o)}async smoothMoveOnGround(e,n,o){const r=await this.czmViewer.getTerrainHeight([e,n])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([e,n,r],this.sceneObject.rotation,o)}async smoothMoveWithRotationOnGround(e,n,o,r){const s=await this.czmViewer.getTerrainHeight([n,o])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([n,o,s],e,r)}visibleDistance(e,n){var r;const o=Ce.getInnerCzmObjects(this);if((r=n.viewer)!=null&&r.camera&&e.show&&o.length!=0){const s=w.getDistancesFromPositions([e.position,Vt(n.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=s>e.minVisibleDistance),o.forEach(c=>{if(c instanceof Le)return;const d=e.show&&a;Reflect.has(c,"showHelper")&&(c.showHelper=d),Reflect.has(c,"enabled")&&(c.enabled=d),Reflect.has(c,"show")&&(c.show=d)})}}static getInnerCzmObjects(e){const n=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(!o.includes("czmViewer")&&o.includes("czm")||!Number.isNaN(+o)?Array.isArray(e[o])?n.push(...Ce.getInnerCzmObjects(e[o])):n.push(e[o]):e[o]&&e[o].obj&&n.push(...Ce.getInnerCzmObjects(e[o].obj)));return n}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam&&o.position){const{position:s,flyToParam:a}=o,{distance:c,heading:d,pitch:u,flyDuration:p,hDelta:f,pDelta:g}=a;return this.flyToWithPromise(n,s,c,[d,u,0],e??p,f,g),!0}return super.flyTo(e,n)}flyIn(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(!o.flyInParam&&o.position&&o.rotation){const s=e??1,a=[...o.rotation];return a[0]+=90,this.flyToWithPromise(n,o.position,void 0,a,s),!0}return super.flyIn(e,n)}}class vt extends Qt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}class xs extends Ce{constructor(e,n){super(e,n);v(this,"_lastHoverResult",this.disposeVar(l.react(void 0)));if(!n.viewer){console.warn("viewer is undefined!");return}const r=this.ad(l.createProcessingFromAsyncFunc(async(s,a)=>{const c=await s.promise(n.pick(a.screenPosition,"innerHoverEvent"));this.lastHoverResult=Object.assign({},c,a)}));this.ad(n.pointerMoveEvent.don(async s=>{!r.isRunning&&r.restart(void 0,s)}))}get lastHoverResult(){return this._lastHoverResult.value}set lastHoverResult(e){this._lastHoverResult.value=e}get lastHoverResultChanged(){return this._lastHoverResult.changed}}class th extends Ce{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}function BT(t){return[t.urlChanged,t.classificationTypeChanged,t.ellipsoidChanged,t.modelUpAxisChanged,t.modelForwardAxisChanged,t.cullWithChildrenBoundsChanged,t.enableShowOutlineChanged,t.projectTo2DChanged,t.debugHeatmapTilePropertyNameChanged,t.enableDebugWireframeChanged,t.vectorClassificationOnlyChanged,t.vectorKeepDecodedPositionsChanged]}function Xy(t,i){const e=i;if(e.modelMatrix){h.Matrix4.clone(h.Matrix4.fromArray(e.modelMatrix),t.modelMatrix);return}if(!e.position){h.Matrix4.clone(h.Matrix4.IDENTITY,t.modelMatrix);return}let n=t._root.transform;const o=Fe({initialRotation:"yForwardzUp",rotation:[0,0,0],position:e.origin});(o&&!o.equalsEpsilon(n,.001)||n.equals(h.Matrix4.IDENTITY))&&o&&(n=o);const r=Fe({initialRotation:"yForwardzUp",rotation:e.rotation,position:e.position});if(!r){console.warn("modelMatrix is undefined!");return}const s=h.Matrix4.inverseTransformation(n,new h.Matrix4);h.Matrix4.multiply(r,s,t.modelMatrix)}class jT extends l.Destroyable{constructor(i,e,n){super(),this._tileset=i,this._czm3DTiles=e,this._updateMatrixEvent=n;{const o=()=>{const s=h.Matrix4.inverseTransformation(i.clippingPlanesOriginMatrix,new h.Matrix4);if(!i.clippingPlanes){i.clippingPlanes=as(e.clippingPlanes??{enabled:!1},s);return}Kl(i.clippingPlanes,e.clippingPlanes,s)};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(e.clippingPlanesChanged,e.originRootTransformInvChanged,this._updateMatrixEvent));this.dispose(r.disposableOn(o))}}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}}class eM extends l.Destroyable{constructor(i,e){super(),this._tileset=i,this._czm3DTiles=e;const{tileset:n,czm3DTiles:o}=this;{const r=()=>{if(!n.clippingPlanes){n.clippingPlanes=as(o.clippingPlanes??{enabled:!1});return}Kl(n.clippingPlanes,o.clippingPlanes)};r(),this.dispose(o.clippingPlanesChanged.disposableOn(r))}}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}}class tM extends l.Destroyable{constructor(i,e){super(),this._tileset=i,this._czm3DTiles=e;const{tileset:n,czmCzm3DTiles:o}=this;{const r=()=>{n.clippingPolygons=o.clippingPolygons?Jl(o.clippingPolygons):new h.ClippingPolygonCollection};r(),this.dispose(o.clippingPolygonsChanged.disposableOn(r))}}get tileset(){return this._tileset}get czmCzm3DTiles(){return this._czm3DTiles}}class iM extends l.Destroyable{constructor(i,e){super(),this._nativeTilesetReadyResetting=i,this._czmFlattenedPlane=e;const{tileset:n}=this;this.setFlattened(!0),this.dispose(()=>{this.setFlattened(!1)});{const o=()=>{const r=this._czmFlattenedPlane.finalMatrix?h.Matrix4.toArray(this._czmFlattenedPlane.finalMatrix):[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];this.setElevationMatrix(r)};o(),this.dispose(this._czmFlattenedPlane.finalMatrixChanged.disposableOn(o))}{const o=()=>{const s=[...this._czmFlattenedPlane.minSize,...this._czmFlattenedPlane.maxSize];this.setFlattenedBound(s)};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(this._czmFlattenedPlane.minSizeChanged,this._czmFlattenedPlane.maxSizeChanged));this.dispose(r.disposableOn(o))}n.xbsjGetFlattenedTextureFunc=()=>{const{sceneObject:o}=this._czmFlattenedPlane.czmTextureWithId;return o?window.czmTexture[o.id].texture:void 0},this.dispose(()=>n.xbsjGetFlattenedTextureFunc=void 0);{const o=()=>{const r=this._czmFlattenedPlane.computedCustomShader;this._nativeTilesetReadyResetting.flattenedCustomShader=r&&new r(this.czm3DTiles,this.czm3DTiles.czmViewer)};o(),this.dispose(this._czmFlattenedPlane.computedCustomShaderChanged.disposableOn(o)),this.dispose(()=>this._nativeTilesetReadyResetting.flattenedCustomShader=void 0)}}get czm3DTiles(){return this._nativeTilesetReadyResetting.czm3DTiles}get tileset(){return this._nativeTilesetReadyResetting.tileset}get czmFlattenedPlane(){return this._czmFlattenedPlane}setFlattened(i){this.tileset.xbsjFlattened=i}setFlattenedBound(i){this.tileset.xbsjFlattenedBound=h.Cartesian4.fromArray(i)}setElevationMatrix(i){this.tileset.xbsjElevationMatrix=h.Matrix4.fromArray(i)}}function nM(t,i){t.show=i.show??!0,t.colorBlendMode=h.Cesium3DTileColorBlendMode[i.colorBlendMode??"HIGHLIGHT"],t.shadows=(i.shadows&&ut.shadowPropsMap[i.shadows])??ut.shadowPropsMap.ENABLED,t.maximumScreenSpaceError=i.maximumScreenSpaceError??16,t.maximumMemoryUsage=i.maximumMemoryUsage??Ae.defaults.maximumMemoryUsage,t.cacheBytes=i.cacheBytes??Ae.defaults.cacheBytes,t.maximumCacheOverflowBytes=i.maximumCacheOverflowBytes??Ae.defaults.maximumCacheOverflowBytes,t.cullRequestsWhileMoving=i.cullRequestsWhileMoving??!0,t.cullRequestsWhileMovingMultiplier=i.cullRequestsWhileMovingMultiplier??60,t.preloadWhenHidden=i.preloadWhenHidden??!1,t.preloadFlightDestinations=i.preloadFlightDestinations??!0,t.preferLeaves=i.preferLeaves??!1,t.dynamicScreenSpaceError=i.dynamicScreenSpaceError??!1,t.dynamicScreenSpaceErrorDensity=i.dynamicScreenSpaceErrorDensity??.00278,t.dynamicScreenSpaceErrorFactor=i.dynamicScreenSpaceErrorFactor??4,t.dynamicScreenSpaceErrorHeightFalloff=i.dynamicScreenSpaceErrorHeightFalloff??.25,t.progressiveResolutionHeightFraction=i.progressiveResolutionHeightFraction??.3,t.foveatedScreenSpaceError=i.foveatedScreenSpaceError??!0,t.foveatedConeSize=i.foveatedConeSize??.1,t.foveatedMinimumScreenSpaceErrorRelaxation=i.foveatedMinimumScreenSpaceErrorRelaxation??0,t.foveatedTimeDelay=i.foveatedTimeDelay??.2,t.skipLevelOfDetail=i.skipLevelOfDetail??!1,t.baseScreenSpaceError=i.baseScreenSpaceError??1024,t.skipScreenSpaceErrorFactor=i.skipScreenSpaceErrorFactor??16,t.skipLevels=i.skipLevels??1,t.immediatelyLoadDesiredLevelOfDetail=i.immediatelyLoadDesiredLevelOfDetail??!1,t.loadSiblings=i.loadSiblings??!1,t.lightColor=(i.lightColor&&ai(i.lightColor))??Ae.defaults.lightColor,t.backFaceCulling=i.backFaceCulling??!0,t.showOutline=i.showOutline??!0,t.outlineColor=ie(i.outlineColor??Ae.defaults.outlineColor),t.featureIdLabel=i.featureIdLabel??Ae.defaults.featureIdLabel,t.instanceFeatureIdLabel=i.instanceFeatureIdLabel??Ae.defaults.instanceFeatureIdLabel,t.showCreditsOnScreen=i.showCreditsOnScreen??!1,t.splitDirection=h.SplitDirection[i.splitDirection??Ae.defaults.splitDirection],t.debugFreezeFrame=i.debugFreezeFrame??!1,t.debugColorizeTiles=i.debugColorizeTiles??!1,t.debugWireframe=i.debugWireframe??!1,t.debugShowBoundingVolume=i.debugShowBoundingVolume??!1,t.debugShowContentBoundingVolume=i.debugShowContentBoundingVolume??!1,t.debugShowViewerRequestVolume=i.debugShowViewerRequestVolume??!1,t.debugShowGeometricError=i.debugShowGeometricError??!1,t.debugShowRenderingStatistics=i.debugShowRenderingStatistics??!1,t.debugShowMemoryUsage=i.debugShowMemoryUsage??!1,t.debugShowUrl=i.debugShowUrl??!1}function oM(t){return[t.showChanged,t.colorBlendModeChanged,t.shadowsChanged,t.maximumScreenSpaceErrorChanged,t.maximumMemoryUsageChanged,t.cacheBytesChanged,t.maximumCacheOverflowBytesChanged,t.cullRequestsWhileMovingChanged,t.cullRequestsWhileMovingMultiplierChanged,t.preloadWhenHiddenChanged,t.preloadFlightDestinationsChanged,t.preferLeavesChanged,t.dynamicScreenSpaceErrorChanged,t.dynamicScreenSpaceErrorDensityChanged,t.dynamicScreenSpaceErrorFactorChanged,t.dynamicScreenSpaceErrorHeightFalloffChanged,t.progressiveResolutionHeightFractionChanged,t.foveatedScreenSpaceErrorChanged,t.foveatedConeSizeChanged,t.foveatedMinimumScreenSpaceErrorRelaxationChanged,t.foveatedTimeDelayChanged,t.skipLevelOfDetailChanged,t.baseScreenSpaceErrorChanged,t.skipScreenSpaceErrorFactorChanged,t.skipLevelsChanged,t.immediatelyLoadDesiredLevelOfDetailChanged,t.loadSiblingsChanged,t.lightColorChanged,t.backFaceCullingChanged,t.showOutlineChanged,t.outlineColorChanged,t.featureIdLabelChanged,t.instanceFeatureIdLabelChanged,t.showCreditsOnScreenChanged,t.splitDirectionChanged,t.debugFreezeFrameChanged,t.debugColorizeTilesChanged,t.debugWireframeChanged,t.debugShowBoundingVolumeChanged,t.debugShowContentBoundingVolumeChanged,t.debugShowViewerRequestVolumeChanged,t.debugShowGeometricErrorChanged,t.debugShowRenderingStatisticsChanged,t.debugShowMemoryUsageChanged,t.debugShowUrlChanged,t.enableShowOutlineChanged]}function rM(t,i){console.warn("Czm3DTiles暂不支持pointCloudShading属性"),t.pointCloudShading=new h.PointCloudShading(i.pointCloudShading)}function sM(t,i){var n,o,r;t.imageBasedLighting.imageBasedLightingFactor=Ee(((n=i.imageBasedLighting)==null?void 0:n.imageBasedLightingFactor)??[1,1]),t.imageBasedLighting.specularEnvironmentMaps=(o=i.imageBasedLighting)==null?void 0:o.specularEnvironmentMaps;const e=(r=i.imageBasedLighting)==null?void 0:r.sphericalHarmonicCoefficients;t.imageBasedLighting.sphericalHarmonicCoefficients=e&&ud(e)}class aM extends w.Destroyable{constructor(e,n,o,r){super();v(this,"_clippingPlanesCollectionResetting");v(this,"_clippingPolygonCollectionResetting");v(this,"_flattenedCustomShader",this.disposeVar(l.react(void 0)));this._tileset=e,this._czm3DTiles=n,this._czmNativeViewer=o,this._czmViewer=r,this._clippingPolygonCollectionResetting=new tM(this.tileset,this.czm3DTiles);const{tileset:s,czm3DTiles:a}=this;{const P=this.disposeVar(l.createNextAnimateFrameEvent(this.czm3DTiles.positionChanged,this.czm3DTiles.rotationChanged,this.czm3DTiles.modelMatrixChanged,this.czm3DTiles.originChanged));Xy(this.tileset,this.czm3DTiles),this.dispose(P.disposableOn(()=>Xy(this.tileset,this.czm3DTiles))),this._clippingPlanesCollectionResetting=this.disposeVar(new l.ObjResettingWithEvent(this.czm3DTiles.absoluteClippingPlanesChanged,()=>this.czm3DTiles.absoluteClippingPlanes?new jT(this.tileset,this.czm3DTiles,P):new eM(this.tileset,this.czm3DTiles)))}this.disposeVar(new l.ObjResettingWithEvent(this.czm3DTiles.czmFlattenedPlaneWithId.sceneObjectChanged,()=>{const{sceneObject:P}=this.czm3DTiles.czmFlattenedPlaneWithId;if(!P)return;let S;w.registerCreatedEventUpdate(this,P,()=>{const C=r.getEngineObject(P);if(P instanceof w.ES3DTileset&&(S=C.flattenedPlane),!!S)return new iM(this,S)})}));const c=this.disposeVar(l.createNextAnimateFrameEvent(...oM(a)));w.registerEventUpdate(this,c,()=>{nM(s,a)}),w.registerEventUpdate(this,a.foveatedInterpolationCallbackChanged,()=>{s.foveatedInterpolationCallback=a.foveatedInterpolationCallback}),w.registerEventUpdate(this,a.styleChanged,()=>{s.style=a.style}),w.registerEventUpdate(this,a.pointCloudShadingChanged,()=>{rM(s,a)}),w.registerEventUpdate(this,a.imageBasedLightingChanged,()=>{sM(s,a)}),w.registerEventUpdate(this,a.environmentMapManagerChanged,()=>{dd(s.environmentMapManager,a)});let d=[],u,p,f=!0,g=()=>{var P;return(P=r.viewer)==null?void 0:P.scene.postUpdate.addEventListener(S=>{s._selectedTiles.length===d.length&&d.every(C=>s._selectedTiles.includes(C))||(d.splice(0,d.length,...s._selectedTiles),s._selectedTiles.forEach(C=>{hs(C.content._model,u)}))})};const m=()=>{p&&(p(),p=void 0),d=[],u=void 0};this.ad(m);const y=(P,S)=>{S=="default"?P._contentState=h.Cesium3DTileContentState.UNLOADED:P.content&&Reflect.has(P.content,"_model")&&!hs(P.content._model,S)&&f&&(f=!1),P.children&&P.children.forEach(C=>{y(C,S)})};this.ad(a.setMaterialEvent.don(async P=>{if(f=!0,P=="default")m(),y(s.root,"default");else{u={};for(const C in P){let E,T,I;const b=P[C];u[C]={...b},Reflect.has(b,"baseColorTexture")&&(b.baseColorTexture==null?u[C].baseColorTexture=void 0:b.baseColorTexture.value!=""&&(E=io(this._czmViewer.viewer,b.baseColorTexture,{magFilter:b.magFilter,minFilter:b.minFilter}))),Reflect.has(b,"normalTexture")&&(b.normalTexture==null?u[C].normalTexture=void 0:b.normalTexture.value!=""&&(T=io(this._czmViewer.viewer,b.normalTexture,{magFilter:b.magFilter,minFilter:b.minFilter}))),Reflect.has(b,"metallicRoughnessTexture")&&(b.metallicRoughnessTexture==null?u[C].metallicRoughnessTexture=void 0:b.metallicRoughnessTexture.value!=""&&(I=io(this._czmViewer.viewer,b.metallicRoughnessTexture,{magFilter:b.magFilter,minFilter:b.minFilter})));const x=await Promise.allSettled([E,T,I]);E=x[0].value,T=x[1].value,I=x[2].value,I!=null&&(u[C].metallicRoughnessTexture=I),E!=null&&(u[C].baseColorTexture=E),T!=null&&(u[C].normalTexture=T)}y(s.root,u),p||(p=g())}const S=w.ESSceneObject.getSceneObject(this.czm3DTiles.id);S&&S instanceof w.ES3DTileset&&S.setMaterialInfoEvent.emit({type:f?"success":"warn",message:f?"完成":"部分材质颜色纹理设置失败,请检查原始模型中材质是否具有baseColorTexture属性"})}));{const P=()=>{var C,E;if(this.flattenedCustomShader){s.customShader=(C=this.flattenedCustomShader)==null?void 0:C.customShader,a.customShaderInstance&&console.warn("压平shader和Czm3DTiles的customShader冲突,优先使用压平shader!");return}s.customShader=(E=a.customShaderInstance)==null?void 0:E.customShader};P();const S=this.disposeVar(l.createNextAnimateFrameEvent(a.customShaderInstanceChanged,this.flattenedCustomShaderChanged));this.dispose(S.disposableOn(P))}this.dispose(a.flyToEvent.disposableOn(P=>{a.czmViewer.actived&&this.tileset&&this._czmNativeViewer.camera.flyToBoundingSphere(this.tileset.boundingSphere,{duration:(P??1e3)/1e3})}))}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}get clippingPlanesCollectionResetting(){return this._clippingPlanesCollectionResetting}get clippingPolygonCollectionResetting(){return this._clippingPolygonCollectionResetting}get flattenedCustomShader(){return this._flattenedCustomShader.value}set flattenedCustomShader(e){this._flattenedCustomShader.value=e}get flattenedCustomShaderChanged(){return this._flattenedCustomShader.changed}}function lM(t){const{imageBasedLightingFactor:i,sphericalHarmonicCoefficients:e,specularEnvironmentMaps:n}=t,o={imageBasedLightingFactor:i&&new h.Cartesian2(i[0],i[1]),sphericalHarmonicCoefficients:e&&e.map(r=>new h.Cartesian3(r[0],r[1],r[2])),specularEnvironmentMaps:n&&w.ESSceneObject.context.getStrFromEnv(n)};return new h.ImageBasedLighting(o)}async function cM(t,i,e){let n="";if(typeof i!="string"?typeof i=="object"&&i.url&&(n=new h.Resource({url:i.url,headers:i.headers,queryParameters:i.queryParameters,templateValues:i.templateValues,proxy:i.proxy,retryCallback:i.retryCallback,retryAttempts:i.retryAttempts,request:i.request,parseUrl:i.parseUrl})):n=i,typeof i=="string"&&i.startsWith("ion://")){const s=+i.substring(6);try{n=await h.IonResource.fromAssetId(s)}catch(a){console.error(`Ion资源未能获取到 error: ${a}`,a);return}}const o=await h.Cesium3DTileset.fromUrl(n,{show:t.show,shadows:t.shadows&&ut.shadowPropsMap[t.shadows],maximumScreenSpaceError:t.maximumScreenSpaceError,maximumMemoryUsage:t.maximumMemoryUsage,cacheBytes:t.cacheBytes,maximumCacheOverflowBytes:t.maximumCacheOverflowBytes,cullWithChildrenBounds:t.cullWithChildrenBounds,cullRequestsWhileMoving:t.cullRequestsWhileMoving,cullRequestsWhileMovingMultiplier:t.cullRequestsWhileMovingMultiplier,preloadWhenHidden:t.preloadWhenHidden,preloadFlightDestinations:t.preloadFlightDestinations,preferLeaves:t.preferLeaves,dynamicScreenSpaceError:t.dynamicScreenSpaceError,dynamicScreenSpaceErrorDensity:t.dynamicScreenSpaceErrorDensity,dynamicScreenSpaceErrorFactor:t.dynamicScreenSpaceErrorFactor,dynamicScreenSpaceErrorHeightFalloff:t.dynamicScreenSpaceErrorHeightFalloff,progressiveResolutionHeightFraction:t.progressiveResolutionHeightFraction,foveatedScreenSpaceError:t.foveatedScreenSpaceError,foveatedConeSize:t.foveatedConeSize,foveatedMinimumScreenSpaceErrorRelaxation:t.foveatedMinimumScreenSpaceErrorRelaxation,foveatedInterpolationCallback:t.foveatedInterpolationCallbackStr&&Function('"use strict";return ('+t.foveatedInterpolationCallbackStr+")")(),foveatedTimeDelay:t.foveatedTimeDelay,skipLevelOfDetail:t.skipLevelOfDetail,baseScreenSpaceError:t.baseScreenSpaceError,skipScreenSpaceErrorFactor:t.skipScreenSpaceErrorFactor,skipLevels:t.skipLevels,immediatelyLoadDesiredLevelOfDetail:t.immediatelyLoadDesiredLevelOfDetail,loadSiblings:t.loadSiblings,classificationType:ut.classificationTypeMap[t.classificationType??Ae.defaults.classificationType],lightColor:t.lightColor&&si(t.lightColor),backFaceCulling:t.backFaceCulling??Ae.defaults.backFaceCulling,showOutline:t.showOutline??Ae.defaults.showOutline,debugHeatmapTilePropertyName:t.debugHeatmapTilePropertyName,debugFreezeFrame:t.debugFreezeFrame,debugColorizeTiles:t.debugColorizeTiles,debugWireframe:t.debugWireframe,debugShowBoundingVolume:t.debugShowBoundingVolume,debugShowContentBoundingVolume:t.debugShowContentBoundingVolume,debugShowViewerRequestVolume:t.debugShowViewerRequestVolume,debugShowGeometricError:t.debugShowGeometricError,debugShowRenderingStatistics:t.debugShowRenderingStatistics,debugShowMemoryUsage:t.debugShowMemoryUsage,debugShowUrl:t.debugShowUrl,customShader:e,ellipsoid:Pe(t.ellipsoid??Ae.defaults.ellipsoid),modelMatrix:t.modelMatrix&&h.Matrix4.fromArray(t.modelMatrix),clippingPlanes:t.clippingPlanes&&as(t.clippingPlanes),clippingPolygons:t.clippingPolygons&&Jl(t.clippingPolygons),imageBasedLighting:t.imageBasedLighting&&lM(t.imageBasedLighting),splitDirection:h.SplitDirection[t.splitDirection??Ae.defaults.splitDirection],modelUpAxis:t.modelUpAxis&&h.Axis[t.modelUpAxis],modelForwardAxis:t.modelForwardAxis&&h.Axis[t.modelForwardAxis],featureIdLabel:t.featureIdLabel??Ae.defaults.featureIdLabel,instanceFeatureIdLabel:t.instanceFeatureIdLabel??Ae.defaults.instanceFeatureIdLabel,outlineColor:t.outlineColor&&ie(t.outlineColor),pointCloudShading:t.pointCloudShading,enableShowOutline:t.enableShowOutline,vectorClassificationOnly:t.vectorClassificationOnly,vectorKeepDecodedPositions:t.vectorKeepDecodedPositions,showCreditsOnScreen:t.showCreditsOnScreen,projectTo2D:t.projectTo2D,enableDebugWireframe:t.enableDebugWireframe});return h.Cesium3DTileset.prototype&&(o.ESSceneObjectID=t.id),o}class hM extends l.Destroyable{constructor(e,n,o,r){var c;super();v(this,"_tileset",this.disposeVar(l.react(void 0)));v(this,"_readyResetting");if(this._url=e,this._czm3DTiles=n,this._czmNativeViewer=o,this._czmViewer=r,this._readyResetting=this.disposeVar(new l.ObjResettingWithEvent(this.tilesetChanged,()=>{if(this.tileset)return new aM(this.tileset,this.czm3DTiles,this._czmNativeViewer,this._czmViewer)})),!this.url)throw new Error("!url");const s=(c=this.czm3DTiles.customShaderInstance)==null?void 0:c.customShader;this.disposeVar(l.createProcessingFromAsyncFunc(async d=>{const u=await d.promise(cM(this.czm3DTiles,this.url,s));u&&(u.style=this.czm3DTiles.style,u.foveatedInterpolationCallback=this.czm3DTiles.foveatedInterpolationCallback,this._czmNativeViewer.scene.primitives.add(u),this.dispose(()=>this._czmNativeViewer.scene.primitives.remove(u)),this._tileset.value=u,this.czm3DTiles.notifyCzmTilesetReady(u,this.czm3DTiles))})).start()}get url(){return this._url}get czm3DTiles(){return this._czm3DTiles}get czmViewer(){return this.czm3DTiles.czmViewer}get tileset(){return this._tileset.value}set tileset(e){this._tileset.value=e}get tilesetChanged(){return this._tileset.changed}get readyResetting(){return this._readyResetting}}function dM(t){if(t)try{return new h.Cesium3DTileStyle(t)}catch(i){console.error(`Cesium3DTiles style error: ${i}`,i);return}}let uM=class extends w.Destroyable{constructor(i,e){super(),this.dv(new l.ObjResettingWithEvent(e.clippingPolygonsIdChanged,(n,o)=>{if(!(!n||n===o||n&&n.length===0))return new pM(i,e)}))}},pM=class extends w.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=e.clippingPolygonsId;this.d(()=>e.clippingPolygons=void 0);const o=s=>{const a=this.dv(l.createNextAnimateFrameEvent(s.positionsChanged,s.reverseChanged,s.enabledChanged,s.showHelperChanged));this.dv(new l.ObjResettingWithEvent(a,()=>new fM(i,s,e)))},r=s=>{let a;s instanceof w.ESExcavate&&w.registerCreatedEventUpdate(this,s,()=>{a=i.getEngineObject(s).czmPolygonClipping,a&&o(a)}),s instanceof w.ESHole&&w.registerCreatedEventUpdate(this,s.excavate,()=>{a=i.getEngineObject(s.excavate).czmPolygonClipping,a&&o(a)})};for(let s=0;s<n.length;s++){const a=n[s],c=w.ESSceneObject.getSceneObjById(a);c&&r(c)}}},fM=class extends w.Destroyable{constructor(i,e,n){super(),this._czmViewer=i;const o=n.clippingPolygonsId,r=e.enabled?e.reverse:void 0;if(o&&o.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<o.length;a++){const c=o[a],d=w.ESSceneObject.getSceneObjById(c);if(!d)return;let u;if(d instanceof w.ESExcavate?u=i.getEngineObject(d).czmPolygonClipping:d instanceof w.ESHole&&(u=i.getEngineObject(d.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[a]={positions:u.positions},s.inverse=r??u.reverse)}n.clippingPolygons=s}}};function Yy(t){let i;try{i=t&&Function('"use strict";return ('+t+")")()}catch{i=void 0}return i||h.Math.lerp}const Zy=`
|
|
365
|
+
`;return r=mu(a),new Worker(r,o)}if(r=t,e||(r=ei(`${it._workerModulePrefix+n}.js`)),!ct.supportsEsmWebWorkers())throw new lt("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function mT(t,i){const e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!ct.supportsWebAssembly()){if(!D(i.fallbackModulePath))throw new lt(`This browser does not support Web Assembly, and no backup module was provided for ${t._workerPath}`);return e.modulePath=ei(i.fallbackModulePath),e}e.wasmBinaryFile=ei(i.wasmBinaryFile);const n=await j.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=n,e}function it(t,i){this._workerPath=t,this._maximumActiveTasks=i??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const vT=(t,i,e,n)=>{const o=({data:r})=>{if(r.id===i){if(D(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new lt(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new H(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),gu.raiseEvent(s),n(s)}else gu.raiseEvent(),e(r.result);t.removeEventListener("message",o)}};return o},yT=[];async function wT(t,i,e){const n=await Promise.resolve(Sy());D(e)?n||(e.length=0):e=yT;const o=t._nextID++,r=new Promise((s,a)=>{t._worker.addEventListener("message",vT(t._worker,o,s,a))});return t._worker.postMessage({id:o,baseUrl:ei.getCesiumBaseUrl().url,parameters:i,canTransferArrayBuffer:n},e),r}async function CT(t,i,e){++t._activeTasks;try{const n=await wT(t,i,e);return--t._activeTasks,n}catch(n){throw--t._activeTasks,n}}it.prototype.scheduleTask=function(t,i){if(D(this._worker)||(this._worker=vu(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return CT(this,t,i)},it.prototype.initWebAssemblyModule=async function(t){if(D(this._webAssemblyPromise))return this._webAssemblyPromise;const i=async()=>{const e=this._worker=vu(this._workerPath),n=await mT(this,t),o=await Promise.resolve(Sy());let r;const s=n.wasmBinary;D(s)&&o&&(r=[s]);const a=new Promise((c,d)=>{e.onmessage=function({data:u}){D(u)?c(u.result):d(new lt("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:n}},r),a};return this._webAssemblyPromise=i(),this._webAssemblyPromise},it.prototype.isDestroyed=function(){return!1},it.prototype.destroy=function(){return D(this._worker)&&this._worker.terminate(),fE(this)},it.taskCompletedEvent=gu,it._defaultWorkerModulePrefix="Workers/",it._workerModulePrefix=it._defaultWorkerModulePrefix,it._canTransferArrayBuffer=void 0;function Zi(){}Zi._transcodeTaskProcessor=new it("transcodeKTX2",Number.POSITIVE_INFINITY),Zi._readyPromise=void 0;function _T(){const t=Zi._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(i){if(i)return Zi._transcodeTaskProcessor;throw new lt("KTX2 transcoder could not be initialized.")});Zi._readyPromise=t}Zi.transcode=function(t,i){return A.defined("supportedTargetFormats",i),D(Zi._readyPromise)||_T(),Zi._readyPromise.then(function(e){let n=t;t instanceof ArrayBuffer&&(n=new Uint8Array(t));const o={supportedTargetFormats:i,ktx2Buffer:n};return e.scheduleTask(o,[n.buffer])}).then(function(e){const n=e.length,o=Object.keys(e[0]);for(let r=0;r<n;r++){const s=e[r];for(let a=0;a<o.length;a++){const c=s[o[a]];s[o[a]]=new wr(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<n;++r)e[r]=e[r][o[0]];n===1&&(e=e[0])}return e}).catch(function(e){throw e})};let Ey;Ay.setKTX2SupportedFormats=function(t,i,e,n,o,r){Ey={s3tc:t,pvrtc:i,astc:e,etc:n,etc1:o,bc7:r}};function Ay(t){A.defined("resourceOrUrlOrBuffer",t);let i;return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?i=Promise.resolve(t):i=j.createIfNeeded(t).fetchArrayBuffer(),i.then(function(e){return Zi.transcode(e,Ey)})}function xt(t){this._ellipsoid=t??le.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(xt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),xt.mercatorAngleToGeodeticLatitude=function(t){return O.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},xt.geodeticLatitudeToMercatorAngle=function(t){t>xt.MaximumLatitude?t=xt.MaximumLatitude:t<-xt.MaximumLatitude&&(t=-xt.MaximumLatitude);const i=Math.sin(t);return .5*Math.log((1+i)/(1-i))},xt.MaximumLatitude=xt.mercatorAngleToGeodeticLatitude(Math.PI),xt.prototype.project=function(t,i){const e=this._semimajorAxis,n=t.longitude*e,o=xt.geodeticLatitudeToMercatorAngle(t.latitude)*e,r=t.height;return D(i)?(i.x=n,i.y=o,i.z=r,i):new k(n,o,r)},xt.prototype.unproject=function(t,i){if(!D(t))throw new H("cartesian is required");const e=this._oneOverSemimajorAxis,n=t.x*e,o=xt.mercatorAngleToGeodeticLatitude(t.y*e),r=t.z;return D(i)?(i.longitude=n,i.latitude=o,i.height=r,i):new fe(n,o,r)};const Ty={};function Ds(t,i){if(!D(t))throw new H("identifier is required.");D(Ty[t])||(Ty[t]=!0,console.warn(i??t))}Ds.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.",Ds.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",Ds.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",Ds.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function My(t,i){if(!D(t)||!D(i))throw new H("identifier and message are required.");Ds(t,i)}function Cr(){H.throwInstantiationError()}Object.defineProperties(Cr.prototype,{rectangle:{get:H.throwInstantiationError},tileWidth:{get:H.throwInstantiationError},tileHeight:{get:H.throwInstantiationError},maximumLevel:{get:H.throwInstantiationError},minimumLevel:{get:H.throwInstantiationError},tilingScheme:{get:H.throwInstantiationError},tileDiscardPolicy:{get:H.throwInstantiationError},errorEvent:{get:H.throwInstantiationError},credit:{get:H.throwInstantiationError},proxy:{get:H.throwInstantiationError},hasAlphaChannel:{get:H.throwInstantiationError}}),Cr.prototype.getTileCredits=function(t,i,e){H.throwInstantiationError()},Cr.prototype.requestImage=function(t,i,e,n){H.throwInstantiationError()},Cr.prototype.pickFeatures=function(t,i,e,n,o){H.throwInstantiationError()};const PT=/\.ktx2$/i;Cr.loadImage=function(t,i){A.defined("url",i);const e=j.createIfNeeded(i);return PT.test(e.url)?Ay(e):D(t)&&D(t.tileDiscardPolicy)?e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):e.fetchImage({preferImageBitmap:!0,flipY:!0})};function Iy(t,i){return My("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),t??i}Object.defineProperty(Iy,"EMPTY_OBJECT",{get:function(){return My("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),_i.EMPTY_OBJECT}});var Kc=3.141592653589793*3e3/180,nt=3.141592653589793,Jc=6378245,Bc=.006693421622965943,Dy=function(n,o){var n=+n,o=+o,r=n-.0065,s=o-.006,a=Math.sqrt(r*r+s*s)-2e-5*Math.sin(s*Kc),c=Math.atan2(s,r)-3e-6*Math.cos(r*Kc),d=a*Math.cos(c),u=a*Math.sin(c);return[d,u]},by=function(o,n){var n=+n,o=+o,r=Math.sqrt(o*o+n*n)+2e-5*Math.sin(n*Kc),s=Math.atan2(n,o)+3e-6*Math.cos(o*Kc),a=r*Math.cos(s)+.0065,c=r*Math.sin(s)+.006;return[a,c]},yu=function(o,n){var n=+n,o=+o;if(Fy(o,n))return[o,n];var r=Ry(o-105,n-35),s=xy(o-105,n-35),a=n/180*nt,c=Math.sin(a);c=1-Bc*c*c;var d=Math.sqrt(c);r=r*180/(Jc*(1-Bc)/(c*d)*nt),s=s*180/(Jc/d*Math.cos(a)*nt);var u=n+r,p=o+s;return[p,u]},wu=function(o,n){var n=+n,o=+o;if(Fy(o,n))return[o,n];var r=Ry(o-105,n-35),s=xy(o-105,n-35),a=n/180*nt,c=Math.sin(a);c=1-Bc*c*c;var d=Math.sqrt(c);r=r*180/(Jc*(1-Bc)/(c*d)*nt),s=s*180/(Jc/d*Math.cos(a)*nt);var u=n+r,p=o+s;return[o*2-p,n*2-u]},Ry=function(o,n){var n=+n,o=+o,r=-100+2*o+3*n+.2*n*n+.1*o*n+.2*Math.sqrt(Math.abs(o));return r+=(20*Math.sin(6*o*nt)+20*Math.sin(2*o*nt))*2/3,r+=(20*Math.sin(n*nt)+40*Math.sin(n/3*nt))*2/3,r+=(160*Math.sin(n/12*nt)+320*Math.sin(n*nt/30))*2/3,r},xy=function(o,n){var n=+n,o=+o,r=300+o+2*n+.1*o*o+.1*o*n+.1*Math.sqrt(Math.abs(o));return r+=(20*Math.sin(6*o*nt)+20*Math.sin(2*o*nt))*2/3,r+=(20*Math.sin(o*nt)+40*Math.sin(o/3*nt))*2/3,r+=(150*Math.sin(o/12*nt)+300*Math.sin(o/30*nt))*2/3,r},Fy=function(o,n){var n=+n,o=+o;return!(o>73.66&&o<135.05&&n>3.86&&n<53.55)};function Cu(t,i){this.x=t||0,this.y=i||0,this.x=this.x,this.y=this.y}Cu.prototype.equals=function(t){return t&&t.x==this.x&&t.y==this.y};function ui(t,i){isNaN(t)&&(t=decode64(t),t=isNaN(t)?0:t),typeof t=="string"&&(t=parseFloat(t)),isNaN(i)&&(i=decode64(i),i=isNaN(i)?0:i),typeof t=="lat"&&(i=parseFloat(i)),this.lng=t,this.lat=i}ui.isInRange=function(t){return t&&t.lng<=180&&t.lng>=-180&&t.lat<=74&&t.lat>=-74},ui.prototype.equals=function(t){return t&&this.lat==t.lat&&this.lng==t.lng};function ze(){}ze.EARTHRADIUS=637099681e-2,ze.MCBAND=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],ze.LLBAND=[75,60,45,30,15,0],ze.MC2LL=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],ze.LL2MC=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],ze.getDistanceByMC=function(t,i){if(!t||!i)return 0;var e,n,o,r;return t=this.convertMC2LL(t),!t||(e=this.toRadians(t.lng),n=this.toRadians(t.lat),i=this.convertMC2LL(i),!i)?0:(o=this.toRadians(i.lng),r=this.toRadians(i.lat),this.getDistance(e,o,n,r))},ze.getDistanceByLL=function(t,i){if(!t||!i)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),i.lng=this.getLoop(i.lng,-180,180),i.lat=this.getRange(i.lat,-74,74);var e,n,o,r;return e=this.toRadians(t.lng),o=this.toRadians(t.lat),n=this.toRadians(i.lng),r=this.toRadians(i.lat),this.getDistance(e,n,o,r)},ze.convertMC2LL=function(r){var i,e;i=new ui(Math.abs(r.lng),Math.abs(r.lat));for(var n=0;n<this.MCBAND.length;n++)if(i.lat>=this.MCBAND[n]){e=this.MC2LL[n];break}var o=this.convertor(r,e),r=new ui(o.lng.toFixed(6),o.lat.toFixed(6));return r},ze.convertLL2MC=function(r){var i,e;r.lng=this.getLoop(r.lng,-180,180),r.lat=this.getRange(r.lat,-74,74),i=new ui(r.lng,r.lat);for(var n=0;n<this.LLBAND.length;n++)if(i.lat>=this.LLBAND[n]){e=this.LL2MC[n];break}if(!e){for(var n=this.LLBAND.length-1;n>=0;n--)if(i.lat<=-this.LLBAND[n]){e=this.LL2MC[n];break}}var o=this.convertor(r,e),r=new ui(o.lng.toFixed(2),o.lat.toFixed(2));return r},ze.convertor=function(t,i){if(!(!t||!i)){var e=i[0]+i[1]*Math.abs(t.lng),n=Math.abs(t.lat)/i[9],o=i[2]+i[3]*n+i[4]*n*n+i[5]*n*n*n+i[6]*n*n*n*n+i[7]*n*n*n*n*n+i[8]*n*n*n*n*n*n;return e*=t.lng<0?-1:1,o*=t.lat<0?-1:1,new ui(e,o)}},ze.getDistance=function(t,i,e,n){return this.EARTHRADIUS*Math.acos(Math.sin(e)*Math.sin(n)+Math.cos(e)*Math.cos(n)*Math.cos(i-t))},ze.toRadians=function(t){return Math.PI*t/180},ze.toDegrees=function(t){return 180*t/Math.PI},ze.getRange=function(t,i,e){return i!=null&&(t=Math.max(t,i)),e!=null&&(t=Math.min(t,e)),t},ze.getLoop=function(t,i,e){for(;t>e;)t-=e-i;for(;t<i;)t+=e-i;return t},ze.prototype.lngLatToMercator=function(t){return ze.convertLL2MC(t)},ze.prototype.lngLatToPoint=function(t){var i=ze.convertLL2MC(t);return new Cu(i.lng,i.lat)},ze.prototype.mercatorToLngLat=function(t){return ze.convertMC2LL(t)},ze.prototype.PointToLngLat=function(t){var i=new ui(t.x,t.y);return ze.convertMC2LL(i)},ze.prototype.PointToPixel=function(t,i,e,n,o){if(t){t=this.lngLatToMercator(t,o);var r=this.getZoomUnits(i),s=Math.round((t.lng-e.lng)/r+n[Twidth]/2),a=Math.round((e.lat-t.lat)/r+n[Theight]/2);return new Cu(s,a)}},ze.prototype.PixelToPoint=function(t,i,e,n,o){if(t){var r=this.getZoomUnits(i),s=e.lng+r*(t.x-n[Twidth]/2),a=e.lat-r*(t.y-n[Theight]/2),c=new ui(s,a);return this.mercatorToLngLat(c,o)}},ze.prototype.getZoomUnits=function(t){return Math.pow(2,18-t)};function Rn(t){t=t||{},this._ellipsoid=Iy(t.ellipsoid,le.WGS84);var i=!0;D(t.wgs84)&&(i=t.wgs84),this._projection=new xt(this._ellipsoid);var e=new ze;this._projection.project=function(s){var a={};return i?(a=yu(O.toDegrees(s.longitude),O.toDegrees(s.latitude)),a=by(a[0],a[1])):a=by(O.toDegrees(s.longitude),O.toDegrees(s.latitude)),a[0]=Math.min(a[0],180),a[0]=Math.max(a[0],-180),a[1]=Math.min(a[1],74.000022),a[1]=Math.max(a[1],-71.988531),a=e.lngLatToPoint(new ui(a[0],a[1])),new ee(a.x,a.y)},this._projection.unproject=function(s){var a=e.mercatorToLngLat(new ui(s.x,s.y));return a[0]=(a[0]+180)%360-180,i?(a=Dy(a.lng,a.lat),a=wu(a[0],a[1])):a=Dy(a.lng,a.lat),new fe(O.toRadians(a[0]),O.toRadians(a[1]))},this._rectangleSouthwestInMeters=new ee(-2003772637e-2,-1170804166e-2),this._rectangleNortheastInMeters=new ee(2003772637e-2,1247410417e-2);var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new oe(n.longitude,n.latitude,o.longitude,o.latitude),this.levelWidth=[];for(var r=0;r<19;r++)this.levelWidth[r]=Math.pow(2,18-r)*256}Object.defineProperties(Rn.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Rn.prototype.getNumberOfXTilesAtLevel=function(t){return(1<<t)*.7},Rn.prototype.getNumberOfYTilesAtLevel=function(t){return 1<<t},Rn.prototype.rectangleToNativeRectangle=function(t,i){var e=this._projection,n=e.project(oe.southwest(t)),o=e.project(oe.northeast(t));return D(i)?(i.west=n.x,i.south=n.y,i.east=o.x,i.north=o.y,i):new oe(n.x,n.y,o.x,o.y)},Rn.prototype.tileXYToNativeRectangle=function(t,i,e,n){var o=this.levelWidth[e],r=t*o,s=(t+1)*o;i=-i;var a=(i+1)*o,c=i*o;return D(n)?(n.west=r,n.south=c,n.east=s,n.north=a,n):new oe(r,c,s,a)},Rn.prototype.tileXYToRectangle=function(t,i,e,n){var o=this.tileXYToNativeRectangle(t,i,e,n),r=this._projection,s=r.unproject(new ee(o.west,o.south)),a=r.unproject(new ee(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o},Rn.prototype.positionToTileXY=function(t,i,e){var n=this._rectangle;if(oe.contains(n,t)){var o=this._projection,r=o.project(t);if(D(r)){var s=this.levelWidth[i],a=Math.floor(r.x/s),c=-Math.floor(r.y/s);return D(e)?(e.x=a,e.y=c,e):new ee(a,c)}}};function jc(t){this._url=t.url||"http://online2.map.bdimg.com/onlinelabel/?qt=tile&styles=pl&x={x}&y={y}&z={z}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new Rn(t),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function ST(t,i,e,n){var o=t._url;return o=o.replace("{x}",i).replace("{y}",-e).replace("{z}",n),o}Object.defineProperties(jc.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 3}},tilingScheme:{get:function(){if(!this._ready)throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),jc.prototype.getTileCredits=function(t,i,e){},jc.prototype.requestImage=function(t,i,e){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=ST(this,t,i,e);return Cr.loadImage(this,n)};class ET extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTime",0);e.url="https://tileser.giiiis.com/timetile/",e.minimumLevel=1,e.maximumLevel=18,e.tilingScheme=new h.GeographicTilingScheme,this.indexTime=e.indexTime||0}get indexTime(){return this._indexTime}set indexTime(e){this._indexTime=e}async requestImage(e,n,o,r){try{let s=this.buildImageUrl(this.indexTime,e,n,o);return h.ImageryProvider.loadImage(this,s)}catch{return}}buildImageUrl(e,n,o,r){return`https://tileser.giiiis.com/timetile/${e}/${r}/${n}/${o}.jpg`}}class AT extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTimeID",0);e.url="https://wayback.maptiles.arcgis.com/",e.minimumLevel=1,e.maximumLevel=18,this.indexTimeID=e.indexTimeID||0}get indexTimeID(){return this._indexTimeID}set indexTimeID(e){this._indexTimeID=e}async requestImage(e,n,o,r){try{let s;return this.indexTimeID!==0?s=this.buildImageUrl(this.indexTimeID,e,n,o):s=`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${o}/${n}/${e}`,h.ImageryProvider.loadImage(this,s)}catch{return}}buildImageUrl(e,n,o,r){return`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${e}/${r}/${o}/${n}`}}const TT=document.createElement("canvas");class _u{constructor(i){v(this,"mapboxRenderer");v(this,"ready");v(this,"readyPromise");v(this,"rectangle");v(this,"tileSize");v(this,"tileWidth");v(this,"tileHeight");v(this,"maximumLevel");v(this,"minimumLevel");v(this,"tileDiscardPolicy");v(this,"credit");v(this,"proxy");v(this,"layerStyle");v(this,"hasAlphaChannel");v(this,"sourceFilter");v(this,"tilingScheme");v(this,"_destroyed",!1);v(this,"_error");v(this,"_style");v(this,"_accessToken");v(this,"_enablePickFeatures");this.ready=!1,this.tilingScheme=i.tilingScheme??new _e.WebMercatorTilingScheme,this.rectangle=i.rectangle??this.tilingScheme.rectangle,this.rectangle=_e.Rectangle.intersection(this.rectangle,this.tilingScheme.rectangle),this.tileSize=this.tileWidth=this.tileHeight=i.tileSize||256,this.maximumLevel=i.maximumLevel??18,this.minimumLevel=i.minimumLevel??0,this.tileDiscardPolicy=void 0,this._error=new _e.Event,this.credit=new _e.Credit(i.credit||"",!1),this.proxy=new _e.DefaultProxy(""),this.hasAlphaChannel=i.hasAlphaChannel??!0,this.sourceFilter=i.sourceFilter,this._accessToken=i.accessToken,this._enablePickFeatures=i.enablePickFeatures??!0,this.layerStyle=i.layerStyle??[],_e.defined(i.style)&&(this.readyPromise=this._build(i.style,i).then(()=>!0))}get style(){return this._style}get isDestroyed(){return this._destroyed}get errorEvent(){return this._error}async _build(i,e={}){const n=await this._preLoad(i,e.scheme??"tms");n.layers=this.layerStyle.length!=0?this.layerStyle:n.layers,this._style=n,this.mapboxRenderer=new $_.BasicRenderer({style:n,canvas:TT,token:e.accessToken,transformRequest:e.transformRequest}),e.showCanvas&&this.mapboxRenderer.showCanvasForDebug(),await this.mapboxRenderer._style.loadedPromise,this.readyPromise=Promise.resolve(!0),this.ready=!0}static async fromUrl(i,e={}){const n=new _u(e);return await n._build(i,e),n}_preLoad(i,e){let n=i;if(typeof i=="string"&&(i.endsWith(".json")||i.startsWith("mapbox://")?i=new _e.Resource({url:i}):(i={version:8,sources:{customSource:{type:"vector",scheme:e,tiles:[i]}},layers:this.layerStyle},n=i)),i instanceof _e.Resource){const o="https://api.mapbox.com/";i.url.startsWith("mapbox://")&&(i.url=i.url.replace("mapbox://",o)),this._accessToken&&i.appendQueryParameters({access_token:this._accessToken}),n=i.fetchJson()}return Promise.resolve(n).catch(o=>{throw this._error.raiseEvent(o),o})}_createTile(){const i=document.createElement("canvas");return i.width=this.tileSize,i.height=this.tileSize,i.style.imageRendering="pixelated",i}_resetTileCache(){Object.values(this.mapboxRenderer._style.sourceCaches).forEach(i=>i._tileCache.reset())}_getTilesSpec(i,e){const{x:n,y:o,level:r}=i,s=this.tileSize,a=[],c=this.tilingScheme.getNumberOfXTilesAtLevel(r)-1,d=this.tilingScheme.getNumberOfYTilesAtLevel(r)-1;for(let u=-1;u<=1;u++){let p=n+u;p<0&&(p=c),p>c&&(p=0);for(let f=-1;f<=1;f++){let g=o+f;g<0||g>d||a.push({source:e,z:r,x:p,y:g,left:0+u*s,top:0+f*s,size:s})}}return a}requestImage(i,e,n,o=!0){if(n<this.minimumLevel||n>this.maximumLevel)return;this.mapboxRenderer.filterForZoom(n);const r=this.mapboxRenderer.getVisibleSources(n).reduce((s,a)=>s.concat(this._getTilesSpec({x:i,y:e,level:n},a)),[]);return new Promise((s,a)=>{const c=this._createTile(),d=c.getContext("2d");d&&(d.globalCompositeOperation="copy");const u=this.mapboxRenderer.renderTiles(d,{srcLeft:0,srcTop:0,width:this.tileSize,height:this.tileSize,destLeft:0,destTop:0},r,p=>{typeof p=="string"&&!p.endsWith("tiles not available")?a(void 0):o?(u.consumer.ctx=null,s(c),this.mapboxRenderer.releaseRender(u),this._resetTileCache()):s(u)})})}pickFeatures(i,e,n,o,r){var s;if(this._enablePickFeatures)return(s=this.requestImage(i,e,n,!1))==null?void 0:s.then(a=>{let c=this.mapboxRenderer.getVisibleSources(n);c=this.sourceFilter?this.sourceFilter(c):c;const d=[],u=_e.Math.toDegrees(o),p=_e.Math.toDegrees(r);return c.forEach(f=>{const g=new _e.ImageryLayerFeatureInfo;g.data=this.mapboxRenderer.queryRenderedFeatures({source:f,renderedZoom:n,lng:u,lat:p,tileZ:n});const m=Object.keys(g.data)[0];g.name=m;const y=g.data[m];y&&(g.configureDescriptionFromProperties((y==null?void 0:y.length)===1?y[0]:y),d.push(g))}),a.consumer.ctx=void 0,this.mapboxRenderer.releaseRender(a),this._resetTileCache(),d.length?d:void 0})}destroy(){this.mapboxRenderer._cancelAllPendingRenders(),this._resetTileCache(),this._destroyed=!0}}function MT(t,i){let e;return i===0?e=h.JulianDate.toIso8601(t.stop):e=h.JulianDate.toIso8601(t.start),{Time:e}}function ky(t){if(t.type==="fromIso8601")return h.TimeIntervalCollection.fromIso8601({iso8601:t.iso8601,isStartIncluded:t.isStartIncluded,isStopIncluded:t.isStopIncluded,leadingInterval:t.leadingInterval,trailingInterval:t.trailingInterval,dataCallback:MT})}const{getStrFromEnv:eh}=w.ESSceneObject.context;function IT(t){const i=Object.entries(t).map(([e,n])=>{try{const o=n&&Function(`"use strict";return (${n})`)();return[e,o]}catch(o){console.error(`getCustomTagsFromJson error: ${o}`,o);return}}).filter(e=>!!e);return Object.fromEntries(i)}async function DT(t,i){var e,n;if(t.type==="WebMapTileServiceImageryProvider")return new h.WebMapTileServiceImageryProvider({url:Wt(t.url),format:t.format??"image/jpeg",layer:t.layer,style:t.style,tileMatrixSetID:t.tileMatrixSetID,tileMatrixLabels:t.tileMatrixLabels,clock:t.times&&((e=i.viewer)==null?void 0:e.clock),times:t.times&&ky(t.times),dimensions:t.dimensions,tileWidth:t.tileWidth??256,tileHeight:t.tileHeight??256,tilingScheme:t.tilingScheme&&gi(t.tilingScheme),rectangle:t.rectangle&&Ge(t.rectangle),minimumLevel:t.minimumLevel??0,maximumLevel:t.maximumLevel,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),credit:t.credit,subdomains:t.subdomains});if(t.type==="TileMapServiceImageryProvider")return t.url?await h.TileMapServiceImageryProvider.fromUrl(Wt(t.url),{fileExtension:t.fileExtension,credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ge(t.rectangle),tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,flipXY:t.flipXY}):void 0;if(t.type==="UrlTemplateImageryProvider"){const o=t.customTags&&IT(t.customTags);return console.log(Wt(t.url),"111"),new h.UrlTemplateImageryProvider({url:Wt(t.url),credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ge(t.rectangle),tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,subdomains:t.subdomains,hasAlphaChannel:t.hasAlphaChannel,pickFeaturesUrl:t.pickFeaturesUrl,enablePickFeatures:t.enablePickFeatures,urlSchemeZeroPadding:t.urlSchemeZeroPadding,customTags:o})}else{if(t.type==="GridImageryProvider")return new h.GridImageryProvider({tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,cells:t.cells,color:t.color&&ie(t.color),glowColor:t.glowColor&&ie(t.glowColor),backgroundColor:t.backgroundColor&&ie(t.backgroundColor),canvasSize:t.canvasSize,glowWidth:t.glowWidth});if(t.type==="ArcGisMapServerImageryProvider")return t.url?await h.ArcGisMapServerImageryProvider.fromUrl(Wt(t.url),{token:t.token,usePreCachedTilesIfAvailable:t.usePreCachedTilesIfAvailable,layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ge(t.rectangle),tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),credit:t.credit,tileWidth:t.tileWidth,tileHeight:t.tileHeight,maximumLevel:t.maximumLevel}):void 0;if(t.type==="BingMapsImageryProvider")return t.url?await h.BingMapsImageryProvider.fromUrl(Wt(t.url),{key:t.key,tileProtocol:t.tileProtocol,mapStyle:t.mapStyle&&h.BingMapsStyle[t.mapStyle],culture:t.culture,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid)}):void 0;if(t.type==="GoogleEarthEnterpriseImageryProvider"){if(!t.url)return;const o=await h.GoogleEarthEnterpriseMetadata.fromUrl(Wt(t.url));return await h.GoogleEarthEnterpriseImageryProvider.fromMetadata(o,{ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),credit:t.credit})}else{if(t.type==="IonImageryProvider")return await h.IonImageryProvider.fromAssetId(t.assetId,{accessToken:t.accessToken,server:t.server});if(t.type==="MapboxImageryProvider")return new h.MapboxImageryProvider({url:t.url&&eh(t.url),mapId:t.mapId,accessToken:t.accessToken,format:t.format,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ge(t.rectangle),credit:t.credit});if(t.type==="MapboxStyleImageryProvider")return new h.MapboxStyleImageryProvider({url:t.url&&eh(t.url),username:t.username,styleId:t.styleId,accessToken:t.accessToken,tilesize:t.tilesize,scaleFactor:t.scaleFactor,rectangle:t.rectangle&&Ge(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel});if(t.type==="OpenStreetMapImageryProvider")return new h.OpenStreetMapImageryProvider({url:eh(t.url),rectangle:t.rectangle&&Ge(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,fileExtension:t.fileExtension});if(t.type==="SingleTileImageryProvider")return new h.SingleTileImageryProvider({url:Wt(t.url),rectangle:t.rectangle&&Ge(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Pe(t.ellipsoid)});if(t.type==="TileCoordinatesImageryProvider")return new h.TileCoordinatesImageryProvider({tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),color:t.color&&ie(t.color),tileWidth:t.tileWidth,tileHeight:t.tileHeight});if(t.type==="WebMapServiceImageryProvider")return new h.WebMapServiceImageryProvider({url:Wt(t.url),layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ge(t.rectangle),tilingScheme:t.tilingScheme&&gi(t.tilingScheme),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,tileWidth:t.tileWidth,tileHeight:t.tileHeight,crs:t.crs,srs:t.srs,credit:t.credit,subdomains:t.subdomains,clock:t.times&&((n=i.viewer)==null?void 0:n.clock),times:t.times&&ky(t.times),parameters:t.parameters,getFeatureInfoParameters:t.getFeatureInfoParameters});if(t.type==="BDImageryProvider")return new jc({url:t.url&&eh(t.url),ellipsoid:t.ellipsoid&&Pe(t.ellipsoid),wgs84:t.wgs84});if(t.type==="GeHistoryImagery")return new ET({indexTime:t.indexTime});if(t.type==="ArcgisHistoryImagery")return new AT({indexTimeID:t.indexTimeID});if(t.type==="MVTImageryProvider")return t.url?await _u.fromUrl(t.url,{maximumLevel:t.maximumLevel,minimumLevel:t.minimumLevel,tileSize:t.tileSize,accessToken:t.accessToken,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ge(t.rectangle),layerStyle:t.style,scheme:t.scheme}):void 0}}}function bT(t,i){i.type}class zy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(r){var s={};return s=wu(h.Math.toDegrees(r.longitude),h.Math.toDegrees(r.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(s[0]),h.Math.toRadians(s[1])))},e.s_unproject=e.unproject,e.unproject=function(r){var s=e.s_unproject(r),a={};return a=yu(h.Math.toDegrees(s.longitude),h.Math.toDegrees(s.latitude)),new h.Cartographic(h.Math.toRadians(a[0]),h.Math.toRadians(a[1]))};var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new h.Rectangle(n.longitude,n.latitude,o.longitude,o.latitude)}}class Ly extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(n){var o={};return o=yu(h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(o[0]),h.Math.toRadians(o[1])))},e.s_unproject=e.unproject,e.unproject=function(n){var o=e.s_unproject(n),r={};return r=wu(h.Math.toDegrees(o.longitude),h.Math.toDegrees(o.latitude)),new h.Cartographic(h.Math.toRadians(r[0]),h.Math.toRadians(r[1]))}}}function RT(t){if(t.type==="GeographicTilingScheme")return"new Cesium.GeographicTilingScheme()";if(t.type==="WebMercatorTilingScheme")return"new Cesium.WebMercatorTilingScheme()"}class xn extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_innerImageryProvider",this.disposeVar(l.react(void 0)));v(this,"_layer",this.disposeVar(l.react(void 0)));const o=e.viewer;if(!o)return;const r=Yt(o);if(!r)return;const{imageriesManager:s}=r;s.add(this),this.dispose(()=>{s.has(this)&&s.delete(this)});const a=()=>{this.layer&&(this.layer=void 0)};this.dispose(a);const c=()=>{this.layer&&(this.layer.alpha=this.alpha??1,this.layer.nightAlpha=this.nightAlpha??1,this.layer.dayAlpha=this.dayAlpha??1,this.layer.brightness=this.brightness??1,this.layer.contrast=this.contrast??1,this.layer.hue=this.hue??0,this.layer.saturation=this.saturation??1,this.layer.gamma=this.gamma??1,this.layer.splitDirection=this.splitDirection&&h.SplitDirection[this.splitDirection]||h.SplitDirection.NONE,this.layer.minificationFilter=this.minificationFilter&&h.TextureMinificationFilter[this.minificationFilter]||h.TextureMinificationFilter.LINEAR,this.layer.magnificationFilter=this.magnificationFilter&&h.TextureMagnificationFilter[this.magnificationFilter]||h.TextureMagnificationFilter.LINEAR,this.layer.show=this.show??!0,this.layer.maximumAnisotropy=this.maximumAnisotropy,this.layer.minimumTerrainLevel=this.minimumTerrainLevel,this.layer.maximumTerrainLevel=this.maximumTerrainLevel,this.layer.colorToAlpha=this.colorToAlpha&&toColor(this.colorToAlpha),this.layer.colorToAlphaThreshold=this.colorToAlphaThreshold??.004,this.imageryProvider&&bT(this.layer.imageryProvider,this.imageryProvider))};let d=!1;const u=this.disposeVar(l.createProcessingFromAsyncFunc(async(y,P)=>{if(P){if(d=!0,a(),!this.innerImageryProvider)return;const S=await y.promise(DT(this.innerImageryProvider,e));if(!S){console.error("createImageryProviderFromJson error!");return}this.layer=new h.ImageryLayer(S),h.ImageryLayer.prototype&&(this.layer.ESSceneObjectID=n),d=!1}c()}));u.restart(void 0,!0);const p=this.disposeVar(new l.Event),f=this.disposeVar(new l.Event);this.ad(this.layerChanged.don(()=>{if(!this.innerImageryProvider||!this.layer||!Reflect.has(this.innerImageryProvider,"rectangle")||this.innerImageryProvider.rectangle[0]!=this.imageryProvider.rectangle[0]||this.innerImageryProvider.rectangle[1]!=this.imageryProvider.rectangle[1]||this.innerImageryProvider.rectangle[2]!=this.imageryProvider.rectangle[2]||this.innerImageryProvider.rectangle[3]!=this.imageryProvider.rectangle[3])return;const y=this.layer.imageryProvider.tilingScheme.rectangle,P=this.innerImageryProvider.rectangle&&Ge(this.innerImageryProvider.rectangle);(P.west<y.west||P.south<y.south||P.east>y.east||P.north>y.north)&&(this.innerImageryProvider.rectangle=[h.Math.toDegrees(Math.max(y.west,P.west)),h.Math.toDegrees(Math.max(y.south,P.south)),h.Math.toDegrees(Math.min(y.east,P.east)),h.Math.toDegrees(Math.min(y.north,P.north))],p.emit())})),this.dispose(this.imageryProviderChanged.disposableOn(()=>{this.innerImageryProvider=structuredClone(this.imageryProvider),p.emit()})),this.dispose(w.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{p.emit()}));const g=this.disposeVar(l.createNextAnimateFrameEvent(this.rectangleChanged,p));this.dispose(g.disposableOn(()=>{u.restart(void 0,!0)}));const m=this.disposeVar(l.createNextAnimateFrameEvent(this.alphaChanged,this.nightAlphaChanged,this.dayAlphaChanged,this.brightnessChanged,this.contrastChanged,this.hueChanged,this.saturationChanged,this.gammaChanged,this.splitDirectionChanged,this.minificationFilterChanged,this.magnificationFilterChanged,this.showChanged,this.maximumAnisotropyChanged,this.minimumTerrainLevelChanged,this.maximumTerrainLevelChanged,this.cutoutRectangleChanged,this.colorToAlphaChanged,this.colorToAlphaThresholdChanged,f));this.dispose(m.disposableOn(()=>{d||u.restart(void 0,!1)})),this.dispose(this.flyToEvent.disposableOn(y=>{if(!e.actived)return;const{viewer:P}=e;P&&P.camera.flyTo({destination:this.rectangle&&!pd(this.rectangle)?Ge(this.rectangle):h.Camera.DEFAULT_VIEW_RECTANGLE,duration:y})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get innerImageryProvider(){return this._innerImageryProvider.value}set innerImageryProvider(e){this._innerImageryProvider.value=e}get innerImageryProviderChanged(){return this._innerImageryProvider.changed}get layer(){return this._layer.value}set layer(e){this._layer.value=e}get layerChanged(){return this._layer.changed}}v(xn,"defaults",{show:!0,rectangle:[-180,-90,180,90],alpha:1,nightAlpha:1,dayAlpha:1,brightness:1,contrast:1,hue:0,saturation:1,gamma:1,splitDirection:"NONE",minificationFilter:"LINEAR",magnificationFilter:"LINEAR",maximumAnisotropy:0,minimumTerrainLevel:0,maximumTerrainLevel:0,cutoutRectangle:[1,1,1,1],colorToAlpha:[1,1,1,.5],colorToAlphaThreshold:.004,imageryProvider:{type:"TileMapServiceImageryProvider"},zIndex:0,hasAlphaChannel:!0,pickFeaturesUrl:""}),(t=>{t.createDefaultProps=()=>({show:void 0,rectangle:l.reactArrayWithUndefined(void 0),alpha:void 0,nightAlpha:void 0,dayAlpha:void 0,brightness:void 0,contrast:void 0,hue:void 0,saturation:void 0,gamma:void 0,splitDirection:void 0,minificationFilter:void 0,magnificationFilter:void 0,maximumAnisotropy:void 0,minimumTerrainLevel:void 0,maximumTerrainLevel:void 0,cutoutRectangle:l.reactArrayWithUndefined(void 0),colorToAlpha:l.reactArrayWithUndefined(void 0),colorToAlphaThreshold:void 0,imageryProvider:l.reactJsonWithUndefined(void 0),zIndex:0,hasAlphaChannel:void 0,pickFeaturesUrl:void 0,targetID:void 0})})(xn||(xn={})),l.extendClassProps(xn.prototype,xn.createDefaultProps);const Pu=h.ApproximateTerrainHeights,xT=h.ComponentDatatype,Ai=h.defaultValue,ht=h.defined,FT=h.destroyObject,Su=h.DeveloperError,kT=h.deprecationWarning,zT=h.GeometryInstance,LT=h.GeometryInstanceAttribute,OT=h.GroundPolylineGeometry,bs=h.DrawCommand,Oy=h.Pass,Ny=h.RenderState,NT=h.ShaderProgram,Rs=h.ShaderSource;let Eu=h._shadersPolylineShadowVolumeFS;const VT=h._shadersPolylineShadowVolumeMorphFS,UT=h._shadersPolylineShadowVolumeMorphVS;let Au=h._shadersPolylineShadowVolumeVS;const Vy=h.BlendingState,Tu=h.ClassificationType,WT=h.CullFace,Uy=h.PolylineColorAppearance,GT=h.PolylineMaterialAppearance,Fn=h.Primitive,_r=h.SceneMode,Wy=h.StencilConstants,Gy=h.StencilFunction,Pr=h.StencilOperation;Au=Au.replace("width = width * max(0.0, czm_metersPerPixel(positionEC));",""),Eu=Eu.replace("float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);","float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w;");function Ti(t){t=Ai(t,Ai.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let i=t.appearance;ht(i)||(i=new GT),this.appearance=i,this.show=Ai(t.show,!0),this.classificationType=Ai(t.classificationType,Tu.BOTH),this.debugShowBoundingVolume=Ai(t.debugShowBoundingVolume,!1),this._debugShowShadowVolume=Ai(t.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:Ai(t.interleave,!1),releaseGeometryInstances:Ai(t.releaseGeometryInstances,!0),allowPicking:Ai(t.allowPicking,!0),asynchronous:Ai(t.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;const e=this;this._readyPromise=new Promise((n,o)=>{e._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const r=this._error;ht(r)?o(r):n(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Hy(!1),this._renderState3DTiles=Hy(!0),this._renderStateMorph=Ny.fromCache({cull:{enabled:!0,face:WT.FRONT},depthTest:{enabled:!0},blending:Vy.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Ti.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}},readyPromise:{get:function(){return kT("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),Ti.initializeTerrainHeights=function(){return Pu.initialize()};function HT(t,i,e){const n=i.context,o=t._primitive,r=o._attributeLocations;let s=o._batchTable.getVertexShaderCallback()(Au);s=Fn._appendShowToShader(o,s),s=Fn._appendDistanceDisplayConditionToShader(o,s),s=Fn._modifyShaderPosition(t,s,i.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(UT);a=Fn._appendShowToShader(o,a),a=Fn._appendDistanceDisplayConditionToShader(o,a),a=Fn._modifyShaderPosition(t,a,i.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Eu);const d=[`GLOBE_MINIMUM_ALTITUDE ${i.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let u="",p="";ht(e.material)?(p=ht(e.material)?e.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);const f=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],g=new Rs({defines:d,sources:[s]}),m=new Rs({defines:f,sources:[p,c]});t._sp=NT.replaceCache({context:n,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:r});let y=n.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!ht(y)){const S=new Rs({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=n.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:n,shaderProgram:t._sp2D,vertexShaderSource:S,fragmentShaderSource:m,attributeLocations:r})}t._sp2D=y;let P=n.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!ht(P)){const S=new Rs({defines:d.concat([`MAX_TERRAIN_HEIGHT ${Pu._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(VT);const C=new Rs({defines:f,sources:[p,c]});P=n.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:n,shaderProgram:t._spMorph,vertexShaderSource:S,fragmentShaderSource:C,attributeLocations:r})}t._spMorph=P}function Hy(t){return Ny.fromCache({cull:{enabled:!0},blending:Vy.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:Gy.EQUAL,frontOperation:{fail:Pr.KEEP,zFail:Pr.KEEP,zPass:Pr.KEEP},backFunction:Gy.EQUAL,backOperation:{fail:Pr.KEEP,zFail:Pr.KEEP,zPass:Pr.KEEP},reference:Wy.CESIUM_3D_TILE_MASK,mask:Wy.CESIUM_3D_TILE_MASK}})}function qT(t,i,e,n,o,r){const s=t._primitive,a=s._va.length;o.length=a,r.length=a;const d=i instanceof Uy?{}:e._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let p=0;p<a;p++){const f=s._va[p];let g=o[p];ht(g)||(g=o[p]=new bs({owner:t,primitiveType:s._primitiveType})),g.vertexArray=f,g.renderState=t._renderState,g.shaderProgram=t._sp,g.uniformMap=u,g.pass=Oy.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const m=bs.shallowClone(g,g.derivedCommands.tileset);m.renderState=t._renderState3DTiles,m.pass=Oy.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;const y=bs.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=t._sp2D,g.derivedCommands.color2D=y;const P=bs.shallowClone(m,m.derivedCommands.color2D);P.shaderProgram=t._sp2D,m.derivedCommands.color2D=P;const S=bs.shallowClone(g,g.derivedCommands.colorMorph);S.renderState=t._renderStateMorph,S.shaderProgram=t._spMorph,S.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=S}}function qy(t,i,e,n,o,r,s){e.mode===_r.MORPHING?i=i.derivedCommands.colorMorph:e.mode!==_r.SCENE3D&&(i=i.derivedCommands.color2D),i.modelMatrix=n,i.boundingVolume=r,i.cull=o,i.debugShowBoundingVolume=s,e.commandList.push(i)}function $T(t,i,e,n,o,r,s){const a=t._primitive;Fn._updateBoundingVolumes(a,i,o);let c;i.mode===_r.SCENE3D?c=a._boundingSphereWC:i.mode===_r.COLUMBUS_VIEW?c=a._boundingSphereCV:i.mode===_r.SCENE2D&&ht(a._boundingSphere2D)?c=a._boundingSphere2D:ht(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);const d=i.mode===_r.MORPHING,u=t.classificationType,p=u!==Tu.CESIUM_3D_TILE,f=u!==Tu.TERRAIN&&!d;let g;const m=i.passes;if(m.render||m.pick&&a.allowPicking){const y=e.length;for(let P=0;P<y;++P){const S=c[P];p&&(g=e[P],qy(t,g,i,o,r,S,s)),f&&(g=e[P].derivedCommands.tileset,qy(t,g,i,o,r,S,s))}}}Ti.prototype.update=function(t){if(!ht(this._primitive)&&!ht(this.geometryInstances))return;if(!Pu.initialized){if(!this.asynchronous)throw new Su("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");Ti.initializeTerrainHeights();return}let i;const e=this,n=this._primitiveOptions;if(!ht(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r);let a;for(i=0;i<r;++i)if(a=o[i].attributes,!ht(a)||!ht(a.color)){this._hasPerInstanceColors=!1;break}for(i=0;i<r;++i){const c=o[i];a={};const d=c.attributes;for(const u in d)d.hasOwnProperty(u)&&(a[u]=d[u]);ht(a.width)||(a.width=new LT({componentDatatype:xT.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=t.scene3DOnly,OT.setProjectionAndEllipsoid(c.geometry,t.mapProjection),s[i]=new zT({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:e})}n.geometryInstances=s,n.appearance=this.appearance,n._createShaderProgramFunction=function(c,d,u){HT(e,d,u)},n._createCommandsFunction=function(c,d,u,p,f,g,m){qT(e,d,u,p,g,m)},n._updateAndQueueCommandsFunction=function(c,d,u,p,f,g,m,y){$T(e,d,u,p,f,g,m)},this._primitive=new Fn(n)}if(this.appearance instanceof Uy&&!this._hasPerInstanceColors)throw new Su("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(t),t.afterRender.push(()=>{!this._ready&&ht(this._primitive)&&this._primitive.ready&&this._completeLoad()})},Ti.prototype.getGeometryInstanceAttributes=function(t){if(!ht(this._primitive))throw new Su("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},Ti.isSupported=function(t){return t.frameState.context.depthTexture},Ti.prototype.isDestroyed=function(){return!1},Ti.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,FT(this)};class vo extends l.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.globe,o=-414,r=8777;let s={};const a=()=>{var p,f,g,m,y;if(!e)return;let d;const u=this.shadingMode||"none";if((this.show??!0)&&!(u==="none"&&!this.enableContour)){let P;this.enableContour?(u==="elevation"?(d=XT(),P=d.materials.elevationRampMaterial.uniforms,P.minimumHeight=((p=this.elevationParam)==null?void 0:p.minHeight)??o,P.maximumHeight=((f=this.elevationParam)==null?void 0:f.maxHeight)??r,s=d.materials.contourMaterial.uniforms):u==="slope"?(d=YT(),P=d.materials.slopeRampMaterial.uniforms,s=d.materials.contourMaterial.uniforms):u==="aspect"?(d=ZT(),P=d.materials.aspectRampMaterial.uniforms,s=d.materials.contourMaterial.uniforms):(d=h.Material.fromType("ElevationContour"),s=d.uniforms),s.width=this.contourWidth,s.spacing=this.contourSpacing,s.color=h.Color.fromCartesian4(h.Cartesian4.fromArray(this.contourColor))):u==="elevation"?(d=h.Material.fromType("ElevationRamp"),P=d.uniforms,P.minimumHeight=((g=this.elevationParam)==null?void 0:g.minHeight)??o,P.maximumHeight=((m=this.elevationParam)==null?void 0:m.maxHeight)??r):u==="slope"?(d=h.Material.fromType("SlopeRamp"),P=d.uniforms):u==="aspect"&&(d=h.Material.fromType("AspectRamp"),P=d.uniforms),u!=="none"&&(P.image=$y(u),u==="elevation"&&((y=this.elevationParam)==null?void 0:y.color)!==void 0&&(P.image=Array.isArray(this.elevationParam.color)?$y(u,this.elevationParam.color):this.elevationParam.color))}n.material=d};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(this.contourColorChanged,this.contourSpacingChanged,this.contourWidthChanged,this.enableContourChanged,this.shadingModeChanged,this.showChanged,this.elevationParamChanged));this.dispose(c.disposableOn(a)),this.dispose(()=>n.material=void 0)}}v(vo,"defaults",{show:!1,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],shadingMode:"none"}),(t=>{t.createDefaultProps=()=>({show:void 0,shadingMode:void 0,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],elevationParam:l.reactJsonWithUndefined(void 0)})})(vo||(vo={})),l.extendClassProps(vo.prototype,vo.createDefaultProps);function XT(){return new h.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1})}function YT(){return new h.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1})}function ZT(){return new h.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1})}const QT=[0,.045,.1,.15,.37,.54,1],KT=[0,.29,.5,Math.sqrt(2)/2,.87,.91,1],JT=[0,.2,.4,.6,.8,.9,1];function $y(t,i){const e=document.createElement("canvas");e.width=100,e.height=1;const n=e.getContext("2d");let o;if(t==="elevation")o=QT;else if(t==="slope")o=KT;else if(t==="aspect")o=JT;else throw new Error("values未赋值!");const r=n.createLinearGradient(0,0,100,0);return r.addColorStop(o[0],i!=null&&i[0]?mn(i==null?void 0:i[0]):"#000000"),r.addColorStop(o[1],i!=null&&i[1]?mn(i==null?void 0:i[1]):"#2747E0"),r.addColorStop(o[2],i!=null&&i[2]?mn(i==null?void 0:i[2]):"#D33B7D"),r.addColorStop(o[3],i!=null&&i[3]?mn(i==null?void 0:i[3]):"#D33038"),r.addColorStop(o[4],i!=null&&i[4]?mn(i==null?void 0:i[4]):"#FF9742"),r.addColorStop(o[5],i!=null&&i[5]?mn(i==null?void 0:i[5]):"#ffd700"),r.addColorStop(o[6],i!=null&&i[6]?mn(i==null?void 0:i[6]):"#ffffff"),n.fillStyle=r,n.fillRect(0,0,100,1),e}class Sr extends l.Destroyable{constructor(e){super();v(this,"_geoPath");v(this,"_geoPolyline");v(this,"_geoCanvasPointPoi");v(this,"_player");v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_currentDistance",this.disposeVar(l.react(0)));v(this,"_ratio",this.disposeVar(w.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new w.ESPathImpl),this._geoPolyline=this.disposeVar(new Ie(e)),this._geoCanvasPointPoi=this.disposeVar(new yn(e)),this._player=this.disposeVar(new w.Player),this._geoPolyline.show=!1,this.dispose(l.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(l.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(l.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(l.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(l.track([this._geoPath,"show"],[this,"show"])),this.dispose(l.track([this._geoPath,"polylineShow"],[this,"polylineShow"])),this.dispose(l.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(l.track([this._geoPath,"width"],[this,"width"])),this.dispose(l.track([this._geoPath,"ground"],[this,"ground"])),this.dispose(l.track([this._geoPath,"color"],[this,"color"])),this.dispose(l.track([this._geoPath,"hasDash"],[this,"hasDash"])),this.dispose(l.track([this._geoPath,"gapColor"],[this,"gapColor"])),this.dispose(l.track([this._geoPath,"dashLength"],[this,"dashLength"])),this.dispose(l.track([this._geoPath,"dashPattern"],[this,"dashPattern"])),this.dispose(l.track([this._geoPath,"hasArrow"],[this,"hasArrow"])),this.dispose(l.track([this._geoPath,"depthTest"],[this,"depthTest"])),this.dispose(l.track([this._geoPath,"arcType"],[this,"arcType"])),this.dispose(l.track([this._geoPath,"allowPicking"],[this,"allowPicking"]));{const n=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};n(),this.dispose(this.showChanged.disposableOn(n)),this.dispose(this.currentPoiShowChanged.disposableOn(n))}this.dispose(l.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const n=()=>{if(this.positions){const r=this.granularity*Math.PI/180,s=sd(this.positions,this.arcType??"GEODESIC",r);if(s){this._geoPath.timePosRots=s.timePosRots,this.rotationRadius.some(a=>a>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};n();const o=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(o.disposableOn(n))}{const n=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const o=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(o-this.currentDistance)>.01&&(this.currentDistance=o)};n(),this.dispose(this._player.currentTimeChanged.disposableOn(n))}{const n=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const o=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(o-(this._player.currentTime??0))>.01&&(this._player.currentTime=o)};n(),this.dispose(this.currentDistanceChanged.disposableOn(n))}this.dispose(l.bind([this._player,"loop"],[this,"loop"])),this.dispose(l.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(l.bind([this._player,"duration"],[this,"duration"])),this.dispose(l.bind([this._player,"playing"],[this,"playing"])),this.dispose(l.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(n=>{this._geoPolyline.flyTo(n)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(r=>r[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:l.reactPositions(void 0),width:1,ground:!1,color:l.reactArray([1,1,1,1]),hasDash:!1,gapColor:l.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Sr||(Sr={})),l.extendClassProps(Sr.prototype,Sr.createDefaultProps);class Ce extends Qt{constructor(e,n){super(e,n);v(this,"_smoothMoving");if(this._smoothMoving=this.disposeVar(new w.SmoothMoveController(this.czmViewer)),this.d(this._smoothMoving.currentPositionChanged.don(r=>{r&&(this.sceneObject.position=r)})),this.d(this._smoothMoving.currentRotationChanged.don(r=>{r&&this._smoothMoving.isRotating&&(this.sceneObject.rotation=r)})),this.d(this._smoothMoving.currentHeadingChanged.don(r=>{if(r!==void 0&&!this._smoothMoving.isRotating){const s=this.sceneObject.rotation;this.sceneObject.rotation=[r-90,s[1],s[2]]}})),!n.viewer){console.warn("viewer is undefined!");return}this.d(e.smoothMoveEvent.don((r,s)=>{this.smoothMove(r,s*1e3)})),this.d(e.smoothMoveWithRotationEvent.don((r,s,a)=>{this.smoothMoveWithRotation(r,s,a*1e3)})),this.d(e.smoothMoveOnGroundEvent.don((r,s,a)=>{this.smoothMoveOnGround(r,s,a*1e3)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((r,s,a,c)=>{this.smoothMoveWithRotationOnGround(r,s,a,c*1e3)})),this.d(e.calcFlyToParamEvent.don(()=>{if(!e.useCalcFlyToParamInESObjectWithLocation)return;if(!e.position){console.warn(`!sceneObject(${e.name}-${e.id}).position`);return}const r=n.calcFlyToParam(e.position);if(!r){console.warn("czmViewer.calcFlyToParam error.");return}e.flyToParam=r})),this.d(e.automaticLandingEvent.don(async r=>{const s=[e.position[0],e.position[1]],a=await n.getTerrainHeight(s);a?e.position=[...s,a]:console.warn("不存在相交"),e.collision=r}));{const r=this.dv(l.createNextAnimateFrameEvent(e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(r.don(()=>this.visibleDistance(e,n))),this.d(n.cameraChanged.don(()=>this.visibleDistance(e,n)))}}smoothMove(e,n){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,this.sceneObject.rotation,n)}smoothMoveWithRotation(e,n,o){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,n,o)}async smoothMoveOnGround(e,n,o){const r=await this.czmViewer.getTerrainHeight([e,n])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([e,n,r],this.sceneObject.rotation,o)}async smoothMoveWithRotationOnGround(e,n,o,r){const s=await this.czmViewer.getTerrainHeight([n,o])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([n,o,s],e,r)}visibleDistance(e,n){var r;const o=Ce.getInnerCzmObjects(this);if((r=n.viewer)!=null&&r.camera&&e.show&&o.length!=0){const s=w.getDistancesFromPositions([e.position,Vt(n.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=s>e.minVisibleDistance),o.forEach(c=>{if(c instanceof Le)return;const d=e.show&&a;Reflect.has(c,"showHelper")&&(c.showHelper=d),Reflect.has(c,"enabled")&&(c.enabled=d),Reflect.has(c,"show")&&(c.show=d)})}}static getInnerCzmObjects(e){const n=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(!o.includes("czmViewer")&&o.includes("czm")||!Number.isNaN(+o)?Array.isArray(e[o])?n.push(...Ce.getInnerCzmObjects(e[o])):n.push(e[o]):e[o]&&e[o].obj&&n.push(...Ce.getInnerCzmObjects(e[o].obj)));return n}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam&&o.position){const{position:s,flyToParam:a}=o,{distance:c,heading:d,pitch:u,flyDuration:p,hDelta:f,pDelta:g}=a;return this.flyToWithPromise(n,s,c,[d,u,0],e??p,f,g),!0}return super.flyTo(e,n)}flyIn(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(!o.flyInParam&&o.position&&o.rotation){const s=e??1,a=[...o.rotation];return a[0]+=90,this.flyToWithPromise(n,o.position,void 0,a,s),!0}return super.flyIn(e,n)}}class vt extends Qt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}class xs extends Ce{constructor(e,n){super(e,n);v(this,"_lastHoverResult",this.disposeVar(l.react(void 0)));if(!n.viewer){console.warn("viewer is undefined!");return}const r=this.ad(l.createProcessingFromAsyncFunc(async(s,a)=>{const c=await s.promise(n.pick(a.screenPosition,"innerHoverEvent"));this.lastHoverResult=Object.assign({},c,a)}));this.ad(n.pointerMoveEvent.don(async s=>{!r.isRunning&&r.restart(void 0,s)}))}get lastHoverResult(){return this._lastHoverResult.value}set lastHoverResult(e){this._lastHoverResult.value=e}get lastHoverResultChanged(){return this._lastHoverResult.changed}}class th extends Ce{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}function BT(t){return[t.urlChanged,t.classificationTypeChanged,t.ellipsoidChanged,t.modelUpAxisChanged,t.modelForwardAxisChanged,t.cullWithChildrenBoundsChanged,t.enableShowOutlineChanged,t.projectTo2DChanged,t.debugHeatmapTilePropertyNameChanged,t.enableDebugWireframeChanged,t.vectorClassificationOnlyChanged,t.vectorKeepDecodedPositionsChanged]}function Xy(t,i){const e=i;if(e.modelMatrix){h.Matrix4.clone(h.Matrix4.fromArray(e.modelMatrix),t.modelMatrix);return}if(!e.position){h.Matrix4.clone(h.Matrix4.IDENTITY,t.modelMatrix);return}let n=t._root.transform;const o=Fe({initialRotation:"yForwardzUp",rotation:[0,0,0],position:e.origin});(o&&!o.equalsEpsilon(n,.001)||n.equals(h.Matrix4.IDENTITY))&&o&&(n=o);const r=Fe({initialRotation:"yForwardzUp",rotation:e.rotation,position:e.position});if(!r){console.warn("modelMatrix is undefined!");return}const s=h.Matrix4.inverseTransformation(n,new h.Matrix4);h.Matrix4.multiply(r,s,t.modelMatrix)}class jT extends l.Destroyable{constructor(i,e,n){super(),this._tileset=i,this._czm3DTiles=e,this._updateMatrixEvent=n;{const o=()=>{const s=h.Matrix4.inverseTransformation(i.clippingPlanesOriginMatrix,new h.Matrix4);if(!i.clippingPlanes){i.clippingPlanes=as(e.clippingPlanes??{enabled:!1},s);return}Kl(i.clippingPlanes,e.clippingPlanes,s)};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(e.clippingPlanesChanged,e.originRootTransformInvChanged,this._updateMatrixEvent));this.dispose(r.disposableOn(o))}}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}}class eM extends l.Destroyable{constructor(i,e){super(),this._tileset=i,this._czm3DTiles=e;const{tileset:n,czm3DTiles:o}=this;{const r=()=>{if(!n.clippingPlanes){n.clippingPlanes=as(o.clippingPlanes??{enabled:!1});return}Kl(n.clippingPlanes,o.clippingPlanes)};r(),this.dispose(o.clippingPlanesChanged.disposableOn(r))}}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}}class tM extends l.Destroyable{constructor(i,e){super(),this._tileset=i,this._czm3DTiles=e;const{tileset:n,czmCzm3DTiles:o}=this;{const r=()=>{n.clippingPolygons=o.clippingPolygons?Jl(o.clippingPolygons):new h.ClippingPolygonCollection};r(),this.dispose(o.clippingPolygonsChanged.disposableOn(r))}}get tileset(){return this._tileset}get czmCzm3DTiles(){return this._czm3DTiles}}class iM extends l.Destroyable{constructor(i,e){super(),this._nativeTilesetReadyResetting=i,this._czmFlattenedPlane=e;const{tileset:n}=this;this.setFlattened(!0),this.dispose(()=>{this.setFlattened(!1)});{const o=()=>{const r=this._czmFlattenedPlane.finalMatrix?h.Matrix4.toArray(this._czmFlattenedPlane.finalMatrix):[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];this.setElevationMatrix(r)};o(),this.dispose(this._czmFlattenedPlane.finalMatrixChanged.disposableOn(o))}{const o=()=>{const s=[...this._czmFlattenedPlane.minSize,...this._czmFlattenedPlane.maxSize];this.setFlattenedBound(s)};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(this._czmFlattenedPlane.minSizeChanged,this._czmFlattenedPlane.maxSizeChanged));this.dispose(r.disposableOn(o))}n.xbsjGetFlattenedTextureFunc=()=>{const{sceneObject:o}=this._czmFlattenedPlane.czmTextureWithId;return o?window.czmTexture[o.id].texture:void 0},this.dispose(()=>n.xbsjGetFlattenedTextureFunc=void 0);{const o=()=>{const r=this._czmFlattenedPlane.computedCustomShader;this._nativeTilesetReadyResetting.flattenedCustomShader=r&&new r(this.czm3DTiles,this.czm3DTiles.czmViewer)};o(),this.dispose(this._czmFlattenedPlane.computedCustomShaderChanged.disposableOn(o)),this.dispose(()=>this._nativeTilesetReadyResetting.flattenedCustomShader=void 0)}}get czm3DTiles(){return this._nativeTilesetReadyResetting.czm3DTiles}get tileset(){return this._nativeTilesetReadyResetting.tileset}get czmFlattenedPlane(){return this._czmFlattenedPlane}setFlattened(i){this.tileset.xbsjFlattened=i}setFlattenedBound(i){this.tileset.xbsjFlattenedBound=h.Cartesian4.fromArray(i)}setElevationMatrix(i){this.tileset.xbsjElevationMatrix=h.Matrix4.fromArray(i)}}function nM(t,i){t.show=i.show??!0,t.colorBlendMode=h.Cesium3DTileColorBlendMode[i.colorBlendMode??"HIGHLIGHT"],t.shadows=(i.shadows&&ut.shadowPropsMap[i.shadows])??ut.shadowPropsMap.ENABLED,t.maximumScreenSpaceError=i.maximumScreenSpaceError??16,t.maximumMemoryUsage=i.maximumMemoryUsage??Ae.defaults.maximumMemoryUsage,t.cacheBytes=i.cacheBytes??Ae.defaults.cacheBytes,t.maximumCacheOverflowBytes=i.maximumCacheOverflowBytes??Ae.defaults.maximumCacheOverflowBytes,t.cullRequestsWhileMoving=i.cullRequestsWhileMoving??!0,t.cullRequestsWhileMovingMultiplier=i.cullRequestsWhileMovingMultiplier??60,t.preloadWhenHidden=i.preloadWhenHidden??!1,t.preloadFlightDestinations=i.preloadFlightDestinations??!0,t.preferLeaves=i.preferLeaves??!1,t.dynamicScreenSpaceError=i.dynamicScreenSpaceError??!1,t.dynamicScreenSpaceErrorDensity=i.dynamicScreenSpaceErrorDensity??.00278,t.dynamicScreenSpaceErrorFactor=i.dynamicScreenSpaceErrorFactor??4,t.dynamicScreenSpaceErrorHeightFalloff=i.dynamicScreenSpaceErrorHeightFalloff??.25,t.progressiveResolutionHeightFraction=i.progressiveResolutionHeightFraction??.3,t.foveatedScreenSpaceError=i.foveatedScreenSpaceError??!0,t.foveatedConeSize=i.foveatedConeSize??.1,t.foveatedMinimumScreenSpaceErrorRelaxation=i.foveatedMinimumScreenSpaceErrorRelaxation??0,t.foveatedTimeDelay=i.foveatedTimeDelay??.2,t.skipLevelOfDetail=i.skipLevelOfDetail??!1,t.baseScreenSpaceError=i.baseScreenSpaceError??1024,t.skipScreenSpaceErrorFactor=i.skipScreenSpaceErrorFactor??16,t.skipLevels=i.skipLevels??1,t.immediatelyLoadDesiredLevelOfDetail=i.immediatelyLoadDesiredLevelOfDetail??!1,t.loadSiblings=i.loadSiblings??!1,t.lightColor=(i.lightColor&&ai(i.lightColor))??Ae.defaults.lightColor,t.backFaceCulling=i.backFaceCulling??!0,t.showOutline=i.showOutline??!0,t.outlineColor=ie(i.outlineColor??Ae.defaults.outlineColor),t.featureIdLabel=i.featureIdLabel??Ae.defaults.featureIdLabel,t.instanceFeatureIdLabel=i.instanceFeatureIdLabel??Ae.defaults.instanceFeatureIdLabel,t.showCreditsOnScreen=i.showCreditsOnScreen??!1,t.splitDirection=h.SplitDirection[i.splitDirection??Ae.defaults.splitDirection],t.debugFreezeFrame=i.debugFreezeFrame??!1,t.debugColorizeTiles=i.debugColorizeTiles??!1,t.debugWireframe=i.debugWireframe??!1,t.debugShowBoundingVolume=i.debugShowBoundingVolume??!1,t.debugShowContentBoundingVolume=i.debugShowContentBoundingVolume??!1,t.debugShowViewerRequestVolume=i.debugShowViewerRequestVolume??!1,t.debugShowGeometricError=i.debugShowGeometricError??!1,t.debugShowRenderingStatistics=i.debugShowRenderingStatistics??!1,t.debugShowMemoryUsage=i.debugShowMemoryUsage??!1,t.debugShowUrl=i.debugShowUrl??!1}function oM(t){return[t.showChanged,t.colorBlendModeChanged,t.shadowsChanged,t.maximumScreenSpaceErrorChanged,t.maximumMemoryUsageChanged,t.cacheBytesChanged,t.maximumCacheOverflowBytesChanged,t.cullRequestsWhileMovingChanged,t.cullRequestsWhileMovingMultiplierChanged,t.preloadWhenHiddenChanged,t.preloadFlightDestinationsChanged,t.preferLeavesChanged,t.dynamicScreenSpaceErrorChanged,t.dynamicScreenSpaceErrorDensityChanged,t.dynamicScreenSpaceErrorFactorChanged,t.dynamicScreenSpaceErrorHeightFalloffChanged,t.progressiveResolutionHeightFractionChanged,t.foveatedScreenSpaceErrorChanged,t.foveatedConeSizeChanged,t.foveatedMinimumScreenSpaceErrorRelaxationChanged,t.foveatedTimeDelayChanged,t.skipLevelOfDetailChanged,t.baseScreenSpaceErrorChanged,t.skipScreenSpaceErrorFactorChanged,t.skipLevelsChanged,t.immediatelyLoadDesiredLevelOfDetailChanged,t.loadSiblingsChanged,t.lightColorChanged,t.backFaceCullingChanged,t.showOutlineChanged,t.outlineColorChanged,t.featureIdLabelChanged,t.instanceFeatureIdLabelChanged,t.showCreditsOnScreenChanged,t.splitDirectionChanged,t.debugFreezeFrameChanged,t.debugColorizeTilesChanged,t.debugWireframeChanged,t.debugShowBoundingVolumeChanged,t.debugShowContentBoundingVolumeChanged,t.debugShowViewerRequestVolumeChanged,t.debugShowGeometricErrorChanged,t.debugShowRenderingStatisticsChanged,t.debugShowMemoryUsageChanged,t.debugShowUrlChanged,t.enableShowOutlineChanged]}function rM(t,i){console.warn("Czm3DTiles暂不支持pointCloudShading属性"),t.pointCloudShading=new h.PointCloudShading(i.pointCloudShading)}function sM(t,i){var n,o,r;t.imageBasedLighting.imageBasedLightingFactor=Ee(((n=i.imageBasedLighting)==null?void 0:n.imageBasedLightingFactor)??[1,1]),t.imageBasedLighting.specularEnvironmentMaps=(o=i.imageBasedLighting)==null?void 0:o.specularEnvironmentMaps;const e=(r=i.imageBasedLighting)==null?void 0:r.sphericalHarmonicCoefficients;t.imageBasedLighting.sphericalHarmonicCoefficients=e&&ud(e)}class aM extends w.Destroyable{constructor(e,n,o,r){super();v(this,"_clippingPlanesCollectionResetting");v(this,"_clippingPolygonCollectionResetting");v(this,"_flattenedCustomShader",this.disposeVar(l.react(void 0)));this._tileset=e,this._czm3DTiles=n,this._czmNativeViewer=o,this._czmViewer=r,this._clippingPolygonCollectionResetting=new tM(this.tileset,this.czm3DTiles);const{tileset:s,czm3DTiles:a}=this;{const P=this.disposeVar(l.createNextAnimateFrameEvent(this.czm3DTiles.positionChanged,this.czm3DTiles.rotationChanged,this.czm3DTiles.modelMatrixChanged,this.czm3DTiles.originChanged));Xy(this.tileset,this.czm3DTiles),this.dispose(P.disposableOn(()=>Xy(this.tileset,this.czm3DTiles))),this._clippingPlanesCollectionResetting=this.disposeVar(new l.ObjResettingWithEvent(this.czm3DTiles.absoluteClippingPlanesChanged,()=>this.czm3DTiles.absoluteClippingPlanes?new jT(this.tileset,this.czm3DTiles,P):new eM(this.tileset,this.czm3DTiles)))}this.disposeVar(new l.ObjResettingWithEvent(this.czm3DTiles.czmFlattenedPlaneWithId.sceneObjectChanged,()=>{const{sceneObject:P}=this.czm3DTiles.czmFlattenedPlaneWithId;if(!P)return;let S;w.registerCreatedEventUpdate(this,P,()=>{const C=r.getEngineObject(P);if(P instanceof w.ES3DTileset&&(S=C.flattenedPlane),!!S)return new iM(this,S)})}));const c=this.disposeVar(l.createNextAnimateFrameEvent(...oM(a)));w.registerEventUpdate(this,c,()=>{nM(s,a)}),w.registerEventUpdate(this,a.foveatedInterpolationCallbackChanged,()=>{s.foveatedInterpolationCallback=a.foveatedInterpolationCallback}),w.registerEventUpdate(this,a.styleChanged,()=>{s.style=a.style}),w.registerEventUpdate(this,a.pointCloudShadingChanged,()=>{rM(s,a)}),w.registerEventUpdate(this,a.imageBasedLightingChanged,()=>{sM(s,a)}),w.registerEventUpdate(this,a.environmentMapManagerChanged,()=>{dd(s.environmentMapManager,a)});let d=[],u,p,f=!0,g=()=>{var P;return(P=r.viewer)==null?void 0:P.scene.postUpdate.addEventListener(S=>{s._selectedTiles.length===d.length&&d.every(C=>s._selectedTiles.includes(C))||(d.splice(0,d.length,...s._selectedTiles),s._selectedTiles.forEach(C=>{hs(C.content._model,u)}))})};const m=()=>{p&&(p(),p=void 0),d=[],u=void 0};this.ad(m);const y=(P,S)=>{S=="default"?P._contentState=h.Cesium3DTileContentState.UNLOADED:P.content&&Reflect.has(P.content,"_model")&&!hs(P.content._model,S)&&f&&(f=!1),P.children&&P.children.forEach(C=>{y(C,S)})};this.ad(a.setMaterialEvent.don(async P=>{if(f=!0,P=="default")m(),y(s.root,"default");else{u={};for(const C in P){let E,T,I;const b=P[C];u[C]={...b},Reflect.has(b,"baseColorTexture")&&(b.baseColorTexture==null?u[C].baseColorTexture=void 0:b.baseColorTexture.value!=""&&(E=io(this._czmViewer.viewer,b.baseColorTexture,{magFilter:b.magFilter,minFilter:b.minFilter}))),Reflect.has(b,"normalTexture")&&(b.normalTexture==null?u[C].normalTexture=void 0:b.normalTexture.value!=""&&(T=io(this._czmViewer.viewer,b.normalTexture,{magFilter:b.magFilter,minFilter:b.minFilter}))),Reflect.has(b,"metallicRoughnessTexture")&&(b.metallicRoughnessTexture==null?u[C].metallicRoughnessTexture=void 0:b.metallicRoughnessTexture.value!=""&&(I=io(this._czmViewer.viewer,b.metallicRoughnessTexture,{magFilter:b.magFilter,minFilter:b.minFilter})));const x=await Promise.allSettled([E,T,I]);E=x[0].value,T=x[1].value,I=x[2].value,I!=null&&(u[C].metallicRoughnessTexture=I),E!=null&&(u[C].baseColorTexture=E),T!=null&&(u[C].normalTexture=T)}y(s.root,u),p||(p=g())}const S=w.ESSceneObject.getSceneObject(this.czm3DTiles.id);S&&S instanceof w.ES3DTileset&&S.setMaterialInfoEvent.emit({type:f?"success":"warn",message:f?"完成":"部分材质颜色纹理设置失败,请检查原始模型中材质是否具有baseColorTexture属性"})}));{const P=()=>{var C,E;if(this.flattenedCustomShader){s.customShader=(C=this.flattenedCustomShader)==null?void 0:C.customShader,a.customShaderInstance&&console.warn("压平shader和Czm3DTiles的customShader冲突,优先使用压平shader!");return}s.customShader=(E=a.customShaderInstance)==null?void 0:E.customShader};P();const S=this.disposeVar(l.createNextAnimateFrameEvent(a.customShaderInstanceChanged,this.flattenedCustomShaderChanged));this.dispose(S.disposableOn(P))}this.dispose(a.flyToEvent.disposableOn(P=>{a.czmViewer.actived&&this.tileset&&this._czmNativeViewer.camera.flyToBoundingSphere(this.tileset.boundingSphere,{duration:(P??1e3)/1e3})}))}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}get clippingPlanesCollectionResetting(){return this._clippingPlanesCollectionResetting}get clippingPolygonCollectionResetting(){return this._clippingPolygonCollectionResetting}get flattenedCustomShader(){return this._flattenedCustomShader.value}set flattenedCustomShader(e){this._flattenedCustomShader.value=e}get flattenedCustomShaderChanged(){return this._flattenedCustomShader.changed}}function lM(t){const{imageBasedLightingFactor:i,sphericalHarmonicCoefficients:e,specularEnvironmentMaps:n}=t,o={imageBasedLightingFactor:i&&new h.Cartesian2(i[0],i[1]),sphericalHarmonicCoefficients:e&&e.map(r=>new h.Cartesian3(r[0],r[1],r[2])),specularEnvironmentMaps:n&&w.ESSceneObject.context.getStrFromEnv(n)};return new h.ImageBasedLighting(o)}async function cM(t,i,e){let n="";if(typeof i!="string"?typeof i=="object"&&i.url&&(n=new h.Resource({url:i.url,headers:i.headers,queryParameters:i.queryParameters,templateValues:i.templateValues,proxy:i.proxy,retryCallback:i.retryCallback,retryAttempts:i.retryAttempts,request:i.request,parseUrl:i.parseUrl})):n=i,typeof i=="string"&&i.startsWith("ion://")){const s=+i.substring(6);try{n=await h.IonResource.fromAssetId(s)}catch(a){console.error(`Ion资源未能获取到 error: ${a}`,a);return}}const o=await h.Cesium3DTileset.fromUrl(n,{show:t.show,shadows:t.shadows&&ut.shadowPropsMap[t.shadows],maximumScreenSpaceError:t.maximumScreenSpaceError,maximumMemoryUsage:t.maximumMemoryUsage,cacheBytes:t.cacheBytes,maximumCacheOverflowBytes:t.maximumCacheOverflowBytes,cullWithChildrenBounds:t.cullWithChildrenBounds,cullRequestsWhileMoving:t.cullRequestsWhileMoving,cullRequestsWhileMovingMultiplier:t.cullRequestsWhileMovingMultiplier,preloadWhenHidden:t.preloadWhenHidden,preloadFlightDestinations:t.preloadFlightDestinations,preferLeaves:t.preferLeaves,dynamicScreenSpaceError:t.dynamicScreenSpaceError,dynamicScreenSpaceErrorDensity:t.dynamicScreenSpaceErrorDensity,dynamicScreenSpaceErrorFactor:t.dynamicScreenSpaceErrorFactor,dynamicScreenSpaceErrorHeightFalloff:t.dynamicScreenSpaceErrorHeightFalloff,progressiveResolutionHeightFraction:t.progressiveResolutionHeightFraction,foveatedScreenSpaceError:t.foveatedScreenSpaceError,foveatedConeSize:t.foveatedConeSize,foveatedMinimumScreenSpaceErrorRelaxation:t.foveatedMinimumScreenSpaceErrorRelaxation,foveatedInterpolationCallback:t.foveatedInterpolationCallbackStr&&Function('"use strict";return ('+t.foveatedInterpolationCallbackStr+")")(),foveatedTimeDelay:t.foveatedTimeDelay,skipLevelOfDetail:t.skipLevelOfDetail,baseScreenSpaceError:t.baseScreenSpaceError,skipScreenSpaceErrorFactor:t.skipScreenSpaceErrorFactor,skipLevels:t.skipLevels,immediatelyLoadDesiredLevelOfDetail:t.immediatelyLoadDesiredLevelOfDetail,loadSiblings:t.loadSiblings,classificationType:ut.classificationTypeMap[t.classificationType??Ae.defaults.classificationType],lightColor:t.lightColor&&si(t.lightColor),backFaceCulling:t.backFaceCulling??Ae.defaults.backFaceCulling,showOutline:t.showOutline??Ae.defaults.showOutline,debugHeatmapTilePropertyName:t.debugHeatmapTilePropertyName,debugFreezeFrame:t.debugFreezeFrame,debugColorizeTiles:t.debugColorizeTiles,debugWireframe:t.debugWireframe,debugShowBoundingVolume:t.debugShowBoundingVolume,debugShowContentBoundingVolume:t.debugShowContentBoundingVolume,debugShowViewerRequestVolume:t.debugShowViewerRequestVolume,debugShowGeometricError:t.debugShowGeometricError,debugShowRenderingStatistics:t.debugShowRenderingStatistics,debugShowMemoryUsage:t.debugShowMemoryUsage,debugShowUrl:t.debugShowUrl,customShader:e,ellipsoid:Pe(t.ellipsoid??Ae.defaults.ellipsoid),modelMatrix:t.modelMatrix&&h.Matrix4.fromArray(t.modelMatrix),clippingPlanes:t.clippingPlanes&&as(t.clippingPlanes),clippingPolygons:t.clippingPolygons&&Jl(t.clippingPolygons),imageBasedLighting:t.imageBasedLighting&&lM(t.imageBasedLighting),splitDirection:h.SplitDirection[t.splitDirection??Ae.defaults.splitDirection],modelUpAxis:t.modelUpAxis&&h.Axis[t.modelUpAxis],modelForwardAxis:t.modelForwardAxis&&h.Axis[t.modelForwardAxis],featureIdLabel:t.featureIdLabel??Ae.defaults.featureIdLabel,instanceFeatureIdLabel:t.instanceFeatureIdLabel??Ae.defaults.instanceFeatureIdLabel,outlineColor:t.outlineColor&&ie(t.outlineColor),pointCloudShading:t.pointCloudShading,enableShowOutline:t.enableShowOutline,vectorClassificationOnly:t.vectorClassificationOnly,vectorKeepDecodedPositions:t.vectorKeepDecodedPositions,showCreditsOnScreen:t.showCreditsOnScreen,projectTo2D:t.projectTo2D,enableDebugWireframe:t.enableDebugWireframe});return h.Cesium3DTileset.prototype&&(o.ESSceneObjectID=t.id),o}class hM extends l.Destroyable{constructor(e,n,o,r){var c;super();v(this,"_tileset",this.disposeVar(l.react(void 0)));v(this,"_readyResetting");if(this._url=e,this._czm3DTiles=n,this._czmNativeViewer=o,this._czmViewer=r,this._readyResetting=this.disposeVar(new l.ObjResettingWithEvent(this.tilesetChanged,()=>{if(this.tileset)return new aM(this.tileset,this.czm3DTiles,this._czmNativeViewer,this._czmViewer)})),!this.url)throw new Error("!url");const s=(c=this.czm3DTiles.customShaderInstance)==null?void 0:c.customShader;this.disposeVar(l.createProcessingFromAsyncFunc(async d=>{const u=await d.promise(cM(this.czm3DTiles,this.url,s));u&&(u.style=this.czm3DTiles.style,u.foveatedInterpolationCallback=this.czm3DTiles.foveatedInterpolationCallback,this._czmNativeViewer.scene.primitives.add(u),this.dispose(()=>this._czmNativeViewer.scene.primitives.remove(u)),this._tileset.value=u,this.czm3DTiles.notifyCzmTilesetReady(u,this.czm3DTiles))})).start()}get url(){return this._url}get czm3DTiles(){return this._czm3DTiles}get czmViewer(){return this.czm3DTiles.czmViewer}get tileset(){return this._tileset.value}set tileset(e){this._tileset.value=e}get tilesetChanged(){return this._tileset.changed}get readyResetting(){return this._readyResetting}}function dM(t){if(t)try{return new h.Cesium3DTileStyle(t)}catch(i){console.error(`Cesium3DTiles style error: ${i}`,i);return}}let uM=class extends w.Destroyable{constructor(i,e){super(),this.dv(new l.ObjResettingWithEvent(e.clippingPolygonsIdChanged,(n,o)=>{if(!(!n||n===o||n&&n.length===0))return new pM(i,e)}))}},pM=class extends w.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=e.clippingPolygonsId;this.d(()=>e.clippingPolygons=void 0);const o=s=>{const a=this.dv(l.createNextAnimateFrameEvent(s.positionsChanged,s.reverseChanged,s.enabledChanged,s.showHelperChanged));this.dv(new l.ObjResettingWithEvent(a,()=>new fM(i,s,e)))},r=s=>{let a;s instanceof w.ESExcavate&&w.registerCreatedEventUpdate(this,s,()=>{a=i.getEngineObject(s).czmPolygonClipping,a&&o(a)}),s instanceof w.ESHole&&w.registerCreatedEventUpdate(this,s.excavate,()=>{a=i.getEngineObject(s.excavate).czmPolygonClipping,a&&o(a)})};for(let s=0;s<n.length;s++){const a=n[s],c=w.ESSceneObject.getSceneObjById(a);c&&r(c)}}},fM=class extends w.Destroyable{constructor(i,e,n){super(),this._czmViewer=i;const o=n.clippingPolygonsId,r=e.enabled?e.reverse:void 0;if(o&&o.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<o.length;a++){const c=o[a],d=w.ESSceneObject.getSceneObjById(c);if(!d)return;let u;if(d instanceof w.ESExcavate?u=i.getEngineObject(d).czmPolygonClipping:d instanceof w.ESHole&&(u=i.getEngineObject(d.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[a]={positions:u.positions},s.inverse=r??u.reverse)}n.clippingPolygons=s}}};function Yy(t){let i;try{i=t&&Function('"use strict";return ('+t+")")()}catch{i=void 0}return i||h.Math.lerp}const Zy=`
|
|
366
366
|
// shader定义请参见文档:https://github.com/CesiumGS/cesium/tree/main/Documentation/CustomShaderGuide#customshader-documentation
|
|
367
367
|
class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
368
368
|
constructor(sceneObject, viewer) {
|
|
@@ -709,7 +709,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
709
709
|
${t0}
|
|
710
710
|
\`\`\`
|
|
711
711
|
|
|
712
|
-
`,i0=Date.now();new Date(i0).toISOString(),new Date(i0+
|
|
712
|
+
`,i0=Date.now();new Date(i0).toISOString(),new Date(i0+1440*60*1e3).toISOString();const ya=class ya extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_loadFuncReact",this.disposeVar(l.react(void 0)));v(this,"_clock");v(this,"_resetClockEvent",this.disposeVar(new l.Event));v(this,"_dataSource",this.disposeVar(l.react(void 0)));this._clock=this.disposeVar(new ue(e)),this.dispose(l.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(l.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(l.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(l.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(l.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(l.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(l.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(l.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(this.flyToEvent.disposableOn(d=>{e.actived&&this.dataSource&&(d!==void 0?o.flyTo(this.dataSource,{duration:d/1e3}):o.flyTo(this.dataSource))}));const r=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource,!0),this._dataSource.value=void 0)};this.dispose(r);const s=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:d}=this;this.startTime=h.JulianDate.toDate(d.clock.startTime).getTime(),this.stopTime=h.JulianDate.toDate(d.clock.stopTime).getTime(),this.currentTime=h.JulianDate.toDate(d.clock.currentTime).getTime(),this.multiplier=d.clock.multiplier,this.clockStep=ue.getClockStep(d.clock.clockStep),this.clockRange=ue.getClockRange(d.clock.clockRange)};this.dispose(this.resetClockEvent.disposableOn(s));const a=()=>{this.dataSource&&(this.dataSource.show=this.show??ya.defaults.show)};a(),this.dispose(this.showChanged.disposableOn(a));const c=this.disposeVar(l.react(void 0));{const d=()=>{var f;if(this.uri)if(this.uri&&typeof this.uri!="string")(f=h.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||f.then(g=>g);else return w.ESSceneObject.context.getStrFromEnv(this.uri)},u=()=>{c.value=this.data??d()};u();const p=this.disposeVar(l.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.dispose(p.disposableOn(u))}{const d=this.disposeVar(l.createProcessingFromAsyncFunc(async f=>{if(r(),!c.value)return;let g;try{g=await h.CzmlDataSource.load(c.value)}catch(m){console.error(`加载czml错误:${m}`),console.error(m)}if(g&&(f.check(),g.entities.values.forEach(m=>{h.Entity.prototype&&(g.ESSceneObjectID=n)}),o.dataSources.add(g),this._dataSource.value=g,a(),(this.autoResetClock??ya.defaults.autoResetClock)&&s(),!!this.loadFun))try{this.loadFun(g)}catch(m){console.error(m)}})),u=()=>{d.isRunning&&d.cancel(),d.restart()};u();const p=this.disposeVar(l.createNextAnimateFrameEvent(c.changed,this.loadFunChanged));this.dispose(p.disposableOn(u))}{const d=()=>{if(this.loadFuncStr)try{const u=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=u}catch(u){console.error(u),this.loadFun=void 0}else this.loadFun=void 0};d(),this.dispose(this.loadFuncStrChanged.disposableOn(d))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};v(ya,"defaults",{show:!0,allowPicking:!0,data:jM,dataMd:eI,autoResetClock:!0,clockEnabled:!1,startTime:ue.defaults.startTime,stopTime:ue.defaults.stopTime,currentTime:ue.defaults.currentTime,multiplier:ue.defaults.multiplier,clockStep:ue.defaults.clockStep,clockRange:ue.defaults.clockRange,shouldAnimate:ue.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:t0,defaultLoadFuncDocStr:tI});let Po=ya;(t=>{t.createDefaultProps=()=>({show:void 0,uri:void 0,allowPicking:void 0,data:l.reactJsonWithUndefined(void 0),autoResetClock:void 0,clockEnabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0,loadFuncStr:void 0})})(Po||(Po={})),l.extendClassProps(Po.prototype,Po.createDefaultProps);const wa=class wa extends w.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Po(e,i.id));this.dispose(l.track([o,"show"],[i,"show"])),this.dispose(l.track([o,"allowPicking"],[i,"allowPicking"])),this.dispose(l.bind([o,"data"],[i,"data"])),this.dispose(l.bind([o,"uri"],[i,"uri"])),this.dispose(l.bind([o,"loadFuncStr"],[i,"loadFuncStr"])),this.dispose(l.bind([o,"autoResetClock"],[i,"autoResetClock"])),this.dispose(l.bind([o,"clockEnabled"],[i,"clockEnabled"])),this.dispose(l.bind([o,"startTime"],[i,"startTime"])),this.dispose(l.bind([o,"stopTime"],[i,"stopTime"])),this.dispose(l.bind([o,"currentTime"],[i,"currentTime"])),this.dispose(l.bind([o,"multiplier"],[i,"multiplier"])),this.dispose(l.bind([o,"clockStep"],[i,"clockStep"])),this.dispose(l.bind([o,"clockRange"],[i,"clockRange"])),this.dispose(l.bind([o,"shouldAnimate"],[i,"shouldAnimate"])),this.dispose(i.flyToEvent.disposableOn(r=>{e.actived&&o.flyTo(r)}))}};v(wa,"type",wa.register("ESCesiumViewer",w.ESCzml.type,wa));let Wu=wa;async function iI(t,i){const e=l.fetchArrayBuffer(t+"index.bin"),n=l.fetchArrayBuffer(t+"vertex.bin"),o=[...new Array(i).keys()].map(p=>p.toString().padStart(6,"0")).map(p=>`${t}bins/R2DC${p}.bin`).map(p=>l.fetchArrayBuffer(p)),r=await Promise.all([e,n,...o]);if(r.some(p=>p===void 0)){console.warn("有数据未能解析!");return}const[s,...a]=r,c=new Uint16Array(s),[d,...u]=a.map(p=>new Float32Array(p));return{indexBuffer:c,vertexBuffer:d,propBuffers:u}}function*nI(t){const e=t.length/3|0;for(let n=0;n<e;++n)yield[t[n*3+0],t[n*3+1],t[n*3+2]]}const Ca=class Ca extends Ce{constructor(e,n){super(e,n);v(this,"_czmCustomPrimitive");v(this,"_czmTexture");if(this._czmCustomPrimitive=this.disposeVar(new ke(n,e.id)),this._czmTexture=this.ad(new Le(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this,{czmTexture:s}=this;{s.uri="",s.size=[1024,1],s.enabled=!0;const c=new l.ColorStops,d=()=>{c.value=e.colorStops??w.ESDataMesh.defaults.colorStops;const u=c.getColorsInUint8(new Uint8Array(1024*4));s.copyTexture({source:{width:1024,height:1,arrayBufferView:u}})};d(),this.dispose(e.colorStopsChanged.disposableOn(d))}this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(l.bind([r,"position"],[e,"position"])),this.dispose(et([r,"rotation"],[e,"rotation"])),r.cull=!1,r.vertexShaderSource=`
|
|
713
713
|
precision highp float;
|
|
714
714
|
in vec3 a_position;
|
|
715
715
|
in vec3 a_prop;
|
|
@@ -799,7 +799,7 @@ ${n0}
|
|
|
799
799
|
}
|
|
800
800
|
|
|
801
801
|
\`\`\`
|
|
802
|
-
`,Yu=Date.now(),Et=class Et extends w.ESSceneObject{constructor(e){super(e);v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_resetClockEvent",this.disposeVar(new l.Event))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new w.LongStringProperty([this,"data"],"数据",void 0,void 0,!0),new w.JsonProperty([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",void 0,!0),new w.BooleanProperty([this,"autoResetClock"],"自动设置时钟",Et.defaults.autoResetClock),new w.BooleanProperty([this,"clockEnabled"],"启用",Et.defaults.clockEnabled),new w.BooleanProperty([this,"shouldAnimate"],"是否启用动画",Et.defaults.shouldAnimate),new w.DateProperty([this,"startTime"],"开始时间",Et.defaults.startTime,!0),new w.DateProperty([this,"stopTime"],"结束时间",Et.defaults.stopTime),new w.DateProperty([this,"currentTime"],"当前时间",Et.defaults.currentTime,!0),new w.NumberProperty([this,"multiplier"],"倍速",Et.defaults.multiplier),new w.EnumProperty([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",Et.defaults.clockStep),new w.EnumProperty([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",Et.defaults.clockRange)],general:[...e.general,new w.BooleanProperty([this,"show"],"是否显示",!0),new w.BooleanProperty([this,"collision"],"开启碰撞",!1),new w.BooleanProperty([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new w.GroupProperty([],"通用","通用"),new w.FunctionProperty(["number"],n=>this.flyTo(n),[1e3],"飞入"),new w.EvalStringProperty([this,"loadFuncStr"],"loadFnStr",n0,uI,!0),new w.FunctionProperty([],()=>this.resetClock(),[],"根据当前加载的数据重设时钟")]}}};v(Et,"createDefaultProps",()=>({...w.ESSceneObject.createDefaultProps(),show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:Yu,stopTime:Yu+
|
|
802
|
+
`,Yu=Date.now(),Et=class Et extends w.ESSceneObject{constructor(e){super(e);v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_resetClockEvent",this.disposeVar(new l.Event))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new w.LongStringProperty([this,"data"],"数据",void 0,void 0,!0),new w.JsonProperty([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",void 0,!0),new w.BooleanProperty([this,"autoResetClock"],"自动设置时钟",Et.defaults.autoResetClock),new w.BooleanProperty([this,"clockEnabled"],"启用",Et.defaults.clockEnabled),new w.BooleanProperty([this,"shouldAnimate"],"是否启用动画",Et.defaults.shouldAnimate),new w.DateProperty([this,"startTime"],"开始时间",Et.defaults.startTime,!0),new w.DateProperty([this,"stopTime"],"结束时间",Et.defaults.stopTime),new w.DateProperty([this,"currentTime"],"当前时间",Et.defaults.currentTime,!0),new w.NumberProperty([this,"multiplier"],"倍速",Et.defaults.multiplier),new w.EnumProperty([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",Et.defaults.clockStep),new w.EnumProperty([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",Et.defaults.clockRange)],general:[...e.general,new w.BooleanProperty([this,"show"],"是否显示",!0),new w.BooleanProperty([this,"collision"],"开启碰撞",!1),new w.BooleanProperty([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new w.GroupProperty([],"通用","通用"),new w.FunctionProperty(["number"],n=>this.flyTo(n),[1e3],"飞入"),new w.EvalStringProperty([this,"loadFuncStr"],"loadFnStr",n0,uI,!0),new w.FunctionProperty([],()=>this.resetClock(),[],"根据当前加载的数据重设时钟")]}}};v(Et,"createDefaultProps",()=>({...w.ESSceneObject.createDefaultProps(),show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:Yu,stopTime:Yu+1440*60*1e3,currentTime:Yu,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,clampToGround:!1})),v(Et,"type",Et.register("ESKml",Et,{chsName:"ESKml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Kml数据加载"}));let rh=Et;const ts=class ts extends w.ESLocalVector2D{constructor(i){super(i)}getESProperties(){const i={...super.getESProperties()};return{...i,more:[...i.more,new w.GroupProperty([],"折线","折线"),new w.Number2sProperty([this,"points"],"本地位置数组",void 0,!0),new w.GroupProperty([],"czm","czm"),new w.BooleanProperty([this,"loop"],"首尾相连",!0),new w.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new w.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new w.NumberProperty([this,"dashLength"],"虚线长度",16),new w.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new w.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new w.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};v(ts,"createDefaultProps",()=>({...w.ESLocalVector2D.createDefaultProps(),points:w.reactPosition2Ds(void 0),loop:!0,hasDash:!0,gapColor:l.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),v(ts,"type",ts.register("ESLocalLineString",ts,{chsName:"局部2D坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineString"}));let sh=ts;const is=class is extends w.ESLocalVector{constructor(i){super(i)}getESProperties(){const i={...super.getESProperties()};return{...i,more:[...i.more,new w.GroupProperty([],"通用","通用"),new w.Number3sProperty([this,"points"],"本地位置数组",void 0,!0),new w.GroupProperty([],"czm","czm"),new w.BooleanProperty([this,"loop"],"首尾相连",!0),new w.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new w.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new w.NumberProperty([this,"dashLength"],"虚线长度",16),new w.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new w.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new w.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};v(is,"createDefaultProps",()=>({...w.ESLocalVector.createDefaultProps(),points:l.reactPositions(void 0),loop:!0,width:void 0,color:l.reactArrayWithUndefined(void 0),hasDash:!0,gapColor:l.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),v(is,"type",is.register("ESLocalLineStringZ",is,{chsName:"局部坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineStringZ"}));let zs=is;const o0=`in vec3 position;
|
|
803
803
|
in vec3 normal;
|
|
804
804
|
in vec2 st;
|
|
805
805
|
out vec3 v_normalEC;
|
|
@@ -1250,7 +1250,7 @@ export type IndexJsonType = {
|
|
|
1250
1250
|
\`\`\`
|
|
1251
1251
|
${p0}
|
|
1252
1252
|
\`\`\`
|
|
1253
|
-
`,Ye=class Ye extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_loadFuncReact",this.disposeVar(l.react(void 0)));v(this,"_dataSource",this.disposeVar(l.react(void 0)));v(this,"_data");v(this,"_defaultHeight",{});v(this,"_defaultBoundingSphere",new h.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{r()});{const s=this.dv(l.createProcessingFromAsyncFunc(async d=>{this.dataSource&&r(),this.url&&(typeof this.url=="object"?this._data=this.url:w.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(w.ESSceneObject.context.getStrFromEnv(this.url)).then(u=>u.json()).then(u=>{this._data=u}).catch(u=>{console.warn("ESGeoJson数据加载失败",u)}),this.dataSource=await h.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(u=>{var f,g;const p=[];for(const m of u.entities.values)if(h.Entity.prototype&&(m.ESSceneObjectID=n),this._isEntityShow(m,e),m.polygon&&p.push(...(f=m.polygon.hierarchy)==null?void 0:f.getValue(h.JulianDate.now()).positions),m.polyline&&p.push(...(g=m.polyline.positions)==null?void 0:g.getValue(h.JulianDate.now())),m.position){const y=m.position.getValue(h.JulianDate.now());y&&p.push(y)}this._defaultBoundingSphere=h.BoundingSphere.fromPoints(p)}))})),a=()=>{s.isRunning&&s.cancel(),s.restart()};a();const c=this.dv(l.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(c.don(a))}{const s=()=>{var c,d;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(u){console.error(u)}else{const u=this.dataSource.entities.values;for(let p=0;p<u.length;p++){const f=u[p];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(c=f.polygon.height)==null?void 0:c.getValue(h.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new h.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new h.ConstantProperty(!this.fillGround),f.polygon.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new h.ConstantProperty(this.filled??Ye.defaults.filled),f.polygon.material=new h.ColorMaterialProperty(new h.Color(...this.fillColor??Ye.defaults.fillColor)),f.polygon.outline=new h.ConstantProperty(!1),f.polyline=new h.PolylineGraphics;const g=JSON.parse(JSON.stringify((d=f.polygon.hierarchy)==null?void 0:d.getValue(h.JulianDate.now()).positions));h.Cartesian3.equals(g[0],g[g.length-1])||g.push(g[0]),f.polyline.positions=g}if(f.polyline&&(f.polyline.show=new h.ConstantProperty(this.stroked??Ye.defaults.stroked),f.polyline.width=new h.ConstantProperty(this.strokeWidth??Ye.defaults.strokeWidth),f.polyline.material=new h.ColorMaterialProperty(new h.Color(...this.strokeColor??Ye.defaults.strokeColor)),f.polyline.clampToGround=new h.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new h.ConstantProperty(this.imageShow??Ye.defaults.imageShow),f.billboard.width=new h.ConstantProperty(this.imageSize?this.imageSize[0]:Ye.defaults.imageSize[0]),f.billboard.height=new h.ConstantProperty(this.imageSize?this.imageSize[1]:Ye.defaults.imageSize[1]);const g=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:Ye.defaults.imageUrl;f.billboard.image=new h.ConstantProperty(w.ESSceneObject.context.getStrFromEnv(g)),f.billboard.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.billboard.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND);const m=this.imageAnchor??Ye.defaults.imageAnchor,y=this.imageOffset??Ye.defaults.imageOffset;if(f.billboard.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-m[0]*f.billboard.width.getValue(h.JulianDate.now())+y[0],-m[1]*f.billboard.height.getValue(h.JulianDate.now())+y[1]])),f.label=new h.LabelGraphics,!f.label)return;f.label.show=new h.ConstantProperty(this.textShow??Ye.defaults.textShow),f.label.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.label.text=new h.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??Ye.defaults.textDefaultText),f.label.fillColor=new h.ConstantProperty(new h.Color(...this.textColor??Ye.defaults.textColor)),f.label.showBackground=new h.ConstantProperty(this.textBackgroundColor!=null);const P=this.textFontSize&&this.textFontSize!=0?this.textFontSize:Ye.defaults.textFontSize,S=this.textOffset??Ye.defaults.textOffset;f.label.backgroundColor=new h.ConstantProperty(new h.Color(...this.textBackgroundColor??Ye.defaults.textBackgroundColor)),f.label.font=new h.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${P}px ${this.textFontFamily??Ye.defaults.textFontFamily}`),f.label.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.label.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.label.eyeOffset=new h.ConstantProperty(h.Cartesian3.fromArray([0,0,-1]));const C=this.textAnchor??Ye.defaults.textAnchor;f.label.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-C[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(h.JulianDate.now()),f.label.font.getValue(h.JulianDate.now())))+S[0],-C[1]*((this.textBackgroundColor?10:0)+P)+S[1]]))}}}};s();const a=this.dv(l.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged));this.dispose(a.don(s))}{const s=()=>{if(!this.dataSource)return;const c=this.dataSource.entities.values;for(let d=0;d<c.length;d++){const u=c[d];this._isEntityShow(u,e)}};s();const a=this.ad(l.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(a.don(s))}{const s=()=>{if(this.loadFuncStr)try{const a=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=a}catch(a){console.error(a),this.loadFun=void 0}else this.loadFun=void 0};s(),this.dispose(this.loadFuncStrChanged.disposableOn(s))}this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&this.dataSource&&(s!==void 0?o.flyTo(this.dataSource,{duration:s/1e3}).then(a=>{a||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:s/1e3})}):o.flyTo(this.dataSource).then(a=>{a||o.camera.flyToBoundingSphere(this._defaultBoundingSphere)}))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,n="16px sans-serif"){const r=document.createElement("canvas").getContext("2d");return r.font=n,r.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=n.viewer)!=null&&o.camera&&this.show){let r;if(e.polygon&&e.polygon.hierarchy)r=w.getMinMaxCorner(e.polygon.hierarchy.getValue(h.JulianDate.now()).positions.map(c=>ce(c))).center;else if(e.polyline&&e.polyline.positions)r=w.getMinMaxCorner(e.polyline.positions.getValue(h.JulianDate.now()).map(c=>ce(c))).center;else if(e.position){const c=e.position.getValue(h.JulianDate.now());c&&(r=ce(c))}if(!r||isNaN(r[0]))return;const s=w.getDistancesFromPositions([r,Vt(n.viewer.camera)],"NONE")[0];let a=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?a=this.minFeatureVisibleDistance<s&&s<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?a=s>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(a=s<this.maxFeatureVisibleDistance),e.show=this.show&&a}}};v(Ye,"defaults",{show:!0,allowPicking:!0,url:f0,defaultLoadFuncStr:p0,defaultLoadFuncDocStr:TI,data:EI,dataMd:AI,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Eo=Ye;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:l.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:l.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:l.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:l.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:l.reactArrayWithUndefined(void 0),imageAnchor:l.reactArrayWithUndefined(void 0),imageOffset:l.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:l.reactArrayWithUndefined(void 0),textBackgroundColor:l.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:l.reactArrayWithUndefined(void 0),textOffset:l.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE"})})(Eo||(Eo={})),l.extendClassProps(Eo.prototype,Eo.createDefaultProps);const Da=class Da extends Qt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Eo(e,i.id));this.dispose(l.track([o,"show"],[i,"show"])),this.dispose(l.track([o,"allowPicking"],[i,"allowPicking"])),this.dispose(l.track([o,"loadFuncStr"],[i,"loadFuncStr"])),this.dispose(l.track([o,"url"],[i,"features"])),this.dispose(l.track([o,"stroked"],[i,"stroked"])),this.dispose(l.track([o,"strokeWidth"],[i,"strokeWidth"])),this.dispose(l.track([o,"strokeWidthType"],[i,"strokeWidthType"])),this.dispose(l.track([o,"strokeColor"],[i,"strokeColor"])),this.dispose(l.track([o,"strokeMaterial"],[i,"strokeMaterial"])),this.dispose(l.track([o,"strokeMaterialParams"],[i,"strokeMaterialParams"])),this.dispose(l.track([o,"strokeGround"],[i,"strokeGround"])),this.dispose(l.track([o,"filled"],[i,"filled"])),this.dispose(l.track([o,"fillColor"],[i,"fillColor"])),this.dispose(l.track([o,"fillMaterial"],[i,"fillMaterial"])),this.dispose(l.track([o,"fillMaterialParams"],[i,"fillMaterialParams"])),this.dispose(l.track([o,"fillGround"],[i,"fillGround"])),this.dispose(l.track([o,"imageShow"],[i,"imageShow"])),this.dispose(l.track([o,"imageUrl"],[i,"imageUrl"])),this.dispose(l.track([o,"imageSize"],[i,"imageSize"])),this.dispose(l.track([o,"imageAnchor"],[i,"imageAnchor"])),this.dispose(l.track([o,"imageOffset"],[i,"imageOffset"])),this.dispose(l.track([o,"textShow"],[i,"textShow"])),this.dispose(l.track([o,"textProperty"],[i,"textProperty"])),this.dispose(l.track([o,"textDefaultText"],[i,"textDefaultText"])),this.dispose(l.track([o,"textColor"],[i,"textColor"])),this.dispose(l.track([o,"textBackgroundColor"],[i,"textBackgroundColor"])),this.dispose(l.track([o,"textFontFamily"],[i,"textFontFamily"])),this.dispose(l.track([o,"textFontSize"],[i,"textFontSize"])),this.dispose(l.track([o,"textFontStyle"],[i,"textFontStyle"])),this.dispose(l.track([o,"textFontWeight"],[i,"textFontWeight"])),this.dispose(l.track([o,"textAnchor"],[i,"textAnchor"])),this.dispose(l.track([o,"textOffset"],[i,"textOffset"])),this.dispose(l.track([o,"minFeatureVisibleDistance"],[i,"minFeatureVisibleDistance"])),this.dispose(l.track([o,"maxFeatureVisibleDistance"],[i,"maxFeatureVisibleDistance"])),this.dispose(l.track([o,"heightReference"],[i,"heightReference"])),this.dispose(i.flyToEvent.disposableOn(r=>{if(e.actived){if(i.flyInParam){const{position:s,rotation:a,flyDuration:c}=i.flyInParam;return se(e.viewer,s,void 0,a,c),!0}o.flyTo(r&&r*1e3)}}));{const r=async(s,a,c)=>{if(!e.actived)return;const d=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(s,a)));if(!(!d||!(d!=null&&d.positions)))if(d.type=="Point"||d.type=="MultiPoint")Jt(e,i,this.id,await this._calculateFeatureHeight(d.type=="MultiPoint"?d.positions.flat():d.positions,i.heightReference,e),1e3,c);else{const u=d.type=="Polygon"||d.type=="MultiPolygon"||d.type=="MultiLineString";let p=[];u?p=d.positions.flat(d.type=="MultiPolygon"?2:1).map(y=>this._calculateFeatureHeight(y,i.fillGround?"CLAMP_TO_GROUND":"NONE",e)):p=d.positions.map(y=>this._calculateFeatureHeight(y,i.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:f,maxPos:g,center:m}=w.getMinMaxCorner(p);Jt(e,i,this.id,m,w.getDistancesFromPositions([f,g],"NONE")[0],c)}};this.d(i.flyToFeatureEvent.don((s,a,c)=>r(s,a,c))),this.d(i.flyToFeatureIndexEvent.don((s,a)=>r(s,void 0,a)))}}_getFeatureByIndexOrProperties(i,e){var s,a,c,d,u,p,f,g;const{sceneObject:n}=this,o=n.features;if(!o)return;const r=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(r){if(e){let m=r.find(y=>(y==null?void 0:y.properties[i])==e);return{type:m!=null&&m.coordinates?m.type:(s=m==null?void 0:m.geometry)==null?void 0:s.type,positions:(m==null?void 0:m.coordinates)||((a=m==null?void 0:m.geometry)==null?void 0:a.coordinates)}}else if(typeof i=="number")return{type:(c=r[i])!=null&&c.coordinates?r[i].type:(u=(d=r[i])==null?void 0:d.geometry)==null?void 0:u.type,positions:((p=r[i])==null?void 0:p.coordinates)||((g=(f=r[i])==null?void 0:f.geometry)==null?void 0:g.coordinates)}}}async _calculateFeatureHeight(i,e,n){const o=[...i];return e=="NONE"?o[2]=o[2]??0:e=="CLAMP_TO_GROUND"||!o[2]?o[2]=await n.getTerrainHeight(o)??0:o[2]+=await n.getTerrainHeight(o)??0,o}};v(Da,"type",Da.register("ESCesiumViewer",w.ESGeoJson.type,Da));let Ju=Da;const ba=class ba extends vt{constructor(e,n){super(e,n);v(this,"_czmGeoESRectangle");v(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ie(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Ci(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,s=this._geoPolyline;s.arcType="RHUMB",this.dispose(l.track([s,"color"],[e,"strokeColor"])),this.dispose(l.track([s,"width"],[e,"strokeWidth"])),this.dispose(l.track([s,"ground"],[e,"strokeGround"])),this.dispose(l.track([r,"ground"],[e,"fillGround"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.show=e.show&&e.stroked,r.show=e.show&&e.filled};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(c.disposableOn(a))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(a))}{const a=()=>{const c=e.points;if(c&&c.length>=2){const{minPos:d,maxPos:u}=w.getMinMaxCorner(c);r.rectangle=[d[0],d[1],u[0],u[1]],r.height=c[0][2],r.extrudedHeight=c[0][2];const p=c.map(y=>(c&&(y[2]=c[0][2]),y)),f=p[0],g=p[1],m=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];s.positions=[...m,f]}else r.rectangle=void 0,s.positions=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(ae(r,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmGeoESRectangle:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):o.points?(ae(r,o,n,o.points,e),!0):!1:!1}};v(ba,"type",ba.register("ESCesiumViewer",w.ESGeoRectangle.type,ba));let Bu=ba;class Os extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new _n(e,n));const{geoPolygon:o}=this;this.dispose(l.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(s=>{o.flyTo(s)})),this.dispose(l.bind([o,"show"],[this,"show"])),this.dispose(l.bind([o,"fill"],[this,"filled"])),this.dispose(l.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(l.bind([o,"ground"],[this,"ground"])),this.dispose(l.bind([o,"outline"],[this,"outline"])),this.dispose(l.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(l.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(l.bind([o,"color"],[this,"color"])),this.dispose(l.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const s=wd([...this.positions,this.positions[0]]);o.positions=s}else o.positions=void 0};r(),this.dispose(this.positionsChanged.disposableOn(r))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:l.reactArray([1,1,1,1]),outlineWidth:1,color:l.reactArrayWithUndefined([1,1,1,.5]),positions:l.reactPositions(void 0),depth:0})})(Os||(Os={})),l.extendClassProps(Os.prototype,Os.createDefaultProps);const Ra=class Ra extends vt{constructor(e,n){super(e,n);v(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Os(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"positions"],[e,"points"])),this.dispose(l.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(l.track([r,"outline"],[e,"stroked"])),this.dispose(l.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(l.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(l.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(l.track([r,"filled"],[e,"filled"])),this.dispose(l.track([r,"color"],[e,"fillColor"])),this.dispose(l.track([r,"ground"],[e,"ground"]));{const s=()=>{r.ground=e.ground||e.fillGround};s();const a=this.dv(l.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(a.don(s))}{const s=()=>{r.color=e.filled?e.fillColor:Ls.defaults.fillStyle.color};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}};v(Ra,"type",Ra.register("ESCesiumViewer",Ls.type,Ra));let ju=Ra;const xa=class xa extends Ce{constructor(e,n){super(e,n);v(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new at(n,e.id));const r=this._czmModel;this.d(r.readyEvent.don(a=>{r.gltf.animations&&(r.activeAnimationsJson=r.gltf.animations.map((c,d)=>({index:d,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),e.czmModelReadyEvent.emit(a)})),this.ad(new rc(o,this._czmModel)),this.d(l.track([r,"show"],[e,"show"])),this.d(l.track([r,"color"],[e,"czmColor"])),this.d(l.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(l.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(l.bind([r,"position"],[e,"position"])),this.d(l.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(l.track([r,"scale"],[e,"scale"])),this.ad(l.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(l.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const a=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};a(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>a(c)))}{const a=()=>{var c,d;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(d=e.czmEnvironmentMapManager)==null?void 0:d.atmosphereScatteringIntensity)};a(),this.ad(e.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const c=[...e.rotation??[0,0,0]];c[0]+=e.instances?0:90,r.rotation=c};a(),this.d(e.rotationChanged.don(a));{const c=()=>{if(a(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(d=>{const u=JSON.parse(JSON.stringify(d));return!u.rotation&&(u.rotation=[0,0,0]),u.rotation[0]+=90,u})};c(),this.ad(e.instancesChanged.don(c))}}this.ad(e.setMaterialEvent.don(a=>{r.setMaterial(a)}));{const a=()=>{const c=[...r.rotation];c[0]-=e.instances?0:90,e.rotation=c};a(),this.d(r.rotationChanged.don(a))}{const a=this.dv(l.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};c(),this.d(a.don(c))}const s=()=>{r.url=w.ESSceneObject.context.getStrFromEnv(sc(typeof e.url=="string"?e.url:e.url.url))};s(),this.d(e.urlChanged.don(s)),this.d(e.setNodePositionEvent.don((a,c)=>{r.setNodeTranslation(a,c)})),this.d(e.setNodeRotationEvent.don((a,c)=>{r.setNodeRotation(a,c)})),this.d(e.setNodeScaleEvent.don((a,c)=>{r.setNodeScale(a,c)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:r,model:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(s&&It(r,o,n,e,s,!0),!!s):!1}};v(xa,"type",xa.register("ESCesiumViewer",w.ESGltfModel.type,xa));let ep=xa;function g0(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class Ns extends l.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new l.Event));v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_distance",this.disposeVar(l.react(0)));v(this,"_surfaceDistance",this.disposeVar(l.react(0)));v(this,"_height",this.disposeVar(l.react(0)));v(this,"_middlePosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));v(this,"_heightPosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const s=this._surfaceDistance.value=w.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="RHUMB"){const s=this._surfaceDistance.value=w.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="NONE"){const s=w.lbhToXyz(this.positions[0]),a=w.lbhToXyz(this.positions[1]);this._distance.value=g0(s,a),this._surfaceDistance.value=g0(w.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const s=this.disposeVar(new Ie(e,n));s.ground=!1,s.loop=!1,this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([s,"arcType"],[this,"arcType"])),this.dispose(l.bind([s,"color"],[this,"color"])),this.dispose(l.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(l.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(l.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(l.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(l.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(l.bind([s,"show"],[this,"show"])),this.dispose(l.bind([s,"width"],[this,"width"])),this.dispose(l.bind([s,"depthTest"],[this,"depthTest"]));{s.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[d,u]=this.positions;s.positions=[d,u,[d[0],d[1],u[2]]]}else s.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&s.flyTo(c)}));const a=this.disposeVar(new $e(e,n));this.dispose(l.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(l.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(l.track([a,"show"],[this,"show"]));{const c=()=>{a.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{a.innerHTML=oo(`高度: ${ac(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(a.pickedEvent.don(c=>{Wi(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:l.reactPositions(void 0),width:1,color:l.reactArray([1,1,1,1]),hasDash:!1,gapColor:l.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Ns||(Ns={})),l.extendClassProps(Ns.prototype,Ns.createDefaultProps);const Fa=class Fa extends vt{constructor(e,n){super(e,n);v(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Ns(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(l.bind([r,"positions"],[e,"points"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const d=e.strokeMaterial??"normal";d==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):d==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const u=e.strokeStyle;if(u.material==="hasDash"&&u.materialParams)try{const p=u.materialParams;Reflect.has(p,"gapColor")&&(r.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(r.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(r.dashPattern=p.dashPattern)}catch(p){console.error(p)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{Wi(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}};v(Fa,"type",Fa.register("ESCesiumViewer",w.ESHeightMeasurement.type,Fa));let tp=Fa;const ip={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},ka=class ka extends Ce{constructor(e,n){super(e,n);v(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new at(n,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"position"],[e,"position"])),this.dispose(et([r,"rotation"],[e,"rotation"])),this.dispose(l.bind([r,"scale"],[e,"scale"]));{const y=this.dv(l.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),P=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};P(),this.d(y.don(P))}const s=w.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),a=w.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),c=w.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),d=w.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),u=w.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=w.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":r.url=s;break;case"police":r.url=a;break;case"pedestrian":r.url=c;break;case"stranger":r.url=d;break;case"suitMan":r.url=u;break;case"suitWoman":r.url=p;break;default:r.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const g=()=>{const y=e.animation??w.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}y==="walking"?r.activeAnimationsJson=ip.czmAnimationsWalk:y==="standing"?r.activeAnimationsJson=ip.czmAnimationsStand:y==="running"&&(r.activeAnimationsJson=ip.czmAnimationsRun)};g();const m=this.ad(l.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(m.disposableOn(()=>g())),this.ad(new rc(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(s&&It(r,o,n,e,s,!0),!!s)}};v(ka,"type",ka.register("ESCesiumViewer",w.ESHuman.type,ka));let np=ka;class m0 extends w.Destroyable{constructor(e,n){super();v(this,"_czmGeoCanvasImagePoi");v(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){se(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Kt,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new vi(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=u=>{let p=u;return u.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+u.split("inner://")[1]),w.ESSceneObject.context.getStrFromEnv(sc(p))},s=()=>{const u=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=u,e.sizeByContent){const f=new Image;f.src=u,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},a=this.disposeVar(l.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(a.disposableOn(()=>s())),s(),this.d(l.track([o,"zOrder"],[e,"zOrder"])),this.dispose(l.track([o,"show"],[e,"show"])),this.dispose(l.bind([o,"position"],[e,"position"])),this.ad(l.bind([o,"isHoverZoom"],[e,"isHoverZoom"]));{const u=()=>{o.scale=[e.scale[1],e.scale[2]]};u(),this.dispose(e.scaleChanged.don(u))}const c=()=>{const u=e.anchor,p=e.offset;u?o.originRatioAndOffset=[...u,-p[0],-p[1]]:o.originRatioAndOffset=[0,0,0,0]},d=this.ad(l.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(d.disposableOn(()=>c())),c(),this.dispose(o.clickEvent.disposableOn(u=>{const{offsetX:p,offsetY:f}=u,m={type:u.button===0?"leftClick":u.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(m)})),this.dispose(o.hoveredChanged.disposableOn(u=>{if(u===void 0)return;const p={type:u?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class v0 extends w.Destroyable{constructor(e,n,o){super();v(this,"_czmGeoImageModel");v(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});v(this,"_isPointEvent",!1);v(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return Jt(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new Hi(n,e.id));const r=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,m,y;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((m=this._eventInfo.add)==null?void 0:m.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((y=this._eventInfo.add)==null?void 0:y.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),w.registerCreatedEventUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,m)=>{(g==null?void 0:g.sceneObject)==(m==null?void 0:m.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(m==null?void 0:m.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(r.scale=[r.scale[0]*1.5,r.scale[1]*1.5])),m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(r.scale=[r.scale[0]/1.5,r.scale[1]/1.5])))}))});const s=e.sizeByContent,c=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),w.ESSceneObject.context.getStrFromEnv(sc(g))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),d=new Image;d.src=c,d.onload=()=>{if(s)r.size=[d.width/100,d.height/100];else{const f=e.size;r.size=[f[0]/100,f[1]/100]}},r.uri=c,this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"position"],[e,"position"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),r.pixelSize=void 0,r.useAxis="XZ";{const f=()=>{r.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(r.rotationMode="WithProp",this.d(et([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const u=()=>{const f=e.anchor,g=e.offset;f?r.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:r.originRatioAndOffset=[0,0,0,0]},p=this.ad(l.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>u())),u()}get czmGeoImageModel(){return this._czmGeoImageModel}}const za=class za extends xs{constructor(e,n){super(e,n);v(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(l.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new l.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new m0(this.sceneObject,this.czmViewer):new v0(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:r,resetting:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s&&s.obj&&s.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",r),!0):!1}};v(za,"type",za.register("ESCesiumViewer",w.ESImageLabel.type,za));let op=za;function MI(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const La=class La extends Qt{constructor(e,n){super(e,n);v(this,"_czmImagery");if(this._czmImagery=this.dv(new xn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const s=this.ad(l.reactJson(""));{const d=()=>{if(typeof e.url=="string")s.value=w.ESSceneObject.context.getStrFromEnv(e.url);else{const u=e.url;u.url=w.ESSceneObject.context.getStrFromEnv(u.url),s.value=u}};d(),this.ad(e.urlChanged.don(d))}const a=()=>{var m;if(!s.value)return;const d=(((m=e.options)==null?void 0:m.type)??"auto").toLowerCase(),u=e.options??{};let p={type:"UrlTemplateImageryProvider",url:s.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...u},f=s.value,g=typeof f=="string"?f:f.url;if(d==="auto"){const y=g.toLowerCase();if(y.startsWith("ion://")){const S=+y.substring(6);p={...u,assetId:S,type:"IonImageryProvider"}}else if(y.includes("{x}")||y.includes("{y}")||y.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(y.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(y.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const P=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=P:f.url=P,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(d==="tms"&&g.includes("/tilemapresource.xml")){const y=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=y:f.url=y,p.url=f}else if(d==="ion"&&g.startsWith("ion://")){const P=+g.substring(6);p={...u,assetId:P,type:"IonImageryProvider"}}p.type=MI(d)}console.log("imageryProvider",p),r.imageryProvider=p};a();const c=this.dv(l.createNextAnimateFrameEvent(s.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(c.don(a))}this.d(l.track([r,"show"],[e,"show"])),this.d(l.bind([r,"alpha"],[e,"opacity"])),this.d(l.bind([r,"alpha"],[e,"czmAlpha"])),this.d(l.track([r,"splitDirection"],[e,"splitDirection"])),this.d(l.track([r,"brightness"],[e,"czmBrightness"])),this.d(l.track([r,"contrast"],[e,"czmContrast"])),this.d(l.track([r,"hue"],[e,"czmHue"])),this.d(l.track([r,"saturation"],[e,"czmSaturation"])),this.d(l.track([r,"gamma"],[e,"czmGamma"])),this.d(l.track([r,"rectangle"],[e,"rectangle"])),this.d(l.track([r,"zIndex"],[e,"zIndex"])),this.ad(l.track([r,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s.flyTo(e&&e),o.flyOverEvent.emit(n,"over",r),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):(s.flyTo(e&&e),o.flyOverEvent.emit(n,"over",r),!0):!1}};v(La,"type",La.register("ESCesiumViewer",w.ESImageryLayer.type,La));let rp=La;class II extends l.Destroyable{constructor(e,n,o,r){super();v(this,"_show");v(this,"_czmESCustomPrimitive");v(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(l.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new ke(n,this._sceneObject.id)),this._czmTexture=this.dv(new Le(n));const s=e,a=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(l.track([a,"show"],[this,"show"])),this.dispose(l.track([a,"show"],[s,"show"])),this.dispose(l.track([a,"allowPicking"],[s,"allowPicking"])),this.dispose(l.track([a,"rotation"],[s,"rotation"])),this.dispose(l.track([a,"position"],[s,"position"])),this.dispose(l.track([a,"scale"],[s,"scale"])),this.ad(s.allowPickingChanged.don(()=>{a.allowPicking=s.allowPicking,a.pass=s.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const d=()=>{const p=s.size/2,f=r[0].map(L=>L*p),g=r[1].map(L=>L*p),m=r[2].map(L=>L*p),y=r[3].map(L=>L*p),P=[...f,...g,...m,...y];let S=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(S=S.reverse());const C=[0,0],E=[1,0],T=[1,1],I=[0,1];let b=[];o=="east"||o=="south"?b=[...E,...C,...I,...T]:o=="west"?b=[...E,...T,...I,...C]:o=="top"?b=[...I,...T,...E,...C]:b=[...C,...E,...T,...I],a.indexTypedArray=new Uint16Array(S),a.attributes={position:{typedArray:new Float32Array(P),componentsPerAttribute:3},st:{typedArray:new Float32Array(b),componentsPerAttribute:2}},c.uri=w.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${s.mode}/${o}.${s.mode!="blueSky"?"png":"jpg"}`);const x=n.getCameraInfo();if(x!=null){const U=w.getDistancesFromPositions([s.position,x.position],"NONE")[0]/(s.size/2*s.autoOpacityFactor);this.changeOpacity(s.autoFollow?1:U)}const z=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!z)return;const{min:W,max:N}=z;a.setLocalAxisedBoundingBox(W,N)};d();const u=this.disposeVar(l.createNextAnimateFrameEvent(s.sizeChanged,s.modeChanged));this.dispose(u.disposableOn(d))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class DI extends l.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{s()}));function s(){var c;if(!((c=e.viewer)!=null&&c.camera))return;const a=e.getCameraInfo();if(a!=null&&(r==null||r.position[0]!=a.position[0]||r.position[1]!=a.position[1]||r.position[2]!=a.position[2]||r.rotation[0]!=a.rotation[0]||r.rotation[1]!=a.rotation[1]||r.rotation[2]!=a.rotation[2])){r=a;const u=w.getDistancesFromPositions([i.position,r.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=r.position,o&&(o=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(u)})}}s()}}const Ke=class Ke extends Ce{constructor(e,n){super(e,n);v(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ke._defaultLocalBox&&Ke._firstLoad&&(Ke._firstLoad=!1,Ke._defaultLocalBox=n.xbsjLocalBoxSources),Ke._eSLocalSkyBoxArr.push(e),this.d(()=>{Ke._eSLocalSkyBoxArr.includes(e)&&Ke._eSLocalSkyBoxArr.splice(Ke._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const r={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const s in r)if(Object.prototype.hasOwnProperty.call(r,s)){const a=r[s];this._czmSkyBoxComponents.push(this.dv(new II(e,n,s,a)))}{const s=this.disposeVar(l.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new l.ObjResettingWithEvent(s,()=>(this.ChangeAutoFollow(),new DI(e,n,this._czmSkyBoxComponents))))}{const s=()=>{this.ChangeAutoFollow()},a=this.disposeVar(l.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(a.disposableOn(s))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ke._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=Ke._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ke._defaultLocalBox)}Ke._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ke._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const s=o.size??w.ESLocalSkyBox.defaults.size;return o.position?(Jt(r,o,n,o.position,s,e,!0),!0):!1}}};v(Ke,"type",Ke.register("ESCesiumViewer",w.ESLocalSkyBox.type,Ke)),v(Ke,"_defaultLocalBox"),v(Ke,"_firstLoad",!0),v(Ke,"_eSLocalSkyBoxArr",[]);let sp=Ke;const oi=class oi extends Ce{constructor(e,n){super(e,n);v(this,"_geoCustomDivPoi");v(this,"_textFunc",this.disposeVar(l.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new $e(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"position"],[e,"position"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(s=>{(e.allowPicking??w.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(s)})),this.dispose(r.innerHtmlMounted.disposableOn(s=>{const a=s.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=c=>r.pickFromDiv(a,{type:"viewerPicking",pointerEvent:c}))}));{const s=()=>{if(!e.position)return;const c=(this.textFunc??oi.defaultTextFunc_度格式)(e.position);r.innerHTML=oo(c)};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(s))}{const s=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?oi.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?oi.defaultTextFunc_度分格式:oi.defaultTextFunc_度分秒格式};s(),this.d(n.lonLatFormatChanged.don(()=>{s()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s.flyTo(e),o.flyOverEvent.emit(n,"over",r),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):(s.flyTo(e),o.flyOverEvent.emit(n,"over",r),!0):!1}};v(oi,"type",oi.register("ESCesiumViewer",w.ESLocationMeasurement.type,oi)),v(oi,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,r=0]=e;return`经度: ${n.toFixed(5)}°
|
|
1253
|
+
`,Ye=class Ye extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_loadFuncReact",this.disposeVar(l.react(void 0)));v(this,"_dataSource",this.disposeVar(l.react(void 0)));v(this,"_data");v(this,"_defaultHeight",{});v(this,"_defaultBoundingSphere",new h.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{r()});{const s=this.dv(l.createProcessingFromAsyncFunc(async d=>{this.dataSource&&r(),this.url&&(typeof this.url=="object"?this._data=this.url:w.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(w.ESSceneObject.context.getStrFromEnv(this.url)).then(u=>u.json()).then(u=>{this._data=u}).catch(u=>{console.warn("ESGeoJson数据加载失败",u)}),this.dataSource=await h.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(u=>{var f,g;const p=[];for(const m of u.entities.values)if(h.Entity.prototype&&(m.ESSceneObjectID=n),this._isEntityShow(m,e),m.polygon&&p.push(...(f=m.polygon.hierarchy)==null?void 0:f.getValue(h.JulianDate.now()).positions),m.polyline&&p.push(...(g=m.polyline.positions)==null?void 0:g.getValue(h.JulianDate.now())),m.position){const y=m.position.getValue(h.JulianDate.now());y&&p.push(y)}this._defaultBoundingSphere=h.BoundingSphere.fromPoints(p)}))})),a=()=>{s.isRunning&&s.cancel(),s.restart()};a();const c=this.dv(l.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(c.don(a))}{const s=()=>{var c,d;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(u){console.error(u)}else{const u=this.dataSource.entities.values;for(let p=0;p<u.length;p++){const f=u[p];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(c=f.polygon.height)==null?void 0:c.getValue(h.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new h.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new h.ConstantProperty(!this.fillGround),f.polygon.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new h.ConstantProperty(this.filled??Ye.defaults.filled),f.polygon.material=new h.ColorMaterialProperty(new h.Color(...this.fillColor??Ye.defaults.fillColor)),f.polygon.outline=new h.ConstantProperty(!1),f.polyline=new h.PolylineGraphics;const g=JSON.parse(JSON.stringify((d=f.polygon.hierarchy)==null?void 0:d.getValue(h.JulianDate.now()).positions));h.Cartesian3.equals(g[0],g[g.length-1])||g.push(g[0]),f.polyline.positions=g}if(f.polyline&&(f.polyline.show=new h.ConstantProperty(this.stroked??Ye.defaults.stroked),f.polyline.width=new h.ConstantProperty(this.strokeWidth??Ye.defaults.strokeWidth),f.polyline.material=new h.ColorMaterialProperty(new h.Color(...this.strokeColor??Ye.defaults.strokeColor)),f.polyline.clampToGround=new h.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new h.ConstantProperty(this.imageShow??Ye.defaults.imageShow),f.billboard.width=new h.ConstantProperty(this.imageSize?this.imageSize[0]:Ye.defaults.imageSize[0]),f.billboard.height=new h.ConstantProperty(this.imageSize?this.imageSize[1]:Ye.defaults.imageSize[1]);const g=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:Ye.defaults.imageUrl;f.billboard.image=new h.ConstantProperty(w.ESSceneObject.context.getStrFromEnv(g)),f.billboard.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.billboard.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND);const m=this.imageAnchor??Ye.defaults.imageAnchor,y=this.imageOffset??Ye.defaults.imageOffset;if(f.billboard.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-m[0]*f.billboard.width.getValue(h.JulianDate.now())+y[0],-m[1]*f.billboard.height.getValue(h.JulianDate.now())+y[1]])),f.label=new h.LabelGraphics,!f.label)return;f.label.show=new h.ConstantProperty(this.textShow??Ye.defaults.textShow),f.label.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.label.text=new h.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??Ye.defaults.textDefaultText),f.label.fillColor=new h.ConstantProperty(new h.Color(...this.textColor??Ye.defaults.textColor)),f.label.showBackground=new h.ConstantProperty(this.textBackgroundColor!=null);const P=this.textFontSize&&this.textFontSize!=0?this.textFontSize:Ye.defaults.textFontSize,S=this.textOffset??Ye.defaults.textOffset;f.label.backgroundColor=new h.ConstantProperty(new h.Color(...this.textBackgroundColor??Ye.defaults.textBackgroundColor)),f.label.font=new h.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${P}px ${this.textFontFamily??Ye.defaults.textFontFamily}`),f.label.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.label.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.label.eyeOffset=new h.ConstantProperty(h.Cartesian3.fromArray([0,0,-1]));const C=this.textAnchor??Ye.defaults.textAnchor;f.label.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-C[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(h.JulianDate.now()),f.label.font.getValue(h.JulianDate.now())))+S[0],-C[1]*((this.textBackgroundColor?10:0)+P)+S[1]]))}}}};s();const a=this.dv(l.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged));this.dispose(a.don(s))}{const s=()=>{if(!this.dataSource)return;const c=this.dataSource.entities.values;for(let d=0;d<c.length;d++){const u=c[d];this._isEntityShow(u,e)}};s();const a=this.ad(l.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(a.don(s))}{const s=()=>{if(this.loadFuncStr)try{const a=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=a}catch(a){console.error(a),this.loadFun=void 0}else this.loadFun=void 0};s(),this.dispose(this.loadFuncStrChanged.disposableOn(s))}this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&this.dataSource&&(s!==void 0?o.flyTo(this.dataSource,{duration:s/1e3}).then(a=>{a||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:s/1e3})}):o.flyTo(this.dataSource).then(a=>{a||o.camera.flyToBoundingSphere(this._defaultBoundingSphere)}))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,n="16px sans-serif"){const r=document.createElement("canvas").getContext("2d");return r.font=n,r.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=n.viewer)!=null&&o.camera&&this.show){let r;if(e.polygon&&e.polygon.hierarchy)r=w.getMinMaxCorner(e.polygon.hierarchy.getValue(h.JulianDate.now()).positions.map(c=>ce(c))).center;else if(e.polyline&&e.polyline.positions)r=w.getMinMaxCorner(e.polyline.positions.getValue(h.JulianDate.now()).map(c=>ce(c))).center;else if(e.position){const c=e.position.getValue(h.JulianDate.now());c&&(r=ce(c))}if(!r||isNaN(r[0]))return;const s=w.getDistancesFromPositions([r,Vt(n.viewer.camera)],"NONE")[0];let a=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?a=this.minFeatureVisibleDistance<s&&s<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?a=s>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(a=s<this.maxFeatureVisibleDistance),e.show=this.show&&a}}};v(Ye,"defaults",{show:!0,allowPicking:!0,url:f0,defaultLoadFuncStr:p0,defaultLoadFuncDocStr:TI,data:EI,dataMd:AI,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Eo=Ye;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:l.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:l.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:l.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:l.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:l.reactArrayWithUndefined(void 0),imageAnchor:l.reactArrayWithUndefined(void 0),imageOffset:l.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:l.reactArrayWithUndefined(void 0),textBackgroundColor:l.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:l.reactArrayWithUndefined(void 0),textOffset:l.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE"})})(Eo||(Eo={})),l.extendClassProps(Eo.prototype,Eo.createDefaultProps);const Da=class Da extends Qt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Eo(e,i.id));this.dispose(l.track([o,"show"],[i,"show"])),this.dispose(l.track([o,"allowPicking"],[i,"allowPicking"])),this.dispose(l.track([o,"loadFuncStr"],[i,"loadFuncStr"])),this.dispose(l.track([o,"url"],[i,"features"])),this.dispose(l.track([o,"stroked"],[i,"stroked"])),this.dispose(l.track([o,"strokeWidth"],[i,"strokeWidth"])),this.dispose(l.track([o,"strokeWidthType"],[i,"strokeWidthType"])),this.dispose(l.track([o,"strokeColor"],[i,"strokeColor"])),this.dispose(l.track([o,"strokeMaterial"],[i,"strokeMaterial"])),this.dispose(l.track([o,"strokeMaterialParams"],[i,"strokeMaterialParams"])),this.dispose(l.track([o,"strokeGround"],[i,"strokeGround"])),this.dispose(l.track([o,"filled"],[i,"filled"])),this.dispose(l.track([o,"fillColor"],[i,"fillColor"])),this.dispose(l.track([o,"fillMaterial"],[i,"fillMaterial"])),this.dispose(l.track([o,"fillMaterialParams"],[i,"fillMaterialParams"])),this.dispose(l.track([o,"fillGround"],[i,"fillGround"])),this.dispose(l.track([o,"imageShow"],[i,"imageShow"])),this.dispose(l.track([o,"imageUrl"],[i,"imageUrl"])),this.dispose(l.track([o,"imageSize"],[i,"imageSize"])),this.dispose(l.track([o,"imageAnchor"],[i,"imageAnchor"])),this.dispose(l.track([o,"imageOffset"],[i,"imageOffset"])),this.dispose(l.track([o,"textShow"],[i,"textShow"])),this.dispose(l.track([o,"textProperty"],[i,"textProperty"])),this.dispose(l.track([o,"textDefaultText"],[i,"textDefaultText"])),this.dispose(l.track([o,"textColor"],[i,"textColor"])),this.dispose(l.track([o,"textBackgroundColor"],[i,"textBackgroundColor"])),this.dispose(l.track([o,"textFontFamily"],[i,"textFontFamily"])),this.dispose(l.track([o,"textFontSize"],[i,"textFontSize"])),this.dispose(l.track([o,"textFontStyle"],[i,"textFontStyle"])),this.dispose(l.track([o,"textFontWeight"],[i,"textFontWeight"])),this.dispose(l.track([o,"textAnchor"],[i,"textAnchor"])),this.dispose(l.track([o,"textOffset"],[i,"textOffset"])),this.dispose(l.track([o,"minFeatureVisibleDistance"],[i,"minFeatureVisibleDistance"])),this.dispose(l.track([o,"maxFeatureVisibleDistance"],[i,"maxFeatureVisibleDistance"])),this.dispose(l.track([o,"heightReference"],[i,"heightReference"])),this.dispose(i.flyToEvent.disposableOn(r=>{if(e.actived){if(i.flyInParam){const{position:s,rotation:a,flyDuration:c}=i.flyInParam;return se(e.viewer,s,void 0,a,c),!0}o.flyTo(r&&r*1e3)}}));{const r=async(s,a,c)=>{if(!e.actived)return;const d=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(s,a)));if(!(!d||!(d!=null&&d.positions)))if(d.type=="Point"||d.type=="MultiPoint")Jt(e,i,this.id,await this._calculateFeatureHeight(d.type=="MultiPoint"?d.positions.flat():d.positions,i.heightReference,e),1e3,c);else{const u=d.type=="Polygon"||d.type=="MultiPolygon"||d.type=="MultiLineString";let p=[];u?p=d.positions.flat(d.type=="MultiPolygon"?2:1).map(y=>this._calculateFeatureHeight(y,i.fillGround?"CLAMP_TO_GROUND":"NONE",e)):p=d.positions.map(y=>this._calculateFeatureHeight(y,i.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:f,maxPos:g,center:m}=w.getMinMaxCorner(p);Jt(e,i,this.id,m,w.getDistancesFromPositions([f,g],"NONE")[0],c)}};this.d(i.flyToFeatureEvent.don((s,a,c)=>r(s,a,c))),this.d(i.flyToFeatureIndexEvent.don((s,a)=>r(s,void 0,a)))}}_getFeatureByIndexOrProperties(i,e){var s,a,c,d,u,p,f,g;const{sceneObject:n}=this,o=n.features;if(!o)return;const r=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(r){if(e){let m=r.find(y=>(y==null?void 0:y.properties[i])==e);return{type:m!=null&&m.coordinates?m.type:(s=m==null?void 0:m.geometry)==null?void 0:s.type,positions:(m==null?void 0:m.coordinates)||((a=m==null?void 0:m.geometry)==null?void 0:a.coordinates)}}else if(typeof i=="number")return{type:(c=r[i])!=null&&c.coordinates?r[i].type:(u=(d=r[i])==null?void 0:d.geometry)==null?void 0:u.type,positions:((p=r[i])==null?void 0:p.coordinates)||((g=(f=r[i])==null?void 0:f.geometry)==null?void 0:g.coordinates)}}}async _calculateFeatureHeight(i,e,n){const o=[...i];return e=="NONE"?o[2]=o[2]??0:e=="CLAMP_TO_GROUND"||!o[2]?o[2]=await n.getTerrainHeight(o)??0:o[2]+=await n.getTerrainHeight(o)??0,o}};v(Da,"type",Da.register("ESCesiumViewer",w.ESGeoJson.type,Da));let Ju=Da;const ba=class ba extends vt{constructor(e,n){super(e,n);v(this,"_czmGeoESRectangle");v(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ie(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Ci(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,s=this._geoPolyline;s.arcType="RHUMB",this.dispose(l.track([s,"color"],[e,"strokeColor"])),this.dispose(l.track([s,"width"],[e,"strokeWidth"])),this.dispose(l.track([s,"ground"],[e,"strokeGround"])),this.dispose(l.track([r,"ground"],[e,"fillGround"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.show=e.show&&e.stroked,r.show=e.show&&e.filled};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(c.disposableOn(a))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(a))}{const a=()=>{const c=e.points;if(c&&c.length>=2){const{minPos:d,maxPos:u}=w.getMinMaxCorner(c);r.rectangle=[d[0],d[1],u[0],u[1]],r.height=c[0][2],r.extrudedHeight=c[0][2];const p=c.map(y=>(c&&(y[2]=c[0][2]),y)),f=p[0],g=p[1],m=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];s.positions=[...m,f]}else r.rectangle=void 0,s.positions=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(ae(r,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmGeoESRectangle:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):o.points?(ae(r,o,n,o.points,e),!0):!1:!1}};v(ba,"type",ba.register("ESCesiumViewer",w.ESGeoRectangle.type,ba));let Bu=ba;class Os extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new _n(e,n));const{geoPolygon:o}=this;this.dispose(l.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(s=>{o.flyTo(s)})),this.dispose(l.bind([o,"show"],[this,"show"])),this.dispose(l.bind([o,"fill"],[this,"filled"])),this.dispose(l.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(l.bind([o,"ground"],[this,"ground"])),this.dispose(l.bind([o,"outline"],[this,"outline"])),this.dispose(l.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(l.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(l.bind([o,"color"],[this,"color"])),this.dispose(l.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const s=wd([...this.positions,this.positions[0]]);o.positions=s}else o.positions=void 0};r(),this.dispose(this.positionsChanged.disposableOn(r))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:l.reactArray([1,1,1,1]),outlineWidth:1,color:l.reactArrayWithUndefined([1,1,1,.5]),positions:l.reactPositions(void 0),depth:0})})(Os||(Os={})),l.extendClassProps(Os.prototype,Os.createDefaultProps);const Ra=class Ra extends vt{constructor(e,n){super(e,n);v(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Os(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"positions"],[e,"points"])),this.dispose(l.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(l.track([r,"outline"],[e,"stroked"])),this.dispose(l.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(l.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(l.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(l.track([r,"filled"],[e,"filled"])),this.dispose(l.track([r,"color"],[e,"fillColor"])),this.dispose(l.track([r,"ground"],[e,"ground"]));{const s=()=>{r.ground=e.ground||e.fillGround};s();const a=this.dv(l.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(a.don(s))}{const s=()=>{r.color=e.filled?e.fillColor:Ls.defaults.fillStyle.color};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}};v(Ra,"type",Ra.register("ESCesiumViewer",Ls.type,Ra));let ju=Ra;const xa=class xa extends Ce{constructor(e,n){super(e,n);v(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new at(n,e.id));const r=this._czmModel;this.d(r.readyEvent.don(a=>{r.gltf.animations&&(r.activeAnimationsJson=r.gltf.animations.map((c,d)=>({index:d,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),e.czmModelReadyEvent.emit(a)})),this.ad(new rc(o,this._czmModel)),this.d(l.track([r,"show"],[e,"show"])),this.d(l.track([r,"color"],[e,"czmColor"])),this.d(l.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(l.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(l.bind([r,"position"],[e,"position"])),this.d(l.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(l.track([r,"scale"],[e,"scale"])),this.ad(l.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(l.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const a=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};a(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>a(c)))}{const a=()=>{var c,d;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(d=e.czmEnvironmentMapManager)==null?void 0:d.atmosphereScatteringIntensity)};a(),this.ad(e.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const c=[...e.rotation??[0,0,0]];c[0]+=e.instances&&e.instances.length!=0?0:90,r.rotation=c};a(),this.d(e.rotationChanged.don(a));{const c=()=>{if(a(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(d=>{const u=JSON.parse(JSON.stringify(d));return!u.rotation&&(u.rotation=[0,0,0]),u.rotation[0]+=90,u})};c(),this.ad(e.instancesChanged.don(c))}}this.ad(e.setMaterialEvent.don(a=>{r.setMaterial(a)}));{const a=()=>{const c=[...r.rotation];c[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=c};a(),this.d(r.rotationChanged.don(a))}{const a=this.dv(l.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};c(),this.d(a.don(c))}const s=()=>{r.url=w.ESSceneObject.context.getStrFromEnv(sc(typeof e.url=="string"?e.url:e.url.url))};s(),this.d(e.urlChanged.don(s)),this.d(e.setNodePositionEvent.don((a,c)=>{r.setNodeTranslation(a,c)})),this.d(e.setNodeRotationEvent.don((a,c)=>{r.setNodeRotation(a,c)})),this.d(e.setNodeScaleEvent.don((a,c)=>{r.setNodeScale(a,c)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:r,model:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(s&&It(r,o,n,e,s,!0),!!s):!1}};v(xa,"type",xa.register("ESCesiumViewer",w.ESGltfModel.type,xa));let ep=xa;function g0(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class Ns extends l.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new l.Event));v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_distance",this.disposeVar(l.react(0)));v(this,"_surfaceDistance",this.disposeVar(l.react(0)));v(this,"_height",this.disposeVar(l.react(0)));v(this,"_middlePosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));v(this,"_heightPosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const s=this._surfaceDistance.value=w.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="RHUMB"){const s=this._surfaceDistance.value=w.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="NONE"){const s=w.lbhToXyz(this.positions[0]),a=w.lbhToXyz(this.positions[1]);this._distance.value=g0(s,a),this._surfaceDistance.value=g0(w.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const s=this.disposeVar(new Ie(e,n));s.ground=!1,s.loop=!1,this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([s,"arcType"],[this,"arcType"])),this.dispose(l.bind([s,"color"],[this,"color"])),this.dispose(l.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(l.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(l.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(l.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(l.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(l.bind([s,"show"],[this,"show"])),this.dispose(l.bind([s,"width"],[this,"width"])),this.dispose(l.bind([s,"depthTest"],[this,"depthTest"]));{s.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[d,u]=this.positions;s.positions=[d,u,[d[0],d[1],u[2]]]}else s.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&s.flyTo(c)}));const a=this.disposeVar(new $e(e,n));this.dispose(l.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(l.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(l.track([a,"show"],[this,"show"]));{const c=()=>{a.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{a.innerHTML=oo(`高度: ${ac(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(a.pickedEvent.don(c=>{Wi(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:l.reactPositions(void 0),width:1,color:l.reactArray([1,1,1,1]),hasDash:!1,gapColor:l.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Ns||(Ns={})),l.extendClassProps(Ns.prototype,Ns.createDefaultProps);const Fa=class Fa extends vt{constructor(e,n){super(e,n);v(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Ns(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(l.bind([r,"positions"],[e,"points"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const d=e.strokeMaterial??"normal";d==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):d==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const u=e.strokeStyle;if(u.material==="hasDash"&&u.materialParams)try{const p=u.materialParams;Reflect.has(p,"gapColor")&&(r.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(r.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(r.dashPattern=p.dashPattern)}catch(p){console.error(p)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{Wi(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}};v(Fa,"type",Fa.register("ESCesiumViewer",w.ESHeightMeasurement.type,Fa));let tp=Fa;const ip={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},ka=class ka extends Ce{constructor(e,n){super(e,n);v(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new at(n,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"position"],[e,"position"])),this.dispose(et([r,"rotation"],[e,"rotation"])),this.dispose(l.bind([r,"scale"],[e,"scale"]));{const y=this.dv(l.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),P=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};P(),this.d(y.don(P))}const s=w.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),a=w.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),c=w.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),d=w.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),u=w.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=w.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":r.url=s;break;case"police":r.url=a;break;case"pedestrian":r.url=c;break;case"stranger":r.url=d;break;case"suitMan":r.url=u;break;case"suitWoman":r.url=p;break;default:r.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const g=()=>{const y=e.animation??w.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}y==="walking"?r.activeAnimationsJson=ip.czmAnimationsWalk:y==="standing"?r.activeAnimationsJson=ip.czmAnimationsStand:y==="running"&&(r.activeAnimationsJson=ip.czmAnimationsRun)};g();const m=this.ad(l.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(m.disposableOn(()=>g())),this.ad(new rc(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(s&&It(r,o,n,e,s,!0),!!s)}};v(ka,"type",ka.register("ESCesiumViewer",w.ESHuman.type,ka));let np=ka;class m0 extends w.Destroyable{constructor(e,n){super();v(this,"_czmGeoCanvasImagePoi");v(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){se(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Kt,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new vi(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=u=>{let p=u;return u.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+u.split("inner://")[1]),w.ESSceneObject.context.getStrFromEnv(sc(p))},s=()=>{const u=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=u,e.sizeByContent){const f=new Image;f.src=u,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},a=this.disposeVar(l.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(a.disposableOn(()=>s())),s(),this.d(l.track([o,"zOrder"],[e,"zOrder"])),this.dispose(l.track([o,"show"],[e,"show"])),this.dispose(l.bind([o,"position"],[e,"position"])),this.ad(l.bind([o,"isHoverZoom"],[e,"isHoverZoom"]));{const u=()=>{o.scale=[e.scale[1],e.scale[2]]};u(),this.dispose(e.scaleChanged.don(u))}const c=()=>{const u=e.anchor,p=e.offset;u?o.originRatioAndOffset=[...u,-p[0],-p[1]]:o.originRatioAndOffset=[0,0,0,0]},d=this.ad(l.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(d.disposableOn(()=>c())),c(),this.dispose(o.clickEvent.disposableOn(u=>{const{offsetX:p,offsetY:f}=u,m={type:u.button===0?"leftClick":u.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(m)})),this.dispose(o.hoveredChanged.disposableOn(u=>{if(u===void 0)return;const p={type:u?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class v0 extends w.Destroyable{constructor(e,n,o){super();v(this,"_czmGeoImageModel");v(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});v(this,"_isPointEvent",!1);v(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return Jt(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new Hi(n,e.id));const r=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,m,y;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((m=this._eventInfo.add)==null?void 0:m.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((y=this._eventInfo.add)==null?void 0:y.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),w.registerCreatedEventUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,m)=>{(g==null?void 0:g.sceneObject)==(m==null?void 0:m.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(m==null?void 0:m.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(r.scale=[r.scale[0]*1.5,r.scale[1]*1.5])),m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(r.scale=[r.scale[0]/1.5,r.scale[1]/1.5])))}))});const s=e.sizeByContent,c=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),w.ESSceneObject.context.getStrFromEnv(sc(g))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),d=new Image;d.src=c,d.onload=()=>{if(s)r.size=[d.width/100,d.height/100];else{const f=e.size;r.size=[f[0]/100,f[1]/100]}},r.uri=c,this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"position"],[e,"position"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),r.pixelSize=void 0,r.useAxis="XZ";{const f=()=>{r.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(r.rotationMode="WithProp",this.d(et([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const u=()=>{const f=e.anchor,g=e.offset;f?r.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:r.originRatioAndOffset=[0,0,0,0]},p=this.ad(l.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>u())),u()}get czmGeoImageModel(){return this._czmGeoImageModel}}const za=class za extends xs{constructor(e,n){super(e,n);v(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(l.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new l.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new m0(this.sceneObject,this.czmViewer):new v0(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:r,resetting:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s&&s.obj&&s.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",r),!0):!1}};v(za,"type",za.register("ESCesiumViewer",w.ESImageLabel.type,za));let op=za;function MI(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const La=class La extends Qt{constructor(e,n){super(e,n);v(this,"_czmImagery");if(this._czmImagery=this.dv(new xn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const s=this.ad(l.reactJson(""));{const d=()=>{if(typeof e.url=="string")s.value=w.ESSceneObject.context.getStrFromEnv(e.url);else{const u=e.url;u.url=w.ESSceneObject.context.getStrFromEnv(u.url),s.value=u}};d(),this.ad(e.urlChanged.don(d))}const a=()=>{var m;if(!s.value)return;const d=(((m=e.options)==null?void 0:m.type)??"auto").toLowerCase(),u=e.options??{};let p={type:"UrlTemplateImageryProvider",url:s.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...u},f=s.value,g=typeof f=="string"?f:f.url;if(d==="auto"){const y=g.toLowerCase();if(y.startsWith("ion://")){const S=+y.substring(6);p={...u,assetId:S,type:"IonImageryProvider"}}else if(y.includes("{x}")||y.includes("{y}")||y.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(y.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(y.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const P=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=P:f.url=P,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(d==="tms"&&g.includes("/tilemapresource.xml")){const y=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=y:f.url=y,p.url=f}else if(d==="ion"&&g.startsWith("ion://")){const P=+g.substring(6);p={...u,assetId:P,type:"IonImageryProvider"}}p.type=MI(d)}console.log("imageryProvider",p),r.imageryProvider=p};a();const c=this.dv(l.createNextAnimateFrameEvent(s.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(c.don(a))}this.d(l.track([r,"show"],[e,"show"])),this.d(l.bind([r,"alpha"],[e,"opacity"])),this.d(l.bind([r,"alpha"],[e,"czmAlpha"])),this.d(l.track([r,"splitDirection"],[e,"splitDirection"])),this.d(l.track([r,"brightness"],[e,"czmBrightness"])),this.d(l.track([r,"contrast"],[e,"czmContrast"])),this.d(l.track([r,"hue"],[e,"czmHue"])),this.d(l.track([r,"saturation"],[e,"czmSaturation"])),this.d(l.track([r,"gamma"],[e,"czmGamma"])),this.d(l.track([r,"rectangle"],[e,"rectangle"])),this.d(l.track([r,"zIndex"],[e,"zIndex"])),this.ad(l.track([r,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s.flyTo(e&&e),o.flyOverEvent.emit(n,"over",r),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):(s.flyTo(e&&e),o.flyOverEvent.emit(n,"over",r),!0):!1}};v(La,"type",La.register("ESCesiumViewer",w.ESImageryLayer.type,La));let rp=La;class II extends l.Destroyable{constructor(e,n,o,r){super();v(this,"_show");v(this,"_czmESCustomPrimitive");v(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(l.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new ke(n,this._sceneObject.id)),this._czmTexture=this.dv(new Le(n));const s=e,a=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(l.track([a,"show"],[this,"show"])),this.dispose(l.track([a,"show"],[s,"show"])),this.dispose(l.track([a,"allowPicking"],[s,"allowPicking"])),this.dispose(l.track([a,"rotation"],[s,"rotation"])),this.dispose(l.track([a,"position"],[s,"position"])),this.dispose(l.track([a,"scale"],[s,"scale"])),this.ad(s.allowPickingChanged.don(()=>{a.allowPicking=s.allowPicking,a.pass=s.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const d=()=>{const p=s.size/2,f=r[0].map(L=>L*p),g=r[1].map(L=>L*p),m=r[2].map(L=>L*p),y=r[3].map(L=>L*p),P=[...f,...g,...m,...y];let S=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(S=S.reverse());const C=[0,0],E=[1,0],T=[1,1],I=[0,1];let b=[];o=="east"||o=="south"?b=[...E,...C,...I,...T]:o=="west"?b=[...E,...T,...I,...C]:o=="top"?b=[...I,...T,...E,...C]:b=[...C,...E,...T,...I],a.indexTypedArray=new Uint16Array(S),a.attributes={position:{typedArray:new Float32Array(P),componentsPerAttribute:3},st:{typedArray:new Float32Array(b),componentsPerAttribute:2}},c.uri=w.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${s.mode}/${o}.${s.mode!="blueSky"?"png":"jpg"}`);const x=n.getCameraInfo();if(x!=null){const U=w.getDistancesFromPositions([s.position,x.position],"NONE")[0]/(s.size/2*s.autoOpacityFactor);this.changeOpacity(s.autoFollow?1:U)}const z=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!z)return;const{min:W,max:N}=z;a.setLocalAxisedBoundingBox(W,N)};d();const u=this.disposeVar(l.createNextAnimateFrameEvent(s.sizeChanged,s.modeChanged));this.dispose(u.disposableOn(d))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class DI extends l.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{s()}));function s(){var c;if(!((c=e.viewer)!=null&&c.camera))return;const a=e.getCameraInfo();if(a!=null&&(r==null||r.position[0]!=a.position[0]||r.position[1]!=a.position[1]||r.position[2]!=a.position[2]||r.rotation[0]!=a.rotation[0]||r.rotation[1]!=a.rotation[1]||r.rotation[2]!=a.rotation[2])){r=a;const u=w.getDistancesFromPositions([i.position,r.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=r.position,o&&(o=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(u)})}}s()}}const Ke=class Ke extends Ce{constructor(e,n){super(e,n);v(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ke._defaultLocalBox&&Ke._firstLoad&&(Ke._firstLoad=!1,Ke._defaultLocalBox=n.xbsjLocalBoxSources),Ke._eSLocalSkyBoxArr.push(e),this.d(()=>{Ke._eSLocalSkyBoxArr.includes(e)&&Ke._eSLocalSkyBoxArr.splice(Ke._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const r={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const s in r)if(Object.prototype.hasOwnProperty.call(r,s)){const a=r[s];this._czmSkyBoxComponents.push(this.dv(new II(e,n,s,a)))}{const s=this.disposeVar(l.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new l.ObjResettingWithEvent(s,()=>(this.ChangeAutoFollow(),new DI(e,n,this._czmSkyBoxComponents))))}{const s=()=>{this.ChangeAutoFollow()},a=this.disposeVar(l.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(a.disposableOn(s))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ke._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=Ke._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ke._defaultLocalBox)}Ke._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ke._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const s=o.size??w.ESLocalSkyBox.defaults.size;return o.position?(Jt(r,o,n,o.position,s,e,!0),!0):!1}}};v(Ke,"type",Ke.register("ESCesiumViewer",w.ESLocalSkyBox.type,Ke)),v(Ke,"_defaultLocalBox"),v(Ke,"_firstLoad",!0),v(Ke,"_eSLocalSkyBoxArr",[]);let sp=Ke;const oi=class oi extends Ce{constructor(e,n){super(e,n);v(this,"_geoCustomDivPoi");v(this,"_textFunc",this.disposeVar(l.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new $e(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"position"],[e,"position"])),this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(s=>{(e.allowPicking??w.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(s)})),this.dispose(r.innerHtmlMounted.disposableOn(s=>{const a=s.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=c=>r.pickFromDiv(a,{type:"viewerPicking",pointerEvent:c}))}));{const s=()=>{if(!e.position)return;const c=(this.textFunc??oi.defaultTextFunc_度格式)(e.position);r.innerHTML=oo(c)};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(s))}{const s=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?oi.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?oi.defaultTextFunc_度分格式:oi.defaultTextFunc_度分秒格式};s(),this.d(n.lonLatFormatChanged.don(()=>{s()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s.flyTo(e),o.flyOverEvent.emit(n,"over",r),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):(s.flyTo(e),o.flyOverEvent.emit(n,"over",r),!0):!1}};v(oi,"type",oi.register("ESCesiumViewer",w.ESLocationMeasurement.type,oi)),v(oi,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,r=0]=e;return`经度: ${n.toFixed(5)}°
|
|
1254
1254
|
纬度: ${o.toFixed(5)}°
|
|
1255
1255
|
高度: ${r.toFixed(2)}m`}),v(oi,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[n,o,r]=md(e,!0);return`经度: ${n}
|
|
1256
1256
|
纬度: ${o}
|
|
@@ -1459,7 +1459,7 @@ ${p0}
|
|
|
1459
1459
|
#endif
|
|
1460
1460
|
|
|
1461
1461
|
czm_material material = czm_getMaterial(materialInput);
|
|
1462
|
-
`))})}return i};var ZI=h.ShadowVolumeAppearance.prototype.createVertexShader;h.ShadowVolumeAppearance.prototype.createVertexShader=function(t,i,e,n){var o=ZI.bind(this)(t,i,e,n);if(this._appearance.isCameraVideo){var r=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];r.forEach(function(s){var a=o.defines.indexOf(s);a!==-1&&o.defines.splice(a,1)}),o.defines.push("XBSJ_CAMERA_VIDEO")}return o};var QI=new h.Cartesian3;function _0(t){var i=new h.Cartesian3(-1,-1,-1),e=new h.Cartesian3(1,1,1);i.y+=1.001,e.y+=1.001;var n=new Float64Array(
|
|
1462
|
+
`))})}return i};var ZI=h.ShadowVolumeAppearance.prototype.createVertexShader;h.ShadowVolumeAppearance.prototype.createVertexShader=function(t,i,e,n){var o=ZI.bind(this)(t,i,e,n);if(this._appearance.isCameraVideo){var r=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];r.forEach(function(s){var a=o.defines.indexOf(s);a!==-1&&o.defines.splice(a,1)}),o.defines.push("XBSJ_CAMERA_VIDEO")}return o};var QI=new h.Cartesian3;function _0(t){var i=new h.Cartesian3(-1,-1,-1),e=new h.Cartesian3(1,1,1);i.y+=1.001,e.y+=1.001;var n=new Float64Array(24);n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=e.x,n[4]=i.y,n[5]=i.z,n[6]=e.x,n[7]=e.y,n[8]=i.z,n[9]=i.x,n[10]=e.y,n[11]=i.z,n[12]=i.x,n[13]=i.y,n[14]=e.z,n[15]=e.x,n[16]=i.y,n[17]=e.z,n[18]=e.x,n[19]=e.y,n[20]=e.z,n[21]=i.x,n[22]=e.y,n[23]=e.z;var o=new h.GeometryAttributes;o.position=new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n});var r=new Uint16Array(36);r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;for(var s=0;s<36;s+=3)r[s]=r[s]^r[s+2],r[s+2]=r[s]^r[s+2],r[s]=r[s]^r[s+2];var a;t&&(a=new Uint16Array(24),a[0]=0,a[1]=1,a[2]=1,a[3]=2,a[4]=2,a[5]=3,a[6]=3,a[7]=0,a[8]=4,a[9]=5,a[10]=5,a[11]=6,a[12]=6,a[13]=7,a[14]=7,a[15]=4,a[16]=0,a[17]=4,a[18]=1,a[19]=5,a[20]=2,a[21]=6,a[22]=3,a[23]=7);var c=h.Cartesian3.subtract(e,i,QI),d=h.Cartesian3.magnitude(c)*.5;return new h.Geometry({attributes:o,indices:t?a:r,primitiveType:t?h.PrimitiveType.LINES:h.PrimitiveType.TRIANGLES,boundingSphere:new h.BoundingSphere(h.Cartesian3.ZERO,d)})}var KI=`
|
|
1463
1463
|
in vec3 position3DHigh;
|
|
1464
1464
|
in vec3 position3DLow;
|
|
1465
1465
|
in vec4 color;
|
|
@@ -1480,7 +1480,7 @@ void main()
|
|
|
1480
1480
|
p.w = 1.0;
|
|
1481
1481
|
gl_Position = czm_projection * p;
|
|
1482
1482
|
}
|
|
1483
|
-
`;function Vs(t){if(!h.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var i=h.defaultValue(t.showHelperPrimitive,!1);this.inverseViewMatrix=h.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new h.Matrix4,h.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new h.PerspectiveFrustum({fov:h.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new h.Matrix4,this._primitiveModelMatrix=new h.Matrix4,this._inverseBoxMV=new h.Matrix4;var e=this,n={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new h.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:h.Material.DefaultImageId},components:{diffuse:"texture(image, fract(materialInput.st)).rgb",alpha:"texture(alphaImage, fract(materialInput.st)).r"}}});{const d=o._uniforms.image_0;o._uniforms.image_0=()=>{const u=this.videoTextureFunc&&this.videoTextureFunc();return u||d()}}{const d=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const u=this.alphaTextureFunc&&this.alphaTextureFunc();return u||d()}}var r=new h.MaterialAppearance({material:o,closed:!1});r._vertexFormat=h.VertexFormat.POSITION_ONLY,r.isCameraVideo=!0;var s=new h.ClassificationPrimitive({geometryInstances:new h.GeometryInstance({geometry:_0(),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0),isCameraVideo:new h.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:h.ClassificationType.CESIUM_3D_TILE,_uniformMap:n,appearance:r,asynchronous:!1,compressVertices:!1,allowPicking:!1});s.isCameraVideo=!0,Object.defineProperties(s,{_sp:{set:function(d){if(this.__sp!==d){if(d){var u=d,p=u.vertexShaderSource;p.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&p.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=u}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=s;var a=new h.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:KI});a.uniforms={u_boxMV:this._boxMV};var c=new h.Primitive({geometryInstances:new h.GeometryInstance({geometry:_0(!0),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:a,asynchronous:!1,compressVertices:!1,cull:!1,show:i});this._helperPrimitive=c,this._projectionMatrix=new h.Matrix4,this._inverseViewProjectionMatrix=new h.Matrix4,this._viewProjectionMatrix=new h.Matrix4,this.show=!0}Vs.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new h.Cartesian3,this._scratchBS=this._scratchBS||new h.BoundingSphere;const s=h.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),a=this.frustum.far,c=this._scratchBS;if(h.Cartesian3.clone(s,c.center),c.radius=a,t.cullingVolume.computeVisibility(c)===h.Intersect.OUTSIDE)return;const d=t.camera;if(d&&d.getPixelSize&&Vi(d._scene,c.center,20)>c.radius)return}var i=h.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=h.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(i||h.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||h.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!i||!e){var n=this._inverseViewProjectionMatrix;h.Matrix4.inverse(this._projectionMatrix,n),h.Matrix4.multiply(this._inverseViewMatrix,n,n);var o=this._viewProjectionMatrix;h.Matrix4.inverse(n,o);var r=this._primitiveModelMatrix;h.Matrix4.fromUniformScale(this.frustum.far,r),h.Matrix4.multiply(this._inverseViewMatrix,r,r),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),h.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),h.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(Vs.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),Vs.prototype.isDestroyed=function(){return!1},Vs.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),h.destroyObject(this)};class Fr extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_resetWithCameraInfoEvent",this.disposeVar(new l.Event));v(this,"_sharedCzmTexture");v(this,"_fovy",this.disposeVar(l.react(0)));v(this,"_fovyUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const r=n(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(r-this.fovy)<1e-5||(this.fovy=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=n(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());v(this,"_fovx",this.disposeVar(l.react(0)));v(this,"_fovxUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const r=n(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(r-this.fovx)<1e-5||(this.fovx=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=n(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());v(this,"_xbsjCameraVideoResettingEvent");v(this,"_xbsjCameraVideoResetting");v(this,"_id",this.disposeVar(l.react(l.createGuid())));n&&(this.id=n);{const r=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};r(),this.ad(this.czmTextureIdChanged.don(r))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new l.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new BI(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const r=e.getCameraInfo();r&&(this.position=r.position,this.rotation=r.rotation)})),this.dispose(this.flyToEvent.disposableOn(r=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}se(e.viewer,this.position,0,this.rotation,r)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}get sharedCzmTexture(){return this._sharedCzmTexture}getCurrentCzmTexture(){return this._sharedCzmTexture}get fovy(){return this._fovy.value}set fovy(e){this._fovy.value=e}get fovyChanged(){return this._fovy.changed}get fovx(){return this._fovx.value}set fovx(e){this._fovx.value=e}get fovxChanged(){return this._fovx.changed}get xbsjCameraVideoResetting(){return this._xbsjCameraVideoResetting}get xbsjCameraVideoChanged(){return this._xbsjCameraVideoResetting.objChanged}get xbsjCameraVideo(){var e;return(e=this._xbsjCameraVideoResetting.obj)==null?void 0:e.xbsjCameraVideo}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(Fr,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(Fr||(Fr={})),l.extendClassProps(Fr.prototype,Fr.createDefaultProps);var dh=new h.Matrix3;function JI(t,i){const{position:e,heading:n,pitch:o,roll:r}=t,s=h.Transforms.eastNorthUpToFixedFrame(e,void 0,i);var a=h.Matrix3.fromRotationX(h.Math.PI_OVER_TWO,dh);return h.Matrix4.multiplyByMatrix3(s,a,s),a=h.Matrix3.fromRotationY(-n,dh),h.Matrix4.multiplyByMatrix3(s,a,s),a=h.Matrix3.fromRotationX(o,dh),h.Matrix4.multiplyByMatrix3(s,a,s),a=h.Matrix3.fromRotationZ(-r,dh),h.Matrix4.multiplyByMatrix3(s,a,s),s}class BI extends l.Destroyable{constructor(e,n){super();v(this,"_xbsjCameraVideo");const{viewer:o}=n;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:r}=e;if(!r)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[s,a,c]}=e,d=h.Math.toRadians,u=h.Cartesian3.fromDegrees(...r),p=JI({position:u,heading:d(s),pitch:d(a),roll:d(c)}),{fov:f,aspectRatio:g,near:m,far:y}=e,P=new h.PerspectiveFrustum({fov:d(f),aspectRatio:g,near:m,far:y}),S=new Vs({inverseViewMatrix:p,frustum:P,showHelperPrimitive:!0});this._xbsjCameraVideo=S,this.dispose(()=>S.destroy()),S.ESSceneObjectID=e.id,o.scene.primitives.add(S),this.dispose(()=>o.scene.primitives.remove(S));{const C=()=>{const E=e.getCurrentCzmTexture();if(E&&E instanceof Le)return E.texture};this.xbsjCameraVideo.videoTextureFunc=C}{const C=()=>{S.showHelperPrimitive=e.showHelperPrimitive};C(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(C))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const qa=class qa extends Ce{constructor(e,n){super(e,n);v(this,"_czmCameraVideo");v(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new Fr(n,e.id)),this._czmTexture=this.dv(new Le(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:r}=this,{czmTexture:s}=this;r.czmTextureId=s.id,this.d(l.track([r,"show"],[e,"show"])),this.d(l.bind([r,"position"],[e,"position"])),this.d(et([r,"rotation"],[e,"rotation"])),this.d(l.track([r,"showHelperPrimitive"],[e,"showFrustum"])),this.d(l.track([s,"uriType"],[e,"videoStreamType"]));{const a=()=>{const d=e.fov??w.ESVideoFusion.defaults.fov,u=e.aspectRatio??w.ESVideoFusion.defaults.aspectRatio;r.fovx=h.Math.clamp(d,.001,179.9),r.aspectRatio=h.Math.clamp(u,.001,Number.MAX_SAFE_INTEGER)};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(c.disposableOn(a))}{const a=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};a(),this.ad(e.farChanged.don(a)),this.d(l.track([e,"far"],[r,"far"]))}{const a=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};a(),this.ad(e.nearChanged.don(a))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{r.fovx=e.fov}));{const a=()=>{e.videoStreamUrl&&(s.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};a(),this.d(e.videoStreamUrlChanged.disposableOn(a))}{const a=()=>{s.loop=e.looping};a(),this.d(e.loopingChanged.don(a))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{r.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const s=o.far??w.ESVideoFusion.defaults.far;return o.position?(Jt(r,o,n,o.position,s,e),!0):!1}}};v(qa,"type",qa.register("ESCesiumViewer",w.ESVideoFusion.type,qa));let mp=qa;function jI(t,i){const e=t,n=i,o=Math.cos,r=Math.sin;var s=[o(-e)*o(-n),r(-e)*o(-n),r(-n)];return s}function P0(t,i,e){return t*(-.5+e/i)}function S0(t,i,e,n){const o=new Float32Array((e+1)*(n+1)*3+3);for(let r=0;r<e+1;++r)for(let s=0;s<n+1;++s){const a=jI(P0(t,e,r),P0(i,n,s));o[(s*(e+1)+r)*3+0]=a[0],o[(s*(e+1)+r)*3+1]=a[1],o[(s*(e+1)+r)*3+2]=a[2]}return o[(e+1)*(n+1)*3+0]=0,o[(e+1)*(n+1)*3+1]=0,o[(e+1)*(n+1)*3+2]=0,o}function eD(t,i){var e=new Uint16Array(t*i*6);for(let n=0;n<t;++n)for(let o=0;o<i;++o){const r=o*(t+1)+n,s=o*(t+1)+n+1,a=(o+1)*(t+1)+n,c=(o+1)*(t+1)+n+1,d=(o*t+n)*6;e[d+0]=r,e[d+1]=s,e[d+2]=c,e[d+3]=r,e[d+4]=c,e[d+5]=a}return e}function tD(t,i,e,n){const o=t*e,r=i*n,s=new Uint16Array((t+1)*(r*2)+(i+1)*(o*2)+4*2);for(let g=0;g<t+1;++g)for(let m=0;m<r;++m){const y=g*e;s[(g*r+m)*2+0]=m*(o+1)+y,s[(g*r+m)*2+1]=(m+1)*(o+1)+y}const a=(t+1)*(r*2);for(let g=0;g<i+1;++g)for(let m=0;m<o;++m){const y=g*n;s[a+(m+g*o)*2+0]=y*(o+1)+m,s[a+(m+g*o)*2+1]=y*(o+1)+m+1}const c=(t+1)*(r*2)+(i+1)*(o*2),d=0,u=o,p=(o+1)*r,f=(o+1)*(r+1)-1;return s[c+0]=d,s[c+1]=(o+1)*(r+1),s[c+2]=u,s[c+3]=(o+1)*(r+1),s[c+4]=p,s[c+5]=(o+1)*(r+1),s[c+6]=f,s[c+7]=(o+1)*(r+1),s}var iD=`
|
|
1483
|
+
`;function Vs(t){if(!h.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var i=h.defaultValue(t.showHelperPrimitive,!1);this.inverseViewMatrix=h.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new h.Matrix4,h.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new h.PerspectiveFrustum({fov:h.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new h.Matrix4,this._primitiveModelMatrix=new h.Matrix4,this._inverseBoxMV=new h.Matrix4;var e=this,n={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new h.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:h.Material.DefaultImageId},components:{diffuse:"texture(image, fract(materialInput.st)).rgb",alpha:"texture(alphaImage, fract(materialInput.st)).r"}}});{const d=o._uniforms.image_0;o._uniforms.image_0=()=>{const u=this.videoTextureFunc&&this.videoTextureFunc();return u||d()}}{const d=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const u=this.alphaTextureFunc&&this.alphaTextureFunc();return u||d()}}var r=new h.MaterialAppearance({material:o,closed:!1});r._vertexFormat=h.VertexFormat.POSITION_ONLY,r.isCameraVideo=!0;var s=new h.ClassificationPrimitive({geometryInstances:new h.GeometryInstance({geometry:_0(),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0),isCameraVideo:new h.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:h.ClassificationType.CESIUM_3D_TILE,_uniformMap:n,appearance:r,asynchronous:!1,compressVertices:!1,allowPicking:!1});s.isCameraVideo=!0,Object.defineProperties(s,{_sp:{set:function(d){if(this.__sp!==d){if(d){var u=d,p=u.vertexShaderSource;p.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&p.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=u}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=s;var a=new h.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:KI});a.uniforms={u_boxMV:this._boxMV};var c=new h.Primitive({geometryInstances:new h.GeometryInstance({geometry:_0(!0),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:a,asynchronous:!1,compressVertices:!1,cull:!1,show:i});this._helperPrimitive=c,this._projectionMatrix=new h.Matrix4,this._inverseViewProjectionMatrix=new h.Matrix4,this._viewProjectionMatrix=new h.Matrix4,this.show=!0}Vs.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new h.Cartesian3,this._scratchBS=this._scratchBS||new h.BoundingSphere;const s=h.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),a=this.frustum.far,c=this._scratchBS;if(h.Cartesian3.clone(s,c.center),c.radius=a,t.cullingVolume.computeVisibility(c)===h.Intersect.OUTSIDE)return;const d=t.camera;if(d&&d.getPixelSize&&Vi(d._scene,c.center,20)>c.radius)return}var i=h.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=h.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(i||h.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||h.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!i||!e){var n=this._inverseViewProjectionMatrix;h.Matrix4.inverse(this._projectionMatrix,n),h.Matrix4.multiply(this._inverseViewMatrix,n,n);var o=this._viewProjectionMatrix;h.Matrix4.inverse(n,o);var r=this._primitiveModelMatrix;h.Matrix4.fromUniformScale(this.frustum.far,r),h.Matrix4.multiply(this._inverseViewMatrix,r,r),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),h.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),h.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(Vs.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),Vs.prototype.isDestroyed=function(){return!1},Vs.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),h.destroyObject(this)};class Fr extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_resetWithCameraInfoEvent",this.disposeVar(new l.Event));v(this,"_sharedCzmTexture");v(this,"_fovy",this.disposeVar(l.react(0)));v(this,"_fovyUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const r=n(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(r-this.fovy)<1e-5||(this.fovy=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=n(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());v(this,"_fovx",this.disposeVar(l.react(0)));v(this,"_fovxUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const r=n(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(r-this.fovx)<1e-5||(this.fovx=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=n(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());v(this,"_xbsjCameraVideoResettingEvent");v(this,"_xbsjCameraVideoResetting");v(this,"_id",this.disposeVar(l.react(l.createGuid())));n&&(this.id=n);{const r=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};r(),this.ad(this.czmTextureIdChanged.don(r))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new l.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new BI(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const r=e.getCameraInfo();r&&(this.position=r.position,this.rotation=r.rotation)})),this.dispose(this.flyToEvent.disposableOn(r=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}se(e.viewer,this.position,0,this.rotation,r)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}get sharedCzmTexture(){return this._sharedCzmTexture}getCurrentCzmTexture(){return this._sharedCzmTexture}get fovy(){return this._fovy.value}set fovy(e){this._fovy.value=e}get fovyChanged(){return this._fovy.changed}get fovx(){return this._fovx.value}set fovx(e){this._fovx.value=e}get fovxChanged(){return this._fovx.changed}get xbsjCameraVideoResetting(){return this._xbsjCameraVideoResetting}get xbsjCameraVideoChanged(){return this._xbsjCameraVideoResetting.objChanged}get xbsjCameraVideo(){var e;return(e=this._xbsjCameraVideoResetting.obj)==null?void 0:e.xbsjCameraVideo}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(Fr,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(Fr||(Fr={})),l.extendClassProps(Fr.prototype,Fr.createDefaultProps);var dh=new h.Matrix3;function JI(t,i){const{position:e,heading:n,pitch:o,roll:r}=t,s=h.Transforms.eastNorthUpToFixedFrame(e,void 0,i);var a=h.Matrix3.fromRotationX(h.Math.PI_OVER_TWO,dh);return h.Matrix4.multiplyByMatrix3(s,a,s),a=h.Matrix3.fromRotationY(-n,dh),h.Matrix4.multiplyByMatrix3(s,a,s),a=h.Matrix3.fromRotationX(o,dh),h.Matrix4.multiplyByMatrix3(s,a,s),a=h.Matrix3.fromRotationZ(-r,dh),h.Matrix4.multiplyByMatrix3(s,a,s),s}class BI extends l.Destroyable{constructor(e,n){super();v(this,"_xbsjCameraVideo");const{viewer:o}=n;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:r}=e;if(!r)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[s,a,c]}=e,d=h.Math.toRadians,u=h.Cartesian3.fromDegrees(...r),p=JI({position:u,heading:d(s),pitch:d(a),roll:d(c)}),{fov:f,aspectRatio:g,near:m,far:y}=e,P=new h.PerspectiveFrustum({fov:d(f),aspectRatio:g,near:m,far:y}),S=new Vs({inverseViewMatrix:p,frustum:P,showHelperPrimitive:!0});this._xbsjCameraVideo=S,this.dispose(()=>S.destroy()),S.ESSceneObjectID=e.id,o.scene.primitives.add(S),this.dispose(()=>o.scene.primitives.remove(S));{const C=()=>{const E=e.getCurrentCzmTexture();if(E&&E instanceof Le)return E.texture};this.xbsjCameraVideo.videoTextureFunc=C}{const C=()=>{S.showHelperPrimitive=e.showHelperPrimitive};C(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(C))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const qa=class qa extends Ce{constructor(e,n){super(e,n);v(this,"_czmCameraVideo");v(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new Fr(n,e.id)),this._czmTexture=this.dv(new Le(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:r}=this,{czmTexture:s}=this;r.czmTextureId=s.id,this.d(l.track([r,"show"],[e,"show"])),this.d(l.bind([r,"position"],[e,"position"])),this.d(et([r,"rotation"],[e,"rotation"])),this.d(l.track([r,"showHelperPrimitive"],[e,"showFrustum"])),this.d(l.track([s,"uriType"],[e,"videoStreamType"]));{const a=()=>{const d=e.fov??w.ESVideoFusion.defaults.fov,u=e.aspectRatio??w.ESVideoFusion.defaults.aspectRatio;r.fovx=h.Math.clamp(d,.001,179.9),r.aspectRatio=h.Math.clamp(u,.001,Number.MAX_SAFE_INTEGER)};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(c.disposableOn(a))}{const a=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};a(),this.ad(e.farChanged.don(a)),this.d(l.track([e,"far"],[r,"far"]))}{const a=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};a(),this.ad(e.nearChanged.don(a))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{r.fovx=e.fov}));{const a=()=>{e.videoStreamUrl&&(s.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};a(),this.d(e.videoStreamUrlChanged.disposableOn(a))}{const a=()=>{s.loop=e.looping};a(),this.d(e.loopingChanged.don(a))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{r.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const s=o.far??w.ESVideoFusion.defaults.far;return o.position?(Jt(r,o,n,o.position,s,e),!0):!1}}};v(qa,"type",qa.register("ESCesiumViewer",w.ESVideoFusion.type,qa));let mp=qa;function jI(t,i){const e=t,n=i,o=Math.cos,r=Math.sin;var s=[o(-e)*o(-n),r(-e)*o(-n),r(-n)];return s}function P0(t,i,e){return t*(-.5+e/i)}function S0(t,i,e,n){const o=new Float32Array((e+1)*(n+1)*3+3);for(let r=0;r<e+1;++r)for(let s=0;s<n+1;++s){const a=jI(P0(t,e,r),P0(i,n,s));o[(s*(e+1)+r)*3+0]=a[0],o[(s*(e+1)+r)*3+1]=a[1],o[(s*(e+1)+r)*3+2]=a[2]}return o[(e+1)*(n+1)*3+0]=0,o[(e+1)*(n+1)*3+1]=0,o[(e+1)*(n+1)*3+2]=0,o}function eD(t,i){var e=new Uint16Array(t*i*6);for(let n=0;n<t;++n)for(let o=0;o<i;++o){const r=o*(t+1)+n,s=o*(t+1)+n+1,a=(o+1)*(t+1)+n,c=(o+1)*(t+1)+n+1,d=(o*t+n)*6;e[d+0]=r,e[d+1]=s,e[d+2]=c,e[d+3]=r,e[d+4]=c,e[d+5]=a}return e}function tD(t,i,e,n){const o=t*e,r=i*n,s=new Uint16Array((t+1)*(r*2)+(i+1)*(o*2)+8);for(let g=0;g<t+1;++g)for(let m=0;m<r;++m){const y=g*e;s[(g*r+m)*2+0]=m*(o+1)+y,s[(g*r+m)*2+1]=(m+1)*(o+1)+y}const a=(t+1)*(r*2);for(let g=0;g<i+1;++g)for(let m=0;m<o;++m){const y=g*n;s[a+(m+g*o)*2+0]=y*(o+1)+m,s[a+(m+g*o)*2+1]=y*(o+1)+m+1}const c=(t+1)*(r*2)+(i+1)*(o*2),d=0,u=o,p=(o+1)*r,f=(o+1)*(r+1)-1;return s[c+0]=d,s[c+1]=(o+1)*(r+1),s[c+2]=u,s[c+3]=(o+1)*(r+1),s[c+4]=p,s[c+5]=(o+1)*(r+1),s[c+6]=f,s[c+7]=(o+1)*(r+1),s}var iD=`
|
|
1484
1484
|
// vtxf 使用double类型的position进行计算
|
|
1485
1485
|
// in vec3 position3DHigh;
|
|
1486
1486
|
// in vec3 position3DLow;
|
|
@@ -1854,7 +1854,7 @@ function (result, this, instanceIndex, frameState) {
|
|
|
1854
1854
|
result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
|
|
1855
1855
|
return result;
|
|
1856
1856
|
}\`\`\`
|
|
1857
|
-
`,Xn=class Xn extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_player");v(this,"_finalImageUrlReact",this.disposeVar(w.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));v(this,"_routePaths",this.disposeVar(l.react(void 0)));v(this,"routePathCallback");v(this,"_id",this.disposeVar(l.react(l.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new w.Player);{const g=Xn.defaults;this.dispose(l.bind([this._player,"loop"],[this,"loop"],m=>m??g.loop,m=>m??g.loop)),this.dispose(l.bind([this._player,"currentTime"],[this,"currentTime"],m=>m??g.currentTime,m=>m??g.currentTime)),this.dispose(l.bind([this._player,"duration"],[this,"duration"],m=>m??g.duration,m=>m??g.duration)),this.dispose(l.bind([this._player,"playing"],[this,"playing"],m=>m??g.playing,m=>m??g.playing)),this.dispose(l.bind([this._player,"speed"],[this,"speed"],m=>m??g.speed,m=>m??g.speed))}const o=this.disposeVar(w.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(l.createProcessingFromAsyncFunc(async g=>{this.routePaths=void 0;const m=o.value;if(m)try{const P=await(await fetch(m)).json();this.routePaths=FD(P,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(P=>({positions:P,width:this.width}));return}}}));{const g=()=>{r.restart()};g();const m=this.disposeVar(l.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(m.disposableOn(g))}{const g=()=>{const m=gd(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);m&&(this.routePathCallback=m)};g(),this.dispose(this.routePathCallbackStrChanged.disposableOn(g))}const s=e.viewer;if(!s){console.warn("viewer is undefined!");return}const a=this.finalImageUrlReact,c=this.disposeVar(new Ko),d=this.disposeVar(l.createProcessingFromAsyncFunc(async g=>{if(!a.value)return;const m=sv(s.scene.context).getTextureHandler(a.value);if(m instanceof Ko)c.reset(m);else{const y=await g.promise(m);c.reset(y)}})),u=()=>c.valid?c.raw:s.scene.context.defaultTexture,p=()=>d.restart();p(),this.dispose(a.changed.disposableOn(p));const f=this.ad(l.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new l.ObjResettingWithEvent(f,()=>this.routePaths?new QD(s,this,a.value&&u||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(g=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))se(s,this.routePaths[0].startPos,s.camera.positionCartographic.height,void 0,g);else{const m=computeBoundingSphere(this.routePaths[0].positions);if(!m)return;const[y,P]=m;se(s,y,P*3,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};v(Xn,"whiteGradientImageBase64",KD),v(Xn,"defaultRoutePathCallback",function(e,n,o){const r=n/50,s=r-Math.floor(r);return e.color=[s*.5+.5,(1-s)*.5+.5,.5,1],e.bgColor=[s*.5+.5,(1-s)*.5+.5,.5,.3],e}),v(Xn,"routePathCallbackStrMd",JD),v(Xn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Xn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let Ki=Xn;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:l.reactArray([0,1,0,1]),bgColor:l.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:l.reactPositionsSet(void 0),data:l.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Ki||(Ki={})),l.extendClassProps(Ki.prototype,Ki.createDefaultProps);class Ji extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_collection");this._collection=this.disposeVar(new Ki(e,n)),this.dispose(l.track([this._collection,"show"],[this,"show"])),this.dispose(l.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(l.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(l.track([this._collection,"color"],[this,"color"])),this.dispose(l.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(l.track([this._collection,"width"],[this,"width"])),this.dispose(l.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(l.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(l.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(l.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(l.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(l.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(l.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(l.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([this._collection,"playing"],[this,"playing"])),this.dispose(l.track([this._collection,"loop"],[this,"loop"])),this.dispose(l.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(l.bind([this._collection,"duration"],[this,"duration"])),this.dispose(l.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((s,a)=>{var c;if(!(!this.positions||a==((c=this.positions)==null?void 0:c.length)-1))return{startPos:s,endPos:this.positions[a+1],width:this.width,heightRatio:this.heightRatio}}).filter(s=>s!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}v(Ji,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Ji,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:l.reactArray([0,1,0,1]),bgColor:l.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:l.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Ji||(Ji={})),l.extendClassProps(Ji.prototype,Ji.createDefaultProps);const vl=class vl extends vt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Ji(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const s=()=>{r.show=e.show&&e.stroked};s(),this.ad(e.showChanged.don(s)),this.ad(e.strokedChanged.don(s))}this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(l.bind([r,"positions"],[e,"points"])),this.dispose(l.track([r,"width"],[e,"strokeWidth"])),this.dispose(l.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(l.track([r,"startTime"],[e,"startTime"])),this.dispose(l.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(l.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(l.track([r,"arcType"],[e,"arcType"])),this.dispose(l.track([r,"brightening"],[e,"brightening"])),this.dispose(l.track([r,"depthTest"],[e,"depthTest"])),this.dispose(l.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(l.track([r,"repeat"],[e,"repeat"])),this.dispose(l.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(l.track([r,"loop"],[e,"loop"])),this.dispose(l.track([r,"currentTime"],[e,"currentTime"])),this.dispose(l.track([r,"duration"],[e,"duration"])),this.dispose(l.track([r,"playing"],[e,"playing"])),this.dispose(l.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmSignalTransmission:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmSignalTransmission:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}};v(vl,"type",vl.register("ESCesiumViewer",lh.type,vl));let $p=vl;function Do(t){var i=[1/0,1/0,-1/0,-1/0];return gh(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}Do.default=Do;var yh={exports:{}},BD=yh.exports,z0;function jD(){return z0||(z0=1,function(t,i){(function(e,n){t.exports=n()})(BD,function(){function e(C,E,T,I,b){(function x(z,W,N,L,U){for(;L>N;){if(L-N>600){var _=L-N+1,M=W-N+1,F=Math.log(_),V=.5*Math.exp(2*F/3),G=.5*Math.sqrt(F*V*(_-V)/_)*(M-_/2<0?-1:1),Z=Math.max(N,Math.floor(W-M*V/_+G)),$=Math.min(L,Math.floor(W+(_-M)*V/_+G));x(z,W,Z,$,U)}var Y=z[W],K=N,te=L;for(n(z,N,W),U(z[L],Y)>0&&n(z,N,L);K<te;){for(n(z,K,te),K++,te--;U(z[K],Y)<0;)K++;for(;U(z[te],Y)>0;)te--}U(z[N],Y)===0?n(z,N,te):n(z,++te,L),te<=W&&(N=te+1),W<=te&&(L=te-1)}})(C,E,T||0,I||C.length-1,b||o)}function n(C,E,T){var I=C[E];C[E]=C[T],C[T]=I}function o(C,E){return C<E?-1:C>E?1:0}var r=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(C,E,T){if(!T)return E.indexOf(C);for(var I=0;I<E.length;I++)if(T(C,E[I]))return I;return-1}function a(C,E){c(C,0,C.children.length,E,C)}function c(C,E,T,I,b){b||(b=P(null)),b.minX=1/0,b.minY=1/0,b.maxX=-1/0,b.maxY=-1/0;for(var x=E;x<T;x++){var z=C.children[x];d(b,C.leaf?I(z):z)}return b}function d(C,E){return C.minX=Math.min(C.minX,E.minX),C.minY=Math.min(C.minY,E.minY),C.maxX=Math.max(C.maxX,E.maxX),C.maxY=Math.max(C.maxY,E.maxY),C}function u(C,E){return C.minX-E.minX}function p(C,E){return C.minY-E.minY}function f(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function g(C){return C.maxX-C.minX+(C.maxY-C.minY)}function m(C,E){return C.minX<=E.minX&&C.minY<=E.minY&&E.maxX<=C.maxX&&E.maxY<=C.maxY}function y(C,E){return E.minX<=C.maxX&&E.minY<=C.maxY&&E.maxX>=C.minX&&E.maxY>=C.minY}function P(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function S(C,E,T,I,b){for(var x=[E,T];x.length;)if(!((T=x.pop())-(E=x.pop())<=I)){var z=E+Math.ceil((T-E)/I/2)*I;e(C,z,E,T,b),x.push(E,z,z,T)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(C){var E=this.data,T=[];if(!y(C,E))return T;for(var I=this.toBBox,b=[];E;){for(var x=0;x<E.children.length;x++){var z=E.children[x],W=E.leaf?I(z):z;y(C,W)&&(E.leaf?T.push(z):m(C,W)?this._all(z,T):b.push(z))}E=b.pop()}return T},r.prototype.collides=function(C){var E=this.data;if(!y(C,E))return!1;for(var T=[];E;){for(var I=0;I<E.children.length;I++){var b=E.children[I],x=E.leaf?this.toBBox(b):b;if(y(C,x)){if(E.leaf||m(C,x))return!0;T.push(b)}}E=T.pop()}return!1},r.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var E=0;E<C.length;E++)this.insert(C[E]);return this}var T=this._build(C.slice(),0,C.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var I=this.data;this.data=T,T=I}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},r.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},r.prototype.clear=function(){return this.data=P([]),this},r.prototype.remove=function(C,E){if(!C)return this;for(var T,I,b,x=this.data,z=this.toBBox(C),W=[],N=[];x||W.length;){if(x||(x=W.pop(),I=W[W.length-1],T=N.pop(),b=!0),x.leaf){var L=s(C,x.children,E);if(L!==-1)return x.children.splice(L,1),W.push(x),this._condense(W),this}b||x.leaf||!m(x,z)?I?(T++,x=I.children[T],b=!1):x=null:(W.push(x),N.push(T),T=0,I=x,x=x.children[0])}return this},r.prototype.toBBox=function(C){return C},r.prototype.compareMinX=function(C,E){return C.minX-E.minX},r.prototype.compareMinY=function(C,E){return C.minY-E.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(C){return this.data=C,this},r.prototype._all=function(C,E){for(var T=[];C;)C.leaf?E.push.apply(E,C.children):T.push.apply(T,C.children),C=T.pop();return E},r.prototype._build=function(C,E,T,I){var b,x=T-E+1,z=this._maxEntries;if(x<=z)return a(b=P(C.slice(E,T+1)),this.toBBox),b;I||(I=Math.ceil(Math.log(x)/Math.log(z)),z=Math.ceil(x/Math.pow(z,I-1))),(b=P([])).leaf=!1,b.height=I;var W=Math.ceil(x/z),N=W*Math.ceil(Math.sqrt(z));S(C,E,T,N,this.compareMinX);for(var L=E;L<=T;L+=N){var U=Math.min(L+N-1,T);S(C,L,U,W,this.compareMinY);for(var _=L;_<=U;_+=W){var M=Math.min(_+W-1,U);b.children.push(this._build(C,_,M,I-1))}}return a(b,this.toBBox),b},r.prototype._chooseSubtree=function(C,E,T,I){for(;I.push(E),!E.leaf&&I.length-1!==T;){for(var b=1/0,x=1/0,z=void 0,W=0;W<E.children.length;W++){var N=E.children[W],L=f(N),U=(_=C,M=N,(Math.max(M.maxX,_.maxX)-Math.min(M.minX,_.minX))*(Math.max(M.maxY,_.maxY)-Math.min(M.minY,_.minY))-L);U<x?(x=U,b=L<b?L:b,z=N):U===x&&L<b&&(b=L,z=N)}E=z||E.children[0]}var _,M;return E},r.prototype._insert=function(C,E,T){var I=T?C:this.toBBox(C),b=[],x=this._chooseSubtree(I,this.data,E,b);for(x.children.push(C),d(x,I);E>=0&&b[E].children.length>this._maxEntries;)this._split(b,E),E--;this._adjustParentBBoxes(I,b,E)},r.prototype._split=function(C,E){var T=C[E],I=T.children.length,b=this._minEntries;this._chooseSplitAxis(T,b,I);var x=this._chooseSplitIndex(T,b,I),z=P(T.children.splice(x,T.children.length-x));z.height=T.height,z.leaf=T.leaf,a(T,this.toBBox),a(z,this.toBBox),E?C[E-1].children.push(z):this._splitRoot(T,z)},r.prototype._splitRoot=function(C,E){this.data=P([C,E]),this.data.height=C.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(C,E,T){for(var I,b,x,z,W,N,L,U=1/0,_=1/0,M=E;M<=T-E;M++){var F=c(C,0,M,this.toBBox),V=c(C,M,T,this.toBBox),G=(b=F,x=V,z=void 0,W=void 0,N=void 0,L=void 0,z=Math.max(b.minX,x.minX),W=Math.max(b.minY,x.minY),N=Math.min(b.maxX,x.maxX),L=Math.min(b.maxY,x.maxY),Math.max(0,N-z)*Math.max(0,L-W)),Z=f(F)+f(V);G<U?(U=G,I=M,_=Z<_?Z:_):G===U&&Z<_&&(_=Z,I=M)}return I||T-E},r.prototype._chooseSplitAxis=function(C,E,T){var I=C.leaf?this.compareMinX:u,b=C.leaf?this.compareMinY:p;this._allDistMargin(C,E,T,I)<this._allDistMargin(C,E,T,b)&&C.children.sort(I)},r.prototype._allDistMargin=function(C,E,T,I){C.children.sort(I);for(var b=this.toBBox,x=c(C,0,E,b),z=c(C,T-E,T,b),W=g(x)+g(z),N=E;N<T-E;N++){var L=C.children[N];d(x,C.leaf?b(L):L),W+=g(x)}for(var U=T-E-1;U>=E;U--){var _=C.children[U];d(z,C.leaf?b(_):_),W+=g(z)}return W},r.prototype._adjustParentBBoxes=function(C,E,T){for(var I=T;I>=0;I--)d(E[I],C)},r.prototype._condense=function(C){for(var E=C.length-1,T=void 0;E>=0;E--)C[E].children.length===0?E>0?(T=C[E-1].children).splice(T.indexOf(C[E]),1):this.clear():a(C[E],this.toBBox)},r})}(yh)),yh.exports}function _t(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=fh(t),o=Ri(i),r=o.type,s=i.bbox,a=o.coordinates;if(s&&eb(n,s)===!1)return!1;r==="Polygon"&&(a=[a]);for(var c=!1,d=0;d<a.length&&!c;d++)if(L0(n,a[d][0],e.ignoreBoundary)){for(var u=!1,p=1;p<a[d].length&&!u;)L0(n,a[d][p],!e.ignoreBoundary)&&(u=!0),p++;u||(c=!0)}return c}function L0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,r=i.length-1;o<i.length;r=o++){var s=i[o][0],a=i[o][1],c=i[r][0],d=i[r][1],u=t[1]*(s-c)+a*(c-t[0])+d*(t[0]-s)===0&&(s-t[0])*(c-t[0])<=0&&(a-t[1])*(d-t[1])<=0;if(u)return!e;var p=a>t[1]!=d>t[1]&&t[0]<(c-s)*(t[1]-a)/(d-a)+s;p&&(n=!n)}return n}function eb(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function tb(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return O0(t);case"FeatureCollection":return ib(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Xp(t);default:throw new Error("unknown GeoJSON type")}}function O0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=N0(t.properties),i.geometry=Xp(t.geometry),i}function N0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=N0(n):i[e]=n}),i}function ib(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return O0(e)}),i}function Xp(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return Xp(e)}),i):(i.coordinates=V0(t.coordinates),i)}function V0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return V0(e)})}function U0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=AD(t),o=[];switch(n){case"LineString":o=Yp(t);break;case"MultiLineString":case"Polygon":bi(t).forEach(function(s){o.push(Yp(s))});break;case"MultiPolygon":bi(t).forEach(function(s){var a=[];s.forEach(function(c){a.push(Yp(c))}),o.push(a)});break;case"Point":return t;case"MultiPoint":var r={};bi(t).forEach(function(s){var a=s.join("-");Object.prototype.hasOwnProperty.call(r,a)||(o.push(s),r[a]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ii({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Yp(t){var i=bi(t);if(i.length===2&&!W0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var r=1;r<n;r++){var s=e[e.length-1];i[r][0]===s[0]&&i[r][1]===s[1]||(e.push(i[r]),o=e.length,o>2&&G0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,W0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return G0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function W0(t,i){return t[0]===i[0]&&t[1]===i[1]}function G0(t,i,e){var n=e[0],o=e[1],r=t[0],s=t[1],a=i[0],c=i[1],d=n-r,u=o-s,p=a-r,f=c-s,g=d*f-u*p;return g!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?r<=n&&n<=a:a<=n&&n<=r:f>0?s<=o&&o<=c:c<=o&&o<=s}function nb(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return gh(t,function(r){e+=r[0],n+=r[1],o++},!0),zn([e/o,n/o],i.properties)}function H0(t){if(!t)throw new Error("geojson is required");var i=[];return kr(t,function(e){ob(e,i)}),Di(i)}function ob(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=bi(n);break;case"LineString":e=[bi(n)]}e.forEach(function(o){var r=rb(o,t.properties);r.forEach(function(s){s.id=i.length,i.push(s)})})}}function rb(t,i){var e=[];return t.reduce(function(n,o){var r=uh([n,o],i);return r.bbox=sb(n,o),e.push(r),o}),e}function sb(t,i){var e=t[0],n=t[1],o=i[0],r=i[1],s=e<o?e:o,a=n<r?n:r,c=e>o?e:o,d=n>r?n:r;return[s,a,c,d]}var wh={exports:{}},Zp={},q0;function $0(){return q0||(q0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(L,U,_){_===void 0&&(_={});var M={type:"Feature"};return(_.id===0||_.id)&&(M.id=_.id),_.bbox&&(M.bbox=_.bbox),M.properties=U||{},M.geometry=L,M}t.feature=i;function e(L,U,_){switch(L){case"Point":return n(U).geometry;case"LineString":return a(U).geometry;case"Polygon":return r(U).geometry;case"MultiPoint":return p(U).geometry;case"MultiLineString":return u(U).geometry;case"MultiPolygon":return f(U).geometry;default:throw new Error(L+" is invalid")}}t.geometry=e;function n(L,U,_){if(_===void 0&&(_={}),!L)throw new Error("coordinates is required");if(!Array.isArray(L))throw new Error("coordinates must be an Array");if(L.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!x(L[0])||!x(L[1]))throw new Error("coordinates must contain numbers");var M={type:"Point",coordinates:L};return i(M,U,_)}t.point=n;function o(L,U,_){return _===void 0&&(_={}),d(L.map(function(M){return n(M,U)}),_)}t.points=o;function r(L,U,_){_===void 0&&(_={});for(var M=0,F=L;M<F.length;M++){var V=F[M];if(V.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var G=0;G<V[V.length-1].length;G++)if(V[V.length-1][G]!==V[0][G])throw new Error("First and last Position are not equivalent.")}var Z={type:"Polygon",coordinates:L};return i(Z,U,_)}t.polygon=r;function s(L,U,_){return _===void 0&&(_={}),d(L.map(function(M){return r(M,U)}),_)}t.polygons=s;function a(L,U,_){if(_===void 0&&(_={}),L.length<2)throw new Error("coordinates must be an array of two or more positions");var M={type:"LineString",coordinates:L};return i(M,U,_)}t.lineString=a;function c(L,U,_){return _===void 0&&(_={}),d(L.map(function(M){return a(M,U)}),_)}t.lineStrings=c;function d(L,U){U===void 0&&(U={});var _={type:"FeatureCollection"};return U.id&&(_.id=U.id),U.bbox&&(_.bbox=U.bbox),_.features=L,_}t.featureCollection=d;function u(L,U,_){_===void 0&&(_={});var M={type:"MultiLineString",coordinates:L};return i(M,U,_)}t.multiLineString=u;function p(L,U,_){_===void 0&&(_={});var M={type:"MultiPoint",coordinates:L};return i(M,U,_)}t.multiPoint=p;function f(L,U,_){_===void 0&&(_={});var M={type:"MultiPolygon",coordinates:L};return i(M,U,_)}t.multiPolygon=f;function g(L,U,_){_===void 0&&(_={});var M={type:"GeometryCollection",geometries:L};return i(M,U,_)}t.geometryCollection=g;function m(L,U){if(U===void 0&&(U=0),U&&!(U>=0))throw new Error("precision must be a positive number");var _=Math.pow(10,U||0);return Math.round(L*_)/_}t.round=m;function y(L,U){U===void 0&&(U="kilometers");var _=t.factors[U];if(!_)throw new Error(U+" units is invalid");return L*_}t.radiansToLength=y;function P(L,U){U===void 0&&(U="kilometers");var _=t.factors[U];if(!_)throw new Error(U+" units is invalid");return L/_}t.lengthToRadians=P;function S(L,U){return E(P(L,U))}t.lengthToDegrees=S;function C(L){var U=L%360;return U<0&&(U+=360),U}t.bearingToAzimuth=C;function E(L){var U=L%(2*Math.PI);return U*180/Math.PI}t.radiansToDegrees=E;function T(L){var U=L%360;return U*Math.PI/180}t.degreesToRadians=T;function I(L,U,_){if(U===void 0&&(U="kilometers"),_===void 0&&(_="kilometers"),!(L>=0))throw new Error("length must be a positive number");return y(P(L,U),_)}t.convertLength=I;function b(L,U,_){if(U===void 0&&(U="meters"),_===void 0&&(_="kilometers"),!(L>=0))throw new Error("area must be a positive number");var M=t.areaFactors[U];if(!M)throw new Error("invalid original units");var F=t.areaFactors[_];if(!F)throw new Error("invalid final units");return L/M*F}t.convertArea=b;function x(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}t.isNumber=x;function z(L){return!!L&&L.constructor===Object}t.isObject=z;function W(L){if(!L)throw new Error("bbox is required");if(!Array.isArray(L))throw new Error("bbox must be an Array");if(L.length!==4&&L.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");L.forEach(function(U){if(!x(U))throw new Error("bbox must only contain numbers")})}t.validateBBox=W;function N(L){if(!L)throw new Error("id is required");if(["string","number"].indexOf(typeof L)===-1)throw new Error("id must be a number or a string")}t.validateId=N}(Zp)),Zp}var Be={},X0;function Y0(){if(X0)return Be;X0=1,Object.defineProperty(Be,"__esModule",{value:!0});var t=$0();function i(C,E,T){if(C!==null)for(var I,b,x,z,W,N,L,U=0,_=0,M,F=C.type,V=F==="FeatureCollection",G=F==="Feature",Z=V?C.features.length:1,$=0;$<Z;$++){L=V?C.features[$].geometry:G?C.geometry:C,M=L?L.type==="GeometryCollection":!1,W=M?L.geometries.length:1;for(var Y=0;Y<W;Y++){var K=0,te=0;if(z=M?L.geometries[Y]:L,z!==null){N=z.coordinates;var re=z.type;switch(U=T&&(re==="Polygon"||re==="MultiPolygon")?1:0,re){case null:break;case"Point":if(E(N,_,$,K,te)===!1)return!1;_++,K++;break;case"LineString":case"MultiPoint":for(I=0;I<N.length;I++){if(E(N[I],_,$,K,te)===!1)return!1;_++,re==="MultiPoint"&&K++}re==="LineString"&&K++;break;case"Polygon":case"MultiLineString":for(I=0;I<N.length;I++){for(b=0;b<N[I].length-U;b++){if(E(N[I][b],_,$,K,te)===!1)return!1;_++}re==="MultiLineString"&&K++,re==="Polygon"&&te++}re==="Polygon"&&K++;break;case"MultiPolygon":for(I=0;I<N.length;I++){for(te=0,b=0;b<N[I].length;b++){for(x=0;x<N[I][b].length-U;x++){if(E(N[I][b][x],_,$,K,te)===!1)return!1;_++}te++}K++}break;case"GeometryCollection":for(I=0;I<z.geometries.length;I++)if(i(z.geometries[I],E,T)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(C,E,T,I){var b=T;return i(C,function(x,z,W,N,L){z===0&&T===void 0?b=x:b=E(b,x,z,W,N,L)},I),b}function n(C,E){var T;switch(C.type){case"FeatureCollection":for(T=0;T<C.features.length&&E(C.features[T].properties,T)!==!1;T++);break;case"Feature":E(C.properties,0);break}}function o(C,E,T){var I=T;return n(C,function(b,x){x===0&&T===void 0?I=b:I=E(I,b,x)}),I}function r(C,E){if(C.type==="Feature")E(C,0);else if(C.type==="FeatureCollection")for(var T=0;T<C.features.length&&E(C.features[T],T)!==!1;T++);}function s(C,E,T){var I=T;return r(C,function(b,x){x===0&&T===void 0?I=b:I=E(I,b,x)}),I}function a(C){var E=[];return i(C,function(T){E.push(T)}),E}function c(C,E){var T,I,b,x,z,W,N,L,U,_,M=0,F=C.type==="FeatureCollection",V=C.type==="Feature",G=F?C.features.length:1;for(T=0;T<G;T++){for(W=F?C.features[T].geometry:V?C.geometry:C,L=F?C.features[T].properties:V?C.properties:{},U=F?C.features[T].bbox:V?C.bbox:void 0,_=F?C.features[T].id:V?C.id:void 0,N=W?W.type==="GeometryCollection":!1,z=N?W.geometries.length:1,b=0;b<z;b++){if(x=N?W.geometries[b]:W,x===null){if(E(null,M,L,U,_)===!1)return!1;continue}switch(x.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(E(x,M,L,U,_)===!1)return!1;break}case"GeometryCollection":{for(I=0;I<x.geometries.length;I++)if(E(x.geometries[I],M,L,U,_)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function d(C,E,T){var I=T;return c(C,function(b,x,z,W,N){x===0&&T===void 0?I=b:I=E(I,b,x,z,W,N)}),I}function u(C,E){c(C,function(T,I,b,x,z){var W=T===null?null:T.type;switch(W){case null:case"Point":case"LineString":case"Polygon":return E(t.feature(T,b,{bbox:x,id:z}),I,0)===!1?!1:void 0}var N;switch(W){case"MultiPoint":N="Point";break;case"MultiLineString":N="LineString";break;case"MultiPolygon":N="Polygon";break}for(var L=0;L<T.coordinates.length;L++){var U=T.coordinates[L],_={type:N,coordinates:U};if(E(t.feature(_,b),I,L)===!1)return!1}})}function p(C,E,T){var I=T;return u(C,function(b,x,z){x===0&&z===0&&T===void 0?I=b:I=E(I,b,x,z)}),I}function f(C,E){u(C,function(T,I,b){var x=0;if(T.geometry){var z=T.geometry.type;if(!(z==="Point"||z==="MultiPoint")){var W,N=0,L=0,U=0;if(i(T,function(_,M,F,V,G){if(W===void 0||I>N||V>L||G>U){W=_,N=I,L=V,U=G,x=0;return}var Z=t.lineString([W,_],T.properties);if(E(Z,I,b,G,x)===!1)return!1;x++,W=_})===!1)return!1}}})}function g(C,E,T){var I=T,b=!1;return f(C,function(x,z,W,N,L){b===!1&&T===void 0?I=x:I=E(I,x,z,W,N,L),b=!0}),I}function m(C,E){if(!C)throw new Error("geojson is required");u(C,function(T,I,b){if(T.geometry!==null){var x=T.geometry.type,z=T.geometry.coordinates;switch(x){case"LineString":if(E(T,I,b,0,0)===!1)return!1;break;case"Polygon":for(var W=0;W<z.length;W++)if(E(t.lineString(z[W],T.properties),I,b,W)===!1)return!1;break}}})}function y(C,E,T){var I=T;return m(C,function(b,x,z,W){x===0&&T===void 0?I=b:I=E(I,b,x,z,W)}),I}function P(C,E){if(E=E||{},!t.isObject(E))throw new Error("options is invalid");var T=E.featureIndex||0,I=E.multiFeatureIndex||0,b=E.geometryIndex||0,x=E.segmentIndex||0,z=E.properties,W;switch(C.type){case"FeatureCollection":T<0&&(T=C.features.length+T),z=z||C.features[T].properties,W=C.features[T].geometry;break;case"Feature":z=z||C.properties,W=C.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":W=C;break;default:throw new Error("geojson is invalid")}if(W===null)return null;var N=W.coordinates;switch(W.type){case"Point":case"MultiPoint":return null;case"LineString":return x<0&&(x=N.length+x-1),t.lineString([N[x],N[x+1]],z,E);case"Polygon":return b<0&&(b=N.length+b),x<0&&(x=N[b].length+x-1),t.lineString([N[b][x],N[b][x+1]],z,E);case"MultiLineString":return I<0&&(I=N.length+I),x<0&&(x=N[I].length+x-1),t.lineString([N[I][x],N[I][x+1]],z,E);case"MultiPolygon":return I<0&&(I=N.length+I),b<0&&(b=N[I].length+b),x<0&&(x=N[I][b].length-x-1),t.lineString([N[I][b][x],N[I][b][x+1]],z,E)}throw new Error("geojson is invalid")}function S(C,E){if(E=E||{},!t.isObject(E))throw new Error("options is invalid");var T=E.featureIndex||0,I=E.multiFeatureIndex||0,b=E.geometryIndex||0,x=E.coordIndex||0,z=E.properties,W;switch(C.type){case"FeatureCollection":T<0&&(T=C.features.length+T),z=z||C.features[T].properties,W=C.features[T].geometry;break;case"Feature":z=z||C.properties,W=C.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":W=C;break;default:throw new Error("geojson is invalid")}if(W===null)return null;var N=W.coordinates;switch(W.type){case"Point":return t.point(N,z,E);case"MultiPoint":return I<0&&(I=N.length+I),t.point(N[I],z,E);case"LineString":return x<0&&(x=N.length+x),t.point(N[x],z,E);case"Polygon":return b<0&&(b=N.length+b),x<0&&(x=N[b].length+x),t.point(N[b][x],z,E);case"MultiLineString":return I<0&&(I=N.length+I),x<0&&(x=N[I].length+x),t.point(N[I][x],z,E);case"MultiPolygon":return I<0&&(I=N.length+I),b<0&&(b=N[I].length+b),x<0&&(x=N[I][b].length-x),t.point(N[I][b][x],z,E)}throw new Error("geojson is invalid")}return Be.coordAll=a,Be.coordEach=i,Be.coordReduce=e,Be.featureEach=r,Be.featureReduce=s,Be.findPoint=S,Be.findSegment=P,Be.flattenEach=u,Be.flattenReduce=p,Be.geomEach=c,Be.geomReduce=d,Be.lineEach=m,Be.lineReduce=y,Be.propEach=n,Be.propReduce=o,Be.segmentEach=f,Be.segmentReduce=g,Be}var Ch={},Z0;function ab(){if(Z0)return Ch;Z0=1,Object.defineProperty(Ch,"__esModule",{value:!0});var t=Y0();function i(e){var n=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){n[0]>o[0]&&(n[0]=o[0]),n[1]>o[1]&&(n[1]=o[1]),n[2]<o[0]&&(n[2]=o[0]),n[3]<o[1]&&(n[3]=o[1])}),n}return i.default=i,Ch.default=i,Ch}var Q0;function lb(){if(Q0)return wh.exports;Q0=1;var t=jD(),i=$0(),e=Y0(),n=ab().default,o=e.featureEach;e.coordEach,i.polygon;var r=i.featureCollection;function s(a){var c=new t(a);return c.insert=function(d){if(d.type!=="Feature")throw new Error("invalid feature");return d.bbox=d.bbox?d.bbox:n(d),t.prototype.insert.call(this,d)},c.load=function(d){var u=[];return Array.isArray(d)?d.forEach(function(p){if(p.type!=="Feature")throw new Error("invalid features");p.bbox=p.bbox?p.bbox:n(p),u.push(p)}):o(d,function(p){if(p.type!=="Feature")throw new Error("invalid features");p.bbox=p.bbox?p.bbox:n(p),u.push(p)}),t.prototype.load.call(this,u)},c.remove=function(d,u){if(d.type!=="Feature")throw new Error("invalid feature");return d.bbox=d.bbox?d.bbox:n(d),t.prototype.remove.call(this,d,u)},c.clear=function(){return t.prototype.clear.call(this)},c.search=function(d){var u=t.prototype.search.call(this,this.toBBox(d));return r(u)},c.collides=function(d){return t.prototype.collides.call(this,this.toBBox(d))},c.all=function(){var d=t.prototype.all.call(this);return r(d)},c.toJSON=function(){return t.prototype.toJSON.call(this)},c.fromJSON=function(d){return t.prototype.fromJSON.call(this,d)},c.toBBox=function(d){var u;if(d.bbox)u=d.bbox;else if(Array.isArray(d)&&d.length===4)u=d;else if(Array.isArray(d)&&d.length===6)u=[d[0],d[1],d[3],d[4]];else if(d.type==="Feature")u=n(d);else if(d.type==="FeatureCollection")u=n(d);else throw new Error("invalid geojson");return{minX:u[0],minY:u[1],maxX:u[2],maxY:u[3]}},c}return wh.exports=s,wh.exports.default=s,wh.exports}var cb=lb();const hb=mc(cb);function Qp(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Ii(t)),i.type==="LineString"&&(i=Ii(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=K0(t,i);return o&&n.push(o),Di(n)}var r=hb();return r.load(H0(i)),mh(H0(t),function(s){mh(r.search(s),function(a){var c=K0(s,a);if(c){var d=bi(c).join(",");e[d]||(e[d]=!0,n.push(c))}})}),Di(n)}function K0(t,i){var e=bi(t),n=bi(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],s=e[1][0],a=e[1][1],c=n[0][0],d=n[0][1],u=n[1][0],p=n[1][1],f=(p-d)*(s-o)-(u-c)*(a-r),g=(u-c)*(r-d)-(p-d)*(o-c),m=(s-o)*(r-d)-(a-r)*(o-c);if(f===0)return null;var y=g/f,P=m/f;if(y>=0&&y<=1&&P>=0&&P<=1){var S=o+y*(s-o),C=r+y*(a-r);return zn([S,C])}return null}function _h(t,i,e){e===void 0&&(e={});for(var n=fh(t),o=bi(i),r=0;r<o.length-1;r++){var s=!1;if(e.ignoreEndVertices&&(r===0&&(s="start"),r===o.length-2&&(s="end"),r===0&&r+1===o.length-1&&(s="both")),db(o[r],o[r+1],n,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function db(t,i,e,n,o){var r=e[0],s=e[1],a=t[0],c=t[1],d=i[0],u=i[1],p=e[0]-a,f=e[1]-c,g=d-a,m=u-c,y=p*m-f*g;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(m)?g>0?a<r&&r<=d:d<=r&&r<a:m>0?c<s&&s<=u:u<=s&&s<c;if(n==="end")return Math.abs(g)>=Math.abs(m)?g>0?a<=r&&r<d:d<r&&r<=a:m>0?c<=s&&s<u:u<s&&s<=c;if(n==="both")return Math.abs(g)>=Math.abs(m)?g>0?a<r&&r<d:d<r&&r<a:m>0?c<s&&s<u:u<s&&s<c}else return Math.abs(g)>=Math.abs(m)?g>0?a<=r&&r<=d:d<=r&&r<=a:m>0?c<=s&&s<=u:u<=s&&s<=c;return!1}function ub(t,i){var e=Ri(t),n=Ri(i),o=e.type,r=n.type;switch(o){case"Point":switch(r){case"MultiPoint":return pb(e,n);case"LineString":return _h(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return _t(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return fb(e,n);case"LineString":return gb(e,n);case"Polygon":case"MultiPolygon":return mb(e,n);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return vb(e,n);case"Polygon":case"MultiPolygon":return yb(e,n);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return wb(e,n);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function pb(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(B0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function fb(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)B0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function gb(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!_h(t.coordinates[n],i))return!1;e||(e=_h(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function mb(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=_t(t.coordinates[1],i),!n){e=!1;break}n=_t(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function vb(t,i){for(var e=0;e<t.coordinates.length;e++)if(!_h(t.coordinates[e],i))return!1;return!0}function yb(t,i){var e=Do(i),n=Do(t);if(!J0(e,n))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!_t(t.coordinates[r],i))return!1;if(o||(o=_t(t.coordinates[r],i,{ignoreBoundary:!0})),!o){var s=Cb(t.coordinates[r],t.coordinates[r+1]);o=_t(s,i,{ignoreBoundary:!0})}}return o}function wb(t,i){var e=Do(t),n=Do(i);if(!J0(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!_t(t.coordinates[0][o],i))return!1;return!0}function J0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function B0(t,i){return t[0]===i[0]&&t[1]===i[1]}function Cb(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function j0(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],r=t[1],s=t[2],a=t[3],c=i/xi([o,r],[s,r],e),d=c*(s-o),u=i/xi([o,r],[o,a],e),p=u*(a-r),f=s-o,g=a-r,m=Math.floor(f/d),y=Math.floor(g/p),P=(f-m*d)/2,S=(g-y*p)/2,C=o+P;C<=s;){for(var E=r+S;E<=a;){var T=zn([C,E],e.properties);e.mask?ub(T,e.mask)&&n.push(T):n.push(T),E+=p}C+=d}return Di(n)}function Kp(t,i){i===void 0&&(i={});var e=Ri(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return _b(e,i);case"MultiPolygon":return Pb(e,i);default:throw new Error("invalid poly")}}function _b(t,i){i===void 0&&(i={});var e=Ri(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return ew(n,o)}function Pb(t,i){i===void 0&&(i={});var e=Ri(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},r=[];return n.forEach(function(s){r.push(ew(s,o))}),Di(r)}function ew(t,i){return t.length>1?_D(t,i):uh(t[0],i)}var Jp,tw;function iw(){if(tw)return Jp;tw=1;var t=Object.prototype.toString;return Jp=function(e){var n=t.call(e),o=n==="[object Arguments]";return o||(o=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Jp}var Bp,nw;function Sb(){if(nw)return Bp;nw=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=iw(),o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),s=o.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var g=f.constructor;return g&&g.prototype===f},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!d["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1}(),p=function(f){if(typeof window>"u"||!u)return c(f);try{return c(f)}catch{return!1}};t=function(g){var m=g!==null&&typeof g=="object",y=e.call(g)==="[object Function]",P=n(g),S=m&&e.call(g)==="[object String]",C=[];if(!m&&!y&&!P)throw new TypeError("Object.keys called on a non-object");var E=s&&y;if(S&&g.length>0&&!i.call(g,0))for(var T=0;T<g.length;++T)C.push(String(T));if(P&&g.length>0)for(var I=0;I<g.length;++I)C.push(String(I));else for(var b in g)!(E&&b==="prototype")&&i.call(g,b)&&C.push(String(b));if(r)for(var x=p(g),z=0;z<a.length;++z)!(x&&a[z]==="constructor")&&i.call(g,a[z])&&C.push(a[z]);return C}}return Bp=t,Bp}var jp,ow;function rw(){if(ow)return jp;ow=1;var t=Array.prototype.slice,i=iw(),e=Object.keys,n=e?function(s){return e(s)}:Sb(),o=Object.keys;return n.shim=function(){if(Object.keys){var s=function(){var a=Object.keys(arguments);return a&&a.length===arguments.length}(1,2);s||(Object.keys=function(c){return i(c)?o(t.call(c)):o(c)})}else Object.keys=n;return Object.keys||n},jp=n,jp}var ef,sw;function aw(){return sw||(sw=1,ef=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var r in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var s=Object.getOwnPropertySymbols(i);if(s.length!==1||s[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(i,e);if(a.value!==o||a.enumerable!==!0)return!1}return!0}),ef}var tf,lw;function nf(){if(lw)return tf;lw=1;var t=aw();return tf=function(){return t()&&!!Symbol.toStringTag},tf}var of,cw;function hw(){return cw||(cw=1,of=Object),of}var rf,dw;function uw(){return dw||(dw=1,rf=Error),rf}var sf,pw;function Eb(){return pw||(pw=1,sf=EvalError),sf}var af,fw;function Ab(){return fw||(fw=1,af=RangeError),af}var lf,gw;function Tb(){return gw||(gw=1,lf=ReferenceError),lf}var cf,mw;function vw(){return mw||(mw=1,cf=SyntaxError),cf}var hf,yw;function Vr(){return yw||(yw=1,hf=TypeError),hf}var df,ww;function Mb(){return ww||(ww=1,df=URIError),df}var uf,Cw;function Ib(){return Cw||(Cw=1,uf=Math.abs),uf}var pf,_w;function Db(){return _w||(_w=1,pf=Math.floor),pf}var ff,Pw;function bb(){return Pw||(Pw=1,ff=Math.max),ff}var gf,Sw;function Rb(){return Sw||(Sw=1,gf=Math.min),gf}var mf,Ew;function xb(){return Ew||(Ew=1,mf=Math.pow),mf}var vf,Aw;function Fb(){return Aw||(Aw=1,vf=Math.round),vf}var yf,Tw;function kb(){return Tw||(Tw=1,yf=Number.isNaN||function(i){return i!==i}),yf}var wf,Mw;function zb(){if(Mw)return wf;Mw=1;var t=kb();return wf=function(e){return t(e)||e===0?e:e<0?-1:1},wf}var Cf,Iw;function Lb(){return Iw||(Iw=1,Cf=Object.getOwnPropertyDescriptor),Cf}var _f,Dw;function Ur(){if(Dw)return _f;Dw=1;var t=Lb();if(t)try{t([],"length")}catch{t=null}return _f=t,_f}var Pf,bw;function Ph(){if(bw)return Pf;bw=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return Pf=t,Pf}var Sf,Rw;function Ob(){if(Rw)return Sf;Rw=1;var t=typeof Symbol<"u"&&Symbol,i=aw();return Sf=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},Sf}var Ef,xw;function Fw(){return xw||(xw=1,Ef=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ef}var Af,kw;function zw(){if(kw)return Af;kw=1;var t=hw();return Af=t.getPrototypeOf||null,Af}var Tf,Lw;function Nb(){if(Lw)return Tf;Lw=1;var t="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,e=Math.max,n="[object Function]",o=function(c,d){for(var u=[],p=0;p<c.length;p+=1)u[p]=c[p];for(var f=0;f<d.length;f+=1)u[f+c.length]=d[f];return u},r=function(c,d){for(var u=[],p=d,f=0;p<c.length;p+=1,f+=1)u[f]=c[p];return u},s=function(a,c){for(var d="",u=0;u<a.length;u+=1)d+=a[u],u+1<a.length&&(d+=c);return d};return Tf=function(c){var d=this;if(typeof d!="function"||i.apply(d)!==n)throw new TypeError(t+d);for(var u=r(arguments,1),p,f=function(){if(this instanceof p){var S=d.apply(this,o(u,arguments));return Object(S)===S?S:this}return d.apply(c,o(u,arguments))},g=e(0,d.length-u.length),m=[],y=0;y<g;y++)m[y]="$"+y;if(p=Function("binder","return function ("+s(m,",")+"){ return binder.apply(this,arguments); }")(f),d.prototype){var P=function(){};P.prototype=d.prototype,p.prototype=new P,P.prototype=null}return p},Tf}var Mf,Ow;function Hs(){if(Ow)return Mf;Ow=1;var t=Nb();return Mf=Function.prototype.bind||t,Mf}var If,Nw;function Df(){return Nw||(Nw=1,If=Function.prototype.call),If}var bf,Vw;function Rf(){return Vw||(Vw=1,bf=Function.prototype.apply),bf}var xf,Uw;function Vb(){return Uw||(Uw=1,xf=typeof Reflect<"u"&&Reflect&&Reflect.apply),xf}var Ff,Ww;function Gw(){if(Ww)return Ff;Ww=1;var t=Hs(),i=Rf(),e=Df(),n=Vb();return Ff=n||t.call(e,i),Ff}var kf,Hw;function zf(){if(Hw)return kf;Hw=1;var t=Hs(),i=Vr(),e=Df(),n=Gw();return kf=function(r){if(r.length<1||typeof r[0]!="function")throw new i("a function is required");return n(t,e,r)},kf}var Lf,qw;function Ub(){if(qw)return Lf;qw=1;var t=zf(),i=Ur(),e;try{e=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var n=!!e&&i&&i(Object.prototype,"__proto__"),o=Object,r=o.getPrototypeOf;return Lf=n&&typeof n.get=="function"?t([n.get]):typeof r=="function"?function(a){return r(a==null?a:o(a))}:!1,Lf}var Of,$w;function Xw(){if($w)return Of;$w=1;var t=Fw(),i=zw(),e=Ub();return Of=t?function(o){return t(o)}:i?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return i(o)}:e?function(o){return e(o)}:null,Of}var Nf,Yw;function Zw(){if(Yw)return Nf;Yw=1;var t=Function.prototype.call,i=Object.prototype.hasOwnProperty,e=Hs();return Nf=e.call(t,i),Nf}var Vf,Qw;function Kw(){if(Qw)return Vf;Qw=1;var t,i=hw(),e=uw(),n=Eb(),o=Ab(),r=Tb(),s=vw(),a=Vr(),c=Mb(),d=Ib(),u=Db(),p=bb(),f=Rb(),g=xb(),m=Fb(),y=zb(),P=Function,S=function(me){try{return P('"use strict"; return ('+me+").constructor;")()}catch{}},C=Ur(),E=Ph(),T=function(){throw new a},I=C?function(){try{return arguments.callee,T}catch{try{return C(arguments,"callee").get}catch{return T}}}():T,b=Ob()(),x=Xw(),z=zw(),W=Fw(),N=Rf(),L=Df(),U={},_=typeof Uint8Array>"u"||!x?t:x(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":b&&x?x([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":P,"%GeneratorFunction%":U,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":b&&x?x(x([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!b||!x?t:x(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!b||!x?t:x(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":b&&x?x(""[Symbol.iterator]()):t,"%Symbol%":b?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":I,"%TypedArray%":_,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":N,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":z,"%Math.abs%":d,"%Math.floor%":u,"%Math.max%":p,"%Math.min%":f,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":y,"%Reflect.getPrototypeOf%":W};if(x)try{null.error}catch(me){var F=x(x(me));M["%Error.prototype%"]=F}var V=function me(ne){var he;if(ne==="%AsyncFunction%")he=S("async function () {}");else if(ne==="%GeneratorFunction%")he=S("function* () {}");else if(ne==="%AsyncGeneratorFunction%")he=S("async function* () {}");else if(ne==="%AsyncGenerator%"){var de=me("%AsyncGeneratorFunction%");de&&(he=de.prototype)}else if(ne==="%AsyncIteratorPrototype%"){var Me=me("%AsyncGenerator%");Me&&x&&(he=x(Me.prototype))}return M[ne]=he,he},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Z=Hs(),$=Zw(),Y=Z.call(L,Array.prototype.concat),K=Z.call(N,Array.prototype.splice),te=Z.call(L,String.prototype.replace),re=Z.call(L,String.prototype.slice),ge=Z.call(L,RegExp.prototype.exec),ye=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Te=/\\(\\)?/g,Oe=function(ne){var he=re(ne,0,1),de=re(ne,-1);if(he==="%"&&de!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(de==="%"&&he!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var Me=[];return te(ne,ye,function(Ne,Ot,st,Uh){Me[Me.length]=st?te(Uh,Te,"$1"):Ot||Ne}),Me},We=function(ne,he){var de=ne,Me;if($(G,de)&&(Me=G[de],de="%"+Me[0]+"%"),$(M,de)){var Ne=M[de];if(Ne===U&&(Ne=V(de)),typeof Ne>"u"&&!he)throw new a("intrinsic "+ne+" exists, but is not available. Please file an issue!");return{alias:Me,name:de,value:Ne}}throw new s("intrinsic "+ne+" does not exist!")};return Vf=function(ne,he){if(typeof ne!="string"||ne.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof he!="boolean")throw new a('"allowMissing" argument must be a boolean');if(ge(/^%?[^%]*%?$/,ne)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var de=Oe(ne),Me=de.length>0?de[0]:"",Ne=We("%"+Me+"%",he),Ot=Ne.name,st=Ne.value,Uh=!1,dm=Ne.alias;dm&&(Me=dm[0],K(de,Y([0,1],dm)));for(var Wh=1,Ql=!0;Wh<de.length;Wh+=1){var ln=de[Wh],Gh=re(ln,0,1),Hh=re(ln,-1);if((Gh==='"'||Gh==="'"||Gh==="`"||Hh==='"'||Hh==="'"||Hh==="`")&&Gh!==Hh)throw new s("property names with quotes must have matching quotes");if((ln==="constructor"||!Ql)&&(Uh=!0),Me+="."+ln,Ot="%"+Me+"%",$(M,Ot))st=M[Ot];else if(st!=null){if(!(ln in st)){if(!he)throw new a("base intrinsic for "+ne+" exists, but the property is not available.");return}if(C&&Wh+1>=de.length){var qh=C(st,ln);Ql=!!qh,Ql&&"get"in qh&&!("originalValue"in qh.get)?st=qh.get:st=st[ln]}else Ql=$(st,ln),st=st[ln];Ql&&!Uh&&(M[Ot]=st)}}return st},Vf}var Uf,Jw;function Wf(){if(Jw)return Uf;Jw=1;var t=Kw(),i=zf(),e=i([t("%String.prototype.indexOf%")]);return Uf=function(o,r){var s=t(o,!!r);return typeof s=="function"&&e(o,".prototype.")>-1?i([s]):s},Uf}var Gf,Bw;function Wb(){if(Bw)return Gf;Bw=1;var t=nf()(),i=Wf(),e=i("Object.prototype.toString"),n=function(a){return t&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:e(a)==="[object Arguments]"},o=function(a){return n(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&e(a)!=="[object Array]"&&"callee"in a&&e(a.callee)==="[object Function]"},r=function(){return n(arguments)}();return n.isLegacyArguments=o,Gf=r?n:o,Gf}var Hf,jw;function qf(){if(jw)return Hf;jw=1;var t=Ph(),i=vw(),e=Vr(),n=Ur();return Hf=function(r,s,a){if(!r||typeof r!="object"&&typeof r!="function")throw new e("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,d=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,f=!!n&&n(r,s);if(t)t(r,s,{configurable:u===null&&f?f.configurable:!u,enumerable:c===null&&f?f.enumerable:!c,value:a,writable:d===null&&f?f.writable:!d});else if(p||!c&&!d&&!u)r[s]=a;else throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Hf}var $f,eC;function Xf(){if(eC)return $f;eC=1;var t=Ph(),i=function(){return!!t};return i.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},$f=i,$f}var Yf,tC;function qs(){if(tC)return Yf;tC=1;var t=rw(),i=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,n=Array.prototype.concat,o=qf(),r=function(d){return typeof d=="function"&&e.call(d)==="[object Function]"},s=Xf()(),a=function(d,u,p,f){if(u in d){if(f===!0){if(d[u]===p)return}else if(!r(f)||!f())return}s?o(d,u,p,!0):o(d,u,p)},c=function(d,u){var p=arguments.length>2?arguments[2]:{},f=t(u);i&&(f=n.call(f,Object.getOwnPropertySymbols(u)));for(var g=0;g<f.length;g+=1)a(d,f[g],u[f[g]],p[f[g]])};return c.supportsDescriptors=!!s,Yf=c,Yf}var Zf={exports:{}},Qf,iC;function Gb(){if(iC)return Qf;iC=1;var t=Kw(),i=qf(),e=Xf()(),n=Ur(),o=Vr(),r=t("%Math.floor%");return Qf=function(a,c){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||r(c)!==c)throw new o("`length` must be a positive 32-bit integer");var d=arguments.length>2&&!!arguments[2],u=!0,p=!0;if("length"in a&&n){var f=n(a,"length");f&&!f.configurable&&(u=!1),f&&!f.writable&&(p=!1)}return(u||p||!d)&&(e?i(a,"length",c,!0,!0):i(a,"length",c)),a},Qf}var Kf,nC;function Hb(){if(nC)return Kf;nC=1;var t=Hs(),i=Rf(),e=Gw();return Kf=function(){return e(t,i,arguments)},Kf}var oC;function rC(){return oC||(oC=1,function(t){var i=Gb(),e=Ph(),n=zf(),o=Hb();t.exports=function(s){var a=n(arguments),c=s.length-(arguments.length-1);return i(a,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o}(Zf)),Zf.exports}var Jf,sC;function aC(){if(sC)return Jf;sC=1;var t=function(i){return i!==i};return Jf=function(e,n){return e===0&&n===0?1/e===1/n:!!(e===n||t(e)&&t(n))},Jf}var Bf,lC;function cC(){if(lC)return Bf;lC=1;var t=aC();return Bf=function(){return typeof Object.is=="function"?Object.is:t},Bf}var jf,hC;function qb(){if(hC)return jf;hC=1;var t=cC(),i=qs();return jf=function(){var n=t();return i(Object,{is:n},{is:function(){return Object.is!==n}}),n},jf}var eg,dC;function $b(){if(dC)return eg;dC=1;var t=qs(),i=rC(),e=aC(),n=cC(),o=qb(),r=i(n(),Object);return t(r,{getPolyfill:n,implementation:e,shim:o}),eg=r,eg}var tg,uC;function Xb(){if(uC)return tg;uC=1;var t=Wf(),i=nf()(),e=Zw(),n=Ur(),o;if(i){var r=t("RegExp.prototype.exec"),s={},a=function(){throw s},c={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=a),o=function(f){if(!f||typeof f!="object")return!1;var g=n(f,"lastIndex"),m=g&&e(g,"value");if(!m)return!1;try{r(f,c)}catch(y){return y===s}}}else{var d=t("Object.prototype.toString"),u="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:d(f)===u}}return tg=o,tg}var ig,pC;function Yb(){if(pC)return ig;pC=1;var t=function(){return typeof(function(){}).name=="string"},i=Object.getOwnPropertyDescriptor;if(i)try{i([],"length")}catch{i=null}t.functionsHaveConfigurableNames=function(){if(!t()||!i)return!1;var o=i(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},ig=t,ig}var ng,fC;function Zb(){if(fC)return ng;fC=1;var t=qf(),i=Xf()(),e=Yb().functionsHaveConfigurableNames(),n=Vr();return ng=function(r,s){if(typeof r!="function")throw new n("`fn` is not a function");var a=arguments.length>2&&!!arguments[2];return(!a||e)&&(i?t(r,"name",s,!0,!0):t(r,"name",s)),r},ng}var og,gC;function mC(){if(gC)return og;gC=1;var t=Zb(),i=Vr(),e=Object;return og=t(function(){if(this==null||this!==e(this))throw new i("RegExp.prototype.flags getter called on non-object");var o="";return this.hasIndices&&(o+="d"),this.global&&(o+="g"),this.ignoreCase&&(o+="i"),this.multiline&&(o+="m"),this.dotAll&&(o+="s"),this.unicode&&(o+="u"),this.unicodeSets&&(o+="v"),this.sticky&&(o+="y"),o},"get flags",!0),og}var rg,vC;function yC(){if(vC)return rg;vC=1;var t=mC(),i=qs().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return rg=function(){if(i&&/a/mig.flags==="gim"){var o=e(RegExp.prototype,"flags");if(o&&typeof o.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",s={};if(Object.defineProperty(s,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(s,"sticky",{get:function(){r+="y"}}),o.get.call(s),r==="dy")return o.get}}return t},rg}var sg,wC;function Qb(){if(wC)return sg;wC=1;var t=qs().supportsDescriptors,i=yC(),e=Ur(),n=Object.defineProperty,o=uw(),r=Xw(),s=/a/;return sg=function(){if(!t||!r)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var c=i(),d=r(s),u=e(d,"flags");return(!u||u.get!==c)&&n(d,"flags",{configurable:!0,enumerable:!1,get:c}),c},sg}var ag,CC;function Kb(){if(CC)return ag;CC=1;var t=qs(),i=rC(),e=mC(),n=yC(),o=Qb(),r=i(n());return t(r,{getPolyfill:n,implementation:e,shim:o}),ag=r,ag}var lg,_C;function Jb(){if(_C)return lg;_C=1;var t=Wf(),i=t("Date.prototype.getDay"),e=function(a){try{return i(a),!0}catch{return!1}},n=t("Object.prototype.toString"),o="[object Date]",r=nf()();return lg=function(a){return typeof a!="object"||a===null?!1:r?e(a):n(a)===o},lg}var cg,PC;function Bb(){if(PC)return cg;PC=1;var t=rw(),i=Wb(),e=$b(),n=Xb(),o=Kb(),r=Jb(),s=Date.prototype.getTime;function a(p,f,g){var m=g||{};return(m.strict?e(p,f):p===f)?!0:!p||!f||typeof p!="object"&&typeof f!="object"?m.strict?e(p,f):p==f:u(p,f,m)}function c(p){return p==null}function d(p){return!(!p||typeof p!="object"||typeof p.length!="number"||typeof p.copy!="function"||typeof p.slice!="function"||p.length>0&&typeof p[0]!="number")}function u(p,f,g){var m,y;if(typeof p!=typeof f||c(p)||c(f)||p.prototype!==f.prototype||i(p)!==i(f))return!1;var P=n(p),S=n(f);if(P!==S)return!1;if(P||S)return p.source===f.source&&o(p)===o(f);if(r(p)&&r(f))return s.call(p)===s.call(f);var C=d(p),E=d(f);if(C!==E)return!1;if(C||E){if(p.length!==f.length)return!1;for(m=0;m<p.length;m++)if(p[m]!==f[m])return!1;return!0}if(typeof p!=typeof f)return!1;try{var T=t(p),I=t(f)}catch{return!1}if(T.length!==I.length)return!1;for(T.sort(),I.sort(),m=T.length-1;m>=0;m--)if(T[m]!=I[m])return!1;for(m=T.length-1;m>=0;m--)if(y=T[m],!a(p[y],f[y],g))return!1;return!0}return cg=a,cg}function jb(t,i){var e=!0;return kr(t,function(n){kr(i,function(o){if(e===!1)return!1;e=eR(n.geometry,o.geometry)})}),e}function eR(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!oR(t.coordinates,i.coordinates);case"LineString":return!SC(i,t);case"Polygon":return!_t(t,i)}break;case"LineString":switch(i.type){case"Point":return!SC(t,i);case"LineString":return!tR(t,i);case"Polygon":return!EC(i,t)}break;case"Polygon":switch(i.type){case"Point":return!_t(i,t);case"LineString":return!EC(t,i);case"Polygon":return!iR(i,t)}}return!1}function SC(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(nR(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function tR(t,i){var e=Qp(t,i);return e.features.length>0}function EC(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(_t(o,t))return!0}var r=Qp(i,Kp(t));return r.features.length>0}function iR(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(_t(o,i))return!0}for(var r=0,s=i.coordinates[0];r<s.length;r++){var a=s[r];if(_t(a,t))return!0}var c=Qp(Kp(t),Kp(i));return c.features.length>0}function nR(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],r=i[0]-t[0],s=i[1]-t[1],a=n*s-o*r;return a!==0?!1:Math.abs(r)>=Math.abs(s)?r>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:s>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function oR(t,i){return t[0]===i[0]&&t[1]===i[1]}var hg,AC;function rR(){if(AC)return hg;AC=1;var t=Bb(),i=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:o};i.prototype.compare=function(r,s){if(r.type!==s.type||!n(r,s))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,s.coordinates);case"LineString":return this.compareLine(r.coordinates,s.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,s);case"Feature":return this.compareFeature(r,s);default:if(r.type.indexOf("Multi")===0){var a=this,c=e(r),d=e(s);return c.every(function(u){return this.some(function(p){return a.compare(u,p)})},d)}}return!1};function e(r){return r.coordinates.map(function(s){return{type:r.type.replace("Multi",""),coordinates:s}})}function n(r,s){return r.hasOwnProperty("coordinates")?r.coordinates.length===s.coordinates.length:r.length===s.length}i.prototype.compareCoord=function(r,s){if(r.length!==s.length)return!1;for(var a=0;a<r.length;a++)if(r[a].toFixed(this.precision)!==s[a].toFixed(this.precision))return!1;return!0},i.prototype.compareLine=function(r,s,a,c){if(!n(r,s))return!1;var d=this.pseudoNode?r:this.removePseudo(r),u=this.pseudoNode?s:this.removePseudo(s);if(!(c&&!this.compareCoord(d[0],u[0])&&(u=this.fixStartIndex(u,d),!u))){var p=this.compareCoord(d[a],u[a]);return this.direction||p?this.comparePath(d,u):this.compareCoord(d[a],u[u.length-(1+a)])?this.comparePath(d.slice().reverse(),u):!1}},i.prototype.fixStartIndex=function(r,s){for(var a,c=-1,d=0;d<r.length;d++)if(this.compareCoord(r[d],s[0])){c=d;break}return c>=0&&(a=[].concat(r.slice(c,r.length),r.slice(1,c+1))),a},i.prototype.comparePath=function(r,s){var a=this;return r.every(function(c,d){return a.compareCoord(c,this[d])},s)},i.prototype.comparePolygon=function(r,s){if(this.compareLine(r.coordinates[0],s.coordinates[0],1,!0)){var a=r.coordinates.slice(1,r.coordinates.length),c=s.coordinates.slice(1,s.coordinates.length),d=this;return a.every(function(u){return this.some(function(p){return d.compareLine(u,p,1,!0)})},c)}else return!1},i.prototype.compareFeature=function(r,s){return r.id!==s.id||!this.objectComparator(r.properties,s.properties)||!this.compareBBox(r,s)?!1:this.compare(r.geometry,s.geometry)},i.prototype.compareBBox=function(r,s){return!!(!r.bbox&&!s.bbox||r.bbox&&s.bbox&&this.compareCoord(r.bbox,s.bbox))},i.prototype.removePseudo=function(r){return r};function o(r,s){return t(r,s,{strict:!0})}return hg=i,hg}var sR=rR();const aR=mc(sR);function lR(t,i){var e=Ri(t).type,n=Ri(i).type;if(e!==n)return!1;var o=new aR({precision:6});return o.compare(U0(t),U0(i))}function cR(t,i){var e=!1;return kr(t,function(n){kr(i,function(o){if(e===!0)return!0;e=!jb(n.geometry,o.geometry)})}),e}/**
|
|
1857
|
+
`,Xn=class Xn extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_player");v(this,"_finalImageUrlReact",this.disposeVar(w.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));v(this,"_routePaths",this.disposeVar(l.react(void 0)));v(this,"routePathCallback");v(this,"_id",this.disposeVar(l.react(l.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new w.Player);{const g=Xn.defaults;this.dispose(l.bind([this._player,"loop"],[this,"loop"],m=>m??g.loop,m=>m??g.loop)),this.dispose(l.bind([this._player,"currentTime"],[this,"currentTime"],m=>m??g.currentTime,m=>m??g.currentTime)),this.dispose(l.bind([this._player,"duration"],[this,"duration"],m=>m??g.duration,m=>m??g.duration)),this.dispose(l.bind([this._player,"playing"],[this,"playing"],m=>m??g.playing,m=>m??g.playing)),this.dispose(l.bind([this._player,"speed"],[this,"speed"],m=>m??g.speed,m=>m??g.speed))}const o=this.disposeVar(w.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(l.createProcessingFromAsyncFunc(async g=>{this.routePaths=void 0;const m=o.value;if(m)try{const P=await(await fetch(m)).json();this.routePaths=FD(P,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(P=>({positions:P,width:this.width}));return}}}));{const g=()=>{r.restart()};g();const m=this.disposeVar(l.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(m.disposableOn(g))}{const g=()=>{const m=gd(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);m&&(this.routePathCallback=m)};g(),this.dispose(this.routePathCallbackStrChanged.disposableOn(g))}const s=e.viewer;if(!s){console.warn("viewer is undefined!");return}const a=this.finalImageUrlReact,c=this.disposeVar(new Ko),d=this.disposeVar(l.createProcessingFromAsyncFunc(async g=>{if(!a.value)return;const m=sv(s.scene.context).getTextureHandler(a.value);if(m instanceof Ko)c.reset(m);else{const y=await g.promise(m);c.reset(y)}})),u=()=>c.valid?c.raw:s.scene.context.defaultTexture,p=()=>d.restart();p(),this.dispose(a.changed.disposableOn(p));const f=this.ad(l.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new l.ObjResettingWithEvent(f,()=>this.routePaths?new QD(s,this,a.value&&u||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(g=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))se(s,this.routePaths[0].startPos,s.camera.positionCartographic.height,void 0,g);else{const m=computeBoundingSphere(this.routePaths[0].positions);if(!m)return;const[y,P]=m;se(s,y,P*3,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};v(Xn,"whiteGradientImageBase64",KD),v(Xn,"defaultRoutePathCallback",function(e,n,o){const r=n/50,s=r-Math.floor(r);return e.color=[s*.5+.5,(1-s)*.5+.5,.5,1],e.bgColor=[s*.5+.5,(1-s)*.5+.5,.5,.3],e}),v(Xn,"routePathCallbackStrMd",JD),v(Xn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Xn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let Ki=Xn;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:l.reactArray([0,1,0,1]),bgColor:l.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:l.reactPositionsSet(void 0),data:l.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Ki||(Ki={})),l.extendClassProps(Ki.prototype,Ki.createDefaultProps);class Ji extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_collection");this._collection=this.disposeVar(new Ki(e,n)),this.dispose(l.track([this._collection,"show"],[this,"show"])),this.dispose(l.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(l.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(l.track([this._collection,"color"],[this,"color"])),this.dispose(l.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(l.track([this._collection,"width"],[this,"width"])),this.dispose(l.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(l.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(l.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(l.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(l.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(l.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(l.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(l.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([this._collection,"playing"],[this,"playing"])),this.dispose(l.track([this._collection,"loop"],[this,"loop"])),this.dispose(l.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(l.bind([this._collection,"duration"],[this,"duration"])),this.dispose(l.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((s,a)=>{var c;if(!(!this.positions||a==((c=this.positions)==null?void 0:c.length)-1))return{startPos:s,endPos:this.positions[a+1],width:this.width,heightRatio:this.heightRatio}}).filter(s=>s!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}v(Ji,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Ji,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:l.reactArray([0,1,0,1]),bgColor:l.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:l.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Ji||(Ji={})),l.extendClassProps(Ji.prototype,Ji.createDefaultProps);const vl=class vl extends vt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Ji(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const s=()=>{r.show=e.show&&e.stroked};s(),this.ad(e.showChanged.don(s)),this.ad(e.strokedChanged.don(s))}this.dispose(l.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(l.bind([r,"positions"],[e,"points"])),this.dispose(l.track([r,"width"],[e,"strokeWidth"])),this.dispose(l.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(l.track([r,"startTime"],[e,"startTime"])),this.dispose(l.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(l.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(l.track([r,"arcType"],[e,"arcType"])),this.dispose(l.track([r,"brightening"],[e,"brightening"])),this.dispose(l.track([r,"depthTest"],[e,"depthTest"])),this.dispose(l.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(l.track([r,"repeat"],[e,"repeat"])),this.dispose(l.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(l.track([r,"loop"],[e,"loop"])),this.dispose(l.track([r,"currentTime"],[e,"currentTime"])),this.dispose(l.track([r,"duration"],[e,"duration"])),this.dispose(l.track([r,"playing"],[e,"playing"])),this.dispose(l.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmSignalTransmission:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmSignalTransmission:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}};v(vl,"type",vl.register("ESCesiumViewer",lh.type,vl));let $p=vl;function Do(t){var i=[1/0,1/0,-1/0,-1/0];return gh(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}Do.default=Do;const Bi=11102230246251565e-32,yt=134217729,BD=(3+8*Bi)*Bi;function Xp(t,i,e,n,o){let r,s,a,c,d=i[0],u=n[0],p=0,f=0;u>d==u>-d?(r=d,d=i[++p]):(r=u,u=n[++f]);let g=0;if(p<t&&f<e)for(u>d==u>-d?(s=d+r,a=r-(s-d),d=i[++p]):(s=u+r,a=r-(s-u),u=n[++f]),r=s,a!==0&&(o[g++]=a);p<t&&f<e;)u>d==u>-d?(s=r+d,c=s-r,a=r-(s-c)+(d-c),d=i[++p]):(s=r+u,c=s-r,a=r-(s-c)+(u-c),u=n[++f]),r=s,a!==0&&(o[g++]=a);for(;p<t;)s=r+d,c=s-r,a=r-(s-c)+(d-c),d=i[++p],r=s,a!==0&&(o[g++]=a);for(;f<e;)s=r+u,c=s-r,a=r-(s-c)+(u-c),u=n[++f],r=s,a!==0&&(o[g++]=a);return(r!==0||g===0)&&(o[g++]=r),g}function jD(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function Hs(t){return new Float64Array(t)}const eb=(3+16*Bi)*Bi,tb=(2+12*Bi)*Bi,ib=(9+64*Bi)*Bi*Bi,Vr=Hs(4),z0=Hs(8),L0=Hs(12),O0=Hs(16),_t=Hs(4);function nb(t,i,e,n,o,r,s){let a,c,d,u,p,f,g,m,y,P,S,C,E,T,I,b,x,z;const W=t-o,N=e-o,L=i-r,U=n-r;T=W*U,f=yt*W,g=f-(f-W),m=W-g,f=yt*U,y=f-(f-U),P=U-y,I=m*P-(T-g*y-m*y-g*P),b=L*N,f=yt*L,g=f-(f-L),m=L-g,f=yt*N,y=f-(f-N),P=N-y,x=m*P-(b-g*y-m*y-g*P),S=I-x,p=I-S,Vr[0]=I-(S+p)+(p-x),C=T+S,p=C-T,E=T-(C-p)+(S-p),S=E-b,p=E-S,Vr[1]=E-(S+p)+(p-b),z=C+S,p=z-C,Vr[2]=C-(z-p)+(S-p),Vr[3]=z;let _=jD(4,Vr),M=tb*s;if(_>=M||-_>=M||(p=t-W,a=t-(W+p)+(p-o),p=e-N,d=e-(N+p)+(p-o),p=i-L,c=i-(L+p)+(p-r),p=n-U,u=n-(U+p)+(p-r),a===0&&c===0&&d===0&&u===0)||(M=ib*s+BD*Math.abs(_),_+=W*u+U*a-(L*d+N*c),_>=M||-_>=M))return _;T=a*U,f=yt*a,g=f-(f-a),m=a-g,f=yt*U,y=f-(f-U),P=U-y,I=m*P-(T-g*y-m*y-g*P),b=c*N,f=yt*c,g=f-(f-c),m=c-g,f=yt*N,y=f-(f-N),P=N-y,x=m*P-(b-g*y-m*y-g*P),S=I-x,p=I-S,_t[0]=I-(S+p)+(p-x),C=T+S,p=C-T,E=T-(C-p)+(S-p),S=E-b,p=E-S,_t[1]=E-(S+p)+(p-b),z=C+S,p=z-C,_t[2]=C-(z-p)+(S-p),_t[3]=z;const F=Xp(4,Vr,4,_t,z0);T=W*u,f=yt*W,g=f-(f-W),m=W-g,f=yt*u,y=f-(f-u),P=u-y,I=m*P-(T-g*y-m*y-g*P),b=L*d,f=yt*L,g=f-(f-L),m=L-g,f=yt*d,y=f-(f-d),P=d-y,x=m*P-(b-g*y-m*y-g*P),S=I-x,p=I-S,_t[0]=I-(S+p)+(p-x),C=T+S,p=C-T,E=T-(C-p)+(S-p),S=E-b,p=E-S,_t[1]=E-(S+p)+(p-b),z=C+S,p=z-C,_t[2]=C-(z-p)+(S-p),_t[3]=z;const V=Xp(F,z0,4,_t,L0);T=a*u,f=yt*a,g=f-(f-a),m=a-g,f=yt*u,y=f-(f-u),P=u-y,I=m*P-(T-g*y-m*y-g*P),b=c*d,f=yt*c,g=f-(f-c),m=c-g,f=yt*d,y=f-(f-d),P=d-y,x=m*P-(b-g*y-m*y-g*P),S=I-x,p=I-S,_t[0]=I-(S+p)+(p-x),C=T+S,p=C-T,E=T-(C-p)+(S-p),S=E-b,p=E-S,_t[1]=E-(S+p)+(p-b),z=C+S,p=z-C,_t[2]=C-(z-p)+(S-p),_t[3]=z;const G=Xp(V,L0,4,_t,O0);return O0[G-1]}function ob(t,i,e,n,o,r){const s=(i-r)*(e-o),a=(t-o)*(n-r),c=s-a,d=Math.abs(s+a);return Math.abs(c)>=eb*d?c:-nb(t,i,e,n,o,r,d)}function Pt(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=fh(t),o=Ri(i),r=o.type,s=i.bbox,a=o.coordinates;if(s&&rb(n,s)===!1)return!1;r==="Polygon"&&(a=[a]);for(var c=!1,d=0;d<a.length&&!c;d++)if(N0(n,a[d][0],e.ignoreBoundary)){for(var u=!1,p=1;p<a[d].length&&!u;)N0(n,a[d][p],!e.ignoreBoundary)&&(u=!0),p++;u||(c=!0)}return c}function N0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,r=i.length-1;o<i.length;r=o++){var s=i[o][0],a=i[o][1],c=i[r][0],d=i[r][1],u=t[1]*(s-c)+a*(c-t[0])+d*(t[0]-s)===0&&(s-t[0])*(c-t[0])<=0&&(a-t[1])*(d-t[1])<=0;if(u)return!e;var p=a>t[1]!=d>t[1]&&t[0]<(c-s)*(t[1]-a)/(d-a)+s;p&&(n=!n)}return n}function rb(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function sb(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return V0(t);case"FeatureCollection":return ab(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Yp(t);default:throw new Error("unknown GeoJSON type")}}function V0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=U0(t.properties),i.geometry=Yp(t.geometry),i}function U0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=U0(n):i[e]=n}),i}function ab(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return V0(e)}),i}function Yp(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return Yp(e)}),i):(i.coordinates=W0(t.coordinates),i)}function W0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return W0(e)})}function G0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=AD(t),o=[];switch(n){case"LineString":o=Zp(t);break;case"MultiLineString":case"Polygon":bi(t).forEach(function(s){o.push(Zp(s))});break;case"MultiPolygon":bi(t).forEach(function(s){var a=[];s.forEach(function(c){a.push(Zp(c))}),o.push(a)});break;case"Point":return t;case"MultiPoint":var r={};bi(t).forEach(function(s){var a=s.join("-");Object.prototype.hasOwnProperty.call(r,a)||(o.push(s),r[a]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ii({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Zp(t){var i=bi(t);if(i.length===2&&!H0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var r=1;r<n;r++){var s=e[e.length-1];i[r][0]===s[0]&&i[r][1]===s[1]||(e.push(i[r]),o=e.length,o>2&&q0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,H0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return q0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function H0(t,i){return t[0]===i[0]&&t[1]===i[1]}function q0(t,i,e){var n=e[0],o=e[1],r=t[0],s=t[1],a=i[0],c=i[1],d=n-r,u=o-s,p=a-r,f=c-s,g=d*f-u*p;return g!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?r<=n&&n<=a:a<=n&&n<=r:f>0?s<=o&&o<=c:c<=o&&o<=s}function lb(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return gh(t,function(r){e+=r[0],n+=r[1],o++},!0),zn([e/o,n/o],i.properties)}function $0(t){if(!t)throw new Error("geojson is required");var i=[];return kr(t,function(e){cb(e,i)}),Di(i)}function cb(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=bi(n);break;case"LineString":e=[bi(n)]}e.forEach(function(o){var r=hb(o,t.properties);r.forEach(function(s){s.id=i.length,i.push(s)})})}}function hb(t,i){var e=[];return t.reduce(function(n,o){var r=uh([n,o],i);return r.bbox=db(n,o),e.push(r),o}),e}function db(t,i){var e=t[0],n=t[1],o=i[0],r=i[1],s=e<o?e:o,a=n<r?n:r,c=e>o?e:o,d=n>r?n:r;return[s,a,c,d]}var yh={exports:{}},wh={exports:{}},ub=wh.exports,X0;function pb(){return X0||(X0=1,(function(t,i){(function(e,n){t.exports=n()})(ub,function(){function e(C,E,T,I,b){(function x(z,W,N,L,U){for(;L>N;){if(L-N>600){var _=L-N+1,M=W-N+1,F=Math.log(_),V=.5*Math.exp(2*F/3),G=.5*Math.sqrt(F*V*(_-V)/_)*(M-_/2<0?-1:1),Z=Math.max(N,Math.floor(W-M*V/_+G)),$=Math.min(L,Math.floor(W+(_-M)*V/_+G));x(z,W,Z,$,U)}var Y=z[W],K=N,te=L;for(n(z,N,W),U(z[L],Y)>0&&n(z,N,L);K<te;){for(n(z,K,te),K++,te--;U(z[K],Y)<0;)K++;for(;U(z[te],Y)>0;)te--}U(z[N],Y)===0?n(z,N,te):n(z,++te,L),te<=W&&(N=te+1),W<=te&&(L=te-1)}})(C,E,T||0,I||C.length-1,b||o)}function n(C,E,T){var I=C[E];C[E]=C[T],C[T]=I}function o(C,E){return C<E?-1:C>E?1:0}var r=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(C,E,T){if(!T)return E.indexOf(C);for(var I=0;I<E.length;I++)if(T(C,E[I]))return I;return-1}function a(C,E){c(C,0,C.children.length,E,C)}function c(C,E,T,I,b){b||(b=P(null)),b.minX=1/0,b.minY=1/0,b.maxX=-1/0,b.maxY=-1/0;for(var x=E;x<T;x++){var z=C.children[x];d(b,C.leaf?I(z):z)}return b}function d(C,E){return C.minX=Math.min(C.minX,E.minX),C.minY=Math.min(C.minY,E.minY),C.maxX=Math.max(C.maxX,E.maxX),C.maxY=Math.max(C.maxY,E.maxY),C}function u(C,E){return C.minX-E.minX}function p(C,E){return C.minY-E.minY}function f(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function g(C){return C.maxX-C.minX+(C.maxY-C.minY)}function m(C,E){return C.minX<=E.minX&&C.minY<=E.minY&&E.maxX<=C.maxX&&E.maxY<=C.maxY}function y(C,E){return E.minX<=C.maxX&&E.minY<=C.maxY&&E.maxX>=C.minX&&E.maxY>=C.minY}function P(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function S(C,E,T,I,b){for(var x=[E,T];x.length;)if(!((T=x.pop())-(E=x.pop())<=I)){var z=E+Math.ceil((T-E)/I/2)*I;e(C,z,E,T,b),x.push(E,z,z,T)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(C){var E=this.data,T=[];if(!y(C,E))return T;for(var I=this.toBBox,b=[];E;){for(var x=0;x<E.children.length;x++){var z=E.children[x],W=E.leaf?I(z):z;y(C,W)&&(E.leaf?T.push(z):m(C,W)?this._all(z,T):b.push(z))}E=b.pop()}return T},r.prototype.collides=function(C){var E=this.data;if(!y(C,E))return!1;for(var T=[];E;){for(var I=0;I<E.children.length;I++){var b=E.children[I],x=E.leaf?this.toBBox(b):b;if(y(C,x)){if(E.leaf||m(C,x))return!0;T.push(b)}}E=T.pop()}return!1},r.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var E=0;E<C.length;E++)this.insert(C[E]);return this}var T=this._build(C.slice(),0,C.length-1,0);if(this.data.children.length)if(this.data.height===T.height)this._splitRoot(this.data,T);else{if(this.data.height<T.height){var I=this.data;this.data=T,T=I}this._insert(T,this.data.height-T.height-1,!0)}else this.data=T;return this},r.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},r.prototype.clear=function(){return this.data=P([]),this},r.prototype.remove=function(C,E){if(!C)return this;for(var T,I,b,x=this.data,z=this.toBBox(C),W=[],N=[];x||W.length;){if(x||(x=W.pop(),I=W[W.length-1],T=N.pop(),b=!0),x.leaf){var L=s(C,x.children,E);if(L!==-1)return x.children.splice(L,1),W.push(x),this._condense(W),this}b||x.leaf||!m(x,z)?I?(T++,x=I.children[T],b=!1):x=null:(W.push(x),N.push(T),T=0,I=x,x=x.children[0])}return this},r.prototype.toBBox=function(C){return C},r.prototype.compareMinX=function(C,E){return C.minX-E.minX},r.prototype.compareMinY=function(C,E){return C.minY-E.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(C){return this.data=C,this},r.prototype._all=function(C,E){for(var T=[];C;)C.leaf?E.push.apply(E,C.children):T.push.apply(T,C.children),C=T.pop();return E},r.prototype._build=function(C,E,T,I){var b,x=T-E+1,z=this._maxEntries;if(x<=z)return a(b=P(C.slice(E,T+1)),this.toBBox),b;I||(I=Math.ceil(Math.log(x)/Math.log(z)),z=Math.ceil(x/Math.pow(z,I-1))),(b=P([])).leaf=!1,b.height=I;var W=Math.ceil(x/z),N=W*Math.ceil(Math.sqrt(z));S(C,E,T,N,this.compareMinX);for(var L=E;L<=T;L+=N){var U=Math.min(L+N-1,T);S(C,L,U,W,this.compareMinY);for(var _=L;_<=U;_+=W){var M=Math.min(_+W-1,U);b.children.push(this._build(C,_,M,I-1))}}return a(b,this.toBBox),b},r.prototype._chooseSubtree=function(C,E,T,I){for(;I.push(E),!E.leaf&&I.length-1!==T;){for(var b=1/0,x=1/0,z=void 0,W=0;W<E.children.length;W++){var N=E.children[W],L=f(N),U=(_=C,M=N,(Math.max(M.maxX,_.maxX)-Math.min(M.minX,_.minX))*(Math.max(M.maxY,_.maxY)-Math.min(M.minY,_.minY))-L);U<x?(x=U,b=L<b?L:b,z=N):U===x&&L<b&&(b=L,z=N)}E=z||E.children[0]}var _,M;return E},r.prototype._insert=function(C,E,T){var I=T?C:this.toBBox(C),b=[],x=this._chooseSubtree(I,this.data,E,b);for(x.children.push(C),d(x,I);E>=0&&b[E].children.length>this._maxEntries;)this._split(b,E),E--;this._adjustParentBBoxes(I,b,E)},r.prototype._split=function(C,E){var T=C[E],I=T.children.length,b=this._minEntries;this._chooseSplitAxis(T,b,I);var x=this._chooseSplitIndex(T,b,I),z=P(T.children.splice(x,T.children.length-x));z.height=T.height,z.leaf=T.leaf,a(T,this.toBBox),a(z,this.toBBox),E?C[E-1].children.push(z):this._splitRoot(T,z)},r.prototype._splitRoot=function(C,E){this.data=P([C,E]),this.data.height=C.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(C,E,T){for(var I,b,x,z,W,N,L,U=1/0,_=1/0,M=E;M<=T-E;M++){var F=c(C,0,M,this.toBBox),V=c(C,M,T,this.toBBox),G=(b=F,x=V,z=void 0,W=void 0,N=void 0,L=void 0,z=Math.max(b.minX,x.minX),W=Math.max(b.minY,x.minY),N=Math.min(b.maxX,x.maxX),L=Math.min(b.maxY,x.maxY),Math.max(0,N-z)*Math.max(0,L-W)),Z=f(F)+f(V);G<U?(U=G,I=M,_=Z<_?Z:_):G===U&&Z<_&&(_=Z,I=M)}return I||T-E},r.prototype._chooseSplitAxis=function(C,E,T){var I=C.leaf?this.compareMinX:u,b=C.leaf?this.compareMinY:p;this._allDistMargin(C,E,T,I)<this._allDistMargin(C,E,T,b)&&C.children.sort(I)},r.prototype._allDistMargin=function(C,E,T,I){C.children.sort(I);for(var b=this.toBBox,x=c(C,0,E,b),z=c(C,T-E,T,b),W=g(x)+g(z),N=E;N<T-E;N++){var L=C.children[N];d(x,C.leaf?b(L):L),W+=g(x)}for(var U=T-E-1;U>=E;U--){var _=C.children[U];d(z,C.leaf?b(_):_),W+=g(z)}return W},r.prototype._adjustParentBBoxes=function(C,E,T){for(var I=T;I>=0;I--)d(E[I],C)},r.prototype._condense=function(C){for(var E=C.length-1,T=void 0;E>=0;E--)C[E].children.length===0?E>0?(T=C[E-1].children).splice(T.indexOf(C[E]),1):this.clear():a(C[E],this.toBBox)},r})})(wh)),wh.exports}var Qp={},Y0;function Z0(){return Y0||(Y0=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(L,U,_){_===void 0&&(_={});var M={type:"Feature"};return(_.id===0||_.id)&&(M.id=_.id),_.bbox&&(M.bbox=_.bbox),M.properties=U||{},M.geometry=L,M}t.feature=i;function e(L,U,_){switch(L){case"Point":return n(U).geometry;case"LineString":return a(U).geometry;case"Polygon":return r(U).geometry;case"MultiPoint":return p(U).geometry;case"MultiLineString":return u(U).geometry;case"MultiPolygon":return f(U).geometry;default:throw new Error(L+" is invalid")}}t.geometry=e;function n(L,U,_){if(_===void 0&&(_={}),!L)throw new Error("coordinates is required");if(!Array.isArray(L))throw new Error("coordinates must be an Array");if(L.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!x(L[0])||!x(L[1]))throw new Error("coordinates must contain numbers");var M={type:"Point",coordinates:L};return i(M,U,_)}t.point=n;function o(L,U,_){return _===void 0&&(_={}),d(L.map(function(M){return n(M,U)}),_)}t.points=o;function r(L,U,_){_===void 0&&(_={});for(var M=0,F=L;M<F.length;M++){var V=F[M];if(V.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var G=0;G<V[V.length-1].length;G++)if(V[V.length-1][G]!==V[0][G])throw new Error("First and last Position are not equivalent.")}var Z={type:"Polygon",coordinates:L};return i(Z,U,_)}t.polygon=r;function s(L,U,_){return _===void 0&&(_={}),d(L.map(function(M){return r(M,U)}),_)}t.polygons=s;function a(L,U,_){if(_===void 0&&(_={}),L.length<2)throw new Error("coordinates must be an array of two or more positions");var M={type:"LineString",coordinates:L};return i(M,U,_)}t.lineString=a;function c(L,U,_){return _===void 0&&(_={}),d(L.map(function(M){return a(M,U)}),_)}t.lineStrings=c;function d(L,U){U===void 0&&(U={});var _={type:"FeatureCollection"};return U.id&&(_.id=U.id),U.bbox&&(_.bbox=U.bbox),_.features=L,_}t.featureCollection=d;function u(L,U,_){_===void 0&&(_={});var M={type:"MultiLineString",coordinates:L};return i(M,U,_)}t.multiLineString=u;function p(L,U,_){_===void 0&&(_={});var M={type:"MultiPoint",coordinates:L};return i(M,U,_)}t.multiPoint=p;function f(L,U,_){_===void 0&&(_={});var M={type:"MultiPolygon",coordinates:L};return i(M,U,_)}t.multiPolygon=f;function g(L,U,_){_===void 0&&(_={});var M={type:"GeometryCollection",geometries:L};return i(M,U,_)}t.geometryCollection=g;function m(L,U){if(U===void 0&&(U=0),U&&!(U>=0))throw new Error("precision must be a positive number");var _=Math.pow(10,U||0);return Math.round(L*_)/_}t.round=m;function y(L,U){U===void 0&&(U="kilometers");var _=t.factors[U];if(!_)throw new Error(U+" units is invalid");return L*_}t.radiansToLength=y;function P(L,U){U===void 0&&(U="kilometers");var _=t.factors[U];if(!_)throw new Error(U+" units is invalid");return L/_}t.lengthToRadians=P;function S(L,U){return E(P(L,U))}t.lengthToDegrees=S;function C(L){var U=L%360;return U<0&&(U+=360),U}t.bearingToAzimuth=C;function E(L){var U=L%(2*Math.PI);return U*180/Math.PI}t.radiansToDegrees=E;function T(L){var U=L%360;return U*Math.PI/180}t.degreesToRadians=T;function I(L,U,_){if(U===void 0&&(U="kilometers"),_===void 0&&(_="kilometers"),!(L>=0))throw new Error("length must be a positive number");return y(P(L,U),_)}t.convertLength=I;function b(L,U,_){if(U===void 0&&(U="meters"),_===void 0&&(_="kilometers"),!(L>=0))throw new Error("area must be a positive number");var M=t.areaFactors[U];if(!M)throw new Error("invalid original units");var F=t.areaFactors[_];if(!F)throw new Error("invalid final units");return L/M*F}t.convertArea=b;function x(L){return!isNaN(L)&&L!==null&&!Array.isArray(L)}t.isNumber=x;function z(L){return!!L&&L.constructor===Object}t.isObject=z;function W(L){if(!L)throw new Error("bbox is required");if(!Array.isArray(L))throw new Error("bbox must be an Array");if(L.length!==4&&L.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");L.forEach(function(U){if(!x(U))throw new Error("bbox must only contain numbers")})}t.validateBBox=W;function N(L){if(!L)throw new Error("id is required");if(["string","number"].indexOf(typeof L)===-1)throw new Error("id must be a number or a string")}t.validateId=N})(Qp)),Qp}var Be={},Q0;function K0(){if(Q0)return Be;Q0=1,Object.defineProperty(Be,"__esModule",{value:!0});var t=Z0();function i(C,E,T){if(C!==null)for(var I,b,x,z,W,N,L,U=0,_=0,M,F=C.type,V=F==="FeatureCollection",G=F==="Feature",Z=V?C.features.length:1,$=0;$<Z;$++){L=V?C.features[$].geometry:G?C.geometry:C,M=L?L.type==="GeometryCollection":!1,W=M?L.geometries.length:1;for(var Y=0;Y<W;Y++){var K=0,te=0;if(z=M?L.geometries[Y]:L,z!==null){N=z.coordinates;var re=z.type;switch(U=T&&(re==="Polygon"||re==="MultiPolygon")?1:0,re){case null:break;case"Point":if(E(N,_,$,K,te)===!1)return!1;_++,K++;break;case"LineString":case"MultiPoint":for(I=0;I<N.length;I++){if(E(N[I],_,$,K,te)===!1)return!1;_++,re==="MultiPoint"&&K++}re==="LineString"&&K++;break;case"Polygon":case"MultiLineString":for(I=0;I<N.length;I++){for(b=0;b<N[I].length-U;b++){if(E(N[I][b],_,$,K,te)===!1)return!1;_++}re==="MultiLineString"&&K++,re==="Polygon"&&te++}re==="Polygon"&&K++;break;case"MultiPolygon":for(I=0;I<N.length;I++){for(te=0,b=0;b<N[I].length;b++){for(x=0;x<N[I][b].length-U;x++){if(E(N[I][b][x],_,$,K,te)===!1)return!1;_++}te++}K++}break;case"GeometryCollection":for(I=0;I<z.geometries.length;I++)if(i(z.geometries[I],E,T)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(C,E,T,I){var b=T;return i(C,function(x,z,W,N,L){z===0&&T===void 0?b=x:b=E(b,x,z,W,N,L)},I),b}function n(C,E){var T;switch(C.type){case"FeatureCollection":for(T=0;T<C.features.length&&E(C.features[T].properties,T)!==!1;T++);break;case"Feature":E(C.properties,0);break}}function o(C,E,T){var I=T;return n(C,function(b,x){x===0&&T===void 0?I=b:I=E(I,b,x)}),I}function r(C,E){if(C.type==="Feature")E(C,0);else if(C.type==="FeatureCollection")for(var T=0;T<C.features.length&&E(C.features[T],T)!==!1;T++);}function s(C,E,T){var I=T;return r(C,function(b,x){x===0&&T===void 0?I=b:I=E(I,b,x)}),I}function a(C){var E=[];return i(C,function(T){E.push(T)}),E}function c(C,E){var T,I,b,x,z,W,N,L,U,_,M=0,F=C.type==="FeatureCollection",V=C.type==="Feature",G=F?C.features.length:1;for(T=0;T<G;T++){for(W=F?C.features[T].geometry:V?C.geometry:C,L=F?C.features[T].properties:V?C.properties:{},U=F?C.features[T].bbox:V?C.bbox:void 0,_=F?C.features[T].id:V?C.id:void 0,N=W?W.type==="GeometryCollection":!1,z=N?W.geometries.length:1,b=0;b<z;b++){if(x=N?W.geometries[b]:W,x===null){if(E(null,M,L,U,_)===!1)return!1;continue}switch(x.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(E(x,M,L,U,_)===!1)return!1;break}case"GeometryCollection":{for(I=0;I<x.geometries.length;I++)if(E(x.geometries[I],M,L,U,_)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}M++}}function d(C,E,T){var I=T;return c(C,function(b,x,z,W,N){x===0&&T===void 0?I=b:I=E(I,b,x,z,W,N)}),I}function u(C,E){c(C,function(T,I,b,x,z){var W=T===null?null:T.type;switch(W){case null:case"Point":case"LineString":case"Polygon":return E(t.feature(T,b,{bbox:x,id:z}),I,0)===!1?!1:void 0}var N;switch(W){case"MultiPoint":N="Point";break;case"MultiLineString":N="LineString";break;case"MultiPolygon":N="Polygon";break}for(var L=0;L<T.coordinates.length;L++){var U=T.coordinates[L],_={type:N,coordinates:U};if(E(t.feature(_,b),I,L)===!1)return!1}})}function p(C,E,T){var I=T;return u(C,function(b,x,z){x===0&&z===0&&T===void 0?I=b:I=E(I,b,x,z)}),I}function f(C,E){u(C,function(T,I,b){var x=0;if(T.geometry){var z=T.geometry.type;if(!(z==="Point"||z==="MultiPoint")){var W,N=0,L=0,U=0;if(i(T,function(_,M,F,V,G){if(W===void 0||I>N||V>L||G>U){W=_,N=I,L=V,U=G,x=0;return}var Z=t.lineString([W,_],T.properties);if(E(Z,I,b,G,x)===!1)return!1;x++,W=_})===!1)return!1}}})}function g(C,E,T){var I=T,b=!1;return f(C,function(x,z,W,N,L){b===!1&&T===void 0?I=x:I=E(I,x,z,W,N,L),b=!0}),I}function m(C,E){if(!C)throw new Error("geojson is required");u(C,function(T,I,b){if(T.geometry!==null){var x=T.geometry.type,z=T.geometry.coordinates;switch(x){case"LineString":if(E(T,I,b,0,0)===!1)return!1;break;case"Polygon":for(var W=0;W<z.length;W++)if(E(t.lineString(z[W],T.properties),I,b,W)===!1)return!1;break}}})}function y(C,E,T){var I=T;return m(C,function(b,x,z,W){x===0&&T===void 0?I=b:I=E(I,b,x,z,W)}),I}function P(C,E){if(E=E||{},!t.isObject(E))throw new Error("options is invalid");var T=E.featureIndex||0,I=E.multiFeatureIndex||0,b=E.geometryIndex||0,x=E.segmentIndex||0,z=E.properties,W;switch(C.type){case"FeatureCollection":T<0&&(T=C.features.length+T),z=z||C.features[T].properties,W=C.features[T].geometry;break;case"Feature":z=z||C.properties,W=C.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":W=C;break;default:throw new Error("geojson is invalid")}if(W===null)return null;var N=W.coordinates;switch(W.type){case"Point":case"MultiPoint":return null;case"LineString":return x<0&&(x=N.length+x-1),t.lineString([N[x],N[x+1]],z,E);case"Polygon":return b<0&&(b=N.length+b),x<0&&(x=N[b].length+x-1),t.lineString([N[b][x],N[b][x+1]],z,E);case"MultiLineString":return I<0&&(I=N.length+I),x<0&&(x=N[I].length+x-1),t.lineString([N[I][x],N[I][x+1]],z,E);case"MultiPolygon":return I<0&&(I=N.length+I),b<0&&(b=N[I].length+b),x<0&&(x=N[I][b].length-x-1),t.lineString([N[I][b][x],N[I][b][x+1]],z,E)}throw new Error("geojson is invalid")}function S(C,E){if(E=E||{},!t.isObject(E))throw new Error("options is invalid");var T=E.featureIndex||0,I=E.multiFeatureIndex||0,b=E.geometryIndex||0,x=E.coordIndex||0,z=E.properties,W;switch(C.type){case"FeatureCollection":T<0&&(T=C.features.length+T),z=z||C.features[T].properties,W=C.features[T].geometry;break;case"Feature":z=z||C.properties,W=C.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":W=C;break;default:throw new Error("geojson is invalid")}if(W===null)return null;var N=W.coordinates;switch(W.type){case"Point":return t.point(N,z,E);case"MultiPoint":return I<0&&(I=N.length+I),t.point(N[I],z,E);case"LineString":return x<0&&(x=N.length+x),t.point(N[x],z,E);case"Polygon":return b<0&&(b=N.length+b),x<0&&(x=N[b].length+x),t.point(N[b][x],z,E);case"MultiLineString":return I<0&&(I=N.length+I),x<0&&(x=N[I].length+x),t.point(N[I][x],z,E);case"MultiPolygon":return I<0&&(I=N.length+I),b<0&&(b=N[I].length+b),x<0&&(x=N[I][b].length-x),t.point(N[I][b][x],z,E)}throw new Error("geojson is invalid")}return Be.coordAll=a,Be.coordEach=i,Be.coordReduce=e,Be.featureEach=r,Be.featureReduce=s,Be.findPoint=S,Be.findSegment=P,Be.flattenEach=u,Be.flattenReduce=p,Be.geomEach=c,Be.geomReduce=d,Be.lineEach=m,Be.lineReduce=y,Be.propEach=n,Be.propReduce=o,Be.segmentEach=f,Be.segmentReduce=g,Be}var Ch={},J0;function fb(){if(J0)return Ch;J0=1,Object.defineProperty(Ch,"__esModule",{value:!0});var t=K0();function i(e){var n=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){n[0]>o[0]&&(n[0]=o[0]),n[1]>o[1]&&(n[1]=o[1]),n[2]<o[0]&&(n[2]=o[0]),n[3]<o[1]&&(n[3]=o[1])}),n}return i.default=i,Ch.default=i,Ch}var B0;function gb(){if(B0)return yh.exports;B0=1;var t=pb(),i=Z0(),e=K0(),n=fb().default,o=e.featureEach;e.coordEach,i.polygon;var r=i.featureCollection;function s(a){var c=new t(a);return c.insert=function(d){if(d.type!=="Feature")throw new Error("invalid feature");return d.bbox=d.bbox?d.bbox:n(d),t.prototype.insert.call(this,d)},c.load=function(d){var u=[];return Array.isArray(d)?d.forEach(function(p){if(p.type!=="Feature")throw new Error("invalid features");p.bbox=p.bbox?p.bbox:n(p),u.push(p)}):o(d,function(p){if(p.type!=="Feature")throw new Error("invalid features");p.bbox=p.bbox?p.bbox:n(p),u.push(p)}),t.prototype.load.call(this,u)},c.remove=function(d,u){if(d.type!=="Feature")throw new Error("invalid feature");return d.bbox=d.bbox?d.bbox:n(d),t.prototype.remove.call(this,d,u)},c.clear=function(){return t.prototype.clear.call(this)},c.search=function(d){var u=t.prototype.search.call(this,this.toBBox(d));return r(u)},c.collides=function(d){return t.prototype.collides.call(this,this.toBBox(d))},c.all=function(){var d=t.prototype.all.call(this);return r(d)},c.toJSON=function(){return t.prototype.toJSON.call(this)},c.fromJSON=function(d){return t.prototype.fromJSON.call(this,d)},c.toBBox=function(d){var u;if(d.bbox)u=d.bbox;else if(Array.isArray(d)&&d.length===4)u=d;else if(Array.isArray(d)&&d.length===6)u=[d[0],d[1],d[3],d[4]];else if(d.type==="Feature")u=n(d);else if(d.type==="FeatureCollection")u=n(d);else throw new Error("invalid geojson");return{minX:u[0],minY:u[1],maxX:u[2],maxY:u[3]}},c}return yh.exports=s,yh.exports.default=s,yh.exports}var mb=gb();const vb=mc(mb);function Kp(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Ii(t)),i.type==="LineString"&&(i=Ii(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=j0(t,i);return o&&n.push(o),Di(n)}var r=vb();return r.load($0(i)),mh($0(t),function(s){mh(r.search(s),function(a){var c=j0(s,a);if(c){var d=bi(c).join(",");e[d]||(e[d]=!0,n.push(c))}})}),Di(n)}function j0(t,i){var e=bi(t),n=bi(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],s=e[1][0],a=e[1][1],c=n[0][0],d=n[0][1],u=n[1][0],p=n[1][1],f=(p-d)*(s-o)-(u-c)*(a-r),g=(u-c)*(r-d)-(p-d)*(o-c),m=(s-o)*(r-d)-(a-r)*(o-c);if(f===0)return null;var y=g/f,P=m/f;if(y>=0&&y<=1&&P>=0&&P<=1){var S=o+y*(s-o),C=r+y*(a-r);return zn([S,C])}return null}function _h(t,i,e){e===void 0&&(e={});for(var n=fh(t),o=bi(i),r=0;r<o.length-1;r++){var s=!1;if(e.ignoreEndVertices&&(r===0&&(s="start"),r===o.length-2&&(s="end"),r===0&&r+1===o.length-1&&(s="both")),yb(o[r],o[r+1],n,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function yb(t,i,e,n,o){var r=e[0],s=e[1],a=t[0],c=t[1],d=i[0],u=i[1],p=e[0]-a,f=e[1]-c,g=d-a,m=u-c,y=p*m-f*g;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(m)?g>0?a<r&&r<=d:d<=r&&r<a:m>0?c<s&&s<=u:u<=s&&s<c;if(n==="end")return Math.abs(g)>=Math.abs(m)?g>0?a<=r&&r<d:d<r&&r<=a:m>0?c<=s&&s<u:u<s&&s<=c;if(n==="both")return Math.abs(g)>=Math.abs(m)?g>0?a<r&&r<d:d<r&&r<a:m>0?c<s&&s<u:u<s&&s<c}else return Math.abs(g)>=Math.abs(m)?g>0?a<=r&&r<=d:d<=r&&r<=a:m>0?c<=s&&s<=u:u<=s&&s<=c;return!1}function wb(t,i){var e=Ri(t),n=Ri(i),o=e.type,r=n.type;switch(o){case"Point":switch(r){case"MultiPoint":return Cb(e,n);case"LineString":return _h(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Pt(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return _b(e,n);case"LineString":return Pb(e,n);case"Polygon":case"MultiPolygon":return Sb(e,n);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return Eb(e,n);case"Polygon":case"MultiPolygon":return Ab(e,n);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return Tb(e,n);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function Cb(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(tw(i.coordinates[e],t.coordinates)){n=!0;break}return n}function _b(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)tw(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function Pb(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!_h(t.coordinates[n],i))return!1;e||(e=_h(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function Sb(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=Pt(t.coordinates[1],i),!n){e=!1;break}n=Pt(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function Eb(t,i){for(var e=0;e<t.coordinates.length;e++)if(!_h(t.coordinates[e],i))return!1;return!0}function Ab(t,i){var e=Do(i),n=Do(t);if(!ew(e,n))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!Pt(t.coordinates[r],i))return!1;if(o||(o=Pt(t.coordinates[r],i,{ignoreBoundary:!0})),!o){var s=Mb(t.coordinates[r],t.coordinates[r+1]);o=Pt(s,i,{ignoreBoundary:!0})}}return o}function Tb(t,i){var e=Do(t),n=Do(i);if(!ew(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!Pt(t.coordinates[0][o],i))return!1;return!0}function ew(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function tw(t,i){return t[0]===i[0]&&t[1]===i[1]}function Mb(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function iw(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],r=t[1],s=t[2],a=t[3],c=i/xi([o,r],[s,r],e),d=c*(s-o),u=i/xi([o,r],[o,a],e),p=u*(a-r),f=s-o,g=a-r,m=Math.floor(f/d),y=Math.floor(g/p),P=(f-m*d)/2,S=(g-y*p)/2,C=o+P;C<=s;){for(var E=r+S;E<=a;){var T=zn([C,E],e.properties);e.mask?wb(T,e.mask)&&n.push(T):n.push(T),E+=p}C+=d}return Di(n)}function Jp(t,i){i===void 0&&(i={});var e=Ri(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return Ib(e,i);case"MultiPolygon":return Db(e,i);default:throw new Error("invalid poly")}}function Ib(t,i){i===void 0&&(i={});var e=Ri(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return nw(n,o)}function Db(t,i){i===void 0&&(i={});var e=Ri(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},r=[];return n.forEach(function(s){r.push(nw(s,o))}),Di(r)}function nw(t,i){return t.length>1?_D(t,i):uh(t[0],i)}var Bp,ow;function rw(){if(ow)return Bp;ow=1;var t=Object.prototype.toString;return Bp=function(e){var n=t.call(e),o=n==="[object Arguments]";return o||(o=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Bp}var jp,sw;function bb(){if(sw)return jp;sw=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=rw(),o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),s=o.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var g=f.constructor;return g&&g.prototype===f},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},u=(function(){if(typeof window>"u")return!1;for(var f in window)try{if(!d["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1})(),p=function(f){if(typeof window>"u"||!u)return c(f);try{return c(f)}catch{return!1}};t=function(g){var m=g!==null&&typeof g=="object",y=e.call(g)==="[object Function]",P=n(g),S=m&&e.call(g)==="[object String]",C=[];if(!m&&!y&&!P)throw new TypeError("Object.keys called on a non-object");var E=s&&y;if(S&&g.length>0&&!i.call(g,0))for(var T=0;T<g.length;++T)C.push(String(T));if(P&&g.length>0)for(var I=0;I<g.length;++I)C.push(String(I));else for(var b in g)!(E&&b==="prototype")&&i.call(g,b)&&C.push(String(b));if(r)for(var x=p(g),z=0;z<a.length;++z)!(x&&a[z]==="constructor")&&i.call(g,a[z])&&C.push(a[z]);return C}}return jp=t,jp}var ef,aw;function lw(){if(aw)return ef;aw=1;var t=Array.prototype.slice,i=rw(),e=Object.keys,n=e?function(s){return e(s)}:bb(),o=Object.keys;return n.shim=function(){if(Object.keys){var s=(function(){var a=Object.keys(arguments);return a&&a.length===arguments.length})(1,2);s||(Object.keys=function(c){return i(c)?o(t.call(c)):o(c)})}else Object.keys=n;return Object.keys||n},ef=n,ef}var tf,cw;function hw(){return cw||(cw=1,tf=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var r in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var s=Object.getOwnPropertySymbols(i);if(s.length!==1||s[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(i,e);if(a.value!==o||a.enumerable!==!0)return!1}return!0}),tf}var nf,dw;function of(){if(dw)return nf;dw=1;var t=hw();return nf=function(){return t()&&!!Symbol.toStringTag},nf}var rf,uw;function pw(){return uw||(uw=1,rf=Object),rf}var sf,fw;function gw(){return fw||(fw=1,sf=Error),sf}var af,mw;function Rb(){return mw||(mw=1,af=EvalError),af}var lf,vw;function xb(){return vw||(vw=1,lf=RangeError),lf}var cf,yw;function Fb(){return yw||(yw=1,cf=ReferenceError),cf}var hf,ww;function Cw(){return ww||(ww=1,hf=SyntaxError),hf}var df,_w;function Ur(){return _w||(_w=1,df=TypeError),df}var uf,Pw;function kb(){return Pw||(Pw=1,uf=URIError),uf}var pf,Sw;function zb(){return Sw||(Sw=1,pf=Math.abs),pf}var ff,Ew;function Lb(){return Ew||(Ew=1,ff=Math.floor),ff}var gf,Aw;function Ob(){return Aw||(Aw=1,gf=Math.max),gf}var mf,Tw;function Nb(){return Tw||(Tw=1,mf=Math.min),mf}var vf,Mw;function Vb(){return Mw||(Mw=1,vf=Math.pow),vf}var yf,Iw;function Ub(){return Iw||(Iw=1,yf=Math.round),yf}var wf,Dw;function Wb(){return Dw||(Dw=1,wf=Number.isNaN||function(i){return i!==i}),wf}var Cf,bw;function Gb(){if(bw)return Cf;bw=1;var t=Wb();return Cf=function(e){return t(e)||e===0?e:e<0?-1:1},Cf}var _f,Rw;function Hb(){return Rw||(Rw=1,_f=Object.getOwnPropertyDescriptor),_f}var Pf,xw;function Wr(){if(xw)return Pf;xw=1;var t=Hb();if(t)try{t([],"length")}catch{t=null}return Pf=t,Pf}var Sf,Fw;function Ph(){if(Fw)return Sf;Fw=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return Sf=t,Sf}var Ef,kw;function qb(){if(kw)return Ef;kw=1;var t=typeof Symbol<"u"&&Symbol,i=hw();return Ef=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},Ef}var Af,zw;function Lw(){return zw||(zw=1,Af=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Af}var Tf,Ow;function Nw(){if(Ow)return Tf;Ow=1;var t=pw();return Tf=t.getPrototypeOf||null,Tf}var Mf,Vw;function $b(){if(Vw)return Mf;Vw=1;var t="Function.prototype.bind called on incompatible ",i=Object.prototype.toString,e=Math.max,n="[object Function]",o=function(c,d){for(var u=[],p=0;p<c.length;p+=1)u[p]=c[p];for(var f=0;f<d.length;f+=1)u[f+c.length]=d[f];return u},r=function(c,d){for(var u=[],p=d,f=0;p<c.length;p+=1,f+=1)u[f]=c[p];return u},s=function(a,c){for(var d="",u=0;u<a.length;u+=1)d+=a[u],u+1<a.length&&(d+=c);return d};return Mf=function(c){var d=this;if(typeof d!="function"||i.apply(d)!==n)throw new TypeError(t+d);for(var u=r(arguments,1),p,f=function(){if(this instanceof p){var S=d.apply(this,o(u,arguments));return Object(S)===S?S:this}return d.apply(c,o(u,arguments))},g=e(0,d.length-u.length),m=[],y=0;y<g;y++)m[y]="$"+y;if(p=Function("binder","return function ("+s(m,",")+"){ return binder.apply(this,arguments); }")(f),d.prototype){var P=function(){};P.prototype=d.prototype,p.prototype=new P,P.prototype=null}return p},Mf}var If,Uw;function qs(){if(Uw)return If;Uw=1;var t=$b();return If=Function.prototype.bind||t,If}var Df,Ww;function bf(){return Ww||(Ww=1,Df=Function.prototype.call),Df}var Rf,Gw;function xf(){return Gw||(Gw=1,Rf=Function.prototype.apply),Rf}var Ff,Hw;function Xb(){return Hw||(Hw=1,Ff=typeof Reflect<"u"&&Reflect&&Reflect.apply),Ff}var kf,qw;function $w(){if(qw)return kf;qw=1;var t=qs(),i=xf(),e=bf(),n=Xb();return kf=n||t.call(e,i),kf}var zf,Xw;function Lf(){if(Xw)return zf;Xw=1;var t=qs(),i=Ur(),e=bf(),n=$w();return zf=function(r){if(r.length<1||typeof r[0]!="function")throw new i("a function is required");return n(t,e,r)},zf}var Of,Yw;function Yb(){if(Yw)return Of;Yw=1;var t=Lf(),i=Wr(),e;try{e=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var n=!!e&&i&&i(Object.prototype,"__proto__"),o=Object,r=o.getPrototypeOf;return Of=n&&typeof n.get=="function"?t([n.get]):typeof r=="function"?function(a){return r(a==null?a:o(a))}:!1,Of}var Nf,Zw;function Qw(){if(Zw)return Nf;Zw=1;var t=Lw(),i=Nw(),e=Yb();return Nf=t?function(o){return t(o)}:i?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return i(o)}:e?function(o){return e(o)}:null,Nf}var Vf,Kw;function Jw(){if(Kw)return Vf;Kw=1;var t=Function.prototype.call,i=Object.prototype.hasOwnProperty,e=qs();return Vf=e.call(t,i),Vf}var Uf,Bw;function jw(){if(Bw)return Uf;Bw=1;var t,i=pw(),e=gw(),n=Rb(),o=xb(),r=Fb(),s=Cw(),a=Ur(),c=kb(),d=zb(),u=Lb(),p=Ob(),f=Nb(),g=Vb(),m=Ub(),y=Gb(),P=Function,S=function(me){try{return P('"use strict"; return ('+me+").constructor;")()}catch{}},C=Wr(),E=Ph(),T=function(){throw new a},I=C?(function(){try{return arguments.callee,T}catch{try{return C(arguments,"callee").get}catch{return T}}})():T,b=qb()(),x=Qw(),z=Nw(),W=Lw(),N=xf(),L=bf(),U={},_=typeof Uint8Array>"u"||!x?t:x(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":b&&x?x([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":U,"%AsyncGenerator%":U,"%AsyncGeneratorFunction%":U,"%AsyncIteratorPrototype%":U,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":n,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":P,"%GeneratorFunction%":U,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":b&&x?x(x([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!b||!x?t:x(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!b||!x?t:x(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":b&&x?x(""[Symbol.iterator]()):t,"%Symbol%":b?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":I,"%TypedArray%":_,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":L,"%Function.prototype.apply%":N,"%Object.defineProperty%":E,"%Object.getPrototypeOf%":z,"%Math.abs%":d,"%Math.floor%":u,"%Math.max%":p,"%Math.min%":f,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":y,"%Reflect.getPrototypeOf%":W};if(x)try{null.error}catch(me){var F=x(x(me));M["%Error.prototype%"]=F}var V=function me(ne){var he;if(ne==="%AsyncFunction%")he=S("async function () {}");else if(ne==="%GeneratorFunction%")he=S("function* () {}");else if(ne==="%AsyncGeneratorFunction%")he=S("async function* () {}");else if(ne==="%AsyncGenerator%"){var de=me("%AsyncGeneratorFunction%");de&&(he=de.prototype)}else if(ne==="%AsyncIteratorPrototype%"){var Me=me("%AsyncGenerator%");Me&&x&&(he=x(Me.prototype))}return M[ne]=he,he},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Z=qs(),$=Jw(),Y=Z.call(L,Array.prototype.concat),K=Z.call(N,Array.prototype.splice),te=Z.call(L,String.prototype.replace),re=Z.call(L,String.prototype.slice),ge=Z.call(L,RegExp.prototype.exec),ye=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Te=/\\(\\)?/g,Oe=function(ne){var he=re(ne,0,1),de=re(ne,-1);if(he==="%"&&de!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(de==="%"&&he!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var Me=[];return te(ne,ye,function(Ne,Ot,st,Uh){Me[Me.length]=st?te(Uh,Te,"$1"):Ot||Ne}),Me},We=function(ne,he){var de=ne,Me;if($(G,de)&&(Me=G[de],de="%"+Me[0]+"%"),$(M,de)){var Ne=M[de];if(Ne===U&&(Ne=V(de)),typeof Ne>"u"&&!he)throw new a("intrinsic "+ne+" exists, but is not available. Please file an issue!");return{alias:Me,name:de,value:Ne}}throw new s("intrinsic "+ne+" does not exist!")};return Uf=function(ne,he){if(typeof ne!="string"||ne.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof he!="boolean")throw new a('"allowMissing" argument must be a boolean');if(ge(/^%?[^%]*%?$/,ne)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var de=Oe(ne),Me=de.length>0?de[0]:"",Ne=We("%"+Me+"%",he),Ot=Ne.name,st=Ne.value,Uh=!1,dm=Ne.alias;dm&&(Me=dm[0],K(de,Y([0,1],dm)));for(var Wh=1,Ql=!0;Wh<de.length;Wh+=1){var ln=de[Wh],Gh=re(ln,0,1),Hh=re(ln,-1);if((Gh==='"'||Gh==="'"||Gh==="`"||Hh==='"'||Hh==="'"||Hh==="`")&&Gh!==Hh)throw new s("property names with quotes must have matching quotes");if((ln==="constructor"||!Ql)&&(Uh=!0),Me+="."+ln,Ot="%"+Me+"%",$(M,Ot))st=M[Ot];else if(st!=null){if(!(ln in st)){if(!he)throw new a("base intrinsic for "+ne+" exists, but the property is not available.");return}if(C&&Wh+1>=de.length){var qh=C(st,ln);Ql=!!qh,Ql&&"get"in qh&&!("originalValue"in qh.get)?st=qh.get:st=st[ln]}else Ql=$(st,ln),st=st[ln];Ql&&!Uh&&(M[Ot]=st)}}return st},Uf}var Wf,eC;function Gf(){if(eC)return Wf;eC=1;var t=jw(),i=Lf(),e=i([t("%String.prototype.indexOf%")]);return Wf=function(o,r){var s=t(o,!!r);return typeof s=="function"&&e(o,".prototype.")>-1?i([s]):s},Wf}var Hf,tC;function Zb(){if(tC)return Hf;tC=1;var t=of()(),i=Gf(),e=i("Object.prototype.toString"),n=function(a){return t&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:e(a)==="[object Arguments]"},o=function(a){return n(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&e(a)!=="[object Array]"&&"callee"in a&&e(a.callee)==="[object Function]"},r=(function(){return n(arguments)})();return n.isLegacyArguments=o,Hf=r?n:o,Hf}var qf,iC;function $f(){if(iC)return qf;iC=1;var t=Ph(),i=Cw(),e=Ur(),n=Wr();return qf=function(r,s,a){if(!r||typeof r!="object"&&typeof r!="function")throw new e("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,d=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,f=!!n&&n(r,s);if(t)t(r,s,{configurable:u===null&&f?f.configurable:!u,enumerable:c===null&&f?f.enumerable:!c,value:a,writable:d===null&&f?f.writable:!d});else if(p||!c&&!d&&!u)r[s]=a;else throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},qf}var Xf,nC;function Yf(){if(nC)return Xf;nC=1;var t=Ph(),i=function(){return!!t};return i.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Xf=i,Xf}var Zf,oC;function $s(){if(oC)return Zf;oC=1;var t=lw(),i=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,n=Array.prototype.concat,o=$f(),r=function(d){return typeof d=="function"&&e.call(d)==="[object Function]"},s=Yf()(),a=function(d,u,p,f){if(u in d){if(f===!0){if(d[u]===p)return}else if(!r(f)||!f())return}s?o(d,u,p,!0):o(d,u,p)},c=function(d,u){var p=arguments.length>2?arguments[2]:{},f=t(u);i&&(f=n.call(f,Object.getOwnPropertySymbols(u)));for(var g=0;g<f.length;g+=1)a(d,f[g],u[f[g]],p[f[g]])};return c.supportsDescriptors=!!s,Zf=c,Zf}var Qf={exports:{}},Kf,rC;function Qb(){if(rC)return Kf;rC=1;var t=jw(),i=$f(),e=Yf()(),n=Wr(),o=Ur(),r=t("%Math.floor%");return Kf=function(a,c){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||r(c)!==c)throw new o("`length` must be a positive 32-bit integer");var d=arguments.length>2&&!!arguments[2],u=!0,p=!0;if("length"in a&&n){var f=n(a,"length");f&&!f.configurable&&(u=!1),f&&!f.writable&&(p=!1)}return(u||p||!d)&&(e?i(a,"length",c,!0,!0):i(a,"length",c)),a},Kf}var Jf,sC;function Kb(){if(sC)return Jf;sC=1;var t=qs(),i=xf(),e=$w();return Jf=function(){return e(t,i,arguments)},Jf}var aC;function lC(){return aC||(aC=1,(function(t){var i=Qb(),e=Ph(),n=Lf(),o=Kb();t.exports=function(s){var a=n(arguments),c=s.length-(arguments.length-1);return i(a,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(Qf)),Qf.exports}var Bf,cC;function hC(){if(cC)return Bf;cC=1;var t=function(i){return i!==i};return Bf=function(e,n){return e===0&&n===0?1/e===1/n:!!(e===n||t(e)&&t(n))},Bf}var jf,dC;function uC(){if(dC)return jf;dC=1;var t=hC();return jf=function(){return typeof Object.is=="function"?Object.is:t},jf}var eg,pC;function Jb(){if(pC)return eg;pC=1;var t=uC(),i=$s();return eg=function(){var n=t();return i(Object,{is:n},{is:function(){return Object.is!==n}}),n},eg}var tg,fC;function Bb(){if(fC)return tg;fC=1;var t=$s(),i=lC(),e=hC(),n=uC(),o=Jb(),r=i(n(),Object);return t(r,{getPolyfill:n,implementation:e,shim:o}),tg=r,tg}var ig,gC;function jb(){if(gC)return ig;gC=1;var t=Gf(),i=of()(),e=Jw(),n=Wr(),o;if(i){var r=t("RegExp.prototype.exec"),s={},a=function(){throw s},c={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(c[Symbol.toPrimitive]=a),o=function(f){if(!f||typeof f!="object")return!1;var g=n(f,"lastIndex"),m=g&&e(g,"value");if(!m)return!1;try{r(f,c)}catch(y){return y===s}}}else{var d=t("Object.prototype.toString"),u="[object RegExp]";o=function(f){return!f||typeof f!="object"&&typeof f!="function"?!1:d(f)===u}}return ig=o,ig}var ng,mC;function eR(){if(mC)return ng;mC=1;var t=function(){return typeof(function(){}).name=="string"},i=Object.getOwnPropertyDescriptor;if(i)try{i([],"length")}catch{i=null}t.functionsHaveConfigurableNames=function(){if(!t()||!i)return!1;var o=i(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},ng=t,ng}var og,vC;function tR(){if(vC)return og;vC=1;var t=$f(),i=Yf()(),e=eR().functionsHaveConfigurableNames(),n=Ur();return og=function(r,s){if(typeof r!="function")throw new n("`fn` is not a function");var a=arguments.length>2&&!!arguments[2];return(!a||e)&&(i?t(r,"name",s,!0,!0):t(r,"name",s)),r},og}var rg,yC;function wC(){if(yC)return rg;yC=1;var t=tR(),i=Ur(),e=Object;return rg=t(function(){if(this==null||this!==e(this))throw new i("RegExp.prototype.flags getter called on non-object");var o="";return this.hasIndices&&(o+="d"),this.global&&(o+="g"),this.ignoreCase&&(o+="i"),this.multiline&&(o+="m"),this.dotAll&&(o+="s"),this.unicode&&(o+="u"),this.unicodeSets&&(o+="v"),this.sticky&&(o+="y"),o},"get flags",!0),rg}var sg,CC;function _C(){if(CC)return sg;CC=1;var t=wC(),i=$s().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return sg=function(){if(i&&/a/mig.flags==="gim"){var o=e(RegExp.prototype,"flags");if(o&&typeof o.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",s={};if(Object.defineProperty(s,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(s,"sticky",{get:function(){r+="y"}}),o.get.call(s),r==="dy")return o.get}}return t},sg}var ag,PC;function iR(){if(PC)return ag;PC=1;var t=$s().supportsDescriptors,i=_C(),e=Wr(),n=Object.defineProperty,o=gw(),r=Qw(),s=/a/;return ag=function(){if(!t||!r)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var c=i(),d=r(s),u=e(d,"flags");return(!u||u.get!==c)&&n(d,"flags",{configurable:!0,enumerable:!1,get:c}),c},ag}var lg,SC;function nR(){if(SC)return lg;SC=1;var t=$s(),i=lC(),e=wC(),n=_C(),o=iR(),r=i(n());return t(r,{getPolyfill:n,implementation:e,shim:o}),lg=r,lg}var cg,EC;function oR(){if(EC)return cg;EC=1;var t=Gf(),i=t("Date.prototype.getDay"),e=function(a){try{return i(a),!0}catch{return!1}},n=t("Object.prototype.toString"),o="[object Date]",r=of()();return cg=function(a){return typeof a!="object"||a===null?!1:r?e(a):n(a)===o},cg}var hg,AC;function rR(){if(AC)return hg;AC=1;var t=lw(),i=Zb(),e=Bb(),n=jb(),o=nR(),r=oR(),s=Date.prototype.getTime;function a(p,f,g){var m=g||{};return(m.strict?e(p,f):p===f)?!0:!p||!f||typeof p!="object"&&typeof f!="object"?m.strict?e(p,f):p==f:u(p,f,m)}function c(p){return p==null}function d(p){return!(!p||typeof p!="object"||typeof p.length!="number"||typeof p.copy!="function"||typeof p.slice!="function"||p.length>0&&typeof p[0]!="number")}function u(p,f,g){var m,y;if(typeof p!=typeof f||c(p)||c(f)||p.prototype!==f.prototype||i(p)!==i(f))return!1;var P=n(p),S=n(f);if(P!==S)return!1;if(P||S)return p.source===f.source&&o(p)===o(f);if(r(p)&&r(f))return s.call(p)===s.call(f);var C=d(p),E=d(f);if(C!==E)return!1;if(C||E){if(p.length!==f.length)return!1;for(m=0;m<p.length;m++)if(p[m]!==f[m])return!1;return!0}if(typeof p!=typeof f)return!1;try{var T=t(p),I=t(f)}catch{return!1}if(T.length!==I.length)return!1;for(T.sort(),I.sort(),m=T.length-1;m>=0;m--)if(T[m]!=I[m])return!1;for(m=T.length-1;m>=0;m--)if(y=T[m],!a(p[y],f[y],g))return!1;return!0}return hg=a,hg}function sR(t,i){var e=!0;return kr(t,function(n){kr(i,function(o){if(e===!1)return!1;e=aR(n.geometry,o.geometry)})}),e}function aR(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!dR(t.coordinates,i.coordinates);case"LineString":return!TC(i,t);case"Polygon":return!Pt(t,i)}break;case"LineString":switch(i.type){case"Point":return!TC(t,i);case"LineString":return!lR(t,i);case"Polygon":return!MC(i,t)}break;case"Polygon":switch(i.type){case"Point":return!Pt(i,t);case"LineString":return!MC(t,i);case"Polygon":return!cR(i,t)}}return!1}function TC(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(hR(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function lR(t,i){var e=Kp(t,i);return e.features.length>0}function MC(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(Pt(o,t))return!0}var r=Kp(i,Jp(t));return r.features.length>0}function cR(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(Pt(o,i))return!0}for(var r=0,s=i.coordinates[0];r<s.length;r++){var a=s[r];if(Pt(a,t))return!0}var c=Kp(Jp(t),Jp(i));return c.features.length>0}function hR(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],r=i[0]-t[0],s=i[1]-t[1],a=n*s-o*r;return a!==0?!1:Math.abs(r)>=Math.abs(s)?r>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:s>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function dR(t,i){return t[0]===i[0]&&t[1]===i[1]}var dg,IC;function uR(){if(IC)return dg;IC=1;var t=rR(),i=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:o};i.prototype.compare=function(r,s){if(r.type!==s.type||!n(r,s))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,s.coordinates);case"LineString":return this.compareLine(r.coordinates,s.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,s);case"Feature":return this.compareFeature(r,s);default:if(r.type.indexOf("Multi")===0){var a=this,c=e(r),d=e(s);return c.every(function(u){return this.some(function(p){return a.compare(u,p)})},d)}}return!1};function e(r){return r.coordinates.map(function(s){return{type:r.type.replace("Multi",""),coordinates:s}})}function n(r,s){return r.hasOwnProperty("coordinates")?r.coordinates.length===s.coordinates.length:r.length===s.length}i.prototype.compareCoord=function(r,s){if(r.length!==s.length)return!1;for(var a=0;a<r.length;a++)if(r[a].toFixed(this.precision)!==s[a].toFixed(this.precision))return!1;return!0},i.prototype.compareLine=function(r,s,a,c){if(!n(r,s))return!1;var d=this.pseudoNode?r:this.removePseudo(r),u=this.pseudoNode?s:this.removePseudo(s);if(!(c&&!this.compareCoord(d[0],u[0])&&(u=this.fixStartIndex(u,d),!u))){var p=this.compareCoord(d[a],u[a]);return this.direction||p?this.comparePath(d,u):this.compareCoord(d[a],u[u.length-(1+a)])?this.comparePath(d.slice().reverse(),u):!1}},i.prototype.fixStartIndex=function(r,s){for(var a,c=-1,d=0;d<r.length;d++)if(this.compareCoord(r[d],s[0])){c=d;break}return c>=0&&(a=[].concat(r.slice(c,r.length),r.slice(1,c+1))),a},i.prototype.comparePath=function(r,s){var a=this;return r.every(function(c,d){return a.compareCoord(c,this[d])},s)},i.prototype.comparePolygon=function(r,s){if(this.compareLine(r.coordinates[0],s.coordinates[0],1,!0)){var a=r.coordinates.slice(1,r.coordinates.length),c=s.coordinates.slice(1,s.coordinates.length),d=this;return a.every(function(u){return this.some(function(p){return d.compareLine(u,p,1,!0)})},c)}else return!1},i.prototype.compareFeature=function(r,s){return r.id!==s.id||!this.objectComparator(r.properties,s.properties)||!this.compareBBox(r,s)?!1:this.compare(r.geometry,s.geometry)},i.prototype.compareBBox=function(r,s){return!!(!r.bbox&&!s.bbox||r.bbox&&s.bbox&&this.compareCoord(r.bbox,s.bbox))},i.prototype.removePseudo=function(r){return r};function o(r,s){return t(r,s,{strict:!0})}return dg=i,dg}var pR=uR();const fR=mc(pR);function gR(t,i){var e=Ri(t).type,n=Ri(i).type;if(e!==n)return!1;var o=new fR({precision:6});return o.compare(G0(t),G0(i))}function mR(t,i){var e=!1;return kr(t,function(n){kr(i,function(o){if(e===!0)return!0;e=!sR(n.geometry,o.geometry)})}),e}/**
|
|
1858
1858
|
* splaytree v3.1.2
|
|
1859
1859
|
* Fast Splay tree for Node and browser
|
|
1860
1860
|
*
|
|
@@ -1874,8 +1874,8 @@ function (result, this, instanceIndex, frameState) {
|
|
|
1874
1874
|
|
|
1875
1875
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
1876
1876
|
and limitations under the License.
|
|
1877
|
-
***************************************************************************** */function
|
|
1878
|
-
`);var r=i+(e?" ":"│ ");t.left&&ug(t.left,r,!1,n,o),t.right&&ug(t.right,r,!0,n,o)}}var pg=function(){function t(i){i===void 0&&(i=dR),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=dg(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Ln(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,r=On(i,this._root,o),s=o(i,r.key);return s===0?this._root=r:(s<0?(n.left=r.left,n.right=r,r.left=null):s>0&&(n.right=r.right,n.left=r,r.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=On(i,e,n);var r=n(i,e.key);return r===0?(e.left===null?o=e.right:(o=On(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=On(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=On(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],r=!1;!r;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):r=!0;return this},t.prototype.range=function(i,e,n,o){for(var r=[],s=this._comparator,a=this._root,c;r.length!==0||a;)if(a)r.push(a),a=a.left;else{if(a=r.pop(),c=s(a.key,e),c>0)break;if(s(a.key,i)>=0&&n.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,r=[];!n;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var r=o(i.key,e.key);if(r===0)break;r<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var r=o(i.key,e.key);if(r===0)break;r<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return fR(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,r=this._comparator;if(n&&mg(i,e,0,o-1,r),this._root===null)this._root=fg(i,e,0,o),this._size=o;else{var s=gR(this.toList(),pR(i,e),r);o=this._size+o,this._root=gg({head:s},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return ug(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,r=TC(i,this._root,o),s=r.left,a=r.right;o(i,e)<0?a=dg(e,n,a,o):s=dg(e,n,s,o),this._root=uR(s,a,o)},t.prototype.split=function(i){return TC(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return hR(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function fg(t,i,e,n){var o=n-e;if(o>0){var r=e+Math.floor(o/2),s=t[r],a=i[r],c=new Ln(s,a);return c.left=fg(t,i,e,r),c.right=fg(t,i,r+1,n),c}return null}function pR(t,i){for(var e=new Ln(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Ln(t[o],i[o]);return n.next=null,e.next}function fR(t){for(var i=t,e=[],n=!1,o=new Ln(null,null),r=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=r=r.next=e.pop(),i=i.right):n=!0;return r.next=null,o.next}function gg(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),r=gg(t,i,o),s=t.head;return s.left=r,t.head=t.head.next,s.right=gg(t,o+1,e),s}return null}function gR(t,i,e){for(var n=new Ln(null,null),o=n,r=t,s=i;r!==null&&s!==null;)e(r.key,s.key)<0?(o.next=r,r=r.next):(o.next=s,s=s.next),o=o.next;return r!==null?o.next=r:s!==null&&(o.next=s),n.next}function mg(t,i,e,n,o){if(!(e>=n)){for(var r=t[e+n>>1],s=e-1,a=n+1;;){do s++;while(o(t[s],r)<0);do a--;while(o(t[a],r)>0);if(s>=a)break;var c=t[s];t[s]=t[a],t[a]=c,c=i[s],i[s]=i[a],i[a]=c}mg(t,i,e,a,o),mg(t,i,a+1,n,o)}}const Bi=11102230246251565e-32,yt=134217729,mR=(3+8*Bi)*Bi;function vg(t,i,e,n,o){let r,s,a,c,d=i[0],u=n[0],p=0,f=0;u>d==u>-d?(r=d,d=i[++p]):(r=u,u=n[++f]);let g=0;if(p<t&&f<e)for(u>d==u>-d?(s=d+r,a=r-(s-d),d=i[++p]):(s=u+r,a=r-(s-u),u=n[++f]),r=s,a!==0&&(o[g++]=a);p<t&&f<e;)u>d==u>-d?(s=r+d,c=s-r,a=r-(s-c)+(d-c),d=i[++p]):(s=r+u,c=s-r,a=r-(s-c)+(u-c),u=n[++f]),r=s,a!==0&&(o[g++]=a);for(;p<t;)s=r+d,c=s-r,a=r-(s-c)+(d-c),d=i[++p],r=s,a!==0&&(o[g++]=a);for(;f<e;)s=r+u,c=s-r,a=r-(s-c)+(u-c),u=n[++f],r=s,a!==0&&(o[g++]=a);return(r!==0||g===0)&&(o[g++]=r),g}function vR(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function $s(t){return new Float64Array(t)}const yR=(3+16*Bi)*Bi,wR=(2+12*Bi)*Bi,CR=(9+64*Bi)*Bi*Bi,Wr=$s(4),MC=$s(8),IC=$s(12),DC=$s(16),Pt=$s(4);function _R(t,i,e,n,o,r,s){let a,c,d,u,p,f,g,m,y,P,S,C,E,T,I,b,x,z;const W=t-o,N=e-o,L=i-r,U=n-r;T=W*U,f=yt*W,g=f-(f-W),m=W-g,f=yt*U,y=f-(f-U),P=U-y,I=m*P-(T-g*y-m*y-g*P),b=L*N,f=yt*L,g=f-(f-L),m=L-g,f=yt*N,y=f-(f-N),P=N-y,x=m*P-(b-g*y-m*y-g*P),S=I-x,p=I-S,Wr[0]=I-(S+p)+(p-x),C=T+S,p=C-T,E=T-(C-p)+(S-p),S=E-b,p=E-S,Wr[1]=E-(S+p)+(p-b),z=C+S,p=z-C,Wr[2]=C-(z-p)+(S-p),Wr[3]=z;let _=vR(4,Wr),M=wR*s;if(_>=M||-_>=M||(p=t-W,a=t-(W+p)+(p-o),p=e-N,d=e-(N+p)+(p-o),p=i-L,c=i-(L+p)+(p-r),p=n-U,u=n-(U+p)+(p-r),a===0&&c===0&&d===0&&u===0)||(M=CR*s+mR*Math.abs(_),_+=W*u+U*a-(L*d+N*c),_>=M||-_>=M))return _;T=a*U,f=yt*a,g=f-(f-a),m=a-g,f=yt*U,y=f-(f-U),P=U-y,I=m*P-(T-g*y-m*y-g*P),b=c*N,f=yt*c,g=f-(f-c),m=c-g,f=yt*N,y=f-(f-N),P=N-y,x=m*P-(b-g*y-m*y-g*P),S=I-x,p=I-S,Pt[0]=I-(S+p)+(p-x),C=T+S,p=C-T,E=T-(C-p)+(S-p),S=E-b,p=E-S,Pt[1]=E-(S+p)+(p-b),z=C+S,p=z-C,Pt[2]=C-(z-p)+(S-p),Pt[3]=z;const F=vg(4,Wr,4,Pt,MC);T=W*u,f=yt*W,g=f-(f-W),m=W-g,f=yt*u,y=f-(f-u),P=u-y,I=m*P-(T-g*y-m*y-g*P),b=L*d,f=yt*L,g=f-(f-L),m=L-g,f=yt*d,y=f-(f-d),P=d-y,x=m*P-(b-g*y-m*y-g*P),S=I-x,p=I-S,Pt[0]=I-(S+p)+(p-x),C=T+S,p=C-T,E=T-(C-p)+(S-p),S=E-b,p=E-S,Pt[1]=E-(S+p)+(p-b),z=C+S,p=z-C,Pt[2]=C-(z-p)+(S-p),Pt[3]=z;const V=vg(F,MC,4,Pt,IC);T=a*u,f=yt*a,g=f-(f-a),m=a-g,f=yt*u,y=f-(f-u),P=u-y,I=m*P-(T-g*y-m*y-g*P),b=c*d,f=yt*c,g=f-(f-c),m=c-g,f=yt*d,y=f-(f-d),P=d-y,x=m*P-(b-g*y-m*y-g*P),S=I-x,p=I-S,Pt[0]=I-(S+p)+(p-x),C=T+S,p=C-T,E=T-(C-p)+(S-p),S=E-b,p=E-S,Pt[1]=E-(S+p)+(p-b),z=C+S,p=z-C,Pt[2]=C-(z-p)+(S-p),Pt[3]=z;const G=vg(V,IC,4,Pt,DC);return DC[G-1]}function PR(t,i,e,n,o,r){const s=(i-r)*(e-o),a=(t-o)*(n-r),c=s-a,d=Math.abs(s+a);return Math.abs(c)>=yR*d?c:-_R(t,i,e,n,o,r,d)}const Xs=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,yg=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,r=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:r}}};let Nn=Number.EPSILON;Nn===void 0&&(Nn=Math.pow(2,-52));const SR=Nn*Nn,bC=(t,i)=>{if(-Nn<t&&t<Nn&&-Nn<i&&i<Nn)return 0;const e=t-i;return e*e<SR*t*i?0:t<i?-1:1};class ER{constructor(){this.reset()}reset(){this.xRounder=new RC,this.yRounder=new RC}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class RC{constructor(){this.tree=new pg,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&bC(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&bC(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const Ys=new ER,Sh=(t,i)=>t.x*i.y-t.y*i.x,xC=(t,i)=>t.x*i.x+t.y*i.y,FC=(t,i,e)=>{const n=PR(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Eh=t=>Math.sqrt(xC(t,t)),AR=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Sh(o,n)/Eh(o)/Eh(n)},TR=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return xC(o,n)/Eh(o)/Eh(n)},kC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},zC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},MR=(t,i,e,n)=>{if(i.x===0)return zC(e,n,t.x);if(n.x===0)return zC(t,i,e.x);if(i.y===0)return kC(e,n,t.y);if(n.y===0)return kC(t,i,e.y);const o=Sh(i,n);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},s=Sh(r,i)/o,a=Sh(r,n)/o,c=t.x+a*i.x,d=e.x+s*n.x,u=t.y+a*i.y,p=e.y+s*n.y,f=(c+d)/2,g=(u+p)/2;return{x:f,y:g}};class ti{static compare(i,e){const n=ti.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Vn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const r=e[n];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const r=this.point.events[o];r.consumedBy===void 0&&n.otherSE.point.events===r.otherSE.point.events&&n.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const r=o.otherSE;e.set(o,{sine:AR(this.point,i.point,r.point),cosine:TR(this.point,i.point,r.point)})};return(o,r)=>{e.has(o)||n(o),e.has(r)||n(r);const{sine:s,cosine:a}=e.get(o),{sine:c,cosine:d}=e.get(r);return s>=0&&c>=0?a<d?1:a>d?-1:0:s<0&&c<0?a<d?-1:a>d?1:0:c<s?-1:c>s?1:0}}}let IR=0;class Vn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,r=i.rightSE.point.x,s=e.rightSE.point.x;if(s<n)return 1;if(r<o)return-1;const a=i.leftSE.point.y,c=e.leftSE.point.y,d=i.rightSE.point.y,u=e.rightSE.point.y;if(n<o){if(c<a&&c<d)return 1;if(c>a&&c>d)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(a<c&&a<u)return-1;if(a>c&&a>u)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(a<c)return-1;if(a>c)return 1;if(r<s){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(r>s){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(r!==s){const p=d-a,f=r-n,g=u-c,m=s-o;if(p>f&&g<m)return 1;if(p<f&&g>m)return-1}return r>s?1:r<s||d<u?-1:d>u?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++IR,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,r,s;const a=ti.comparePoints(i,e);if(a<0)o=i,r=e,s=1;else if(a>0)o=e,r=i,s=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new ti(o,!0),d=new ti(r,!1);return new Vn(c,d,[n],[s])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const r=(i.y-e.y)/o.y,s=e.x+r*o.x;if(i.x===s)return 0;const a=(i.x-e.x)/o.x,c=e.y+a*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=yg(e,n);if(o===null)return null;const r=this.leftSE.point,s=this.rightSE.point,a=i.leftSE.point,c=i.rightSE.point,d=Xs(e,a)&&this.comparePoint(a)===0,u=Xs(n,r)&&i.comparePoint(r)===0,p=Xs(e,c)&&this.comparePoint(c)===0,f=Xs(n,s)&&i.comparePoint(s)===0;if(u&&d)return f&&!p?s:!f&&p?c:null;if(u)return p&&r.x===c.x&&r.y===c.y?null:r;if(d)return f&&s.x===a.x&&s.y===a.y?null:a;if(f&&p)return null;if(f)return s;if(p)return c;const g=MR(r,this.vector(),a,i.vector());return g===null||!Xs(o,g)?null:Ys.round(g.x,g.y)}split(i){const e=[],n=i.events!==void 0,o=new ti(i,!0),r=new ti(i,!1),s=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const a=new Vn(o,s,this.rings.slice(),this.windings.slice());return ti.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),ti.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Vn.compare(e,n);if(o!==0){if(o>0){const r=e;e=n,n=r}if(e.prev===n){const r=e;e=n,n=r}for(let r=0,s=n.rings.length;r<s;r++){const a=n.rings[r],c=n.windings[r],d=e.rings.indexOf(a);d===-1?(e.rings.push(a),e.windings.push(c)):e.windings[d]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let a=0,c=this.rings.length;a<c;a++){const d=this.rings[a],u=this.windings[a],p=e.indexOf(d);p===-1?(e.push(d),n.push(u)):n[p]+=u}const r=[],s=[];for(let a=0,c=e.length;a<c;a++){if(n[a]===0)continue;const d=e[a],u=d.poly;if(s.indexOf(u)===-1)if(d.isExterior)r.push(u);else{s.indexOf(u)===-1&&s.push(u);const p=r.indexOf(d.poly);p!==-1&&r.splice(p,1)}}for(let a=0,c=r.length;a<c;a++){const d=r[a].multiPoly;o.indexOf(d)===-1&&o.push(d)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(pi.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===pi.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${pi.type}`)}return this._isInResult}}class LC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Ys.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let s=1,a=i.length;s<a;s++){if(typeof i[s][0]!="number"||typeof i[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Ys.round(i[s][0],i[s][1]);c.x===r.x&&c.y===r.y||(this.segments.push(Vn.fromRing(r,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),r=c)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(Vn.fromRing(r,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class DR{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new LC(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,o=i.length;n<o;n++){const r=new LC(i[n],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,s=o.length;r<s;r++)i.push(o[r])}return i}}class OC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,o=i.length;n<o;n++){const r=new DR(i[n],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let r=0,s=o.length;r<s;r++)i.push(o[r])}return i}}class Ah{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const r=i[n];if(!r.isInResult()||r.ringOut)continue;let s=null,a=r.leftSE,c=r.rightSE;const d=[a],u=a.point,p=[];for(;s=a,a=c,d.push(a),a.point!==u;)for(;;){const f=a.getAvailableLinkedEvents();if(f.length===0){const y=d[0].point,P=d[d.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${P.x}, ${P.y}].`)}if(f.length===1){c=f[0].otherSE;break}let g=null;for(let y=0,P=p.length;y<P;y++)if(p[y].point===a.point){g=y;break}if(g!==null){const y=p.splice(g)[0],P=d.splice(y.index);P.unshift(P[0].otherSE),e.push(new Ah(P.reverse()));continue}p.push({index:d.length,point:a.point});const m=a.getLeftmostComparator(s);c=f.sort(m)[0].otherSE;break}e.push(new Ah(d))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let d=1,u=this.events.length-1;d<u;d++){const p=this.events[d].point,f=this.events[d+1].point;FC(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];FC(n,i,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,s=this.isExteriorRing()?0:e.length-1,a=this.isExteriorRing()?e.length:-1,c=[];for(let d=s;d!=a;d+=r)c.push([e[d].x,e[d].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const s=this.events[o];ti.compare(i,s)>0&&(i=s)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class NC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class bR{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const r=i[n];if(!r.poly)if(r.isExteriorRing())e.push(new NC(r));else{const s=r.enclosingRing();s.poly||e.push(new NC(s)),s.poly.addInterior(r)}}return e}}class RR{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vn.compare;this.queue=i,this.tree=new pg(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r=o,s=o,a,c;for(;a===void 0;)r=this.tree.prev(r),r===null?a=null:r.key.consumedBy===void 0&&(a=r.key);for(;c===void 0;)s=this.tree.next(s),s===null?c=null:s.key.consumedBy===void 0&&(c=s.key);if(i.isLeft){let d=null;if(a){const p=a.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!a.isAnEndpoint(p))){const f=this._splitSafely(a,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}let u=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}if(d!==null||u!==null){let p=null;d===null?p=u:u===null?p=d:p=ti.comparePoints(d,u)<=0?d:u,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=a)}else{if(a&&c){const d=a.getIntersection(c);if(d!==null){if(!a.isAnEndpoint(d)){const u=this._splitSafely(a,d);for(let p=0,f=u.length;p<f;p++)n.push(u[p])}if(!c.isAnEndpoint(d)){const u=this._splitSafely(c,d);for(let p=0,f=u.length;p<f;p++)n.push(u[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const VC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,xR=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class FR{run(i,e,n){pi.type=i,Ys.reset();const o=[new OC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new OC(n[p],!1));if(pi.numMultiPolys=o.length,pi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)yg(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(pi.type==="intersection")for(let p=0,f=o.length;p<f;p++){const g=o[p];for(let m=p+1,y=o.length;m<y;m++)if(yg(g.bbox,o[m].bbox)===null)return[]}const r=new pg(ti.compare);for(let p=0,f=o.length;p<f;p++){const g=o[p].getSweepEvents();for(let m=0,y=g.length;m<y;m++)if(r.insert(g[m]),r.size>VC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const s=new RR(r);let a=r.size,c=r.pop();for(;c;){const p=c.key;if(r.size===a){const g=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(r.size>VC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(s.segments.length>xR)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=s.process(p);for(let g=0,m=f.length;g<m;g++){const y=f[g];y.consumedBy===void 0&&r.insert(y)}a=r.size,c=r.pop()}Ys.reset();const d=Ah.factory(s.segments);return new bR(d).getGeom()}}const pi=new FR;var kR={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return pi.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return pi.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return pi.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return pi.run("difference",t,e)}};function Th(t,i,e){e===void 0&&(e={});var n=Ri(t),o=Ri(i),r=kR.intersection(n.coordinates,o.coordinates);return r.length===0?null:r.length===1?Ct(r[0],e.properties):PD(r,e.properties)}function zR(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],r=t[1],s=t[2],a=t[3],c=(r+a)/2,d=(o+s)/2,u=i*2/xi([o,c],[s,c],e),p=u*(s-o),f=i*2/xi([d,r],[d,a],e),g=f*(a-r),m=p/2,y=m*2,P=Math.sqrt(3)/2*g,S=s-o,C=a-r,E=3/4*y,T=P,I=(S-y)/(y-m/2),b=Math.floor(I),x=(b*E-m/2-S)/2-m/2+E/2,z=Math.floor((C-P)/P),W=(C-z*P)/2,N=z*P-C>P/2;N&&(W-=P/4);for(var L=[],U=[],_=0;_<6;_++){var M=2*Math.PI/6*_;L.push(Math.cos(M)),U.push(Math.sin(M))}for(var F=[],V=0;V<=b;V++)for(var G=0;G<=z;G++){var Z=V%2===1;if(!(G===0&&Z)&&!(G===0&&N)){var $=V*E+o-x,Y=G*T+r+W;if(Z&&(Y-=P/2),e.triangles===!0)OR([$,Y],p/2,g/2,JSON.parse(n),L,U).forEach(function(te){e.mask?Th(e.mask,te)&&F.push(te):F.push(te)});else{var K=LR([$,Y],p/2,g/2,JSON.parse(n),L,U);e.mask?Th(e.mask,K)&&F.push(K):F.push(K)}}}return Di(F)}function LR(t,i,e,n,o,r){for(var s=[],a=0;a<6;a++){var c=t[0]+i*o[a],d=t[1]+e*r[a];s.push([c,d])}return s.push(s[0].slice()),Ct([s],n)}function OR(t,i,e,n,o,r){for(var s=[],a=0;a<6;a++){var c=[];c.push(t),c.push([t[0]+i*o[a],t[1]+e*r[a]]),c.push([t[0]+i*o[(a+1)%6],t[1]+e*r[(a+1)%6]]),c.push(t),s.push(Ct([c],n))}return s}function NR(t,i,e,n){n===void 0&&(n={});for(var o=[],r=t[0],s=t[1],a=t[2],c=t[3],d=i/xi([r,s],[a,s],n),u=d*(a-r),p=e/xi([r,s],[r,c],n),f=p*(c-s),g=a-r,m=c-s,y=Math.floor(g/u),P=Math.floor(m/f),S=(g-y*u)/2,C=(m-P*f)/2,E=r+S,T=0;T<y;T++){for(var I=s+C,b=0;b<P;b++){var x=Ct([[[E,I],[E,I+f],[E+u,I+f],[E+u,I],[E,I]]],n.properties);n.mask?cR(n.mask,x)&&o.push(x):o.push(x),I+=f}E+=u}return Di(o)}function VR(t,i,e){return e===void 0&&(e={}),NR(t,i,i,e)}function UR(t,i,e){e===void 0&&(e={});for(var n=[],o=i/xi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),s=i/xi([t[0],t[1]],[t[0],t[3]],e),a=s*(t[3]-t[1]),c=0,d=t[0];d<=t[2];){for(var u=0,p=t[1];p<=t[3];){var f=null,g=null;c%2===0&&u%2===0?(f=Ct([[[d,p],[d,p+a],[d+r,p],[d,p]]],e.properties),g=Ct([[[d,p+a],[d+r,p+a],[d+r,p],[d,p+a]]],e.properties)):c%2===0&&u%2===1?(f=Ct([[[d,p],[d+r,p+a],[d+r,p],[d,p]]],e.properties),g=Ct([[[d,p],[d,p+a],[d+r,p+a],[d,p]]],e.properties)):u%2===0&&c%2===1?(f=Ct([[[d,p],[d,p+a],[d+r,p+a],[d,p]]],e.properties),g=Ct([[[d,p],[d+r,p+a],[d+r,p],[d,p]]],e.properties)):u%2===1&&c%2===1&&(f=Ct([[[d,p],[d,p+a],[d+r,p],[d,p]]],e.properties),g=Ct([[[d,p+a],[d+r,p+a],[d+r,p],[d,p+a]]],e.properties)),e.mask?(Th(e.mask,f)&&n.push(f),Th(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=a,u++}c++,d+=r}return Di(n)}function WR(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(ED(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",r=r||1;var s=Do(t),a;switch(n){case"point":case"points":a=j0(s,i,e);break;case"square":case"squares":a=VR(s,i,e);break;case"hex":case"hexes":a=zR(s,i,e);break;case"triangle":case"triangles":a=UR(s,i,e);break;default:throw new Error("invalid gridType")}var c=[];return mh(a,function(d){var u=0,p=0;mh(t,function(g){var m=n==="point"?d:nb(d),y=xi(m,g,e),P;if(o!==void 0&&(P=g.properties[o]),P===void 0&&(P=g.geometry.coordinates[2]),P===void 0)throw new Error("zValue is missing");y===0&&(u=P);var S=1/Math.pow(y,r);p+=S,u+=S*P});var f=tb(d);f.properties[o]=u/p,c.push(f)}),Di(c)}function GR(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),r=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(r,r);const s=new h.Ray(n,r),a=e.pickFromRay(s);return!!(e.globe.pick(s,e)||a)}const UC=(t=0)=>new Promise(i=>setTimeout(i,t));function HR(t,i){const e=Di(t.map(c=>zn(c))),n=Ct([t]);return WR(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>_t(zn(c),n))}function qR(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return rs(e)}function $R(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,r=t[2]+(i[2]-t[2])*e,s=t[3]+(i[3]-t[3])*e;return[n,o,r,s]}const yl=class yl extends Ht{constructor(e,n){super(e,n);v(this,"czmPointPrimitiveCollection");v(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new uo(n,e.id));this.czmPointPrimitiveCollection=r,this.d(l.track([r,"show"],[e,"show"]));{const s=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const c=[...e.points,e.points[0]],d=e.sampleDistance,u=HR(c,d).map(E=>[...E,e.height]),p=Math.floor(e.extrudedHeight/d);if(p>0){const E=[...u];for(let T=1;T<=p;T++)u.push(...E.map(I=>[I[0],I[1],e.height+T*d]))}const{startTime:f,endTime:g,spanTime:m}=e,y=m*36e5,P=Math.floor((g-f)/y),S=Array(u.length).fill(0);e:for(let E=0;E<P;E++){if(await UC(),this._stopRun)break e;const T=new Date(f+E*y),I=qR(T);t:for(let b=0;b<u.length;b++){if(await UC(),this._stopRun)break t;GR(u[b],I,o.scene)||(S[b]=(S[b]*P+1)/P)}!this._stopRun&&(e.progress=Number(((E+1)/P*100).toFixed(2)))}const C=u.map((E,T)=>({position:[...E],color:$R(e.startColor,e.endColor,S[T]),pixelSize:10}));r.pointPrimitiveOptions=C},a=this.dv(l.createProcessingFromAsyncFunc(async c=>{await c.promise(s())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,a.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,a.isRunning&&a.cancel()}))}}flyTo(e,n){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;if(!s||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(s.positions){const a=[...s.positions];return s.positions.forEach(c=>{a.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),ae(r,o,n,a,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;if(!s||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(s.positions){const a=[...s.positions];return s.positions.forEach(c=>{a.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),ae(r,o,n,a,e),!0}return!1}};v(yl,"type",yl.register("ESCesiumViewer",w.ESSunshineAnalysis.type,yl));let wg=yl;const WC=(t=0)=>new Promise(i=>setTimeout(i,t)),Vo=class Vo extends l.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new l.Event));v(this,"_startEvent",this.disposeVar(new l.Event));v(this,"_stopEvent",this.dv(new l.Event));v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_geoPolyline");v(this,"_customPrimitive");v(this,"_geoDivPoi");v(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Ie(e,n)),this._customPrimitive=this.disposeVar(new ke(e,n)),this._geoDivPoi=this.disposeVar(new $e(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Wi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
1877
|
+
***************************************************************************** */function vR(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(d){return function(u){return c([d,u])}}function c(d){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(r=d[0]&2?o.return:d[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,d[1])).done)return r;switch(o=0,r&&(d=[d[0]&2,r.value]),d[0]){case 0:case 1:r=d;break;case 4:return e.label++,{value:d[1],done:!1};case 5:e.label++,o=d[1],d=[0];continue;case 7:d=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(d[0]===6||d[0]===2)){e=0;continue}if(d[0]===3&&(!r||d[1]>r[0]&&d[1]<r[3])){e.label=d[1];break}if(d[0]===6&&e.label<r[1]){e.label=r[1],r=d;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(d);break}r[2]&&e.ops.pop(),e.trys.pop();continue}d=i.call(t,e)}catch(u){d=[6,u],o=0}finally{n=r=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}var Ln=(function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t})();function yR(t,i){return t>i?1:t<i?-1:0}function On(t,i,e){for(var n=new Ln(null,null),o=n,r=n;;){var s=e(t,i.key);if(s<0){if(i.left===null)break;if(e(t,i.left.key)<0){var a=i.left;if(i.left=a.right,a.right=i,i=a,i.left===null)break}r.left=i,r=i,i=i.left}else if(s>0){if(i.right===null)break;if(e(t,i.right.key)>0){var a=i.right;if(i.right=a.left,a.left=i,i=a,i.right===null)break}o.right=i,o=i,i=i.right}else break}return o.right=i.left,r.left=i.right,i.left=n.right,i.right=n.left,i}function ug(t,i,e,n){var o=new Ln(t,i);if(e===null)return o.left=o.right=null,o;e=On(t,e,n);var r=n(t,e.key);return r<0?(o.left=e.left,o.right=e,e.left=null):r>=0&&(o.right=e.right,o.left=e,e.right=null),o}function DC(t,i,e){var n=null,o=null;if(i){i=On(t,i,e);var r=e(i.key,t);r===0?(n=i.left,o=i.right):r<0?(o=i.right,i.right=null,n=i):(n=i.left,i.left=null,o=i)}return{left:n,right:o}}function wR(t,i,e){return i===null?t:(t===null||(i=On(t.key,i,e),i.left=t),i)}function pg(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
|
|
1878
|
+
`);var r=i+(e?" ":"│ ");t.left&&pg(t.left,r,!1,n,o),t.right&&pg(t.right,r,!0,n,o)}}var fg=(function(){function t(i){i===void 0&&(i=yR),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=ug(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Ln(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,r=On(i,this._root,o),s=o(i,r.key);return s===0?this._root=r:(s<0?(n.left=r.left,n.right=r,r.left=null):s>0&&(n.right=r.right,n.left=r,r.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=On(i,e,n);var r=n(i,e.key);return r===0?(e.left===null?o=e.right:(o=On(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=On(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=On(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],r=!1;!r;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):r=!0;return this},t.prototype.range=function(i,e,n,o){for(var r=[],s=this._comparator,a=this._root,c;r.length!==0||a;)if(a)r.push(a),a=a.left;else{if(a=r.pop(),c=s(a.key,e),c>0)break;if(s(a.key,i)>=0&&n.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,r=[];!n;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var r=o(i.key,e.key);if(r===0)break;r<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var r=o(i.key,e.key);if(r===0)break;r<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return _R(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,r=this._comparator;if(n&&vg(i,e,0,o-1,r),this._root===null)this._root=gg(i,e,0,o),this._size=o;else{var s=PR(this.toList(),CR(i,e),r);o=this._size+o,this._root=mg({head:s},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return pg(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,r=DC(i,this._root,o),s=r.left,a=r.right;o(i,e)<0?a=ug(e,n,a,o):s=ug(e,n,s,o),this._root=wR(s,a,o)},t.prototype.split=function(i){return DC(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return vR(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t})();function gg(t,i,e,n){var o=n-e;if(o>0){var r=e+Math.floor(o/2),s=t[r],a=i[r],c=new Ln(s,a);return c.left=gg(t,i,e,r),c.right=gg(t,i,r+1,n),c}return null}function CR(t,i){for(var e=new Ln(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Ln(t[o],i[o]);return n.next=null,e.next}function _R(t){for(var i=t,e=[],n=!1,o=new Ln(null,null),r=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=r=r.next=e.pop(),i=i.right):n=!0;return r.next=null,o.next}function mg(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),r=mg(t,i,o),s=t.head;return s.left=r,t.head=t.head.next,s.right=mg(t,o+1,e),s}return null}function PR(t,i,e){for(var n=new Ln(null,null),o=n,r=t,s=i;r!==null&&s!==null;)e(r.key,s.key)<0?(o.next=r,r=r.next):(o.next=s,s=s.next),o=o.next;return r!==null?o.next=r:s!==null&&(o.next=s),n.next}function vg(t,i,e,n,o){if(!(e>=n)){for(var r=t[e+n>>1],s=e-1,a=n+1;;){do s++;while(o(t[s],r)<0);do a--;while(o(t[a],r)>0);if(s>=a)break;var c=t[s];t[s]=t[a],t[a]=c,c=i[s],i[s]=i[a],i[a]=c}vg(t,i,e,a,o),vg(t,i,a+1,n,o)}}const Xs=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,yg=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,r=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:r}}};let Nn=Number.EPSILON;Nn===void 0&&(Nn=Math.pow(2,-52));const SR=Nn*Nn,bC=(t,i)=>{if(-Nn<t&&t<Nn&&-Nn<i&&i<Nn)return 0;const e=t-i;return e*e<SR*t*i?0:t<i?-1:1};class ER{constructor(){this.reset()}reset(){this.xRounder=new RC,this.yRounder=new RC}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class RC{constructor(){this.tree=new fg,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&bC(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&bC(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const Ys=new ER,Sh=(t,i)=>t.x*i.y-t.y*i.x,xC=(t,i)=>t.x*i.x+t.y*i.y,FC=(t,i,e)=>{const n=ob(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Eh=t=>Math.sqrt(xC(t,t)),AR=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Sh(o,n)/Eh(o)/Eh(n)},TR=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return xC(o,n)/Eh(o)/Eh(n)},kC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},zC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},MR=(t,i,e,n)=>{if(i.x===0)return zC(e,n,t.x);if(n.x===0)return zC(t,i,e.x);if(i.y===0)return kC(e,n,t.y);if(n.y===0)return kC(t,i,e.y);const o=Sh(i,n);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},s=Sh(r,i)/o,a=Sh(r,n)/o,c=t.x+a*i.x,d=e.x+s*n.x,u=t.y+a*i.y,p=e.y+s*n.y,f=(c+d)/2,g=(u+p)/2;return{x:f,y:g}};class ti{static compare(i,e){const n=ti.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Vn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const r=e[n];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const r=this.point.events[o];r.consumedBy===void 0&&n.otherSE.point.events===r.otherSE.point.events&&n.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const r=o.otherSE;e.set(o,{sine:AR(this.point,i.point,r.point),cosine:TR(this.point,i.point,r.point)})};return(o,r)=>{e.has(o)||n(o),e.has(r)||n(r);const{sine:s,cosine:a}=e.get(o),{sine:c,cosine:d}=e.get(r);return s>=0&&c>=0?a<d?1:a>d?-1:0:s<0&&c<0?a<d?-1:a>d?1:0:c<s?-1:c>s?1:0}}}let IR=0;class Vn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,r=i.rightSE.point.x,s=e.rightSE.point.x;if(s<n)return 1;if(r<o)return-1;const a=i.leftSE.point.y,c=e.leftSE.point.y,d=i.rightSE.point.y,u=e.rightSE.point.y;if(n<o){if(c<a&&c<d)return 1;if(c>a&&c>d)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(a<c&&a<u)return-1;if(a>c&&a>u)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(a<c)return-1;if(a>c)return 1;if(r<s){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(r>s){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(r!==s){const p=d-a,f=r-n,g=u-c,m=s-o;if(p>f&&g<m)return 1;if(p<f&&g>m)return-1}return r>s?1:r<s||d<u?-1:d>u?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++IR,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,r,s;const a=ti.comparePoints(i,e);if(a<0)o=i,r=e,s=1;else if(a>0)o=e,r=i,s=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new ti(o,!0),d=new ti(r,!1);return new Vn(c,d,[n],[s])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const r=(i.y-e.y)/o.y,s=e.x+r*o.x;if(i.x===s)return 0;const a=(i.x-e.x)/o.x,c=e.y+a*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=yg(e,n);if(o===null)return null;const r=this.leftSE.point,s=this.rightSE.point,a=i.leftSE.point,c=i.rightSE.point,d=Xs(e,a)&&this.comparePoint(a)===0,u=Xs(n,r)&&i.comparePoint(r)===0,p=Xs(e,c)&&this.comparePoint(c)===0,f=Xs(n,s)&&i.comparePoint(s)===0;if(u&&d)return f&&!p?s:!f&&p?c:null;if(u)return p&&r.x===c.x&&r.y===c.y?null:r;if(d)return f&&s.x===a.x&&s.y===a.y?null:a;if(f&&p)return null;if(f)return s;if(p)return c;const g=MR(r,this.vector(),a,i.vector());return g===null||!Xs(o,g)?null:Ys.round(g.x,g.y)}split(i){const e=[],n=i.events!==void 0,o=new ti(i,!0),r=new ti(i,!1),s=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const a=new Vn(o,s,this.rings.slice(),this.windings.slice());return ti.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),ti.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Vn.compare(e,n);if(o!==0){if(o>0){const r=e;e=n,n=r}if(e.prev===n){const r=e;e=n,n=r}for(let r=0,s=n.rings.length;r<s;r++){const a=n.rings[r],c=n.windings[r],d=e.rings.indexOf(a);d===-1?(e.rings.push(a),e.windings.push(c)):e.windings[d]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let a=0,c=this.rings.length;a<c;a++){const d=this.rings[a],u=this.windings[a],p=e.indexOf(d);p===-1?(e.push(d),n.push(u)):n[p]+=u}const r=[],s=[];for(let a=0,c=e.length;a<c;a++){if(n[a]===0)continue;const d=e[a],u=d.poly;if(s.indexOf(u)===-1)if(d.isExterior)r.push(u);else{s.indexOf(u)===-1&&s.push(u);const p=r.indexOf(d.poly);p!==-1&&r.splice(p,1)}}for(let a=0,c=r.length;a<c;a++){const d=r[a].multiPoly;o.indexOf(d)===-1&&o.push(d)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(pi.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===pi.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${pi.type}`)}return this._isInResult}}class LC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Ys.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let s=1,a=i.length;s<a;s++){if(typeof i[s][0]!="number"||typeof i[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=Ys.round(i[s][0],i[s][1]);c.x===r.x&&c.y===r.y||(this.segments.push(Vn.fromRing(r,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),r=c)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(Vn.fromRing(r,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class DR{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new LC(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,o=i.length;n<o;n++){const r=new LC(i[n],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,s=o.length;r<s;r++)i.push(o[r])}return i}}class OC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,o=i.length;n<o;n++){const r=new DR(i[n],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let r=0,s=o.length;r<s;r++)i.push(o[r])}return i}}class Ah{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const r=i[n];if(!r.isInResult()||r.ringOut)continue;let s=null,a=r.leftSE,c=r.rightSE;const d=[a],u=a.point,p=[];for(;s=a,a=c,d.push(a),a.point!==u;)for(;;){const f=a.getAvailableLinkedEvents();if(f.length===0){const y=d[0].point,P=d[d.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${P.x}, ${P.y}].`)}if(f.length===1){c=f[0].otherSE;break}let g=null;for(let y=0,P=p.length;y<P;y++)if(p[y].point===a.point){g=y;break}if(g!==null){const y=p.splice(g)[0],P=d.splice(y.index);P.unshift(P[0].otherSE),e.push(new Ah(P.reverse()));continue}p.push({index:d.length,point:a.point});const m=a.getLeftmostComparator(s);c=f.sort(m)[0].otherSE;break}e.push(new Ah(d))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let d=1,u=this.events.length-1;d<u;d++){const p=this.events[d].point,f=this.events[d+1].point;FC(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];FC(n,i,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,s=this.isExteriorRing()?0:e.length-1,a=this.isExteriorRing()?e.length:-1,c=[];for(let d=s;d!=a;d+=r)c.push([e[d].x,e[d].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const s=this.events[o];ti.compare(i,s)>0&&(i=s)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class NC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class bR{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const r=i[n];if(!r.poly)if(r.isExteriorRing())e.push(new NC(r));else{const s=r.enclosingRing();s.poly||e.push(new NC(s)),s.poly.addInterior(r)}}return e}}class RR{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Vn.compare;this.queue=i,this.tree=new fg(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r=o,s=o,a,c;for(;a===void 0;)r=this.tree.prev(r),r===null?a=null:r.key.consumedBy===void 0&&(a=r.key);for(;c===void 0;)s=this.tree.next(s),s===null?c=null:s.key.consumedBy===void 0&&(c=s.key);if(i.isLeft){let d=null;if(a){const p=a.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!a.isAnEndpoint(p))){const f=this._splitSafely(a,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}let u=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}if(d!==null||u!==null){let p=null;d===null?p=u:u===null?p=d:p=ti.comparePoints(d,u)<=0?d:u,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=a)}else{if(a&&c){const d=a.getIntersection(c);if(d!==null){if(!a.isAnEndpoint(d)){const u=this._splitSafely(a,d);for(let p=0,f=u.length;p<f;p++)n.push(u[p])}if(!c.isAnEndpoint(d)){const u=this._splitSafely(c,d);for(let p=0,f=u.length;p<f;p++)n.push(u[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const VC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,xR=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class FR{run(i,e,n){pi.type=i,Ys.reset();const o=[new OC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new OC(n[p],!1));if(pi.numMultiPolys=o.length,pi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)yg(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(pi.type==="intersection")for(let p=0,f=o.length;p<f;p++){const g=o[p];for(let m=p+1,y=o.length;m<y;m++)if(yg(g.bbox,o[m].bbox)===null)return[]}const r=new fg(ti.compare);for(let p=0,f=o.length;p<f;p++){const g=o[p].getSweepEvents();for(let m=0,y=g.length;m<y;m++)if(r.insert(g[m]),r.size>VC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const s=new RR(r);let a=r.size,c=r.pop();for(;c;){const p=c.key;if(r.size===a){const g=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(r.size>VC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(s.segments.length>xR)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=s.process(p);for(let g=0,m=f.length;g<m;g++){const y=f[g];y.consumedBy===void 0&&r.insert(y)}a=r.size,c=r.pop()}Ys.reset();const d=Ah.factory(s.segments);return new bR(d).getGeom()}}const pi=new FR;var kR={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return pi.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return pi.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return pi.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return pi.run("difference",t,e)}};function Th(t,i,e){e===void 0&&(e={});var n=Ri(t),o=Ri(i),r=kR.intersection(n.coordinates,o.coordinates);return r.length===0?null:r.length===1?Ct(r[0],e.properties):PD(r,e.properties)}function zR(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],r=t[1],s=t[2],a=t[3],c=(r+a)/2,d=(o+s)/2,u=i*2/xi([o,c],[s,c],e),p=u*(s-o),f=i*2/xi([d,r],[d,a],e),g=f*(a-r),m=p/2,y=m*2,P=Math.sqrt(3)/2*g,S=s-o,C=a-r,E=3/4*y,T=P,I=(S-y)/(y-m/2),b=Math.floor(I),x=(b*E-m/2-S)/2-m/2+E/2,z=Math.floor((C-P)/P),W=(C-z*P)/2,N=z*P-C>P/2;N&&(W-=P/4);for(var L=[],U=[],_=0;_<6;_++){var M=2*Math.PI/6*_;L.push(Math.cos(M)),U.push(Math.sin(M))}for(var F=[],V=0;V<=b;V++)for(var G=0;G<=z;G++){var Z=V%2===1;if(!(G===0&&Z)&&!(G===0&&N)){var $=V*E+o-x,Y=G*T+r+W;if(Z&&(Y-=P/2),e.triangles===!0)OR([$,Y],p/2,g/2,JSON.parse(n),L,U).forEach(function(te){e.mask?Th(e.mask,te)&&F.push(te):F.push(te)});else{var K=LR([$,Y],p/2,g/2,JSON.parse(n),L,U);e.mask?Th(e.mask,K)&&F.push(K):F.push(K)}}}return Di(F)}function LR(t,i,e,n,o,r){for(var s=[],a=0;a<6;a++){var c=t[0]+i*o[a],d=t[1]+e*r[a];s.push([c,d])}return s.push(s[0].slice()),Ct([s],n)}function OR(t,i,e,n,o,r){for(var s=[],a=0;a<6;a++){var c=[];c.push(t),c.push([t[0]+i*o[a],t[1]+e*r[a]]),c.push([t[0]+i*o[(a+1)%6],t[1]+e*r[(a+1)%6]]),c.push(t),s.push(Ct([c],n))}return s}function NR(t,i,e,n){n===void 0&&(n={});for(var o=[],r=t[0],s=t[1],a=t[2],c=t[3],d=i/xi([r,s],[a,s],n),u=d*(a-r),p=e/xi([r,s],[r,c],n),f=p*(c-s),g=a-r,m=c-s,y=Math.floor(g/u),P=Math.floor(m/f),S=(g-y*u)/2,C=(m-P*f)/2,E=r+S,T=0;T<y;T++){for(var I=s+C,b=0;b<P;b++){var x=Ct([[[E,I],[E,I+f],[E+u,I+f],[E+u,I],[E,I]]],n.properties);n.mask?mR(n.mask,x)&&o.push(x):o.push(x),I+=f}E+=u}return Di(o)}function VR(t,i,e){return e===void 0&&(e={}),NR(t,i,i,e)}function UR(t,i,e){e===void 0&&(e={});for(var n=[],o=i/xi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),s=i/xi([t[0],t[1]],[t[0],t[3]],e),a=s*(t[3]-t[1]),c=0,d=t[0];d<=t[2];){for(var u=0,p=t[1];p<=t[3];){var f=null,g=null;c%2===0&&u%2===0?(f=Ct([[[d,p],[d,p+a],[d+r,p],[d,p]]],e.properties),g=Ct([[[d,p+a],[d+r,p+a],[d+r,p],[d,p+a]]],e.properties)):c%2===0&&u%2===1?(f=Ct([[[d,p],[d+r,p+a],[d+r,p],[d,p]]],e.properties),g=Ct([[[d,p],[d,p+a],[d+r,p+a],[d,p]]],e.properties)):u%2===0&&c%2===1?(f=Ct([[[d,p],[d,p+a],[d+r,p+a],[d,p]]],e.properties),g=Ct([[[d,p],[d+r,p+a],[d+r,p],[d,p]]],e.properties)):u%2===1&&c%2===1&&(f=Ct([[[d,p],[d,p+a],[d+r,p],[d,p]]],e.properties),g=Ct([[[d,p+a],[d+r,p+a],[d+r,p],[d,p+a]]],e.properties)),e.mask?(Th(e.mask,f)&&n.push(f),Th(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=a,u++}c++,d+=r}return Di(n)}function WR(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(ED(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",r=r||1;var s=Do(t),a;switch(n){case"point":case"points":a=iw(s,i,e);break;case"square":case"squares":a=VR(s,i,e);break;case"hex":case"hexes":a=zR(s,i,e);break;case"triangle":case"triangles":a=UR(s,i,e);break;default:throw new Error("invalid gridType")}var c=[];return mh(a,function(d){var u=0,p=0;mh(t,function(g){var m=n==="point"?d:lb(d),y=xi(m,g,e),P;if(o!==void 0&&(P=g.properties[o]),P===void 0&&(P=g.geometry.coordinates[2]),P===void 0)throw new Error("zValue is missing");y===0&&(u=P);var S=1/Math.pow(y,r);p+=S,u+=S*P});var f=sb(d);f.properties[o]=u/p,c.push(f)}),Di(c)}function GR(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),r=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(r,r);const s=new h.Ray(n,r),a=e.pickFromRay(s);return!!(e.globe.pick(s,e)||a)}const UC=(t=0)=>new Promise(i=>setTimeout(i,t));function HR(t,i){const e=Di(t.map(c=>zn(c))),n=Ct([t]);return WR(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>Pt(zn(c),n))}function qR(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return rs(e)}function $R(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,r=t[2]+(i[2]-t[2])*e,s=t[3]+(i[3]-t[3])*e;return[n,o,r,s]}const yl=class yl extends Ht{constructor(e,n){super(e,n);v(this,"czmPointPrimitiveCollection");v(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new uo(n,e.id));this.czmPointPrimitiveCollection=r,this.d(l.track([r,"show"],[e,"show"]));{const s=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const c=[...e.points,e.points[0]],d=e.sampleDistance,u=HR(c,d).map(E=>[...E,e.height]),p=Math.floor(e.extrudedHeight/d);if(p>0){const E=[...u];for(let T=1;T<=p;T++)u.push(...E.map(I=>[I[0],I[1],e.height+T*d]))}const{startTime:f,endTime:g,spanTime:m}=e,y=m*36e5,P=Math.floor((g-f)/y),S=Array(u.length).fill(0);e:for(let E=0;E<P;E++){if(await UC(),this._stopRun)break e;const T=new Date(f+E*y),I=qR(T);t:for(let b=0;b<u.length;b++){if(await UC(),this._stopRun)break t;GR(u[b],I,o.scene)||(S[b]=(S[b]*P+1)/P)}!this._stopRun&&(e.progress=Number(((E+1)/P*100).toFixed(2)))}const C=u.map((E,T)=>({position:[...E],color:$R(e.startColor,e.endColor,S[T]),pixelSize:10}));r.pointPrimitiveOptions=C},a=this.dv(l.createProcessingFromAsyncFunc(async c=>{await c.promise(s())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,a.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,a.isRunning&&a.cancel()}))}}flyTo(e,n){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;if(!s||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(s.positions){const a=[...s.positions];return s.positions.forEach(c=>{a.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),ae(r,o,n,a,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;if(!s||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(s.positions){const a=[...s.positions];return s.positions.forEach(c=>{a.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),ae(r,o,n,a,e),!0}return!1}};v(yl,"type",yl.register("ESCesiumViewer",w.ESSunshineAnalysis.type,yl));let wg=yl;const WC=(t=0)=>new Promise(i=>setTimeout(i,t)),Vo=class Vo extends l.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new l.Event));v(this,"_startEvent",this.disposeVar(new l.Event));v(this,"_stopEvent",this.dv(new l.Event));v(this,"_flyToEvent",this.disposeVar(new l.Event));v(this,"_geoPolyline");v(this,"_customPrimitive");v(this,"_geoDivPoi");v(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Ie(e,n)),this._customPrimitive=this.disposeVar(new ke(e,n)),this._geoDivPoi=this.disposeVar(new $e(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Wi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
1879
1879
|
uniform vec4 u_color;
|
|
1880
1880
|
void main()
|
|
1881
1881
|
{
|
|
@@ -1887,7 +1887,7 @@ void main()
|
|
|
1887
1887
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
1888
1888
|
}
|
|
1889
1889
|
`,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(l.track([this._customPrimitive,"show"],[this,"show"])),this.d(l.track([this._geoPolyline,"show"],[this,"show"])),this.d(l.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(l.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(l.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let r=function(d,u){const p=[];for(const f of u)switch(f){case"SquareMeter_SquareKilometer":d>=1e6?p.push(`面积:${(d/1e6).toFixed(2)} km²`):p.push(`面积:${d.toFixed(2)} m²`);break;case"MU_Hectare":const g=d*(1/666.7);if(g>=15){const m=g/15;p.push(`面积:${m.toFixed(2)} 公顷`)}else p.push(`面积:${g.toFixed(2)} 亩`);break}return p};const s=()=>{let d=[];this.totalArea?this._starting?d=["分析计算中..."]:d=[...r(this.totalArea,this.units)]:this._starting?d=["分析计算中..."]:d=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=oo([...d].join(`
|
|
1890
|
-
`),24))};s(),this.d(this.totalAreaChanged.don(s)),this.d(this.unitsChanged.don(s)),this.d(l.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=e0(this.positions):this._geoDivPoi.position=void 0)}));const a=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const d=this.interpolationDistance??Vo.defaults.interpolationDistance,u=this.interpolation??Vo.defaults.interpolation,p=this.offsetHeight??Vo.defaults.offsetHeight,f=this.drillDepth??Vo.defaults.drillDepth,g=[];if(this.positions)for(let $=0;$<this.positions.length;++$){const Y=h.Cartesian3.fromDegrees(this.positions[$][0],this.positions[$][1],this.positions[$][2]);g.push(Y)}var m=YR(g);if(isNaN(m.x)||isNaN(m.y)||isNaN(m.z)){console.warn("法向量计算错误!");return}var y=ZR(g),P=h.Cartesian3.normalize(y,new h.Cartesian3),S=h.Cartesian3.dot(P,m);S<0&&(m=GC(m),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),E=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(S)<.999){const $=QR(m,P);var T=GC(y),I=h.Matrix4.fromTranslation(T,new h.Matrix4);E=h.Matrix4.multiply($,I,I),C=h.Matrix4.inverse(E,new h.Matrix4)}var b=Gr(g,E),x=[],z=[],W=JR(b);if(u&&d>0){var N=KR(b);const $=Math.max(N.maxy-N.miny,N.maxx-N.minx);var L=t2(W,N,d);const Y=await Cg(L,C,E,m,o.scene,p,f,$);var U=i2(b,d);const K=await Cg(U,C,E,m,o.scene,p,f,$);z.push(...Y.world_cartesian),x.push(...Y.local),z.push(...K.world_cartesian),x.push(...K.local);for(let te=0;te<b.length;++te){const re=b[te];var _=await Cg([re],C,E,m,o.scene,p,f,$);if(_.local.length>0)x.push(..._.local),z.push(..._.world_cartesian);else{const ge=[re.x,re.y,re.z+p];x.push(ge);var M=Gr([h.Cartesian3.fromArray(ge)],C);for(let ye=0;ye<M.length;++ye)z.push(M[ye])}}}else{const $=b.map(Y=>h.Cartesian3.fromArray([Y.x,Y.y,Y.z+$]));x=$,z=Gr($,C)}var F=BR(x,W);const V=jR(z,F);this.totalArea=V;const G=[];x.forEach($=>{const Y=[$.x,$.y,$.z];Y&&G.push(...Y)});const Z={position:{typedArray:new Float32Array(G),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(C),this.customPrimitive.attributes=Z;const $=await XR([...F]);this.customPrimitive.indexTypedArray=new Uint32Array($),this.customPrimitive.show=!0;const Y=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!Y)return;const{min:K,max:te}=Y;this.customPrimitive.setLocalAxisedBoundingBox(K,te)}},c=this.dv(l.createProcessingFromAsyncFunc(async d=>{await d.promise(a()),this._starting=!1,s()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,s(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,s()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};v(Vo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let bo=Vo;(t=>{t.createDefaultProps=()=>({positions:l.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:l.reactArray([1,1,1,1]),units:l.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(bo||(bo={})),l.extendClassProps(bo.prototype,bo.createDefaultProps);async function XR(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await WC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function YR(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let d=0;d<r;++d){var s=t[d],a;d==0?a=t[t.length-1]:a=t[d-1];var c;d==t.length-1?c=t[0]:c=t[d+1],i=h.Cartesian3.subtract(s,a,i),e=h.Cartesian3.subtract(s,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/r,n.y=o.y/r,n.z=o.z/r,n}function ZR(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function GC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function QR(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,r=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function Gr(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function KR(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(r=>{i=Math.min(i,r.x),e=Math.min(e,r.y),n=Math.max(n,r.x),o=Math.max(o,r.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function JR(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function BR(t,i){var e=[];t.forEach(s=>{const a=[s.x,s.y];e.push(a)});var n=H_.from(e).triangles;const o=[],r=Ct([i]);for(let s=0;s<n.length;s+=3){const a=n[s],c=n[s+1],d=n[s+2],u=(t[a].x+t[c].x+t[d].x)/3,p=(t[a].y+t[c].y+t[d].y)/3;_t([u,p],r)&&o.push(a,c,d)}return new Uint32Array(o.reverse())}function jR(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=e2(o)}return e}function e2(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,r=Math.sqrt(o*(o-i)*(o-e)*(o-n));return r||0}function t2(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var r=i.miny;r<i.maxy;r+=e)o2([o,r],t)&&n.push(new h.Cartesian3(o,r,0));return n}function i2(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o;s==t.length-1?o=t[0]:o=t[s+1];var r=n2(n,o,i);e.push(...r)}return e}function n2(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),r=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(r.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];r=h.Cartesian3.normalize(r,r);for(var s=e;s<o;){var a=new h.Cartesian3(r.x*s,r.y*s,r.z*s),c=h.Cartesian3.add(t,a,new h.Cartesian3);n.push(c),s+=e}return n}function o2(t,i){var e=zn(t);if(!lR(zn(i[0]),zn(i[i.length-1])))return!1;var n=[];n.push(i);var o=Ct(n);return _t(e,o)}async function Cg(t,i,e,n,o,r,s,a){var c=[];t.forEach(E=>{var T=E.clone();T.z=a,c.push(T)});var d=Gr(c,i),u=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],g=[];for(let E=0;E<d.length;++E){await WC();var m=d[E],y=new h.Ray(m,u),P=void 0;try{P=o.pickFromRay(y)}catch{}if(!P){y=new h.Ray(m,n);try{P=o.pickFromRay(y)}catch{}}if(P){var S=P.position;if(!(!S||!S.x||isNaN(S.x))){var C=Gr([S],e);C.forEach(T=>{T.z+=r}),S=Gr(C,i)[0],g.push(S),S=h.Cartographic.fromCartesian(S),p.push([S.longitude,S.latitude,S.height]),f.push(C[0])}}}return{local:f,world:p,world_cartesian:g}}const wl=class wl extends Ht{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new bo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(l.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(l.track([r,"units"],[e,"units"])),this.d(l.track([r,"show"],[e,"show"])),this.d(l.track([r,"positions"],[e,"points"])),this.d(l.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(l.track([r,"offsetHeight"],[e,"offsetHeight"]));{const s=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(a.disposableOn(s))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s.positions&&ae(r,o,n,s.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):(s.positions&&ae(r,o,n,s.positions,e),!0):!1}};v(wl,"type",wl.register("ESCesiumViewer",w.ESSurfaceAreaMeasurement.type,wl));let _g=wl;async function r2(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Cl=class Cl extends w.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new w.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;n.add(r),this.dispose(()=>n.delete(r)),r.instanceClass=class extends l.Destroyable{constructor(a,c,d){if(super(),this._subContainer=a,!d||!(d instanceof Re))return;d.extensions.cursorPositionInfo.enabled=!0;const u=document.createElement("div");this._subContainer.appendChild(u),this.dispose(()=>this._subContainer.removeChild(u)),u.style.width="100%",u.style.position="absolute",u.style.height=`${w.ESViewerStatusBar.defaults.height}px`,u.style.left="0",u.style.bottom="0",u.style.color="#fff",u.style.padding="0 20px 0 0",u.style.boxSizing="border-box",u.style.lineHeight=`${w.ESViewerStatusBar.defaults.height}px`,u.style.zIndex="100",u.style.alignContent="center",u.style.justifyContent="space-between";const p=document.createElement("span");u.appendChild(p),this.dispose(()=>u.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const g=document.createElement("span");p.appendChild(g),g.addEventListener("dblclick",function(){let y=g.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),r2(y)}),g.style.cursor="pointer",this.dispose(()=>p.removeChild(g));const m=document.createElement("span");u.appendChild(m),this.dispose(()=>u.removeChild(m));{const y=()=>{u.style.height=(e.height??w.ESViewerStatusBar.defaults.height)+"px",u.style.lineHeight=(e.height??w.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{u.style.fontSize=(e.fontSize??w.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?u.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:u.style.background=`rgba(${w.ESViewerStatusBar.defaults.bgColor[0]},${w.ESViewerStatusBar.defaults.bgColor[1]},${w.ESViewerStatusBar.defaults.bgColor[2]},${w.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{m.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const P=()=>{e.show?(u.style.display="flex",y=this.disposeVar(l.createAnimateFrameWithStartValues(()=>{var I;let S="",C="";const E=d.getCameraInfo();if(E){const b=(z,W)=>E.position[z].toFixed(W),x=(z,W)=>E.rotation[z].toFixed(W);S=`帧率:${d.getFPS()}FPS 经度: ${b(0,5)}° 纬度: ${b(1,5)}° 高度: ${b(2,2)}米 偏航角: ${x(0,2)}° 俯仰角: ${x(1,2)}° 翻滚角:${x(2,2)}° `}f.innerText=S;const T=(I=d.extensions)==null?void 0:I.cursorPositionInfo.cursorPosition;if(T){const b=(x,z)=>T[x].toFixed(z);C=`鼠标位置:${b(0,5)}° ${b(1,5)}° ${b(2,2)}m`}else C="暂时无法获取鼠标位置...";g.innerText=C})),y.start()):(u.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(P)),P()}}}}get customDiv(){return this._customDiv}};v(Cl,"type",Cl.register("ESCesiumViewer",w.ESViewerStatusBar.type,Cl));let Pg=Cl;const _l=class _l extends w.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new w.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;n.add(r),this.dispose(()=>n.delete(r)),this.dispose(l.track([r,"show"],[e,"show"])),r.instanceClass=class extends l.Destroyable{constructor(a,c,d){if(super(),this._subContainer=a,!d||!(d instanceof Re))return;d.extensions.cursorPositionInfo.enabled=!0;const u=document.createElement("div");this._subContainer.appendChild(u),this.dispose(()=>this._subContainer.removeChild(u));const p=document.createElement("div");u.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${w.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${w.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const g=document.createElement("div");f.appendChild(g);const m=document.createElement("div");f.appendChild(m);const y=document.createElement("div");p.appendChild(y);const P=document.createElement("div");y.appendChild(P);const S=document.createElement("div");P.appendChild(S);const C=document.createElement("div");P.appendChild(C);const E=document.createElement("span");y.appendChild(E);{const z=()=>{p.style.height=(e.height??w.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??w.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(z)),z()}{const z=()=>{p.style.fontSize=(e.fontSize??w.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(z)),z()}{const z=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${w.ESViewerStatusBarScale.defaults.bgColor[0]},${w.ESViewerStatusBarScale.defaults.bgColor[1]},${w.ESViewerStatusBarScale.defaults.bgColor[2]},${w.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(z)),z()}f.style.display="flex",g.style.fontWeight="bold",g.style.padding="0 0 0 25px";let T="EarthSDK";g.innerText=T,m.style.fontWeight="";let I="——免费开源地球可视化开发包";m.innerText=I,y.style.width="550px",P.style.position="fixed",P.style.width="125px",P.style.height="30px",P.style.padding="0 5px",P.style.display="flex",P.style.justifyContent="flex-end",P.style.pointerEvents="auto",P.style.zIndex="101",S.style.width="125px",S.style.display="inline-block",S.style.textAlign="center",S.style.fontSize="14px",S.style.fontWeight="lighter",S.style.lineHeight="30px",S.style.color="#fff",S.innerHTML="1000km",C.style.borderRight="1px solid #fff",C.style.borderLeft="1px solid #fff",C.style.borderBottom="1px solid #fff",C.style.position="absolute",C.style.height="10px",C.style.top="15px",C.style.width="75px",C.style.right=`${60/2}px`,E.style.display="flex",E.style.zIndex="101",E.style.justifyContent="flex-end",E.style.right="0";const b=()=>{const z=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||z&&z>1e6)P.style.display="none";else{P.style.display="block";const W=n.viewerLegend.legend.computedLengthInStr;W&&(S.innerHTML=W);const N=n.viewerLegend.legend.computedLengthInPixels;if(N){C.style.width=`${N}px`;const L=(135-N)/2;C.style.left=`${L}px`}}};b();const x=setInterval(()=>{b()},200);this.dispose(()=>clearInterval(x));{let z;const W=()=>{e.show?(u.style.display="block",z=this.disposeVar(l.createAnimateFrameWithStartValues(()=>{var _;let N="";const L=d.getCameraInfo();if(L){const M=(F,V)=>L.position[F].toFixed(V);N+=`帧率:${d.getFPS()}FPS 相机: ${M(2,2)}米 `}const U=(_=d.extensions)==null?void 0:_.cursorPositionInfo.cursorPosition;if(U){const M=(F,V)=>U[F].toFixed(V);N+=`位置:${M(0,5)}° ${M(1,5)}° ${M(2,2)}米`}else N+="暂时无法获取鼠标位置...";E.innerText=N})),z.start()):(u.style.display="none",z.destroy())};this.dispose(e.showChanged.disposableOn(W)),W()}}}}get customDiv(){return this._customDiv}};v(_l,"type",_l.register("ESCesiumViewer",w.ESViewerStatusBarScale.type,_l));let Sg=_l;const HC=h.Math.toDegrees,s2=new h.Cartographic;function qC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),r=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(r,r);const s=new h.Ray(n,r),a=e.pickFromRay(s),c=e.globe.pick(s,e);var d;if(a&&a.position&&c){const m=h.Cartesian3.distance(n,a.position),y=h.Cartesian3.distance(n,c);d=m<y?a.position:c}else a&&a.position?d=a.position:c&&(d=c);if(!d)return;const u=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,d)>u?o:d,g=h.Cartographic.fromCartesian(f,void 0,s2);return[HC(g.longitude),HC(g.latitude),g.height]}const Pl=class Pl extends vt{constructor(e,n){super(e,n);v(this,"_hideGeoPolylines",this.disposeVar(new Gt(this.czmViewer,this.sceneObject.id)));v(this,"_visibleGeoPolylines",this.disposeVar(new Gt(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,s=this._visibleGeoPolylines;this.d(l.track([r,"show"],[e,"show"])),this.d(l.track([s,"show"],[e,"show"])),this.d(l.track([s,"color"],[e,"visibleColor"])),this.d(l.track([r,"color"],[e,"invisibleColor"]));{const a=()=>{const d=e.points,u=e.heightOffset;if(!d||d.length<2||d[0].toString()===d[1].toString()){r.positions=void 0,s.positions=void 0;return}const p=[],f=[],[g,m,y]=d[0],P=[g,m,y+u];try{d.forEach((S,C)=>{if(C===0)return;const E=qC(P,S,o.scene);E?(p.push([S,E]),f.push([P,E])):f.push([P,S])}),r.positions=p,s.positions=f}catch(S){console.warn(S)}};a();const c=this.dv(l.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(a))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),ae(r,o,n,s,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),ae(r,o,n,s,e),!0}}};v(Pl,"type",Pl.register("ESCesiumViewer",w.ESVisibilityAnalysis.type,Pl));let Eg=Pl;class Zs extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.dv(new l.Event));v(this,"_enableEvent",this.dv(new l.Event));v(this,"_clearEvent",this.dv(new l.Event));v(this,"_gridPoints",this.dv(l.reactJson([])));v(this,"excavationPolylines");v(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Gt(e,n)),s=this.dv(new Gt(e,n));this.excavationPolylines=r,this.fillPolylines=s;const a=r;a.color=[1,1,0,1],this.d(l.track([a,"show"],[this,"show"])),a.show=!1,a.depthTest=!0;const c=s;c.color=[0,0,1,1],this.d(l.track([c,"show"],[this,"show"])),c.show=!1;{const g=this.ad(new Mi(e,n));this.d(l.track([g,"show"],[this,"show"])),this.d(l.bind([g,"allowPicking"],[this,"allowPicking"])),this.d(l.bind([g,"positions"],[this,"positions"])),this.d(l.bind([g,"depthTest"],[this,"depthTest"])),this.d(l.bind([g,"outlineWidth"],[this,"outlineWidth"])),this.d(l.bind([g,"outlineColor"],[this,"outlineColor"])),this.d(l.bind([g,"outline"],[this,"outline"])),this.d(l.bind([g,"color"],[this,"fillColor"])),this.d(l.bind([g,"fill"],[this,"filled"])),this.d(l.bind([g,"strokeGround"],[this,"strokeGround"])),this.d(l.bind([g,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(P=>{g.flyTo(P)}));const m=()=>{g.positions=this.positions};m();const y=this.dv(l.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(m))}const d=()=>{if(!this.positions||!this.positions.length)return;const{minPos:g,maxPos:m}=w.getMinMaxCorner(this.positions),y=g[0],P=g[1],S=m[0],C=m[1],T={type:"Polygon",coordinates:[[...this.positions.map(U=>[U[0],U[1]])]]},I=[y,P,S,C],b=this.gridWidth,W=j0(I,b,{units:"meters",mask:T}).features.map(U=>U.geometry.coordinates),N=h.Math.toRadians;return W.map(U=>new h.Cartographic(N(U[0]),N(U[1])))},u=()=>{a.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,a.depthTest=!0},p=this.dv(l.createProcessingFromAsyncFunc(async g=>{const m=d();let y=0,P=300;const S=Math.ceil(m.length/P),C=[];do{let E=[];y===S-1?E=m.slice(y*P):E=m.slice(y*P,(y+1)*P);const T=o.scene.sampleHeightMostDetailed(E),I=await g.promise(T);if(y===S-1?this.progress=Math.round(this.progress+100/S):this.progress+=100/S,I&&I.length){const b=h.Math.toDegrees,x=I.filter(z=>z!=null).map(z=>[b(z.longitude),b(z.latitude),z.height]);C.push(...x)}y++}while(y<S);!C||!C.length||(this.gridPoints=C)}));let f=null;{const g=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let m=0;const y=[];let P=0;const S=[];this.gridPoints.forEach(C=>{const E=this.positions;C[2]>E[0][2]?(m+=this.gridWidth*this.gridWidth*(C[2]-E[0][2]),y.push([C,[C[0],C[1],E[0][2]]])):(P+=this.gridWidth*this.gridWidth*(E[0][2]-C[2]),S.push([C,[C[0],C[1],E[0][2]]]))}),a.positions=y,c.positions=S,a.show=!0,c.show=!0,this.area=jy(this.positions),this.cutVolume=m,this.fillVolume=P,this.cutAndFillVolume=P-m,f&&clearTimeout(f),f=setTimeout(()=>{a.depthTest=!1},200)};g(),this.d(this.gridPointsChanged.don(g)),this.d(()=>clearTimeout(f))}{const g=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};g(),this.d(this.positionsChanged.don(g))}{const g=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const m=JSON.parse(JSON.stringify(this.positions.slice(1)));m.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=m};g(),this.d(this.planeHeightChanged.don(g))}this.d(this.enableEvent.don(()=>{u(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{u()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:l.reactPositions(void 0),planeHeight:l.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(Zs||(Zs={})),l.extendClassProps(Zs.prototype,Zs.createDefaultProps);const Sl=class Sl extends Ht{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Zs(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(l.track([r,"show"],[e,"show"])),this.d(l.bind([r,"positions"],[e,"points"])),this.d(l.track([r,"allowPicking"],[e,"allowPicking"])),this.d(l.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(l.track([r,"gridWidth"],[e,"gridWidth"])),this.d(l.track([e,"cutVolume"],[r,"cutVolume"])),this.d(l.track([e,"fillVolume"],[r,"fillVolume"])),this.d(l.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(l.bind([e,"progress"],[r,"progress"])),this.d(l.track([r,"depthTest"],[e,"depthTest"])),this.d(l.track([r,"outline"],[e,"stroked"])),this.d(l.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(l.track([r,"outlineColor"],[e,"strokeColor"])),this.d(l.track([r,"filled"],[e,"filled"])),this.d(l.track([r,"fillColor"],[e,"fillColor"])),this.d(l.track([r,"fillGround"],[e,"fillGround"])),this.d(l.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(l.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}};v(Sl,"type",Sl.register("ESCesiumViewer",w.ESVolumeMeasurement.type,Sl));let Ag=Sl;const El=class El extends Ht{constructor(e,n){super(e,n);v(this,"czmEntity");v(this,"czmPolyline",this.ad(new w.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;n.add(r),this.ad(()=>n.delete(r)),this.ad(l.bind([r,"show"],[e,"show"])),this.ad(l.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(l.bind([r,"stroked"],[e,"stroked"])),this.ad(l.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(l.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(l.bind([r,"strokeGround"],[e,"strokeGround"]));{const d=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?r.points=p:r.points=p.map(f=>(f[2]=e.height??w.ESGeoExtrudedPolygon.defaults.height,f))}};d();const u=this.ad(l.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(u.don(d))}const s=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(s.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(s));let a=new h.PolygonHierarchy;s.polygon&&(s.polygon.hierarchy=new h.CallbackProperty(()=>a,!1));const c=()=>{const d=dt(e.points??[]);if(d.length<2){a=new h.PolygonHierarchy;return}a=new h.PolygonHierarchy(d)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const d=()=>{s.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!s.show&&e.filled)};d();const u=this.ad(l.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(u.don(d))}{const d=()=>{s.polygon&&(s.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};d(),this.ad(e.perPositionHeightChanged.don(d))}{const d=()=>{s.polygon&&(s.polygon.height=new h.ConstantProperty(e.height??w.ESGeoExtrudedPolygon.defaults.height))};d(),this.dispose(e.heightChanged.disposableOn(d))}{const d=()=>{s.polygon&&(s.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??w.ESGeoExtrudedPolygon.defaults.extrudedHeight))};d(),this.dispose(e.extrudedHeightChanged.disposableOn(d))}{const d=()=>{const u=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));s.polygon&&(s.polygon.material=u)};d(),this.dispose(e.fillColorChanged.disposableOn(d))}this.disposeVar(new l.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Re.ObjectsToExcludeWrapper(n,s)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=w.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};v(El,"type",El.register("ESCesiumViewer",w.ESGeoExtrudedPolygon.type,El));let Tg=El;const Al=class Al extends w.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=i;this.dispose(l.bind([o,"position"],[i,"position"])),this.dispose(l.bind([o,"rotation"],[i,"rotation"])),this.ad(l.bind([o,"scale"],[i,"scale"])),this.ad(l.track([r,"scale"],[i,"scale"])),this.dispose(l.track([r,"rotation"],[i,"rotation"]));const s=()=>{const c=i.position;r.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};s();const a=this.dv(l.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(a.don(s)),this.ad(r.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};v(Al,"type",Al.register("ESCesiumViewer",w.ESHumanPoi.type,Al));let Mg=Al;const Tl=class Tl extends w.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var u,p,f,g;const d=(g=(f=(p=(u=c==null?void 0:c._root)==null?void 0:u._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:g._features[0];d?o.strokeFeature([d],h.Color.LIME.toBytes().map(m=>m/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),r()})})),s=o.url,a=Date.now();s.includes("?reload=")?o.url=s.replace(/\?reload=\d+/,`?reload=${a}`):o.url=s+`?reload=${a}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const r=()=>{const a=i.layerConfig;if(!a){o.style=void 0;return}const c=i.colorBlendMode,d=(f,g)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,g);const m=f.getProperty("layer"),y=f.getProperty("dataset"),P=m.toString(),S=y.toString(),C=a.find(T=>T.dataset.toString()===S&&T.layer.toString()===P);if(C&&C.value.color){const T=C.value.color;return h.Color.fromCssColorString(T,g)}const E=a.filter(T=>T.dataset.toString()===S);if(E.length==1&&E[0].value.color){const T=E[0].value.color;return h.Color.fromCssColorString(T,g)}else return h.Color.clone(h.Color.WHITE,g)}catch(m){return console.warn(m),h.Color.clone(h.Color.WHITE,g)}},u=f=>{try{if(f.getPropertyIds().includes("id")){const E=Object.entries(i.visJson);for(let T=0;T<E.length;T++){const I=E[T];if(f.getProperty("id").toString()===I[0])return I[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const g=f.getProperty("layer"),m=f.getProperty("dataset"),y=g.toString(),P=m.toString(),S=a.find(E=>E.dataset.toString()===P&&E.layer.toString()===y);if(S&&S.value.visible===!1)return!1;if(S&&S.value.visible===!0)return!0;const C=a.filter(E=>E.dataset.toString()===P);return!(C.length==1&&C[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,g){return d(f,g)}},show:{evaluate:function(f){return u(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return u(f)}}}),console.log("style",p),o.style=p};r();const s=this.dv(l.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(s.don(()=>{r()}))}))}};v(Tl,"type",Tl.register("ESCesiumViewer",w.ESRtsTileset.type,Tl));let Ig=Tl;const Ml=class Ml extends Ar{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Ml,"type",Ml.register("ESCesiumViewer",w.ESRtsFeatureEditing.type,Ml));let Dg=Ml;const Il=class Il extends Ar{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Il,"type",Il.register("ESCesiumViewer",w.ESMsTileset.type,Il));let bg=Il;const Dl=class Dl extends Ce{constructor(e,n){super(e,n);v(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Bt(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmGeoPoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s.flyTo(e),o.flyOverEvent.emit(n,"over",r),!0):!1}};v(Dl,"type",Dl.register("ESCesiumViewer",w.ESStaticMesh.type,Dl));let Rg=Dl;const bl=class bl extends vt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new Ym(n));this.ad(i.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),s=Number.isFinite(i.radius)?i.radius:w.ESSkylineAnalysis.defaults.radius,{depths:a,windowPositions:c,positions:d}=o.getSkylineDepthsAndPositions(r,n.scene.canvas.width,n.scene.canvas.height,s),u=ce(n.camera.position);d.push(u),i.depths=a,i.windowPositions=c,i.points=d}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(ae(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(ae(o,n,e,n.points,i),!0):!1:!1}};v(bl,"type",bl.register("ESCesiumViewer",w.ESSkylineAnalysis.type,bl));let xg=bl;class a2 extends l.Destroyable{constructor(e,n){super();v(this,"_rectangle");v(this,"_updateHeatMapEvent",this.disposeVar(new l.Event));const o=e.sceneObject;this._rectangle=this.ad(new Ci(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(l.bind([this.rectangle,"show"],[o,"show"])),this.ad(l.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class l2 extends l.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_updateHeatMapEvent",this.disposeVar(new l.Event));v(this,"czmViewer");v(this,"czmESHeatMap");const o=this.czmViewer=n,r=this.czmESHeatMap=e,s=r.sceneObject,a=o.viewer;if(!a)return;let c,d;const u=this.ad(new l.Event),p=()=>{f(),!(!c||!d)&&(this._primitive=a.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:d,asynchronous:!1,allowPicking:s.allowPicking})))},f=()=>{this.primitive&&a.scene.primitives.remove(this.primitive)};this.ad(f);{const g=()=>{this.primitive&&(this.primitive.show=s.show)};g(),this.ad(s.showChanged.don(g))}{const g=this.ad(l.createNextAnimateFrameEvent(s.allowPickingChanged,u));this.ad(g.don(p))}{const g=()=>{r.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(m=>{if(!r.rectangle)return;const y=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,P=w.getDistancesFromPositions([[r.rectangle[0],y,0],[r.rectangle[2],y,0]],"GEODESIC")[0]/5;d=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:m}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(P),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=m,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(P)),g(),this.primitive||u.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
1890
|
+
`),24))};s(),this.d(this.totalAreaChanged.don(s)),this.d(this.unitsChanged.don(s)),this.d(l.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=e0(this.positions):this._geoDivPoi.position=void 0)}));const a=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const d=this.interpolationDistance??Vo.defaults.interpolationDistance,u=this.interpolation??Vo.defaults.interpolation,p=this.offsetHeight??Vo.defaults.offsetHeight,f=this.drillDepth??Vo.defaults.drillDepth,g=[];if(this.positions)for(let $=0;$<this.positions.length;++$){const Y=h.Cartesian3.fromDegrees(this.positions[$][0],this.positions[$][1],this.positions[$][2]);g.push(Y)}var m=YR(g);if(isNaN(m.x)||isNaN(m.y)||isNaN(m.z)){console.warn("法向量计算错误!");return}var y=ZR(g),P=h.Cartesian3.normalize(y,new h.Cartesian3),S=h.Cartesian3.dot(P,m);S<0&&(m=GC(m),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),E=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(S)<.999){const $=QR(m,P);var T=GC(y),I=h.Matrix4.fromTranslation(T,new h.Matrix4);E=h.Matrix4.multiply($,I,I),C=h.Matrix4.inverse(E,new h.Matrix4)}var b=Gr(g,E),x=[],z=[],W=JR(b);if(u&&d>0){var N=KR(b);const $=Math.max(N.maxy-N.miny,N.maxx-N.minx);var L=t2(W,N,d);const Y=await Cg(L,C,E,m,o.scene,p,f,$);var U=i2(b,d);const K=await Cg(U,C,E,m,o.scene,p,f,$);z.push(...Y.world_cartesian),x.push(...Y.local),z.push(...K.world_cartesian),x.push(...K.local);for(let te=0;te<b.length;++te){const re=b[te];var _=await Cg([re],C,E,m,o.scene,p,f,$);if(_.local.length>0)x.push(..._.local),z.push(..._.world_cartesian);else{const ge=[re.x,re.y,re.z+p];x.push(ge);var M=Gr([h.Cartesian3.fromArray(ge)],C);for(let ye=0;ye<M.length;++ye)z.push(M[ye])}}}else{const $=b.map(Y=>h.Cartesian3.fromArray([Y.x,Y.y,Y.z+$]));x=$,z=Gr($,C)}var F=BR(x,W);const V=jR(z,F);this.totalArea=V;const G=[];x.forEach($=>{const Y=[$.x,$.y,$.z];Y&&G.push(...Y)});const Z={position:{typedArray:new Float32Array(G),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(C),this.customPrimitive.attributes=Z;const $=await XR([...F]);this.customPrimitive.indexTypedArray=new Uint32Array($),this.customPrimitive.show=!0;const Y=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!Y)return;const{min:K,max:te}=Y;this.customPrimitive.setLocalAxisedBoundingBox(K,te)}},c=this.dv(l.createProcessingFromAsyncFunc(async d=>{await d.promise(a()),this._starting=!1,s()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,s(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,s()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};v(Vo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let bo=Vo;(t=>{t.createDefaultProps=()=>({positions:l.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:l.reactArray([1,1,1,1]),units:l.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(bo||(bo={})),l.extendClassProps(bo.prototype,bo.createDefaultProps);async function XR(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await WC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function YR(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let d=0;d<r;++d){var s=t[d],a;d==0?a=t[t.length-1]:a=t[d-1];var c;d==t.length-1?c=t[0]:c=t[d+1],i=h.Cartesian3.subtract(s,a,i),e=h.Cartesian3.subtract(s,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/r,n.y=o.y/r,n.z=o.z/r,n}function ZR(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function GC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function QR(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,r=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function Gr(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function KR(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(r=>{i=Math.min(i,r.x),e=Math.min(e,r.y),n=Math.max(n,r.x),o=Math.max(o,r.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function JR(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function BR(t,i){var e=[];t.forEach(s=>{const a=[s.x,s.y];e.push(a)});var n=H_.from(e).triangles;const o=[],r=Ct([i]);for(let s=0;s<n.length;s+=3){const a=n[s],c=n[s+1],d=n[s+2],u=(t[a].x+t[c].x+t[d].x)/3,p=(t[a].y+t[c].y+t[d].y)/3;Pt([u,p],r)&&o.push(a,c,d)}return new Uint32Array(o.reverse())}function jR(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=e2(o)}return e}function e2(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,r=Math.sqrt(o*(o-i)*(o-e)*(o-n));return r||0}function t2(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var r=i.miny;r<i.maxy;r+=e)o2([o,r],t)&&n.push(new h.Cartesian3(o,r,0));return n}function i2(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o;s==t.length-1?o=t[0]:o=t[s+1];var r=n2(n,o,i);e.push(...r)}return e}function n2(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),r=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(r.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];r=h.Cartesian3.normalize(r,r);for(var s=e;s<o;){var a=new h.Cartesian3(r.x*s,r.y*s,r.z*s),c=h.Cartesian3.add(t,a,new h.Cartesian3);n.push(c),s+=e}return n}function o2(t,i){var e=zn(t);if(!gR(zn(i[0]),zn(i[i.length-1])))return!1;var n=[];n.push(i);var o=Ct(n);return Pt(e,o)}async function Cg(t,i,e,n,o,r,s,a){var c=[];t.forEach(E=>{var T=E.clone();T.z=a,c.push(T)});var d=Gr(c,i),u=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],g=[];for(let E=0;E<d.length;++E){await WC();var m=d[E],y=new h.Ray(m,u),P=void 0;try{P=o.pickFromRay(y)}catch{}if(!P){y=new h.Ray(m,n);try{P=o.pickFromRay(y)}catch{}}if(P){var S=P.position;if(!(!S||!S.x||isNaN(S.x))){var C=Gr([S],e);C.forEach(T=>{T.z+=r}),S=Gr(C,i)[0],g.push(S),S=h.Cartographic.fromCartesian(S),p.push([S.longitude,S.latitude,S.height]),f.push(C[0])}}}return{local:f,world:p,world_cartesian:g}}const wl=class wl extends Ht{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new bo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(l.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(l.track([r,"units"],[e,"units"])),this.d(l.track([r,"show"],[e,"show"])),this.d(l.track([r,"positions"],[e,"points"])),this.d(l.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(l.track([r,"offsetHeight"],[e,"offsetHeight"]));{const s=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(a.disposableOn(s))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s.positions&&ae(r,o,n,s.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,n):(s.positions&&ae(r,o,n,s.positions,e),!0):!1}};v(wl,"type",wl.register("ESCesiumViewer",w.ESSurfaceAreaMeasurement.type,wl));let _g=wl;async function r2(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Cl=class Cl extends w.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new w.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;n.add(r),this.dispose(()=>n.delete(r)),r.instanceClass=class extends l.Destroyable{constructor(a,c,d){if(super(),this._subContainer=a,!d||!(d instanceof Re))return;d.extensions.cursorPositionInfo.enabled=!0;const u=document.createElement("div");this._subContainer.appendChild(u),this.dispose(()=>this._subContainer.removeChild(u)),u.style.width="100%",u.style.position="absolute",u.style.height=`${w.ESViewerStatusBar.defaults.height}px`,u.style.left="0",u.style.bottom="0",u.style.color="#fff",u.style.padding="0 20px 0 0",u.style.boxSizing="border-box",u.style.lineHeight=`${w.ESViewerStatusBar.defaults.height}px`,u.style.zIndex="100",u.style.alignContent="center",u.style.justifyContent="space-between";const p=document.createElement("span");u.appendChild(p),this.dispose(()=>u.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const g=document.createElement("span");p.appendChild(g),g.addEventListener("dblclick",function(){let y=g.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),r2(y)}),g.style.cursor="pointer",this.dispose(()=>p.removeChild(g));const m=document.createElement("span");u.appendChild(m),this.dispose(()=>u.removeChild(m));{const y=()=>{u.style.height=(e.height??w.ESViewerStatusBar.defaults.height)+"px",u.style.lineHeight=(e.height??w.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{u.style.fontSize=(e.fontSize??w.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?u.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:u.style.background=`rgba(${w.ESViewerStatusBar.defaults.bgColor[0]},${w.ESViewerStatusBar.defaults.bgColor[1]},${w.ESViewerStatusBar.defaults.bgColor[2]},${w.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{m.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const P=()=>{e.show?(u.style.display="flex",y=this.disposeVar(l.createAnimateFrameWithStartValues(()=>{var I;let S="",C="";const E=d.getCameraInfo();if(E){const b=(z,W)=>E.position[z].toFixed(W),x=(z,W)=>E.rotation[z].toFixed(W);S=`帧率:${d.getFPS()}FPS 经度: ${b(0,5)}° 纬度: ${b(1,5)}° 高度: ${b(2,2)}米 偏航角: ${x(0,2)}° 俯仰角: ${x(1,2)}° 翻滚角:${x(2,2)}° `}f.innerText=S;const T=(I=d.extensions)==null?void 0:I.cursorPositionInfo.cursorPosition;if(T){const b=(x,z)=>T[x].toFixed(z);C=`鼠标位置:${b(0,5)}° ${b(1,5)}° ${b(2,2)}m`}else C="暂时无法获取鼠标位置...";g.innerText=C})),y.start()):(u.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(P)),P()}}}}get customDiv(){return this._customDiv}};v(Cl,"type",Cl.register("ESCesiumViewer",w.ESViewerStatusBar.type,Cl));let Pg=Cl;const _l=class _l extends w.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new w.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;n.add(r),this.dispose(()=>n.delete(r)),this.dispose(l.track([r,"show"],[e,"show"])),r.instanceClass=class extends l.Destroyable{constructor(a,c,d){if(super(),this._subContainer=a,!d||!(d instanceof Re))return;d.extensions.cursorPositionInfo.enabled=!0;const u=document.createElement("div");this._subContainer.appendChild(u),this.dispose(()=>this._subContainer.removeChild(u));const p=document.createElement("div");u.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${w.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${w.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const g=document.createElement("div");f.appendChild(g);const m=document.createElement("div");f.appendChild(m);const y=document.createElement("div");p.appendChild(y);const P=document.createElement("div");y.appendChild(P);const S=document.createElement("div");P.appendChild(S);const C=document.createElement("div");P.appendChild(C);const E=document.createElement("span");y.appendChild(E);{const z=()=>{p.style.height=(e.height??w.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??w.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(z)),z()}{const z=()=>{p.style.fontSize=(e.fontSize??w.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(z)),z()}{const z=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${w.ESViewerStatusBarScale.defaults.bgColor[0]},${w.ESViewerStatusBarScale.defaults.bgColor[1]},${w.ESViewerStatusBarScale.defaults.bgColor[2]},${w.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(z)),z()}f.style.display="flex",g.style.fontWeight="bold",g.style.padding="0 0 0 25px";let T="EarthSDK";g.innerText=T,m.style.fontWeight="";let I="——免费开源地球可视化开发包";m.innerText=I,y.style.width="550px",P.style.position="fixed",P.style.width="125px",P.style.height="30px",P.style.padding="0 5px",P.style.display="flex",P.style.justifyContent="flex-end",P.style.pointerEvents="auto",P.style.zIndex="101",S.style.width="125px",S.style.display="inline-block",S.style.textAlign="center",S.style.fontSize="14px",S.style.fontWeight="lighter",S.style.lineHeight="30px",S.style.color="#fff",S.innerHTML="1000km",C.style.borderRight="1px solid #fff",C.style.borderLeft="1px solid #fff",C.style.borderBottom="1px solid #fff",C.style.position="absolute",C.style.height="10px",C.style.top="15px",C.style.width="75px",C.style.right=`${60/2}px`,E.style.display="flex",E.style.zIndex="101",E.style.justifyContent="flex-end",E.style.right="0";const b=()=>{const z=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||z&&z>1e6)P.style.display="none";else{P.style.display="block";const W=n.viewerLegend.legend.computedLengthInStr;W&&(S.innerHTML=W);const N=n.viewerLegend.legend.computedLengthInPixels;if(N){C.style.width=`${N}px`;const L=(135-N)/2;C.style.left=`${L}px`}}};b();const x=setInterval(()=>{b()},200);this.dispose(()=>clearInterval(x));{let z;const W=()=>{e.show?(u.style.display="block",z=this.disposeVar(l.createAnimateFrameWithStartValues(()=>{var _;let N="";const L=d.getCameraInfo();if(L){const M=(F,V)=>L.position[F].toFixed(V);N+=`帧率:${d.getFPS()}FPS 相机: ${M(2,2)}米 `}const U=(_=d.extensions)==null?void 0:_.cursorPositionInfo.cursorPosition;if(U){const M=(F,V)=>U[F].toFixed(V);N+=`位置:${M(0,5)}° ${M(1,5)}° ${M(2,2)}米`}else N+="暂时无法获取鼠标位置...";E.innerText=N})),z.start()):(u.style.display="none",z.destroy())};this.dispose(e.showChanged.disposableOn(W)),W()}}}}get customDiv(){return this._customDiv}};v(_l,"type",_l.register("ESCesiumViewer",w.ESViewerStatusBarScale.type,_l));let Sg=_l;const HC=h.Math.toDegrees,s2=new h.Cartographic;function qC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),r=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(r,r);const s=new h.Ray(n,r),a=e.pickFromRay(s),c=e.globe.pick(s,e);var d;if(a&&a.position&&c){const m=h.Cartesian3.distance(n,a.position),y=h.Cartesian3.distance(n,c);d=m<y?a.position:c}else a&&a.position?d=a.position:c&&(d=c);if(!d)return;const u=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,d)>u?o:d,g=h.Cartographic.fromCartesian(f,void 0,s2);return[HC(g.longitude),HC(g.latitude),g.height]}const Pl=class Pl extends vt{constructor(e,n){super(e,n);v(this,"_hideGeoPolylines",this.disposeVar(new Gt(this.czmViewer,this.sceneObject.id)));v(this,"_visibleGeoPolylines",this.disposeVar(new Gt(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,s=this._visibleGeoPolylines;this.d(l.track([r,"show"],[e,"show"])),this.d(l.track([s,"show"],[e,"show"])),this.d(l.track([s,"color"],[e,"visibleColor"])),this.d(l.track([r,"color"],[e,"invisibleColor"]));{const a=()=>{const d=e.points,u=e.heightOffset;if(!d||d.length<2||d[0].toString()===d[1].toString()){r.positions=void 0,s.positions=void 0;return}const p=[],f=[],[g,m,y]=d[0],P=[g,m,y+u];try{d.forEach((S,C)=>{if(C===0)return;const E=qC(P,S,o.scene);E?(p.push([S,E]),f.push([P,E])):f.push([P,S])}),r.positions=p,s.positions=f}catch(S){console.warn(S)}};a();const c=this.dv(l.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(a))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),ae(r,o,n,s,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),ae(r,o,n,s,e),!0}}};v(Pl,"type",Pl.register("ESCesiumViewer",w.ESVisibilityAnalysis.type,Pl));let Eg=Pl;class Zs extends l.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.dv(new l.Event));v(this,"_enableEvent",this.dv(new l.Event));v(this,"_clearEvent",this.dv(new l.Event));v(this,"_gridPoints",this.dv(l.reactJson([])));v(this,"excavationPolylines");v(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Gt(e,n)),s=this.dv(new Gt(e,n));this.excavationPolylines=r,this.fillPolylines=s;const a=r;a.color=[1,1,0,1],this.d(l.track([a,"show"],[this,"show"])),a.show=!1,a.depthTest=!0;const c=s;c.color=[0,0,1,1],this.d(l.track([c,"show"],[this,"show"])),c.show=!1;{const g=this.ad(new Mi(e,n));this.d(l.track([g,"show"],[this,"show"])),this.d(l.bind([g,"allowPicking"],[this,"allowPicking"])),this.d(l.bind([g,"positions"],[this,"positions"])),this.d(l.bind([g,"depthTest"],[this,"depthTest"])),this.d(l.bind([g,"outlineWidth"],[this,"outlineWidth"])),this.d(l.bind([g,"outlineColor"],[this,"outlineColor"])),this.d(l.bind([g,"outline"],[this,"outline"])),this.d(l.bind([g,"color"],[this,"fillColor"])),this.d(l.bind([g,"fill"],[this,"filled"])),this.d(l.bind([g,"strokeGround"],[this,"strokeGround"])),this.d(l.bind([g,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(P=>{g.flyTo(P)}));const m=()=>{g.positions=this.positions};m();const y=this.dv(l.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(m))}const d=()=>{if(!this.positions||!this.positions.length)return;const{minPos:g,maxPos:m}=w.getMinMaxCorner(this.positions),y=g[0],P=g[1],S=m[0],C=m[1],T={type:"Polygon",coordinates:[[...this.positions.map(U=>[U[0],U[1]])]]},I=[y,P,S,C],b=this.gridWidth,W=iw(I,b,{units:"meters",mask:T}).features.map(U=>U.geometry.coordinates),N=h.Math.toRadians;return W.map(U=>new h.Cartographic(N(U[0]),N(U[1])))},u=()=>{a.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,a.depthTest=!0},p=this.dv(l.createProcessingFromAsyncFunc(async g=>{const m=d();let y=0,P=300;const S=Math.ceil(m.length/P),C=[];do{let E=[];y===S-1?E=m.slice(y*P):E=m.slice(y*P,(y+1)*P);const T=o.scene.sampleHeightMostDetailed(E),I=await g.promise(T);if(y===S-1?this.progress=Math.round(this.progress+100/S):this.progress+=100/S,I&&I.length){const b=h.Math.toDegrees,x=I.filter(z=>z!=null).map(z=>[b(z.longitude),b(z.latitude),z.height]);C.push(...x)}y++}while(y<S);!C||!C.length||(this.gridPoints=C)}));let f=null;{const g=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let m=0;const y=[];let P=0;const S=[];this.gridPoints.forEach(C=>{const E=this.positions;C[2]>E[0][2]?(m+=this.gridWidth*this.gridWidth*(C[2]-E[0][2]),y.push([C,[C[0],C[1],E[0][2]]])):(P+=this.gridWidth*this.gridWidth*(E[0][2]-C[2]),S.push([C,[C[0],C[1],E[0][2]]]))}),a.positions=y,c.positions=S,a.show=!0,c.show=!0,this.area=jy(this.positions),this.cutVolume=m,this.fillVolume=P,this.cutAndFillVolume=P-m,f&&clearTimeout(f),f=setTimeout(()=>{a.depthTest=!1},200)};g(),this.d(this.gridPointsChanged.don(g)),this.d(()=>clearTimeout(f))}{const g=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};g(),this.d(this.positionsChanged.don(g))}{const g=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const m=JSON.parse(JSON.stringify(this.positions.slice(1)));m.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=m};g(),this.d(this.planeHeightChanged.don(g))}this.d(this.enableEvent.don(()=>{u(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{u()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:l.reactPositions(void 0),planeHeight:l.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(Zs||(Zs={})),l.extendClassProps(Zs.prototype,Zs.createDefaultProps);const Sl=class Sl extends Ht{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new Zs(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(l.track([r,"show"],[e,"show"])),this.d(l.bind([r,"positions"],[e,"points"])),this.d(l.track([r,"allowPicking"],[e,"allowPicking"])),this.d(l.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(l.track([r,"gridWidth"],[e,"gridWidth"])),this.d(l.track([e,"cutVolume"],[r,"cutVolume"])),this.d(l.track([e,"fillVolume"],[r,"fillVolume"])),this.d(l.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(l.bind([e,"progress"],[r,"progress"])),this.d(l.track([r,"depthTest"],[e,"depthTest"])),this.d(l.track([r,"outline"],[e,"stroked"])),this.d(l.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(l.track([r,"outlineColor"],[e,"strokeColor"])),this.d(l.track([r,"filled"],[e,"filled"])),this.d(l.track([r,"fillColor"],[e,"fillColor"])),this.d(l.track([r,"fillGround"],[e,"fillGround"])),this.d(l.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(l.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):s.positions?(ae(r,o,n,s.positions,e),!0):!1:!1}};v(Sl,"type",Sl.register("ESCesiumViewer",w.ESVolumeMeasurement.type,Sl));let Ag=Sl;const El=class El extends Ht{constructor(e,n){super(e,n);v(this,"czmEntity");v(this,"czmPolyline",this.ad(new w.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;n.add(r),this.ad(()=>n.delete(r)),this.ad(l.bind([r,"show"],[e,"show"])),this.ad(l.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(l.bind([r,"stroked"],[e,"stroked"])),this.ad(l.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(l.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(l.bind([r,"strokeGround"],[e,"strokeGround"]));{const d=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?r.points=p:r.points=p.map(f=>(f[2]=e.height??w.ESGeoExtrudedPolygon.defaults.height,f))}};d();const u=this.ad(l.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(u.don(d))}const s=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(s.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(s));let a=new h.PolygonHierarchy;s.polygon&&(s.polygon.hierarchy=new h.CallbackProperty(()=>a,!1));const c=()=>{const d=dt(e.points??[]);if(d.length<2){a=new h.PolygonHierarchy;return}a=new h.PolygonHierarchy(d)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const d=()=>{s.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!s.show&&e.filled)};d();const u=this.ad(l.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(u.don(d))}{const d=()=>{s.polygon&&(s.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};d(),this.ad(e.perPositionHeightChanged.don(d))}{const d=()=>{s.polygon&&(s.polygon.height=new h.ConstantProperty(e.height??w.ESGeoExtrudedPolygon.defaults.height))};d(),this.dispose(e.heightChanged.disposableOn(d))}{const d=()=>{s.polygon&&(s.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??w.ESGeoExtrudedPolygon.defaults.extrudedHeight))};d(),this.dispose(e.extrudedHeightChanged.disposableOn(d))}{const d=()=>{const u=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));s.polygon&&(s.polygon.material=u)};d(),this.dispose(e.fillColorChanged.disposableOn(d))}this.disposeVar(new l.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Re.ObjectsToExcludeWrapper(n,s)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=w.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};v(El,"type",El.register("ESCesiumViewer",w.ESGeoExtrudedPolygon.type,El));let Tg=El;const Al=class Al extends w.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=i;this.dispose(l.bind([o,"position"],[i,"position"])),this.dispose(l.bind([o,"rotation"],[i,"rotation"])),this.ad(l.bind([o,"scale"],[i,"scale"])),this.ad(l.track([r,"scale"],[i,"scale"])),this.dispose(l.track([r,"rotation"],[i,"rotation"]));const s=()=>{const c=i.position;r.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};s();const a=this.dv(l.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(a.don(s)),this.ad(r.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};v(Al,"type",Al.register("ESCesiumViewer",w.ESHumanPoi.type,Al));let Mg=Al;const Tl=class Tl extends w.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var u,p,f,g;const d=(g=(f=(p=(u=c==null?void 0:c._root)==null?void 0:u._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:g._features[0];d?o.strokeFeature([d],h.Color.LIME.toBytes().map(m=>m/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),r()})})),s=o.url,a=Date.now();s.includes("?reload=")?o.url=s.replace(/\?reload=\d+/,`?reload=${a}`):o.url=s+`?reload=${a}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const r=()=>{const a=i.layerConfig;if(!a){o.style=void 0;return}const c=i.colorBlendMode,d=(f,g)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,g);const m=f.getProperty("layer"),y=f.getProperty("dataset"),P=m.toString(),S=y.toString(),C=a.find(T=>T.dataset.toString()===S&&T.layer.toString()===P);if(C&&C.value.color){const T=C.value.color;return h.Color.fromCssColorString(T,g)}const E=a.filter(T=>T.dataset.toString()===S);if(E.length==1&&E[0].value.color){const T=E[0].value.color;return h.Color.fromCssColorString(T,g)}else return h.Color.clone(h.Color.WHITE,g)}catch(m){return console.warn(m),h.Color.clone(h.Color.WHITE,g)}},u=f=>{try{if(f.getPropertyIds().includes("id")){const E=Object.entries(i.visJson);for(let T=0;T<E.length;T++){const I=E[T];if(f.getProperty("id").toString()===I[0])return I[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const g=f.getProperty("layer"),m=f.getProperty("dataset"),y=g.toString(),P=m.toString(),S=a.find(E=>E.dataset.toString()===P&&E.layer.toString()===y);if(S&&S.value.visible===!1)return!1;if(S&&S.value.visible===!0)return!0;const C=a.filter(E=>E.dataset.toString()===P);return!(C.length==1&&C[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,g){return d(f,g)}},show:{evaluate:function(f){return u(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return u(f)}}}),console.log("style",p),o.style=p};r();const s=this.dv(l.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(s.don(()=>{r()}))}))}};v(Tl,"type",Tl.register("ESCesiumViewer",w.ESRtsTileset.type,Tl));let Ig=Tl;const Ml=class Ml extends Ar{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Ml,"type",Ml.register("ESCesiumViewer",w.ESRtsFeatureEditing.type,Ml));let Dg=Ml;const Il=class Il extends Ar{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Il,"type",Il.register("ESCesiumViewer",w.ESMsTileset.type,Il));let bg=Il;const Dl=class Dl extends Ce{constructor(e,n){super(e,n);v(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Bt(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(l.track([r,"show"],[e,"show"])),this.dispose(l.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:r,czmGeoPoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(s.flyTo(e),o.flyOverEvent.emit(n,"over",r),!0):!1}};v(Dl,"type",Dl.register("ESCesiumViewer",w.ESStaticMesh.type,Dl));let Rg=Dl;const bl=class bl extends vt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new Ym(n));this.ad(i.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),s=Number.isFinite(i.radius)?i.radius:w.ESSkylineAnalysis.defaults.radius,{depths:a,windowPositions:c,positions:d}=o.getSkylineDepthsAndPositions(r,n.scene.canvas.width,n.scene.canvas.height,s),u=ce(n.camera.position);d.push(u),i.depths=a,i.windowPositions=c,i.points=d}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(ae(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(ae(o,n,e,n.points,i),!0):!1:!1}};v(bl,"type",bl.register("ESCesiumViewer",w.ESSkylineAnalysis.type,bl));let xg=bl;class a2 extends l.Destroyable{constructor(e,n){super();v(this,"_rectangle");v(this,"_updateHeatMapEvent",this.disposeVar(new l.Event));const o=e.sceneObject;this._rectangle=this.ad(new Ci(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(l.bind([this.rectangle,"show"],[o,"show"])),this.ad(l.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class l2 extends l.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_updateHeatMapEvent",this.disposeVar(new l.Event));v(this,"czmViewer");v(this,"czmESHeatMap");const o=this.czmViewer=n,r=this.czmESHeatMap=e,s=r.sceneObject,a=o.viewer;if(!a)return;let c,d;const u=this.ad(new l.Event),p=()=>{f(),!(!c||!d)&&(this._primitive=a.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:d,asynchronous:!1,allowPicking:s.allowPicking})))},f=()=>{this.primitive&&a.scene.primitives.remove(this.primitive)};this.ad(f);{const g=()=>{this.primitive&&(this.primitive.show=s.show)};g(),this.ad(s.showChanged.don(g))}{const g=this.ad(l.createNextAnimateFrameEvent(s.allowPickingChanged,u));this.ad(g.don(p))}{const g=()=>{r.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(m=>{if(!r.rectangle)return;const y=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,P=w.getDistancesFromPositions([[r.rectangle[0],y,0],[r.rectangle[2],y,0]],"GEODESIC")[0]/5;d=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:m}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(P),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=m,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(P)),g(),this.primitive||u.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
1891
1891
|
in vec3 position3DHigh;
|
|
1892
1892
|
in vec3 position3DLow;
|
|
1893
1893
|
in vec3 normal;
|
|
@@ -2255,10 +2255,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2255
2255
|
`;function Kk(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
2256
2256
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
2257
2257
|
gitee地址:${t}
|
|
2258
|
-
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const rt=class rt extends w.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(l.react(0)));v(this,"_viewer",this.dv(l.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(l.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(l.react(0)));v(this,"_editingSystem",Dh);v(this,"_moveObjectsProcess",this.ad(i_()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new b2(this)),this.ad(new R2(this)),this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new z2(this)})),this._viewerLegend=this.dv(new qk(this)),this._viewerInstance=this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new cm(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=ie([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new l.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new FF(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Yt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],rt.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Vt(e),rotation:$o(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const s=h.Cartesian3.fromDegrees(...e),a=h.Cartesian3.distance(o.positionWC,s),c=h.Cartesian3.subtract(s,r,new h.Cartesian3);h.Cartesian3.normalize(c,c);const d=h.Transforms.rotationMatrixFromPositionVelocity(r,c,h.Ellipsoid.WGS84),u=h.Matrix4.fromRotationTranslation(d,r);var p=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(u,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),f=h.Matrix4.multiply(h.Matrix4.inverse(p,new h.Matrix4),u,new h.Matrix4),g=h.Matrix4.getMatrix3(f,new h.Matrix3),m=h.Quaternion.fromRotationMatrix(g),y=h.HeadingPitchRoll.fromQuaternion(m);const P=$o(o);return{distance:a,heading:h.Math.toDegrees(y.heading)+90,pitch:h.Math.toDegrees(y.pitch),flyDuration:1,hDelta:-(P[0]-(h.Math.toDegrees(y.heading)+90)),pDelta:P[1]-h.Math.toDegrees(y.pitch)}}flyIn(e,n,o,r="default"){var c;if(!n)return;n[0]=-n[0];const s={position:e,rotation:n,duration:(o??1)*1e3},a=(c=this.viewer)==null?void 0:c.camera;return a&&ps(a,s)}flyTo(e,n,o="default"){var g;const{distance:r,heading:s,pitch:a,flyDuration:c,hDelta:d,pDelta:u}=e,p={position:n,viewDistance:r,rotation:[s,a,0],duration:c*1e3,hdelta:d,pdelta:u},f=(g=this.viewer)==null?void 0:g.camera;return f&&ps(f,p)}flyToBoundingSphere(e,n,o=1){var p;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=w.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:a,radius:c}=s,d={position:a,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},u=(p=this.viewer)==null?void 0:p.camera;return u&&ps(u,d)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Vt(e),rotation:$o(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var r,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var r,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,r,s,a){var c,d;(d=(c=this._viewerInstance)==null?void 0:c.obj)==null||d.navigationManager.changeToLine(e,n,o,r,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,r,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,r,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,r,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToFollow(e,n,o,r,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const r=h.Cartographic.fromDegrees(e,n,void 0,rt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,n){const o=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await jm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Ve(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&n!=null&&(r.editingID=`${o.callSource}_${l.createGuid()}`,this._editingSystem.create(this,r,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=l.createGuid();for(let r=0;r<e.length;r++){const s=e[r],a=s.components.main??s;a.editingID=o,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=rt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!rt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=rt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Mt(e,n)}localPositionsToPositions(e,n){return gn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Ve(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},n=rt.defaults;return{...e,more:[...e.more,new w.GroupProperty([],"通用","通用"),new w.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",Qk,Zk,!0),new w.FunctionProperty([],()=>rt.getCesiumIonToken(),[],"获取官方token"),new w.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new w.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new w.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new w.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new w.GroupProperty([],"Viewer","Viewer"),new w.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new w.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new w.BooleanProperty([this,"shadows"]),new w.GroupProperty([],"比例尺","比例尺(Legend)"),new w.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new w.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new w.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new w.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new w.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new w.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new w.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new w.GroupProperty([],"场景","场景(Scene)"),new w.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new w.GroupProperty([],"Globe","Globe"),new w.BooleanProperty([this,"depthTestAgainstTerrain"],"depthTestAgainstTerrain",n.depthTestAgainstTerrain,!0),new w.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new w.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new w.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new w.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new w.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new w.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new w.BooleanProperty([this,"sceneGlobeShowSkirts"]),new w.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new w.ColorProperty([this,"sceneGlobeBaseColor"]),new w.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new w.JsonProperty([this,"sceneGlobeClippingPlanes"]),new w.StringProperty([this,"sceneGlobeClippingPlanesId"]),new w.JsonProperty([this,"sceneGlobeClippingPolygons"]),new w.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new w.GroupProperty([],"underground","underground"),new w.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new w.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new w.GroupProperty([],"Translucency","Translucency"),new w.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",n.sceneGlobeTranslucencyEnabled,!0),new w.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",n.sceneGlobeTranslucencyBackFaceAlpha,!0),new w.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new w.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",n.sceneGlobeTranslucencyFrontFaceAlpha,!0),new w.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new w.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new w.GroupProperty([],"Sun","Sun"),new w.BooleanProperty([this,"sun"],"sun",n.sun,!0),new w.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new w.GroupProperty([],"Moon","Moon"),new w.BooleanProperty([this,"moon"],"moon",n.moon,!0),new w.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new w.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new w.GroupProperty([],"SkyBox","SkyBox"),new w.BooleanProperty([this,"sceneSkyBoxShow"]),new w.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new w.GroupProperty([],"Background","Background"),new w.BooleanProperty([this,"xbsjUseBackground"]),new w.StringProperty([this,"xbsjBackgroundImageUri"]),new w.ColorProperty([this,"xbsjBackgroundColor"]),new w.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new w.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new w.ColorProperty([this,"sceneBackgroundColor"]),new w.GroupProperty([],"Fog","Fog"),new w.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new w.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new w.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new w.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new w.GroupProperty([],"Sscc","Sscc"),new w.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new w.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new w.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new w.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new w.GroupProperty([],"后处理","后处理"),new w.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new w.GroupProperty([],"环境遮蔽","环境遮蔽"),new w.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new w.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new w.GroupProperty([],"Bloom","Bloom"),new w.BooleanProperty([this,"scenePpsBloomEnabled"]),new w.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new w.NumberProperty([this,"scenePpsBloomContrast"]),new w.NumberProperty([this,"scenePpsBloomBrightness"]),new w.NumberProperty([this,"scenePpsBloomDelta"]),new w.NumberProperty([this,"scenePpsBloomSigma"]),new w.NumberProperty([this,"scenePpsBloomStepSize"]),new w.GroupProperty([],"调试","调试"),new w.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new w.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new w.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new w.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new w.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new w.GroupProperty([],"Inspector","Inspector"),new w.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new w.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new w.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(rt,"type",rt.register("ESCesiumViewer",rt)),v(rt,"getCesiumIonToken",Kk),v(rt,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(rt,"latestDefaultAccessToken"),v(rt,"ObjectsToExcludeWrapper",k2),v(rt,"defaults",{...w.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,depthTestAgainstTerrain:!1,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyEnabled:!1,sceneGlobeTranslucencyBackFaceAlpha:1,sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlpha:1,sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),v(rt,"getHeightsScartchCarto",new h.Cartographic);let Re=rt;(t=>{t.createDefaultProps=()=>({...w.ESViewer.createDefaultProps(),...Yk()})})(Re||(Re={})),l.extendClassProps(Re.prototype,Re.createDefaultProps),R.copyright=void 0;try{const t="earthsdk3-cesium",i="3.4.0",e="2025-09-12T07:06:00.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="7bb817c2218c8ba03b2c728ade4fc430cfee47dd",a=((Date.now()-175766076e4)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
2258
|
+
`;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const rt=class rt extends w.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(l.react(0)));v(this,"_viewer",this.dv(l.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(l.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(l.react(0)));v(this,"_editingSystem",Dh);v(this,"_moveObjectsProcess",this.ad(i_()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new b2(this)),this.ad(new R2(this)),this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new z2(this)})),this._viewerLegend=this.dv(new qk(this)),this._viewerInstance=this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new cm(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=ie([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new l.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new FF(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Yt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],rt.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Vt(e),rotation:$o(e)}}calcFlyToParam(e){if(!this.getCameraInfo()||!this.viewer)return;const{camera:o}=this.viewer;let r=o.positionWC;const s=h.Cartesian3.fromDegrees(...e),a=h.Cartesian3.distance(o.positionWC,s),c=h.Cartesian3.subtract(s,r,new h.Cartesian3);h.Cartesian3.normalize(c,c);const d=h.Transforms.rotationMatrixFromPositionVelocity(r,c,h.Ellipsoid.WGS84),u=h.Matrix4.fromRotationTranslation(d,r);var p=h.Transforms.eastNorthUpToFixedFrame(h.Matrix4.getTranslation(u,new h.Cartesian3),h.Ellipsoid.WGS84,new h.Matrix4),f=h.Matrix4.multiply(h.Matrix4.inverse(p,new h.Matrix4),u,new h.Matrix4),g=h.Matrix4.getMatrix3(f,new h.Matrix3),m=h.Quaternion.fromRotationMatrix(g),y=h.HeadingPitchRoll.fromQuaternion(m);const P=$o(o);return{distance:a,heading:h.Math.toDegrees(y.heading)+90,pitch:h.Math.toDegrees(y.pitch),flyDuration:1,hDelta:-(P[0]-(h.Math.toDegrees(y.heading)+90)),pDelta:P[1]-h.Math.toDegrees(y.pitch)}}flyIn(e,n,o,r="default"){var c;if(!n)return;n[0]=-n[0];const s={position:e,rotation:n,duration:(o??1)*1e3},a=(c=this.viewer)==null?void 0:c.camera;return a&&ps(a,s)}flyTo(e,n,o="default"){var g;const{distance:r,heading:s,pitch:a,flyDuration:c,hDelta:d,pDelta:u}=e,p={position:n,viewDistance:r,rotation:[s,a,0],duration:c*1e3,hdelta:d,pdelta:u},f=(g=this.viewer)==null?void 0:g.camera;return f&&ps(f,p)}flyToBoundingSphere(e,n,o=1){var p;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=w.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:a,radius:c}=s,d={position:a,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},u=(p=this.viewer)==null?void 0:p.camera;return u&&ps(u,d)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Vt(e),rotation:$o(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var r,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var r,s;(s=(r=this._viewerInstance)==null?void 0:r.obj)==null||s.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,r,s,a){var c,d;(d=(c=this._viewerInstance)==null?void 0:c.obj)==null||d.navigationManager.changeToLine(e,n,o,r,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,r,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,r,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,r,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToFollow(e,n,o,r,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const r=h.Cartographic.fromDegrees(e,n,void 0,rt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,n){const o=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await jm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Ve(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&n!=null&&(r.editingID=`${o.callSource}_${l.createGuid()}`,this._editingSystem.create(this,r,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=l.createGuid();for(let r=0;r<e.length;r++){const s=e[r],a=s.components.main??s;a.editingID=o,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=rt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!rt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=rt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Mt(e,n)}localPositionsToPositions(e,n){return gn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Ve(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},n=rt.defaults;return{...e,more:[...e.more,new w.GroupProperty([],"通用","通用"),new w.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",Qk,Zk,!0),new w.FunctionProperty([],()=>rt.getCesiumIonToken(),[],"获取官方token"),new w.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new w.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new w.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new w.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new w.GroupProperty([],"Viewer","Viewer"),new w.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new w.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new w.BooleanProperty([this,"shadows"]),new w.GroupProperty([],"比例尺","比例尺(Legend)"),new w.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new w.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new w.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new w.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new w.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new w.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new w.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new w.GroupProperty([],"场景","场景(Scene)"),new w.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new w.GroupProperty([],"Globe","Globe"),new w.BooleanProperty([this,"depthTestAgainstTerrain"],"depthTestAgainstTerrain",n.depthTestAgainstTerrain,!0),new w.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new w.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new w.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new w.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new w.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new w.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new w.BooleanProperty([this,"sceneGlobeShowSkirts"]),new w.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new w.ColorProperty([this,"sceneGlobeBaseColor"]),new w.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new w.JsonProperty([this,"sceneGlobeClippingPlanes"]),new w.StringProperty([this,"sceneGlobeClippingPlanesId"]),new w.JsonProperty([this,"sceneGlobeClippingPolygons"]),new w.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new w.GroupProperty([],"underground","underground"),new w.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new w.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new w.GroupProperty([],"Translucency","Translucency"),new w.BooleanProperty([this,"sceneGlobeTranslucencyEnabled"],"启用",n.sceneGlobeTranslucencyEnabled,!0),new w.NumberProperty([this,"sceneGlobeTranslucencyBackFaceAlpha"],"背面透明度",n.sceneGlobeTranslucencyBackFaceAlpha,!0),new w.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new w.NumberProperty([this,"sceneGlobeTranslucencyFrontFaceAlpha"],"正面透明度",n.sceneGlobeTranslucencyFrontFaceAlpha,!0),new w.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new w.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new w.GroupProperty([],"Sun","Sun"),new w.BooleanProperty([this,"sun"],"sun",n.sun,!0),new w.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new w.GroupProperty([],"Moon","Moon"),new w.BooleanProperty([this,"moon"],"moon",n.moon,!0),new w.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new w.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new w.GroupProperty([],"SkyBox","SkyBox"),new w.BooleanProperty([this,"sceneSkyBoxShow"]),new w.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new w.GroupProperty([],"Background","Background"),new w.BooleanProperty([this,"xbsjUseBackground"]),new w.StringProperty([this,"xbsjBackgroundImageUri"]),new w.ColorProperty([this,"xbsjBackgroundColor"]),new w.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new w.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new w.ColorProperty([this,"sceneBackgroundColor"]),new w.GroupProperty([],"Fog","Fog"),new w.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new w.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new w.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new w.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new w.GroupProperty([],"Sscc","Sscc"),new w.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new w.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new w.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new w.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new w.GroupProperty([],"后处理","后处理"),new w.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new w.GroupProperty([],"环境遮蔽","环境遮蔽"),new w.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new w.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new w.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new w.GroupProperty([],"Bloom","Bloom"),new w.BooleanProperty([this,"scenePpsBloomEnabled"]),new w.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new w.NumberProperty([this,"scenePpsBloomContrast"]),new w.NumberProperty([this,"scenePpsBloomBrightness"]),new w.NumberProperty([this,"scenePpsBloomDelta"]),new w.NumberProperty([this,"scenePpsBloomSigma"]),new w.NumberProperty([this,"scenePpsBloomStepSize"]),new w.GroupProperty([],"调试","调试"),new w.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new w.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new w.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new w.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new w.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new w.GroupProperty([],"Inspector","Inspector"),new w.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new w.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new w.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(rt,"type",rt.register("ESCesiumViewer",rt)),v(rt,"getCesiumIonToken",Kk),v(rt,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(rt,"latestDefaultAccessToken"),v(rt,"ObjectsToExcludeWrapper",k2),v(rt,"defaults",{...w.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,depthTestAgainstTerrain:!1,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyEnabled:!1,sceneGlobeTranslucencyBackFaceAlpha:1,sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlpha:1,sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),v(rt,"getHeightsScartchCarto",new h.Cartographic);let Re=rt;(t=>{t.createDefaultProps=()=>({...w.ESViewer.createDefaultProps(),...Yk()})})(Re||(Re={})),l.extendClassProps(Re.prototype,Re.createDefaultProps),R.copyright=void 0;try{const t="earthsdk3-cesium",i="3.4.2",e="2025-09-18T02:13:26.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="3d737339ba5ffdc4be0b07ea49fd20497f22db07",a=((Date.now()-1758161606e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
2259
2259
|
%c${o?o+`
|
|
2260
2260
|
`:""}当前网站正在使用${t},此软件版权归${n}所有
|
|
2261
|
-
`;R.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
2261
|
+
`;R.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","3d737339ba5ffdc4be0b07ea49fd20497f22db07")},get info(){return c},get date(){return"2025-09-18T02:13:26.000Z"},get author(){return"suplyang"},get version(){return"3.4.2"},get name(){return"earthsdk3-cesium"},get commitId(){return"3d737339ba5ffdc4be0b07ea49fd20497f22db07"},print(){console.info(this.info,`
|
|
2262
2262
|
font-size: 18px;
|
|
2263
2263
|
font-weight: 1000;
|
|
2264
2264
|
line-height: 1;
|
|
@@ -2275,4 +2275,4 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2275
2275
|
color: rgb(0, 120, 215);
|
|
2276
2276
|
padding-bottom: 2px;
|
|
2277
2277
|
padding-left: 35px;
|
|
2278
|
-
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=R.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&R.copyright.print()}catch{}X_(),R.BaseEditingWrapper=wt,R.CircularAppendEditing=KC,R.CircularAppendEditingWrapper=Hg,R.CircularInsertEditing=BC,R.CircularInsertEditingWrapper=qg,R.CurrentPositionsCenter=hd,R.CurrentScale=cd,R.CurrentSceneScalePoi=Qm,R.CursorFloatDiv=lS,R.CursorInfo=cS,R.Czm3DTiles=Ae,R.CzmCameraChanged=jl,R.CzmCanvasAndDivSwitchPoi=dS,R.CzmCanvasPoi=Td,R.CzmCircle=co,R.CzmCircleGroundPrimitive=Sn,R.CzmCircleOutlinePrimitive=En,R.CzmCirclePrimitive=Pn,R.CzmClippingPlanes=Er,R.CzmClock=ue,R.CzmCustomPrimitive=ke,R.CzmDivPoi=Md,R.CzmES3DTileset=Ar,R.CzmESAlarm=bu,R.CzmESApertureEffect=Ru,R.CzmESAreaMeasurement=xu,R.CzmESBlastParticleSystem=Fu,R.CzmESBoxClipping=ku,R.CzmESCameraView=zu,R.CzmESCameraVisibleRange=Lu,R.CzmESCar=Ou,R.CzmESCityBasePoint=Vu,R.CzmESClassification=Uu,R.CzmESClippingPlane=Du,R.CzmESCustomPrimitive=xp,R.CzmESCzml=Wu,R.CzmESDataMesh=Gu,R.CzmESDirectionMeasurement=Hu,R.CzmESDistanceMeasurement=qu,R.CzmESDynamicWater=Fp,R.CzmESEntityCluster=kp,R.CzmESExcavate=$u,R.CzmESFireParticleSystem=Xu,R.CzmESGeHistoryImagery=zp,R.CzmESGeoBezierPath=Zu,R.CzmESGeoDiv=Qu,R.CzmESGeoDivTextPoi=Ku,R.CzmESGeoExtrudedPolygon=Tg,R.CzmESGeoJson=Ju,R.CzmESGeoLineString=br,R.CzmESGeoPoints=kg,R.CzmESGeoPolygon=Ht,R.CzmESGeoPolygonImpl=Mi,R.CzmESGeoRectangle=Bu,R.CzmESGeoSmoothPolygon=ju,R.CzmESGeoVector=vt,R.CzmESGeoWater=Lp,R.CzmESGltfModel=ep,R.CzmESHeatMap=Fg,R.CzmESHeightMeasurement=tp,R.CzmESHuman=np,R.CzmESHumanPoi=Mg,R.CzmESImageLabel=op,R.CzmESImageryLayer=rp,R.CzmESKml=wp,R.CzmESLabel=xs,R.CzmESLocalCircle=Cp,R.CzmESLocalLineString=_p,R.CzmESLocalLineStringZ=Pp,R.CzmESLocalPolygon=Sp,R.CzmESLocalPolygonZ=Ep,R.CzmESLocalRectangle=Ap,R.CzmESLocalSkyBox=sp,R.CzmESLocalVector=th,R.CzmESLocationMeasurement=ap,R.CzmESMVTLayer=Op,R.CzmESMsTileset=bg,R.CzmESNavigator=Tp,R.CzmESObjectWithLocation=Ce,R.CzmESParticleSystemPrimitive=lp,R.CzmESPath=Mp,R.CzmESPipeFence=Np,R.CzmESPipeline=Vp,R.CzmESPipeserTileset=Wp,R.CzmESPit=Gp,R.CzmESPoi2D=cp,R.CzmESPoi3D=hp,R.CzmESPolygonFence=Ip,R.CzmESPolygonFlattenedPlane=Iu,R.CzmESPolygonWithHole=Hp,R.CzmESRectangle=Dp,R.CzmESRoad=bp,R.CzmESRtsFeatureEditing=Dg,R.CzmESRtsTileset=Ig,R.CzmESScale=Rp,R.CzmESSignalTransmission=$p,R.CzmESSkylineAnalysis=xg,R.CzmESStaticMesh=Rg,R.CzmESSubmergingAnalysis=dp,R.CzmESSunshineAnalysis=wg,R.CzmESSurfaceAreaMeasurement=_g,R.CzmESTerrainLayer=up,R.CzmESTextLabel=pp,R.CzmESUEWidget=fp,R.CzmESUnrealActor=gp,R.CzmESVideoFusion=mp,R.CzmESViewShed=vp,R.CzmESViewerStatusBar=Pg,R.CzmESViewerStatusBarScale=Sg,R.CzmESVisibilityAnalysis=Eg,R.CzmESVisualObject=Qt,R.CzmESVolumeMeasurement=Ag,R.CzmESWidget=yp,R.CzmFlattenedPlane=kn,R.CzmGlobeMaterial=vo,R.CzmImageModel=Hi,R.CzmImagery=xn,R.CzmModelPrimitive=at,R.CzmParticleSystemPrimitive=wi,R.CzmPicking=Ym,R.CzmPoint=Bt,R.CzmPointPrimitiveCollection=uo,R.CzmPoisContext=av,R.CzmPolygon=jo,R.CzmPolygonClipping=Rr,R.CzmPolygonGroundPrimitive=Bo,R.CzmPolygonGroundPrimitiveWithHeight=or,R.CzmPolygonPrimitive=vn,R.CzmPolygonPrimitiveWithHeight=Cn,R.CzmPolygonWithHeight=_n,R.CzmPolyline=Ie,R.CzmPolylineGroundPrimitive=nr,R.CzmPolylinePrimitive=ir,R.CzmPolylines=ci,R.CzmPolylinesGroundPrimitive=Jo,R.CzmPolylinesPrimitive=Gt,R.CzmRectangle=Ci,R.CzmSignalTransmission=Ji,R.CzmTexture=Le,R.CzmView=Dt,R.CzmViewDistanceRangeControl=Qn,R.CzmWater=ho,R.CzmWaterPrimitive=vs,R.DoublePointsAppendEditing=qr,R.DoublePointsAppendEditingWrapper=Wg,R.DoublePointsModifyEditing=xo,R.DoublePointsModifyEditingWrapper=Gg,R.ESCesiumViewer=Re,R.ESCustomPrimitive=ah,R.ESGeHistoryImagery=oh,R.ESGeoBezierPath=hh,R.ESGeoSmoothPolygon=Ls,R.ESKml=rh,R.ESLocalLineString=sh,R.ESLocalLineStringZ=zs,R.ESMVTLayer=nh,R.ESRoad=ch,R.ESSignalTransmission=lh,R.GeoCanvasImagePoi=vi,R.GeoCanvasMenuPoi=er,R.GeoCanvasPoi=Gi,R.GeoCanvasPointPoi=yn,R.GeoCustomDivPoi=$e,R.GeoDivSwitchPoi=ao,R.GeoDivTextPoi=yi,R.GeoPolylinePath=xr,R.HeightModifyEditing=t_,R.HeightModifyEditingWrapper=Jg,R.ImageLabel2D=m0,R.ImageLabel3D=v0,R.ImageriesManager=w_,R.LabelManager=y_,R.LineStringAppendEditing=QC,R.LineStringAppendEditingWrapper=$g,R.LineStringInsertEditing=JC,R.LineStringInsertEditingWrapper=Xg,R.PickingManager=C_,R.PlaceEditing=zi,R.PlaceEditingWrapper=Ng,R.PolylinePath=Sr,R.ResourceHandler=Ko,R.RotationEditing=fi,R.RotationEditingWrapper=Vg,R.ScaleEditing=en,R.ScaleEditingWrapper=Ug,R.ScatterAppendEditing=jC,R.ScatterAppendEditingWrapper=Yg,R.ScatterModifyEditing=e_,R.ScatterModifyEditingWrapper=Zg,R.SharedTexturePool=rv,R.SmoothMoving=Zm,R.TerrainManager=v_,R.TextLabel2D=w0,R.TextLabel3D=C0,R.ToGCJ02WebMercatorTilingScheme=zy,R.ToWGS84WebMercatorTilingScheme=Ly,R.TranslationEditing=ji,R.TranslationEditingWrapper=Ih,R.ViewerExtensions=__,R.VisibilityAppendEditing=$r,R.VisibilityAppendEditingWrapper=Qg,R.VisibilityModifyEditing=Xr,R.VisibilityModifyEditingWrapper=Kg,R.Widget2D=wn,R.Widget3D=gc,R.WinPosFromCartesian=tc,R.XbsjGroundPolylinePrimitive=Ti,R._ESEditModeInstance=Dh,R.angleToHumanStr=ds,R.areaToHumanStr=cP,R.bindNorthRotation=et,R.capture=jm,R.checkAndConvertImage=lP,R.computeCutPoint=qC,R.computeCzmModelMatrix=Fe,R.computePickingInfoWithCoordinates=Jh,R.createClippingPlaneCollection=as,R.createClippingPolygonCollection=Jl,R.createGeoBoudingSphereReactFromPositions=Bm,R.createHelperLine=m1,R.createInfoPoi=yd,R.createInnerClassFromJson=fd,R.createInnerHtmlWithWhiteTextBlackBackground=oo,R.createMaterialFromJson=Am,R.createMaterialRef=li,R.createMoveObjectsProcessing=i_,R.createPolygonHierarchy=Ui,R.createTexture=io,R.createTextureFromImage=Ed,R.createTilingSchema=gi,R.czmFlyTo=ps,R.czmModelActiveAnimationsWithVisible=rc,R.czmSubscribeAndEvaluate=mi,R.defaultFlyToRotation=Kt,R.distanceToHumanStr=ac,R.extendComponentProps=hP,R.flyTo=se,R.flyWithPosition=Jt,R.flyWithPositions=ae,R.flyWithPrimitive=It,R.fromCartesian=Z_,R.fromCartesian2=pm,R.fromCartesian3=rs,R.fromCartesian4=fm,R.fromCartographic=qo,R.fromColor=K_,R.fromDistanceDisplayCondition=j_,R.fromEllipsoid=a1,R.fromHeadingPitchRoll=B_,R.fromNearFarScalar=J_,R.fromQuaternion=t1,R.fromRectangle=r1,R.generateCartesianArc=Nm,R.geoNeareastPointOnRhumbLine=Kn,R.geoNeareastPointOnRhumbLine2=v1,R.geoPolylineToBezierSpline=wd,R.getCameraPosition=Vt,R.getCameraRotation=$o,R.getCameraTargetPos=ym,R.getCenterAndViewDistance=Cd,R.getCzmCode=oP,R.getDefaultComponentProps=dP,R.getDefaultWinPosAndDepth=A1,R.getDetailedTerrainDistance=iv,R.getDirectionVectorFromRotation=Dm,R.getDistancesAndTimePosRotsFromPositions=sd,R.getElevationMatrix=$k,R.getEllipsoidGeodesicCenter=td,R.getFlyToCenterAndRotation=lc,R.getFoveatedInterpolationCallback=Yy,R.getFuncFromStr=gd,R.getGroundTerrainDistance=tv,R.getGroundTerrainDistances=ev,R.getIncludedAngleFromPositions=Gm,R.getInverseModelMatrix=Um,R.getMinMaxPosition=Jm,R.getModelMatrixFromPosition=ad,R.getObjectProperties=ro,R.getPointerEventButton=Wi,R.getPolygonPointsFromHierarchy=ld,R.getQuaternion=Yh,R.getQuaternionWithXForwardZUp=mm,R.getQuaternionWithYForwardZUp=Bl,R.getResource=Wt,R.getSceneScaleForScreenPixelSize=Vi,R.getSharedTexturePool=sv,R.getTilingSchemeStr=RT,R.getViewerExtensions=Yt,R.getWinPos=Im,R.getXbsjWaterMaterial=qm,R.hackCesium3DTileset=V_,R.hackCzmModel3DTileContent=U_,R.hackModel=N_,R.hackModelSceneGraph=W_,R.imgUrlToBase64=so,R.localPositionToPosition=fn,R.localPositionsToPositions=gn,R.merge3dTilesServer=J1,R.pickHeightPosition=ec,R.pickPosition=Sm,R.pickVirtualEarth=Xo,R.pickVirtualPlane=Em,R.positionAndRotationToQuaternion=o1,R.positionFromCartesian=ce,R.positionToCartesian=Ve,R.positionToHumanStr=md,R.positionToLocalPosition=Wm,R.positionsToLocalPositions=Mt,R.positionsToUniqueCartesians=dt,R.rectangleIsGlobal=pd,R.rpToap=sc,R.setClippingPlaneCollection=Kl,R.setCylinderGeometry=vd,R.setModelMaterial=hs,R.setRectangleGeometry=Km,R.setViewerExtensions=om,R.toCartesian=ai,R.toCartesian2=Ee,R.toCartesian3=si,R.toCartesian4=Xh,R.toCartographic=Q_,R.toCoefficients=ud,R.toColor=ie,R.toDistanceDisplayCondition=ss,R.toEllipsoid=Pe,R.toHeadingPitchRoll=gm,R.toNearFarScalar=cn,R.toQuaternion=e1,R.toRectangle=Ge,R.toRgbaString=mn,R.updateEnvironmentMapManager=dd,R.updateMaterialFromJson=ed,R.winPosAndDepthEqual=Mm,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
|
2278
|
+
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=R.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&R.copyright.print()}catch{}X_(),R.BaseEditingWrapper=wt,R.CircularAppendEditing=KC,R.CircularAppendEditingWrapper=Hg,R.CircularInsertEditing=BC,R.CircularInsertEditingWrapper=qg,R.CurrentPositionsCenter=hd,R.CurrentScale=cd,R.CurrentSceneScalePoi=Qm,R.CursorFloatDiv=lS,R.CursorInfo=cS,R.Czm3DTiles=Ae,R.CzmCameraChanged=jl,R.CzmCanvasAndDivSwitchPoi=dS,R.CzmCanvasPoi=Td,R.CzmCircle=co,R.CzmCircleGroundPrimitive=Sn,R.CzmCircleOutlinePrimitive=En,R.CzmCirclePrimitive=Pn,R.CzmClippingPlanes=Er,R.CzmClock=ue,R.CzmCustomPrimitive=ke,R.CzmDivPoi=Md,R.CzmES3DTileset=Ar,R.CzmESAlarm=bu,R.CzmESApertureEffect=Ru,R.CzmESAreaMeasurement=xu,R.CzmESBlastParticleSystem=Fu,R.CzmESBoxClipping=ku,R.CzmESCameraView=zu,R.CzmESCameraVisibleRange=Lu,R.CzmESCar=Ou,R.CzmESCityBasePoint=Vu,R.CzmESClassification=Uu,R.CzmESClippingPlane=Du,R.CzmESCustomPrimitive=xp,R.CzmESCzml=Wu,R.CzmESDataMesh=Gu,R.CzmESDirectionMeasurement=Hu,R.CzmESDistanceMeasurement=qu,R.CzmESDynamicWater=Fp,R.CzmESEntityCluster=kp,R.CzmESExcavate=$u,R.CzmESFireParticleSystem=Xu,R.CzmESGeHistoryImagery=zp,R.CzmESGeoBezierPath=Zu,R.CzmESGeoDiv=Qu,R.CzmESGeoDivTextPoi=Ku,R.CzmESGeoExtrudedPolygon=Tg,R.CzmESGeoJson=Ju,R.CzmESGeoLineString=br,R.CzmESGeoPoints=kg,R.CzmESGeoPolygon=Ht,R.CzmESGeoPolygonImpl=Mi,R.CzmESGeoRectangle=Bu,R.CzmESGeoSmoothPolygon=ju,R.CzmESGeoVector=vt,R.CzmESGeoWater=Lp,R.CzmESGltfModel=ep,R.CzmESHeatMap=Fg,R.CzmESHeightMeasurement=tp,R.CzmESHuman=np,R.CzmESHumanPoi=Mg,R.CzmESImageLabel=op,R.CzmESImageryLayer=rp,R.CzmESKml=wp,R.CzmESLabel=xs,R.CzmESLocalCircle=Cp,R.CzmESLocalLineString=_p,R.CzmESLocalLineStringZ=Pp,R.CzmESLocalPolygon=Sp,R.CzmESLocalPolygonZ=Ep,R.CzmESLocalRectangle=Ap,R.CzmESLocalSkyBox=sp,R.CzmESLocalVector=th,R.CzmESLocationMeasurement=ap,R.CzmESMVTLayer=Op,R.CzmESMsTileset=bg,R.CzmESNavigator=Tp,R.CzmESObjectWithLocation=Ce,R.CzmESParticleSystemPrimitive=lp,R.CzmESPath=Mp,R.CzmESPipeFence=Np,R.CzmESPipeline=Vp,R.CzmESPipeserTileset=Wp,R.CzmESPit=Gp,R.CzmESPoi2D=cp,R.CzmESPoi3D=hp,R.CzmESPolygonFence=Ip,R.CzmESPolygonFlattenedPlane=Iu,R.CzmESPolygonWithHole=Hp,R.CzmESRectangle=Dp,R.CzmESRoad=bp,R.CzmESRtsFeatureEditing=Dg,R.CzmESRtsTileset=Ig,R.CzmESScale=Rp,R.CzmESSignalTransmission=$p,R.CzmESSkylineAnalysis=xg,R.CzmESStaticMesh=Rg,R.CzmESSubmergingAnalysis=dp,R.CzmESSunshineAnalysis=wg,R.CzmESSurfaceAreaMeasurement=_g,R.CzmESTerrainLayer=up,R.CzmESTextLabel=pp,R.CzmESUEWidget=fp,R.CzmESUnrealActor=gp,R.CzmESVideoFusion=mp,R.CzmESViewShed=vp,R.CzmESViewerStatusBar=Pg,R.CzmESViewerStatusBarScale=Sg,R.CzmESVisibilityAnalysis=Eg,R.CzmESVisualObject=Qt,R.CzmESVolumeMeasurement=Ag,R.CzmESWidget=yp,R.CzmFlattenedPlane=kn,R.CzmGlobeMaterial=vo,R.CzmImageModel=Hi,R.CzmImagery=xn,R.CzmModelPrimitive=at,R.CzmParticleSystemPrimitive=wi,R.CzmPicking=Ym,R.CzmPoint=Bt,R.CzmPointPrimitiveCollection=uo,R.CzmPoisContext=av,R.CzmPolygon=jo,R.CzmPolygonClipping=Rr,R.CzmPolygonGroundPrimitive=Bo,R.CzmPolygonGroundPrimitiveWithHeight=or,R.CzmPolygonPrimitive=vn,R.CzmPolygonPrimitiveWithHeight=Cn,R.CzmPolygonWithHeight=_n,R.CzmPolyline=Ie,R.CzmPolylineGroundPrimitive=nr,R.CzmPolylinePrimitive=ir,R.CzmPolylines=ci,R.CzmPolylinesGroundPrimitive=Jo,R.CzmPolylinesPrimitive=Gt,R.CzmRectangle=Ci,R.CzmSignalTransmission=Ji,R.CzmTexture=Le,R.CzmView=Dt,R.CzmViewDistanceRangeControl=Qn,R.CzmWater=ho,R.CzmWaterPrimitive=vs,R.DoublePointsAppendEditing=qr,R.DoublePointsAppendEditingWrapper=Wg,R.DoublePointsModifyEditing=xo,R.DoublePointsModifyEditingWrapper=Gg,R.ESCesiumViewer=Re,R.ESCustomPrimitive=ah,R.ESGeHistoryImagery=oh,R.ESGeoBezierPath=hh,R.ESGeoSmoothPolygon=Ls,R.ESKml=rh,R.ESLocalLineString=sh,R.ESLocalLineStringZ=zs,R.ESMVTLayer=nh,R.ESRoad=ch,R.ESSignalTransmission=lh,R.GeoCanvasImagePoi=vi,R.GeoCanvasMenuPoi=er,R.GeoCanvasPoi=Gi,R.GeoCanvasPointPoi=yn,R.GeoCustomDivPoi=$e,R.GeoDivSwitchPoi=ao,R.GeoDivTextPoi=yi,R.GeoPolylinePath=xr,R.HeightModifyEditing=t_,R.HeightModifyEditingWrapper=Jg,R.ImageLabel2D=m0,R.ImageLabel3D=v0,R.ImageriesManager=w_,R.LabelManager=y_,R.LineStringAppendEditing=QC,R.LineStringAppendEditingWrapper=$g,R.LineStringInsertEditing=JC,R.LineStringInsertEditingWrapper=Xg,R.PickingManager=C_,R.PlaceEditing=zi,R.PlaceEditingWrapper=Ng,R.PolylinePath=Sr,R.ResourceHandler=Ko,R.RotationEditing=fi,R.RotationEditingWrapper=Vg,R.ScaleEditing=en,R.ScaleEditingWrapper=Ug,R.ScatterAppendEditing=jC,R.ScatterAppendEditingWrapper=Yg,R.ScatterModifyEditing=e_,R.ScatterModifyEditingWrapper=Zg,R.SharedTexturePool=rv,R.SmoothMoving=Zm,R.TerrainManager=v_,R.TextLabel2D=w0,R.TextLabel3D=C0,R.ToGCJ02WebMercatorTilingScheme=zy,R.ToWGS84WebMercatorTilingScheme=Ly,R.TranslationEditing=ji,R.TranslationEditingWrapper=Ih,R.ViewerExtensions=__,R.VisibilityAppendEditing=$r,R.VisibilityAppendEditingWrapper=Qg,R.VisibilityModifyEditing=Xr,R.VisibilityModifyEditingWrapper=Kg,R.Widget2D=wn,R.Widget3D=gc,R.WinPosFromCartesian=tc,R.XbsjGroundPolylinePrimitive=Ti,R._ESEditModeInstance=Dh,R.angleToHumanStr=ds,R.areaToHumanStr=cP,R.bindNorthRotation=et,R.capture=jm,R.checkAndConvertImage=lP,R.computeCutPoint=qC,R.computeCzmModelMatrix=Fe,R.computePickingInfoWithCoordinates=Jh,R.createClippingPlaneCollection=as,R.createClippingPolygonCollection=Jl,R.createGeoBoudingSphereReactFromPositions=Bm,R.createHelperLine=m1,R.createInfoPoi=yd,R.createInnerClassFromJson=fd,R.createInnerHtmlWithWhiteTextBlackBackground=oo,R.createMaterialFromJson=Am,R.createMaterialRef=li,R.createMoveObjectsProcessing=i_,R.createPolygonHierarchy=Ui,R.createTexture=io,R.createTextureFromImage=Ed,R.createTilingSchema=gi,R.czmFlyTo=ps,R.czmModelActiveAnimationsWithVisible=rc,R.czmSubscribeAndEvaluate=mi,R.defaultFlyToRotation=Kt,R.distanceToHumanStr=ac,R.extendComponentProps=hP,R.flyTo=se,R.flyWithPosition=Jt,R.flyWithPositions=ae,R.flyWithPrimitive=It,R.fromCartesian=Z_,R.fromCartesian2=pm,R.fromCartesian3=rs,R.fromCartesian4=fm,R.fromCartographic=qo,R.fromColor=K_,R.fromDistanceDisplayCondition=j_,R.fromEllipsoid=a1,R.fromHeadingPitchRoll=B_,R.fromNearFarScalar=J_,R.fromQuaternion=t1,R.fromRectangle=r1,R.generateCartesianArc=Nm,R.geoNeareastPointOnRhumbLine=Kn,R.geoNeareastPointOnRhumbLine2=v1,R.geoPolylineToBezierSpline=wd,R.getCameraPosition=Vt,R.getCameraRotation=$o,R.getCameraTargetPos=ym,R.getCenterAndViewDistance=Cd,R.getCzmCode=oP,R.getDefaultComponentProps=dP,R.getDefaultWinPosAndDepth=A1,R.getDetailedTerrainDistance=iv,R.getDirectionVectorFromRotation=Dm,R.getDistancesAndTimePosRotsFromPositions=sd,R.getElevationMatrix=$k,R.getEllipsoidGeodesicCenter=td,R.getFlyToCenterAndRotation=lc,R.getFoveatedInterpolationCallback=Yy,R.getFuncFromStr=gd,R.getGroundTerrainDistance=tv,R.getGroundTerrainDistances=ev,R.getIncludedAngleFromPositions=Gm,R.getInverseModelMatrix=Um,R.getMinMaxPosition=Jm,R.getModelMatrixFromPosition=ad,R.getObjectProperties=ro,R.getPointerEventButton=Wi,R.getPolygonPointsFromHierarchy=ld,R.getQuaternion=Yh,R.getQuaternionWithXForwardZUp=mm,R.getQuaternionWithYForwardZUp=Bl,R.getResource=Wt,R.getSceneScaleForScreenPixelSize=Vi,R.getSharedTexturePool=sv,R.getTilingSchemeStr=RT,R.getViewerExtensions=Yt,R.getWinPos=Im,R.getXbsjWaterMaterial=qm,R.hackCesium3DTileset=V_,R.hackCzmModel3DTileContent=U_,R.hackModel=N_,R.hackModelSceneGraph=W_,R.imgUrlToBase64=so,R.localPositionToPosition=fn,R.localPositionsToPositions=gn,R.merge3dTilesServer=J1,R.pickHeightPosition=ec,R.pickPosition=Sm,R.pickVirtualEarth=Xo,R.pickVirtualPlane=Em,R.positionAndRotationToQuaternion=o1,R.positionFromCartesian=ce,R.positionToCartesian=Ve,R.positionToHumanStr=md,R.positionToLocalPosition=Wm,R.positionsToLocalPositions=Mt,R.positionsToUniqueCartesians=dt,R.rectangleIsGlobal=pd,R.rpToap=sc,R.setClippingPlaneCollection=Kl,R.setCylinderGeometry=vd,R.setModelMaterial=hs,R.setRectangleGeometry=Km,R.setViewerExtensions=om,R.toCartesian=ai,R.toCartesian2=Ee,R.toCartesian3=si,R.toCartesian4=Xh,R.toCartographic=Q_,R.toCoefficients=ud,R.toColor=ie,R.toDistanceDisplayCondition=ss,R.toEllipsoid=Pe,R.toHeadingPitchRoll=gm,R.toNearFarScalar=cn,R.toQuaternion=e1,R.toRectangle=Ge,R.toRgbaString=mn,R.updateEnvironmentMapManager=dd,R.updateMaterialFromJson=ed,R.winPosAndDepthEqual=Mm,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
|