earthsdk3-cesium 3.6.0-beta.3 → 3.6.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var EarthSDK3_Cesium=function(ne,Xe,c){"use strict";var k7=Object.defineProperty;var Q7=(ne,Xe,c)=>Xe in ne?k7(ne,Xe,{enumerable:!0,configurable:!0,writable:!0,value:c}):ne[Xe]=c;var L=(ne,Xe,c)=>Q7(ne,typeof Xe!="symbol"?Xe+"":Xe,c);var gs=typeof document<"u"?document.currentScript:null;function OE(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const w=OE(Xe);window.Cesium=w;function LE(){Object.keys(w).forEach(t=>{w[t].prototype&&Object.defineProperty(w[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:c.createGuid()})})}w.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhN2VkNDM5ZS1jMDk0LTQ3NDItOTM5ZS00MzU3M2M1MTc2ZTkiLCJpZCI6MjU5LCJpYXQiOjE3NjIxODg4MDB9.ZZG574sONzeHxsX8HJMaL_ZiGA3dh_HrOxL7DrKRcd4";const Su=class Su extends c.Destroyable{};L(Su,"defaults",{enabled:!0}),L(Su,"createDefaultProps",()=>({...Su.defaults}));let Fn=Su;c.extendClassProps(Fn.prototype,Fn.createDefaultProps);class Hn extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r,a)=>this.flyTo(o,r,a))),this.d(n.flyInEvent.don((o,r,a)=>this.flyIn(o,r,a))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:a}=o;n.flyInParam={position:r,rotation:a,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(n,e,i,o,r,a,s,l="default"){const{sceneObject:u,czmViewer:A}=this,h=A.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:a??0,pDelta:s??0},e,l);h&&h.then(f=>{})}flyTo(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}flyIn(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}get czmViewer(){return this.viewer}}function Ye(t,n){return w.Cartesian3.fromDegrees(...t,void 0,n)}const zE=new w.Cartographic;function De(t,n){const e=w.Cartographic.fromCartesian(t,void 0,zE);if(e)return n=n||[0,0,0],n[0]=w.Math.toDegrees(e.longitude),n[1]=w.Math.toDegrees(e.latitude),n[2]=e.height,n}function Ze(t,n){return n=n||new w.Cartesian2,n.x=t[0],n.y=t[1],n}function qv(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function ri(t,n){return n=n||new w.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function Ya(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function ld(t,n){return n=n||new w.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Kv(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}function oi(t,n){if(t.length===4)return ld(t,n);if(t.length===3)return ri(t,n);if(t.length===2)return Ze(t,n);throw new Error("toCartesian error: should not be here!")}function kE(t,n){if(t instanceof w.Cartesian2)return qv(t,n);if(t instanceof w.Cartesian3)return Ya(t,n);if(t instanceof w.Cartesian4)return Kv(t,n);throw new Error("fromCartesian error: should not be here!")}function QE(t,n){return n=n||new w.Cartographic,n.longitude=w.Math.toRadians(t[0]),n.latitude=w.Math.toRadians(t[1]),n.height=t[2],n}function fo(t,n){return n=n||[0,0,0],n[0]=w.Math.toDegrees(t.longitude),n[1]=w.Math.toDegrees(t.latitude),n[2]=t.height,n}function Be(t,n){return n=n||new w.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function VE(t,n){return n=n||[0,0,0,0],n[0]=t.red,n[1]=t.green,n[2]=t.blue,n[3]=t.alpha,n}function gr(t,n){return n=n||new w.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function NE(t,n){return n=n||[0,0,0,0],n[0]=t.near,n[1]=t.nearValue,n[2]=t.far,n[3]=t.farValue,n}function Zv(t,n){return n=n||new w.HeadingPitchRoll,n.heading=w.Math.toRadians(t[0]-90),n.pitch=w.Math.toRadians(t[1]),n.roll=w.Math.toRadians(t[2]),n}function HE(t,n){return n=n||[0,0,0],n[0]=w.Math.toDegrees(t.heading+w.Math.PI_OVER_TWO),n[1]=w.Math.toDegrees(t.pitch),n[2]=w.Math.toDegrees(t.roll),n}function Ja(t,n){return n=n||new w.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function GE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function WE(t,n){return n=n||new w.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function jE(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}const qE=new w.HeadingPitchRoll,KE=new w.Cartesian3;function ZE(t,n,e){const i=Zv(n,qE),o=Ye(t,KE);return w.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function gt(t,n){return n=n||new w.Rectangle,n.west=t[0]*Math.PI/180,n.south=t[1]*Math.PI/180,n.east=t[2]*Math.PI/180,n.north=t[3]*Math.PI/180,n}function $E(t,n){return n=n||[0,0,0,0],n[0]=t.west,n[1]=t.south,n[2]=t.east,n[3]=t.north,n}const XE=new w.Cartesian3;function qe(t,n){return n=n||new w.Ellipsoid,w.Ellipsoid.fromCartesian3(w.Cartesian3.fromArray(t,void 0,XE),n)}function YE(t,n){return n=n||[0,0,0],n[0]=t.radii.x,n[1]=t.radii.y,n[2]=t.radii.z,n}function si(t){if(t.type==="GeographicTilingScheme")return new w.GeographicTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),rectangle:t.rectangle&&gt(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new w.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new px({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new mx({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function el(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:a,edgeWidth:s}=t;let l=o&&w.Matrix4.fromArray(o);return n&&(l=l||w.Matrix4.clone(w.Matrix4.IDENTITY,new w.Matrix4),w.Matrix4.multiply(n,l,l)),new w.ClippingPlaneCollection({planes:e&&e.map(u=>new w.ClippingPlane(ri(u.normal),u.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:a&&Be(a),edgeWidth:s})}function bh(t,n,e){const i=n;if(!i){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),i.planes)for(let r of i.planes)t.add(new w.ClippingPlane(ri(r.normal),r.distance));let o=i.modelMatrix&&w.Matrix4.fromArray(i.modelMatrix)||w.Matrix4.clone(w.Matrix4.IDENTITY,new w.Matrix4);e&&w.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Be(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function xh(t){const{polygons:n,enabled:e,inverse:i}=t;return new w.ClippingPolygonCollection({polygons:n&&n.map(o=>new w.ClippingPolygon({positions:o.positions.map(r=>Ye(r))})),enabled:e,inverse:i})}function _h(t,n){return ud(t,w.Cartesian3.UNIT_Y,w.Cartesian3.UNIT_Z,w.Cartesian3.UNIT_X,n)}function $v(t,n){return ud(t,w.Cartesian3.UNIT_X,w.Cartesian3.UNIT_Z,new w.Cartesian3(0,-1,0),n)}function ud(t,n,e,i,o){const[r,a,s]=t,l=w.Quaternion.fromAxisAngle(e,w.Math.toRadians(-r)),u=w.Quaternion.fromAxisAngle(i,w.Math.toRadians(a)),A=w.Quaternion.fromAxisAngle(n,w.Math.toRadians(s)),h=w.Quaternion.clone(w.Quaternion.IDENTITY,o);return w.Quaternion.multiply(A,h,h),w.Quaternion.multiply(u,h,h),w.Quaternion.multiply(l,h,h),h}function yr(t,n){return Array.isArray(t)?t.length!==n?(console.warn(`array.length !== ${n}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Xv(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function lt(t,n){if(!((!t.localScale||yr(t.localScale,3))&&(!t.localRotation||yr(t.localRotation,3))&&(!t.localPosition||yr(t.localPosition,3))&&(!t.localModelMatrix||yr(t.localModelMatrix,16))&&(!t.scale||yr(t.scale,3))&&(!t.rotation||yr(t.rotation,3))&&(!t.position||yr(t.position,3))&&(!t.modelMatrix||yr(t.modelMatrix,16)))||t.localScale&&!Xv(t.localScale)||t.scale&&!Xv(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 i=n??w.Matrix4.clone(w.Matrix4.IDENTITY);if(t.localScale){const[o,r,a]=t.localScale??[1,1,1],s=w.Matrix4.fromScale(w.Cartesian3.fromElements(o,r,a),new w.Matrix4);w.Matrix4.multiply(s,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=w.Quaternion.fromAxisAngle(w.Cartesian3.UNIT_Z,w.Math.toRadians(90)),r=w.Matrix3.fromQuaternion(o);w.Matrix4.multiply(w.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=_h(t.localRotation),r=w.Matrix3.fromQuaternion(o);w.Matrix4.multiply(w.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=w.Matrix4.fromTranslation(w.Cartesian3.fromArray(t.localPosition));w.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=w.Matrix4.fromArray(t.localModelMatrix);w.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=w.Matrix4.fromScale(w.Cartesian3.fromElements(o,o,o),new w.Matrix4);w.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,a]=t.scale??[1,1,1],s=w.Matrix4.fromScale(w.Cartesian3.fromElements(o,r,a),new w.Matrix4);w.Matrix4.multiply(s,i,i)}if(t.rotation){const o=_h(t.rotation),r=w.Matrix3.fromQuaternion(o);w.Matrix4.multiply(w.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=w.Cartesian3.fromDegrees(...t.position),r=w.Transforms.eastNorthUpToFixedFrame(o);w.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=w.Matrix4.fromArray(t.modelMatrix);w.Matrix4.multiply(o,i,i)}return i}const JE=new w.Cartesian3,tl=new w.HeadingPitchRoll,e2=new w.Matrix4,t2=new w.Cartesian3,n2=new w.Cartographic;function i2(t,n=[0,0,0],e=0,i){const[o,r,a]=t,s=w.Cartesian3.fromDegrees(o,r,a,void 0,JE),l=[...n];for(let A=0;A<3;++A)l[A]=w.Math.RADIANS_PER_DEGREE*l[A];if(e!==0){tl.heading=l[0],tl.pitch=l[1],tl.roll=l[2],tl.heading-=w.Math.PI_OVER_TWO;const A=w.Transforms.headingPitchRollToFixedFrame(s,tl,void 0,void 0,e2),h=w.Matrix4.multiplyByPointAsVector(A,w.Cartesian3.UNIT_X,t2);w.Cartesian3.multiplyByScalar(h,e,h),w.Cartesian3.subtract(s,h,s)}const u=w.Cartographic.fromCartesian(s,void 0,n2);if(u)return i=i||[0,0,0],i[0]=u.longitude*180/Math.PI,i[1]=u.latitude*180/Math.PI,i[2]=u.height,i}function Yv(t,n,e,i){return i2(t,n,e,i)}const vr=w.Math.toDegrees;function Mn(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=o,n):[vr(e),vr(i),o]}function ys(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=vr(o),n):[e,i,o].map(vr)}class Ch extends c.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new w.Matrix4);L(this,"_originProjMatrix",new w.Matrix4);L(this,"_changed",new c.Event);this._scene=e;const i=this._scene.camera;w.Matrix4.clone(i.viewMatrix,this._originViewMatrix),w.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){w.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(w.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),w.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(w.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class r2 extends c.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class o2 extends c.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new c.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new r2(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class po extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(c.react(1)));L(this,"_viewDistance",this.disposeVar(c.react(0)));L(this,"_debug",this.disposeVar(c.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new o2(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:a,czmViewer:s}=this,[l,u,A]=c.getReactFuncs(i),[h,f,p]=c.getReactFuncs(a),[d,m,v]=r?c.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let x=1,E=Number.NEGATIVE_INFINITY;const B=l(),P=h(),I=d?d():0,D=s.getCurrentCameraInfo();if(!B||!P||!D){this._viewDistance.value=E,this._visibleAlpha.value=x;return}E=c.cartesianDistance(D.position,P)-(I??0);const[F,S,T,b]=B;F>S||S>T||T>b?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):E>=S&&E<=T?x=1:E<=F||E>=b?x=0:E>F&&E<S?S-F<=0?x=0:x=(E-F)/(S-F):E>T&&E<b?(b<=T&&(x=0),x=(b-E)/(b-T)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=E,this._visibleAlpha.value=x};y();const g=[s.cameraChanged,A,p];v&&g.push(v);const _=this.disposeVar(c.createNextAnimateFrameEvent(...g));this.dispose(_.disposableOn(y))}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 s2=new w.BoundingSphere(w.Cartesian3.ZERO,0);function Ni(t,n,e){var i=s2;w.Cartesian3.clone(n,i.center);const o=t.camera.getPixelSize(i,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function Yt(t,n=!1){const e=t.length;let i;const o=[];for(let r=0;r<e;++r){const[a,s,l]=t[r],u=n?w.Cartesian3.fromDegrees(a,s):w.Cartesian3.fromDegrees(a,s,l);if(!u)continue;const{x:A,y:h,z:f}=u;[A,h,f].every(Number.isFinite)&&(!i||!w.Cartesian3.equals(i,u))&&(i=u,o.push(i))}return o}function mo(t,n,e,i){const o=c.geoRhumbDistance(t,e),r=c.geoRhumbHeading(t,e),a=Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(n*Math.PI/180);return a>0?c.geoRhumbDestination(t,o,n,i):c.geoRhumbDestination(t,o,n+180,i),[a>0?o:-o,i]}function a2(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const a=c.geoRhumbDestination(t,i*r,n);a&&o.push(a)}return o}function l2(t,n){return c.geoNearestPointOnLine(t,n).geometry.coordinates}const Jv=new w.Cartesian3,u2=new w.Ray,c2=new w.Plane(w.Cartesian3.UNIT_X,0);function Sh(t,n,e,i){const o=w.Cartesian3.normalize(n,Jv),r=w.Cartesian3.cross(t.camera.right,o,Jv);w.Cartesian3.normalize(r,r);const a=w.Plane.fromPointNormal(n,r,c2),s=t.camera.getPickRay(e,u2);if(s)return w.IntersectionTests.rayPlane(s,a,i)}const cd=new w.Cartesian3,h2=new w.Ray,A2=new w.Cartographic,f2=new w.Ellipsoid;function vs(t,n,e,i){const o=t.camera.getPickRay(n,h2);if(!o)return;const r=w.Cartesian3.fromElements(e,e,e,cd),a=w.Cartesian3.add(r,w.Ellipsoid.WGS84.radii,cd),s=w.Ellipsoid.fromCartesian3(a,f2),l=w.IntersectionTests.rayEllipsoid(o,s);if(l){const u=l.start>0?l.start:l.stop;if(u){const A=w.Ray.getPoint(o,u,cd),h=w.Cartographic.fromCartesian(A,void 0,A2);return i=i||new w.Cartographic,i.longitude=h.longitude,i.latitude=h.latitude,i.height=e,i}else return}else return}function ws(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function e0(t){const n=w.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const t0=new w.Cartographic,n0=new w.Cartesian3,yn=[0,0,0],wr=[0,0,0],hd=new w.Cartesian2,Ad=new w.Cartesian3;function fd(t,n,e,i,o,r){o.constraintMode="none",ws([0,0,0],o.startDragPos),r=r||{},oi(c.getDomEventCurrentTargetPos(t),hd);const a=e.position;if(!Ye(a,Ad))return;const s=Ni(n,Ad,i);if(s===void 0||!Sh(n,Ad,hd,n0)||!De(n0,yn))return;const l=e0(yn[2])*c.geoDistance(a,yn);if(!r.z&&l<s&&Math.abs(a[2]-yn[2])<e.dimensions[0]&&yn[2]>a[2])return o.constraintMode="z",ws(yn,o.startDragPos),!0;if(!vs(n,hd,a[2],t0)||!fo(t0,yn))return;const u=e0(a[2])*c.geoDistance(a,yn),A=e.dimensions[0];if(!(u>1.05*A)){if(!r.zAxis&&u>.95*A&&u<=1.05*A){o.constraintMode="zAxis",ws(yn,o.startDragPos);return}{const[h,f]=mo(a,e.heading+90,yn,wr);if(!r.x&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,yn)<s)){o.constraintMode="x",ws(wr,o.startDragPos);return}}{const[h,f]=mo(a,e.heading,yn,wr);if(!r.y&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,yn)<s)){o.constraintMode="y",ws(wr,o.startDragPos);return}}r.xy||(o.constraintMode="xy",ws(yn,o.startDragPos))}}async function i0(t,n,e,i){var s;const o=(s=t.viewer)==null?void 0:s.scene;if(!o)throw new Error("!scene");const r=c.getDomEventCurrentTargetPos(n),a=oi(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=vs(o,a,e);return l?fo(l):void 0}}let dd,pd;function r0(t,n,e,i,o){o=o||new w.Cartesian3,dd=dd||new w.Ray,pd=pd||new w.Plane(w.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,dd),a=w.Plane.fromPointNormal(n,e,pd);return o=w.IntersectionTests.rayPlane(r,a,o),o}function o0(t){const n=w.Material.fromType(t.type);return md(n,t),n}function vn(t){return t&&c.ESSceneObject.context.getStrFromEnv(t)||w.Material.DefaultImageId}function d2(t){return{x:t[0],y:t[1]}}function md(t,n){n.type==="Color"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.gapColor=Be(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.outlineColor=Be(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.color=Be(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Be(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Ze(n.lineCount??[8,8]),t.uniforms.lineThickness=Ze(n.lineThickness??[1,1]),t.uniforms.lineOffset=Ze(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Be(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Be(n.oddColor??[0,0,1,.5]),t.uniforms.horizontal=n.horizontal??!0,t.uniforms.offset=n.offset??0,t.uniforms.repeat=n.repeat??5):n.type==="Checkerboard"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Be(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Be(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Be(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Be(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=vn(n.specularMap),t.uniforms.normalMap=vn(n.normalMap),t.uniforms.frequency=n.frequency??10,t.uniforms.animationSpeed=n.animationSpeed??.01,t.uniforms.amplitude=n.amplitude??1,t.uniforms.specularIntensity=n.specularIntensity??.5,t.uniforms.fadeFactor=n.fadeFactor??1):n.type==="RimLighting"?(t.uniforms.color=Be(n.color??[1,0,0,.7]),t.uniforms.rimColor=Be(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Be(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Be(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=d2(n.fadeDirection??[!0,!0]),t.uniforms.time=Ze(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Be(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=vn(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=vn(n.image):n.type==="ElevationBand"?(t.uniforms.color=vn(n.colors),t.uniforms.heights=vn(n.heights)):n.type==="XbsjPolylineArrow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.image=vn(n.image),t.uniforms.repeat=n.repeat??60,t.uniforms.speed=n.speed??1,t.uniforms.lineLength=n.lineLength??1,t.uniforms.arrowColor=Be(n.arrowColor??[1,1,1,1])):console.warn(`未知材质类型,无法更新 ${n.type}`)}function ai(t,n){const e=c.react(void 0);let i="";const[o,r,a]=c.getReactFuncs(t),s=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=o0(l)):e.value&&md(e.value,l):(i="",e.value=void 0)}catch{}};return s(),e.dispose(a.disposableOn(s)),e}function Hi(t,n=!1){const e=Yt(t.positions,n),i=t.holes&&t.holes.map(o=>Hi(o));return{positions:e,holes:i}}function gd(t,n){const e=Math.PI/180,i=1/e,o=new w.Cartographic(t[0]*e,t[1]*e,t[2]),r=new w.Cartographic(n[0]*e,n[1]*e,n[2]),a=new w.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new w.Cartographic);if(a)return a.height=(o.height+r.height)*.5,[a.longitude*i,a.latitude*i,a.height]}const s0=new w.Cartesian4,p2=new w.Matrix4;function m2(){return{left:0,top:0,right:0,bottom:0,depth:0}}function a0(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function l0(t,n,e){if(t.scene.mode!==w.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,a=t.camera.frustum.projectionMatrix,s=w.Matrix4.multiply(a,r,p2),l=w.Matrix4.multiplyByVector(s,w.Cartesian4.fromElements(n.x,n.y,n.z,1,s0),s0);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const u=o*(l.x*.5+.5),A=i*(l.y*.5+.5),h=o-u,f=i-A,p=l.z;if(!(u<0||A<0||h<0||f<0||p<0||p>1))return e?(e.left=u,e.top=f,e.right=h,e.bottom=A,e.depth=p):e={left:u,top:f,right:h,bottom:A,depth:p},e}const go={left:0,top:0,right:0,bottom:0,depth:0};class Eh extends c.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new w.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new c.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new Ch(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=i}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 i=l0(this._viewer,this._cartesian,go);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?a0(this._winPos,go)||(e=!0,this._winPos.left=go.left,this._winPos.top=go.top,this._winPos.right=go.right,this._winPos.bottom=go.bottom,this._winPos.depth=go.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){w.Cartesian3.equals(this._cartesian,e)||(w.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function u0(t){const n=w.Math.toRadians(t[0]),e=w.Math.toRadians(t[1]),i=w.Math.toRadians(t[2]),o=w.Matrix3.fromHeadingPitchRoll(new w.HeadingPitchRoll(n,e,i)),r=new w.Cartesian3;return w.Matrix3.multiplyByVector(o,w.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const g2=w.Check,yo=w.defined,c0=w.Math.EPSILON10;function y2(t,n,e,i){if(g2.defined("equalsEpsilon",n),!yo(t))return;e=e??!1;const o=yo(i),r=t.length;if(r<2)return t;let a,s=t[0],l,u,A=0,h=-1;for(a=1;a<r;++a)l=t[a],n(s,l,c0)?(yo(u)||(u=t.slice(0,a),A=a-1,h=0),o&&i.push(a)):(yo(u)&&(u.push(l),A=a,o&&(h=i.length)),s=l);return e&&n(t[0],t[r-1],c0)&&(o&&(yo(u)?i.splice(h,0,A):i.push(r-1)),yo(u)?u.length-=1:u=t.slice(0,-1)),yo(u)?u:t}const Ne=w.Cartesian3,bs=w.Cartographic,vo=w.defined,h0=w.DeveloperError,A0=w.Ellipsoid,v2=w.EllipsoidGeodesic,f0=w.EllipsoidRhumbLine,w2=w.IntersectionTests,yd=w.Math,xs=w.Matrix4,wo=w.Plane,Dt={};Dt.numberOfPoints=function(t,n,e){const i=Ne.distance(t,n);return Math.ceil(i/e)},Dt.numberOfPointsRhumbLine=function(t,n,e){const i=Math.pow(t.longitude-n.longitude,2)+Math.pow(t.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(e*e))))};const b2=new bs;Dt.extractHeights=function(t,n){const e=t.length,i=new Array(e);for(let o=0;o<e;o++){const r=t[o];i[o]=n.cartesianToCartographic(r,b2).height}return i};const x2=new xs,_2=new Ne,d0=new Ne,C2=new wo(Ne.UNIT_X,0),p0=new Ne,S2=new wo(Ne.UNIT_X,0),E2=new Ne,P2=new Ne,vd=[];function m0(t,n,e){const i=vd;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const a=(e-n)/t;for(o=0;o<t;o++){const s=n+o*a;i[o]=s}return i}const Ph=new bs,Bh=new bs,br=new Ne,wd=new Ne,B2=new Ne,bd=new v2;let nl=new f0;function T2(t,n,e,i,o,r,a,s){const l=i.scaleToGeodeticSurface(t,wd),u=i.scaleToGeodeticSurface(n,B2),A=Dt.numberOfPoints(t,n,e),h=i.cartesianToCartographic(l,Ph),f=i.cartesianToCartographic(u,Bh),p=m0(A,o,r);bd.setEndPoints(h,f);const d=bd.surfaceDistance/A;let m=s;h.height=o;let v=i.cartographicToCartesian(h,br);Ne.pack(v,a,m),m+=3;for(let y=1;y<A;y++){const g=bd.interpolateUsingSurfaceDistance(y*d,Bh);g.height=p[y],v=i.cartographicToCartesian(g,br),Ne.pack(v,a,m),m+=3}return m}function I2(t,n,e,i,o,r,a,s){const l=i.cartesianToCartographic(t,Ph),u=i.cartesianToCartographic(n,Bh),A=Dt.numberOfPointsRhumbLine(l,u,e);l.height=0,u.height=0;const h=m0(A,o,r);nl.ellipsoid.equals(i)||(nl=new f0(void 0,void 0,i)),nl.setEndPoints(l,u);const f=nl.surfaceDistance/A;let p=s;l.height=o;let d=i.cartographicToCartesian(l,br);Ne.pack(d,a,p),p+=3;for(let m=1;m<A;m++){const v=nl.interpolateUsingSurfaceDistance(m*f,Bh);v.height=h[m],d=i.cartographicToCartesian(v,br),Ne.pack(d,a,p),p+=3}return p}Dt.wrapLongitude=function(t,n){const e=[],i=[];if(vo(t)&&t.length>0){n=n??xs.IDENTITY;const o=xs.inverseTransformation(n,x2),r=xs.multiplyByPoint(o,Ne.ZERO,_2),a=Ne.normalize(xs.multiplyByPointAsVector(o,Ne.UNIT_Y,d0),d0),s=wo.fromPointNormal(r,a,C2),l=Ne.normalize(xs.multiplyByPointAsVector(o,Ne.UNIT_X,p0),p0),u=wo.fromPointNormal(r,l,S2);let A=1;e.push(Ne.clone(t[0]));let h=e[0];const f=t.length;for(let p=1;p<f;++p){const d=t[p];if(wo.getPointDistance(u,h)<0||wo.getPointDistance(u,d)<0){const m=w2.lineSegmentPlane(h,d,s,E2);if(vo(m)){const v=Ne.multiplyByScalar(a,5e-9,P2);wo.getPointDistance(s,h)<0&&Ne.negate(v,v),e.push(Ne.add(m,v,new Ne)),i.push(A+1),Ne.negate(v,v),e.push(Ne.add(m,v,new Ne)),A=1}}e.push(Ne.clone(t[p])),A++,h=d}i.push(A)}return{positions:e,lengths:i}},Dt.generateArc=function(t){vo(t)||(t={});const n=t.positions;if(!vo(n))throw new h0("options.positions is required.");const e=n.length,i=t.ellipsoid??A0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const m=i.scaleToGeodeticSurface(n[0],wd);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(m,br);Ne.multiplyByScalar(v,o,v),Ne.add(m,v,m)}return[m.x,m.y,m.z]}let a=t.minDistance;if(!vo(a)){const m=t.granularity??yd.RADIANS_PER_DEGREE;a=yd.chordLength(m,i.maximumRadius)}let s=0,l;for(l=0;l<e-1;l++)s+=Dt.numberOfPoints(n[l],n[l+1],a);const u=(s+1)*3,A=new Array(u);let h=0;for(l=0;l<e-1;l++){const m=n[l],v=n[l+1],y=r?o[l]:o,g=r?o[l+1]:o;h=T2(m,v,a,i,y,g,A,h)}vd.length=0;const f=n[e-1],p=i.cartesianToCartographic(f,Ph);p.height=r?o[e-1]:o;const d=i.cartographicToCartesian(p,br);return Ne.pack(d,A,u-3),A};const g0=new bs,F2=new bs;Dt.generateRhumbArc=function(t){vo(t)||(t={});const n=t.positions;if(!vo(n))throw new h0("options.positions is required.");const e=n.length,i=t.ellipsoid??A0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],wd);if(o=r?o[0]:o,o!==0){const g=i.geodeticSurfaceNormal(y,br);Ne.multiplyByScalar(g,o,g),Ne.add(y,g,y)}return[y.x,y.y,y.z]}const a=t.granularity??yd.RADIANS_PER_DEGREE;let s=0,l,u=i.cartesianToCartographic(n[0],g0),A;for(l=0;l<e-1;l++)A=i.cartesianToCartographic(n[l+1],F2),s+=Dt.numberOfPointsRhumbLine(u,A,a),u=bs.clone(A,g0);const h=(s+1)*3,f=new Array(h);let p=0;for(l=0;l<e-1;l++){const y=n[l],g=n[l+1],_=r?o[l]:o,x=r?o[l+1]:o;p=I2(y,g,a,i,_,x,f,p)}vd.length=0;const d=n[e-1],m=i.cartesianToCartographic(d,Ph);m.height=r?o[e-1]:o;const v=i.cartographicToCartesian(m,br);return Ne.pack(v,f,h-3),f},Dt.generateCartesianArc=function(t){const n=Dt.generateArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=Ne.unpack(n,o*3);return i},Dt.generateCartesianRhumbArc=function(t){const n=Dt.generateRhumbArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=Ne.unpack(n,o*3);return i};const Th=w.ArcType,M2=w.Cartesian3,D2=w.Math;function y0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=y2(t.positions,M2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===Th.GEODESIC||n===Th.RHUMB){let s;n===Th.GEODESIC?(s=D2.chordLength(e,i.maximumRadius),Dt.numberOfPoints):(s=e,Dt.numberOfPointsRhumbLine);const l=Dt.extractHeights(r,i);n===Th.GEODESIC?r=Dt.generateCartesianArc({positions:r,minDistance:s,ellipsoid:i,height:l}):r=Dt.generateCartesianRhumbArc({positions:r,granularity:s,ellipsoid:i,height:l})}return r}}function xd(t,n="GEODESIC",e){const o=t.map(c.lbhToXyz).map(h=>w.Cartesian3.fromArray(h));let r;if(e>0&&n!=="NONE"){if(r=y0({arcType:w.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:w.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let a=0;const s=[0],l=r.length;for(let h=1;h<l;++h)a+=w.Cartesian3.distance(r[h-1],r[h]),s.push(a);const u=r.map(h=>c.xyzToLbh([h.x,h.y,h.z]));return{timePosRots:s.map((h,f)=>[s[f],u[f],void 0]),distances:s}}function v0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function _d(t,n){const e=w.Matrix4.clone(w.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:a="YForwardZUp"}=t;if(i){const[s,l,u]=i;w.Transforms.eastNorthUpToFixedFrame(w.Cartesian3.fromDegrees(s,l,u),void 0,e)}if(o){const s=new w.Quaternion;a==="YForwardZUp"?_h(o,s):a==="XForwardZUp"&&$v(o,s);const l=w.Matrix3.fromQuaternion(s);w.Matrix4.multiply(e,w.Matrix4.fromRotationTranslation(l),e)}return r&&w.Matrix4.multiplyByScale(e,oi(r),e),v0(e,n)}const R2=new w.Matrix4;function w0(t,n){const e=w.Matrix4.fromArray(t,0,R2);return w.Matrix4.inverse(e,e),v0(e,n)}const U2=new w.Matrix4,O2=new w.Cartesian3;function b0(t,n,e){const[i,o,r]=n,a=w.Cartesian3.fromDegrees(i,o,r,void 0,O2),s=w.Matrix4.fromArray(t,0,U2),l=w.Matrix4.multiplyByPoint(s,a,a),{x:u,y:A,z:h}=l;return e=e||[0,0,0],e[0]=u,e[1]=A,e[2]=h,e}const L2=new w.Matrix4,z2=new w.Cartesian3,k2=new w.Cartographic;function xr(t,n,e){const[i,o,r]=n,a=w.Cartesian3.fromElements(i,o,r,z2),s=w.Matrix4.fromArray(t,0,L2),l=w.Matrix4.multiplyByPoint(s,a,a),u=w.Cartographic.fromCartesian(l,void 0,k2);return e=e||[0,0,0],e[0]=w.Math.toDegrees(u.longitude),e[1]=w.Math.toDegrees(u.latitude),e[2]=u.height,e}function wn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=_d({position:e,rotation:i,scale:o,initialRotationMode:r}),s=w0(a);return[n.map(u=>b0(s,u)),a,s]}function _r(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=_d({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>xr(a,l)),a]}function x0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=Xe.Cartesian3.fromDegrees(...t[e]),o=Xe.Cartesian3.fromDegrees(...t[e+1]),r=Xe.Cartesian3.fromDegrees(...t[e+2]),a=Xe.Cartesian3.angleBetween(Xe.Cartesian3.subtract(i,o,new Xe.Cartesian3),Xe.Cartesian3.subtract(r,o,new Xe.Cartesian3));n.push(isNaN(a)?0:Xe.Math.toDegrees(a))}return n}function Cd(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>De(i)))),t.holes&&t.holes.forEach(i=>{e=Cd(i,e)}),e}function Dn(t){return typeof t=="string"?c.ESSceneObject.context.getStrFromEnv(t):new w.Resource({url:c.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 Sd extends c.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[a,s,l]=c.getReactFuncs(e),[u,A,h]=c.getReactFuncs(i),f=new w.Cartesian3,p=()=>{let d=a();d&&(d=[...d],n.editingHeightOffset&&(d[2]-=n.editingHeightOffset),w.Cartesian3.fromDegrees(...d,void 0,f))};p(),this.dispose(l.disposableOn(p)),this.dispose(r.preUpdate.addEventListener(()=>{if(w.Cartesian3.ZERO.equals(f))return;const d=Ni(r,f,o);d!==void 0?A([d,d,d]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${d??"undefined"}`)}))}}function Q2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:w.Matrix4.toArray(w.Matrix4.IDENTITY);let e,i,o,r;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))r=w.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=w.Cartesian3.add(r,w.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new w.Cartesian3),i=w.Cartesian3.add(r,w.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new w.Cartesian3),o=w.Cartesian3.add(r,w.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new w.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];r=w.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=w.Cartesian3.add(r,w.Cartesian3.fromArray([f,0,0]),new w.Cartesian3),i=w.Cartesian3.add(r,w.Cartesian3.fromArray([0,f,0]),new w.Cartesian3),o=w.Cartesian3.add(r,w.Cartesian3.fromArray([0,0,f]),new w.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let a,s,l,u,A,h;return w.Matrix4.IDENTITY.equals(w.Matrix4.fromArray(n))?(a=De(e),u=De(w.Cartesian3.add(r,w.Cartesian3.subtract(r,e,new w.Cartesian3),new w.Cartesian3)),s=De(i),A=De(w.Cartesian3.add(r,w.Cartesian3.subtract(r,i,new w.Cartesian3),new w.Cartesian3)),l=De(o),h=De(w.Cartesian3.add(r,w.Cartesian3.subtract(r,o,new w.Cartesian3),new w.Cartesian3))):(a=xr(n,[e.x,e.y,e.z]),u=xr(n,[-e.x,-e.y,-e.z]),s=xr(n,[i.x,i.y,i.z]),A=xr(n,[-i.x,-i.y,-i.z]),l=xr(n,[o.x,o.y,o.z]),h=xr(n,[-o.x,-o.y,-o.z])),!a||!u||!s||!A||!l||!h?"无法生成包围盒,请检查包围盒是否正确":[w.Math.toRadians(Math.min(a[0],u[0],s[0],A[0],l[0],h[0])),w.Math.toRadians(Math.min(a[1],u[1],s[1],A[1],l[1],h[1])),w.Math.toRadians(Math.max(a[0],u[0],s[0],A[0],l[0],h[0])),w.Math.toRadians(Math.max(a[1],u[1],s[1],A[1],l[1],h[1])),Math.min(a[2],u[2],s[2],A[2],l[2],h[2]),Math.max(a[2],u[2],s[2],A[2],l[2],h[2])]}const _0=c.createProcessingFromAsyncFunc(async(t,n)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},i={},o=[];if(await c.step(t,async l=>new Promise(async(u,A)=>{for(let h=0;h<n.length;h++){const f=n[h];await fetch(f).then(p=>p.json()).then(p=>{p&&!Reflect.has(p,"success")?i[f]=p:o.push({index:h,url:f,message:p.message}),h==n.length-1&&u()}).catch(p=>{o.push({index:h,url:f,message:p}),h==n.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],a=[],s=[];for(const l in i){const u=i[l];a.push(u.geometricError??u.root.geometricError??0);const A=Q2(u);r.push(A),s.push({content:{uri:l},boundingVolume:{region:A},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...a),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(l=>l[0])),Math.min(...r.map(l=>l[1])),Math.max(...r.map(l=>l[2])),Math.max(...r.map(l=>l[3])),Math.min(...r.map(l=>l[4])),Math.max(...r.map(l=>l[5]))],e.tilesUrl.root.children=s),e});function V2(t){return new Promise((n,e)=>{_0.restart(void 0,t),_0.completeEvent.don(i=>{n(i)})})}class Ed extends c.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(c.react(0)));const[i,o,r]=c.getReactFuncs(e);{const a=()=>{const s=i();if(s){const{center:l,minPos:u,maxPos:A}=c.getMinMaxCorner(s);this._center.value=l,this._radius.value=c.geoDistance(u,A)/2}else this._center.value=void 0};a(),this.dispose(r.disposableOn(a))}}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 C0(t){return new w.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new w.Color(.2,.3,.6,1),blendColor:new w.Color(0,1,.699,1),specularMap:w.Material.DefaultImageId,normalMap:w.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
1
+ var EarthSDK3_Cesium=function(ne,Xe,c){"use strict";var Q7=Object.defineProperty;var V7=(ne,Xe,c)=>Xe in ne?Q7(ne,Xe,{enumerable:!0,configurable:!0,writable:!0,value:c}):ne[Xe]=c;var L=(ne,Xe,c)=>V7(ne,typeof Xe!="symbol"?Xe+"":Xe,c);var gs=typeof document<"u"?document.currentScript:null;function OE(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const w=OE(Xe);window.Cesium=w;function LE(){Object.keys(w).forEach(t=>{w[t].prototype&&Object.defineProperty(w[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:c.createGuid()})})}w.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhN2VkNDM5ZS1jMDk0LTQ3NDItOTM5ZS00MzU3M2M1MTc2ZTkiLCJpZCI6MjU5LCJpYXQiOjE3NjIxODg4MDB9.ZZG574sONzeHxsX8HJMaL_ZiGA3dh_HrOxL7DrKRcd4";const Su=class Su extends c.Destroyable{};L(Su,"defaults",{enabled:!0}),L(Su,"createDefaultProps",()=>({...Su.defaults}));let Fn=Su;c.extendClassProps(Fn.prototype,Fn.createDefaultProps);class Hn extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r,a)=>this.flyTo(o,r,a))),this.d(n.flyInEvent.don((o,r,a)=>this.flyIn(o,r,a))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:a}=o;n.flyInParam={position:r,rotation:a,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(n,e,i,o,r,a,s,l="default"){const{sceneObject:u,czmViewer:A}=this,h=A.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:a??0,pDelta:s??0},e,l);h&&h.then(f=>{})}flyTo(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}flyIn(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}get czmViewer(){return this.viewer}}function Ye(t,n){return w.Cartesian3.fromDegrees(...t,void 0,n)}const zE=new w.Cartographic;function De(t,n){const e=w.Cartographic.fromCartesian(t,void 0,zE);if(e)return n=n||[0,0,0],n[0]=w.Math.toDegrees(e.longitude),n[1]=w.Math.toDegrees(e.latitude),n[2]=e.height,n}function Ze(t,n){return n=n||new w.Cartesian2,n.x=t[0],n.y=t[1],n}function qv(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function ri(t,n){return n=n||new w.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function Ya(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function ld(t,n){return n=n||new w.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Kv(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}function oi(t,n){if(t.length===4)return ld(t,n);if(t.length===3)return ri(t,n);if(t.length===2)return Ze(t,n);throw new Error("toCartesian error: should not be here!")}function kE(t,n){if(t instanceof w.Cartesian2)return qv(t,n);if(t instanceof w.Cartesian3)return Ya(t,n);if(t instanceof w.Cartesian4)return Kv(t,n);throw new Error("fromCartesian error: should not be here!")}function QE(t,n){return n=n||new w.Cartographic,n.longitude=w.Math.toRadians(t[0]),n.latitude=w.Math.toRadians(t[1]),n.height=t[2],n}function fo(t,n){return n=n||[0,0,0],n[0]=w.Math.toDegrees(t.longitude),n[1]=w.Math.toDegrees(t.latitude),n[2]=t.height,n}function Be(t,n){return n=n||new w.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function VE(t,n){return n=n||[0,0,0,0],n[0]=t.red,n[1]=t.green,n[2]=t.blue,n[3]=t.alpha,n}function gr(t,n){return n=n||new w.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function NE(t,n){return n=n||[0,0,0,0],n[0]=t.near,n[1]=t.nearValue,n[2]=t.far,n[3]=t.farValue,n}function Zv(t,n){return n=n||new w.HeadingPitchRoll,n.heading=w.Math.toRadians(t[0]-90),n.pitch=w.Math.toRadians(t[1]),n.roll=w.Math.toRadians(t[2]),n}function HE(t,n){return n=n||[0,0,0],n[0]=w.Math.toDegrees(t.heading+w.Math.PI_OVER_TWO),n[1]=w.Math.toDegrees(t.pitch),n[2]=w.Math.toDegrees(t.roll),n}function Ja(t,n){return n=n||new w.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function GE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function WE(t,n){return n=n||new w.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function jE(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}const qE=new w.HeadingPitchRoll,KE=new w.Cartesian3;function ZE(t,n,e){const i=Zv(n,qE),o=Ye(t,KE);return w.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function gt(t,n){return n=n||new w.Rectangle,n.west=t[0]*Math.PI/180,n.south=t[1]*Math.PI/180,n.east=t[2]*Math.PI/180,n.north=t[3]*Math.PI/180,n}function $E(t,n){return n=n||[0,0,0,0],n[0]=t.west,n[1]=t.south,n[2]=t.east,n[3]=t.north,n}const XE=new w.Cartesian3;function qe(t,n){return n=n||new w.Ellipsoid,w.Ellipsoid.fromCartesian3(w.Cartesian3.fromArray(t,void 0,XE),n)}function YE(t,n){return n=n||[0,0,0],n[0]=t.radii.x,n[1]=t.radii.y,n[2]=t.radii.z,n}function si(t){if(t.type==="GeographicTilingScheme")return new w.GeographicTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),rectangle:t.rectangle&&gt(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new w.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new px({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new mx({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function el(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:a,edgeWidth:s}=t;let l=o&&w.Matrix4.fromArray(o);return n&&(l=l||w.Matrix4.clone(w.Matrix4.IDENTITY,new w.Matrix4),w.Matrix4.multiply(n,l,l)),new w.ClippingPlaneCollection({planes:e&&e.map(u=>new w.ClippingPlane(ri(u.normal),u.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:a&&Be(a),edgeWidth:s})}function bh(t,n,e){const i=n;if(!i){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),i.planes)for(let r of i.planes)t.add(new w.ClippingPlane(ri(r.normal),r.distance));let o=i.modelMatrix&&w.Matrix4.fromArray(i.modelMatrix)||w.Matrix4.clone(w.Matrix4.IDENTITY,new w.Matrix4);e&&w.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Be(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function xh(t){const{polygons:n,enabled:e,inverse:i}=t;return new w.ClippingPolygonCollection({polygons:n&&n.map(o=>new w.ClippingPolygon({positions:o.positions.map(r=>Ye(r))})),enabled:e,inverse:i})}function _h(t,n){return ud(t,w.Cartesian3.UNIT_Y,w.Cartesian3.UNIT_Z,w.Cartesian3.UNIT_X,n)}function $v(t,n){return ud(t,w.Cartesian3.UNIT_X,w.Cartesian3.UNIT_Z,new w.Cartesian3(0,-1,0),n)}function ud(t,n,e,i,o){const[r,a,s]=t,l=w.Quaternion.fromAxisAngle(e,w.Math.toRadians(-r)),u=w.Quaternion.fromAxisAngle(i,w.Math.toRadians(a)),A=w.Quaternion.fromAxisAngle(n,w.Math.toRadians(s)),h=w.Quaternion.clone(w.Quaternion.IDENTITY,o);return w.Quaternion.multiply(A,h,h),w.Quaternion.multiply(u,h,h),w.Quaternion.multiply(l,h,h),h}function yr(t,n){return Array.isArray(t)?t.length!==n?(console.warn(`array.length !== ${n}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Xv(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function lt(t,n){if(!((!t.localScale||yr(t.localScale,3))&&(!t.localRotation||yr(t.localRotation,3))&&(!t.localPosition||yr(t.localPosition,3))&&(!t.localModelMatrix||yr(t.localModelMatrix,16))&&(!t.scale||yr(t.scale,3))&&(!t.rotation||yr(t.rotation,3))&&(!t.position||yr(t.position,3))&&(!t.modelMatrix||yr(t.modelMatrix,16)))||t.localScale&&!Xv(t.localScale)||t.scale&&!Xv(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 i=n??w.Matrix4.clone(w.Matrix4.IDENTITY);if(t.localScale){const[o,r,a]=t.localScale??[1,1,1],s=w.Matrix4.fromScale(w.Cartesian3.fromElements(o,r,a),new w.Matrix4);w.Matrix4.multiply(s,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=w.Quaternion.fromAxisAngle(w.Cartesian3.UNIT_Z,w.Math.toRadians(90)),r=w.Matrix3.fromQuaternion(o);w.Matrix4.multiply(w.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=_h(t.localRotation),r=w.Matrix3.fromQuaternion(o);w.Matrix4.multiply(w.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=w.Matrix4.fromTranslation(w.Cartesian3.fromArray(t.localPosition));w.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=w.Matrix4.fromArray(t.localModelMatrix);w.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=w.Matrix4.fromScale(w.Cartesian3.fromElements(o,o,o),new w.Matrix4);w.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,a]=t.scale??[1,1,1],s=w.Matrix4.fromScale(w.Cartesian3.fromElements(o,r,a),new w.Matrix4);w.Matrix4.multiply(s,i,i)}if(t.rotation){const o=_h(t.rotation),r=w.Matrix3.fromQuaternion(o);w.Matrix4.multiply(w.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=w.Cartesian3.fromDegrees(...t.position),r=w.Transforms.eastNorthUpToFixedFrame(o);w.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=w.Matrix4.fromArray(t.modelMatrix);w.Matrix4.multiply(o,i,i)}return i}const JE=new w.Cartesian3,tl=new w.HeadingPitchRoll,e2=new w.Matrix4,t2=new w.Cartesian3,n2=new w.Cartographic;function i2(t,n=[0,0,0],e=0,i){const[o,r,a]=t,s=w.Cartesian3.fromDegrees(o,r,a,void 0,JE),l=[...n];for(let A=0;A<3;++A)l[A]=w.Math.RADIANS_PER_DEGREE*l[A];if(e!==0){tl.heading=l[0],tl.pitch=l[1],tl.roll=l[2],tl.heading-=w.Math.PI_OVER_TWO;const A=w.Transforms.headingPitchRollToFixedFrame(s,tl,void 0,void 0,e2),h=w.Matrix4.multiplyByPointAsVector(A,w.Cartesian3.UNIT_X,t2);w.Cartesian3.multiplyByScalar(h,e,h),w.Cartesian3.subtract(s,h,s)}const u=w.Cartographic.fromCartesian(s,void 0,n2);if(u)return i=i||[0,0,0],i[0]=u.longitude*180/Math.PI,i[1]=u.latitude*180/Math.PI,i[2]=u.height,i}function Yv(t,n,e,i){return i2(t,n,e,i)}const vr=w.Math.toDegrees;function Mn(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=o,n):[vr(e),vr(i),o]}function ys(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=vr(o),n):[e,i,o].map(vr)}class Ch extends c.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new w.Matrix4);L(this,"_originProjMatrix",new w.Matrix4);L(this,"_changed",new c.Event);this._scene=e;const i=this._scene.camera;w.Matrix4.clone(i.viewMatrix,this._originViewMatrix),w.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){w.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(w.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),w.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(w.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class r2 extends c.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class o2 extends c.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new c.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new r2(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class po extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(c.react(1)));L(this,"_viewDistance",this.disposeVar(c.react(0)));L(this,"_debug",this.disposeVar(c.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new o2(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:a,czmViewer:s}=this,[l,u,A]=c.getReactFuncs(i),[h,f,p]=c.getReactFuncs(a),[d,m,v]=r?c.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let x=1,E=Number.NEGATIVE_INFINITY;const B=l(),P=h(),I=d?d():0,D=s.getCurrentCameraInfo();if(!B||!P||!D){this._viewDistance.value=E,this._visibleAlpha.value=x;return}E=c.cartesianDistance(D.position,P)-(I??0);const[F,S,T,b]=B;F>S||S>T||T>b?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):E>=S&&E<=T?x=1:E<=F||E>=b?x=0:E>F&&E<S?S-F<=0?x=0:x=(E-F)/(S-F):E>T&&E<b?(b<=T&&(x=0),x=(b-E)/(b-T)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=E,this._visibleAlpha.value=x};y();const g=[s.cameraChanged,A,p];v&&g.push(v);const _=this.disposeVar(c.createNextAnimateFrameEvent(...g));this.dispose(_.disposableOn(y))}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 s2=new w.BoundingSphere(w.Cartesian3.ZERO,0);function Ni(t,n,e){var i=s2;w.Cartesian3.clone(n,i.center);const o=t.camera.getPixelSize(i,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function Yt(t,n=!1){const e=t.length;let i;const o=[];for(let r=0;r<e;++r){const[a,s,l]=t[r],u=n?w.Cartesian3.fromDegrees(a,s):w.Cartesian3.fromDegrees(a,s,l);if(!u)continue;const{x:A,y:h,z:f}=u;[A,h,f].every(Number.isFinite)&&(!i||!w.Cartesian3.equals(i,u))&&(i=u,o.push(i))}return o}function mo(t,n,e,i){const o=c.geoRhumbDistance(t,e),r=c.geoRhumbHeading(t,e),a=Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(n*Math.PI/180);return a>0?c.geoRhumbDestination(t,o,n,i):c.geoRhumbDestination(t,o,n+180,i),[a>0?o:-o,i]}function a2(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const a=c.geoRhumbDestination(t,i*r,n);a&&o.push(a)}return o}function l2(t,n){return c.geoNearestPointOnLine(t,n).geometry.coordinates}const Jv=new w.Cartesian3,u2=new w.Ray,c2=new w.Plane(w.Cartesian3.UNIT_X,0);function Sh(t,n,e,i){const o=w.Cartesian3.normalize(n,Jv),r=w.Cartesian3.cross(t.camera.right,o,Jv);w.Cartesian3.normalize(r,r);const a=w.Plane.fromPointNormal(n,r,c2),s=t.camera.getPickRay(e,u2);if(s)return w.IntersectionTests.rayPlane(s,a,i)}const cd=new w.Cartesian3,h2=new w.Ray,A2=new w.Cartographic,f2=new w.Ellipsoid;function vs(t,n,e,i){const o=t.camera.getPickRay(n,h2);if(!o)return;const r=w.Cartesian3.fromElements(e,e,e,cd),a=w.Cartesian3.add(r,w.Ellipsoid.WGS84.radii,cd),s=w.Ellipsoid.fromCartesian3(a,f2),l=w.IntersectionTests.rayEllipsoid(o,s);if(l){const u=l.start>0?l.start:l.stop;if(u){const A=w.Ray.getPoint(o,u,cd),h=w.Cartographic.fromCartesian(A,void 0,A2);return i=i||new w.Cartographic,i.longitude=h.longitude,i.latitude=h.latitude,i.height=e,i}else return}else return}function ws(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function e0(t){const n=w.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const t0=new w.Cartographic,n0=new w.Cartesian3,yn=[0,0,0],wr=[0,0,0],hd=new w.Cartesian2,Ad=new w.Cartesian3;function fd(t,n,e,i,o,r){o.constraintMode="none",ws([0,0,0],o.startDragPos),r=r||{},oi(c.getDomEventCurrentTargetPos(t),hd);const a=e.position;if(!Ye(a,Ad))return;const s=Ni(n,Ad,i);if(s===void 0||!Sh(n,Ad,hd,n0)||!De(n0,yn))return;const l=e0(yn[2])*c.geoDistance(a,yn);if(!r.z&&l<s&&Math.abs(a[2]-yn[2])<e.dimensions[0]&&yn[2]>a[2])return o.constraintMode="z",ws(yn,o.startDragPos),!0;if(!vs(n,hd,a[2],t0)||!fo(t0,yn))return;const u=e0(a[2])*c.geoDistance(a,yn),A=e.dimensions[0];if(!(u>1.05*A)){if(!r.zAxis&&u>.95*A&&u<=1.05*A){o.constraintMode="zAxis",ws(yn,o.startDragPos);return}{const[h,f]=mo(a,e.heading+90,yn,wr);if(!r.x&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,yn)<s)){o.constraintMode="x",ws(wr,o.startDragPos);return}}{const[h,f]=mo(a,e.heading,yn,wr);if(!r.y&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,yn)<s)){o.constraintMode="y",ws(wr,o.startDragPos);return}}r.xy||(o.constraintMode="xy",ws(yn,o.startDragPos))}}async function i0(t,n,e,i){var s;const o=(s=t.viewer)==null?void 0:s.scene;if(!o)throw new Error("!scene");const r=c.getDomEventCurrentTargetPos(n),a=oi(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=vs(o,a,e);return l?fo(l):void 0}}let dd,pd;function r0(t,n,e,i,o){o=o||new w.Cartesian3,dd=dd||new w.Ray,pd=pd||new w.Plane(w.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,dd),a=w.Plane.fromPointNormal(n,e,pd);return o=w.IntersectionTests.rayPlane(r,a,o),o}function o0(t){const n=w.Material.fromType(t.type);return md(n,t),n}function vn(t){return t&&c.ESSceneObject.context.getStrFromEnv(t)||w.Material.DefaultImageId}function d2(t){return{x:t[0],y:t[1]}}function md(t,n){n.type==="Color"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.gapColor=Be(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.outlineColor=Be(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.color=Be(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Be(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Ze(n.lineCount??[8,8]),t.uniforms.lineThickness=Ze(n.lineThickness??[1,1]),t.uniforms.lineOffset=Ze(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Be(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Be(n.oddColor??[0,0,1,.5]),t.uniforms.horizontal=n.horizontal??!0,t.uniforms.offset=n.offset??0,t.uniforms.repeat=n.repeat??5):n.type==="Checkerboard"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Be(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Be(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Be(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Be(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=vn(n.specularMap),t.uniforms.normalMap=vn(n.normalMap),t.uniforms.frequency=n.frequency??10,t.uniforms.animationSpeed=n.animationSpeed??.01,t.uniforms.amplitude=n.amplitude??1,t.uniforms.specularIntensity=n.specularIntensity??.5,t.uniforms.fadeFactor=n.fadeFactor??1):n.type==="RimLighting"?(t.uniforms.color=Be(n.color??[1,0,0,.7]),t.uniforms.rimColor=Be(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Be(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Be(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=d2(n.fadeDirection??[!0,!0]),t.uniforms.time=Ze(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Be(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=vn(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=vn(n.image):n.type==="ElevationBand"?(t.uniforms.color=vn(n.colors),t.uniforms.heights=vn(n.heights)):n.type==="XbsjPolylineArrow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.image=vn(n.image),t.uniforms.repeat=n.repeat??60,t.uniforms.speed=n.speed??1,t.uniforms.lineLength=n.lineLength??1,t.uniforms.arrowColor=Be(n.arrowColor??[1,1,1,1])):console.warn(`未知材质类型,无法更新 ${n.type}`)}function ai(t,n){const e=c.react(void 0);let i="";const[o,r,a]=c.getReactFuncs(t),s=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=o0(l)):e.value&&md(e.value,l):(i="",e.value=void 0)}catch{}};return s(),e.dispose(a.disposableOn(s)),e}function Hi(t,n=!1){const e=Yt(t.positions,n),i=t.holes&&t.holes.map(o=>Hi(o));return{positions:e,holes:i}}function gd(t,n){const e=Math.PI/180,i=1/e,o=new w.Cartographic(t[0]*e,t[1]*e,t[2]),r=new w.Cartographic(n[0]*e,n[1]*e,n[2]),a=new w.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new w.Cartographic);if(a)return a.height=(o.height+r.height)*.5,[a.longitude*i,a.latitude*i,a.height]}const s0=new w.Cartesian4,p2=new w.Matrix4;function m2(){return{left:0,top:0,right:0,bottom:0,depth:0}}function a0(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function l0(t,n,e){if(t.scene.mode!==w.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,a=t.camera.frustum.projectionMatrix,s=w.Matrix4.multiply(a,r,p2),l=w.Matrix4.multiplyByVector(s,w.Cartesian4.fromElements(n.x,n.y,n.z,1,s0),s0);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const u=o*(l.x*.5+.5),A=i*(l.y*.5+.5),h=o-u,f=i-A,p=l.z;if(!(u<0||A<0||h<0||f<0||p<0||p>1))return e?(e.left=u,e.top=f,e.right=h,e.bottom=A,e.depth=p):e={left:u,top:f,right:h,bottom:A,depth:p},e}const go={left:0,top:0,right:0,bottom:0,depth:0};class Eh extends c.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new w.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new c.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new Ch(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=i}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 i=l0(this._viewer,this._cartesian,go);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?a0(this._winPos,go)||(e=!0,this._winPos.left=go.left,this._winPos.top=go.top,this._winPos.right=go.right,this._winPos.bottom=go.bottom,this._winPos.depth=go.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){w.Cartesian3.equals(this._cartesian,e)||(w.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function u0(t){const n=w.Math.toRadians(t[0]),e=w.Math.toRadians(t[1]),i=w.Math.toRadians(t[2]),o=w.Matrix3.fromHeadingPitchRoll(new w.HeadingPitchRoll(n,e,i)),r=new w.Cartesian3;return w.Matrix3.multiplyByVector(o,w.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const g2=w.Check,yo=w.defined,c0=w.Math.EPSILON10;function y2(t,n,e,i){if(g2.defined("equalsEpsilon",n),!yo(t))return;e=e??!1;const o=yo(i),r=t.length;if(r<2)return t;let a,s=t[0],l,u,A=0,h=-1;for(a=1;a<r;++a)l=t[a],n(s,l,c0)?(yo(u)||(u=t.slice(0,a),A=a-1,h=0),o&&i.push(a)):(yo(u)&&(u.push(l),A=a,o&&(h=i.length)),s=l);return e&&n(t[0],t[r-1],c0)&&(o&&(yo(u)?i.splice(h,0,A):i.push(r-1)),yo(u)?u.length-=1:u=t.slice(0,-1)),yo(u)?u:t}const Ne=w.Cartesian3,bs=w.Cartographic,vo=w.defined,h0=w.DeveloperError,A0=w.Ellipsoid,v2=w.EllipsoidGeodesic,f0=w.EllipsoidRhumbLine,w2=w.IntersectionTests,yd=w.Math,xs=w.Matrix4,wo=w.Plane,Dt={};Dt.numberOfPoints=function(t,n,e){const i=Ne.distance(t,n);return Math.ceil(i/e)},Dt.numberOfPointsRhumbLine=function(t,n,e){const i=Math.pow(t.longitude-n.longitude,2)+Math.pow(t.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(e*e))))};const b2=new bs;Dt.extractHeights=function(t,n){const e=t.length,i=new Array(e);for(let o=0;o<e;o++){const r=t[o];i[o]=n.cartesianToCartographic(r,b2).height}return i};const x2=new xs,_2=new Ne,d0=new Ne,C2=new wo(Ne.UNIT_X,0),p0=new Ne,S2=new wo(Ne.UNIT_X,0),E2=new Ne,P2=new Ne,vd=[];function m0(t,n,e){const i=vd;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const a=(e-n)/t;for(o=0;o<t;o++){const s=n+o*a;i[o]=s}return i}const Ph=new bs,Bh=new bs,br=new Ne,wd=new Ne,B2=new Ne,bd=new v2;let nl=new f0;function T2(t,n,e,i,o,r,a,s){const l=i.scaleToGeodeticSurface(t,wd),u=i.scaleToGeodeticSurface(n,B2),A=Dt.numberOfPoints(t,n,e),h=i.cartesianToCartographic(l,Ph),f=i.cartesianToCartographic(u,Bh),p=m0(A,o,r);bd.setEndPoints(h,f);const d=bd.surfaceDistance/A;let m=s;h.height=o;let v=i.cartographicToCartesian(h,br);Ne.pack(v,a,m),m+=3;for(let y=1;y<A;y++){const g=bd.interpolateUsingSurfaceDistance(y*d,Bh);g.height=p[y],v=i.cartographicToCartesian(g,br),Ne.pack(v,a,m),m+=3}return m}function I2(t,n,e,i,o,r,a,s){const l=i.cartesianToCartographic(t,Ph),u=i.cartesianToCartographic(n,Bh),A=Dt.numberOfPointsRhumbLine(l,u,e);l.height=0,u.height=0;const h=m0(A,o,r);nl.ellipsoid.equals(i)||(nl=new f0(void 0,void 0,i)),nl.setEndPoints(l,u);const f=nl.surfaceDistance/A;let p=s;l.height=o;let d=i.cartographicToCartesian(l,br);Ne.pack(d,a,p),p+=3;for(let m=1;m<A;m++){const v=nl.interpolateUsingSurfaceDistance(m*f,Bh);v.height=h[m],d=i.cartographicToCartesian(v,br),Ne.pack(d,a,p),p+=3}return p}Dt.wrapLongitude=function(t,n){const e=[],i=[];if(vo(t)&&t.length>0){n=n??xs.IDENTITY;const o=xs.inverseTransformation(n,x2),r=xs.multiplyByPoint(o,Ne.ZERO,_2),a=Ne.normalize(xs.multiplyByPointAsVector(o,Ne.UNIT_Y,d0),d0),s=wo.fromPointNormal(r,a,C2),l=Ne.normalize(xs.multiplyByPointAsVector(o,Ne.UNIT_X,p0),p0),u=wo.fromPointNormal(r,l,S2);let A=1;e.push(Ne.clone(t[0]));let h=e[0];const f=t.length;for(let p=1;p<f;++p){const d=t[p];if(wo.getPointDistance(u,h)<0||wo.getPointDistance(u,d)<0){const m=w2.lineSegmentPlane(h,d,s,E2);if(vo(m)){const v=Ne.multiplyByScalar(a,5e-9,P2);wo.getPointDistance(s,h)<0&&Ne.negate(v,v),e.push(Ne.add(m,v,new Ne)),i.push(A+1),Ne.negate(v,v),e.push(Ne.add(m,v,new Ne)),A=1}}e.push(Ne.clone(t[p])),A++,h=d}i.push(A)}return{positions:e,lengths:i}},Dt.generateArc=function(t){vo(t)||(t={});const n=t.positions;if(!vo(n))throw new h0("options.positions is required.");const e=n.length,i=t.ellipsoid??A0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const m=i.scaleToGeodeticSurface(n[0],wd);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(m,br);Ne.multiplyByScalar(v,o,v),Ne.add(m,v,m)}return[m.x,m.y,m.z]}let a=t.minDistance;if(!vo(a)){const m=t.granularity??yd.RADIANS_PER_DEGREE;a=yd.chordLength(m,i.maximumRadius)}let s=0,l;for(l=0;l<e-1;l++)s+=Dt.numberOfPoints(n[l],n[l+1],a);const u=(s+1)*3,A=new Array(u);let h=0;for(l=0;l<e-1;l++){const m=n[l],v=n[l+1],y=r?o[l]:o,g=r?o[l+1]:o;h=T2(m,v,a,i,y,g,A,h)}vd.length=0;const f=n[e-1],p=i.cartesianToCartographic(f,Ph);p.height=r?o[e-1]:o;const d=i.cartographicToCartesian(p,br);return Ne.pack(d,A,u-3),A};const g0=new bs,F2=new bs;Dt.generateRhumbArc=function(t){vo(t)||(t={});const n=t.positions;if(!vo(n))throw new h0("options.positions is required.");const e=n.length,i=t.ellipsoid??A0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],wd);if(o=r?o[0]:o,o!==0){const g=i.geodeticSurfaceNormal(y,br);Ne.multiplyByScalar(g,o,g),Ne.add(y,g,y)}return[y.x,y.y,y.z]}const a=t.granularity??yd.RADIANS_PER_DEGREE;let s=0,l,u=i.cartesianToCartographic(n[0],g0),A;for(l=0;l<e-1;l++)A=i.cartesianToCartographic(n[l+1],F2),s+=Dt.numberOfPointsRhumbLine(u,A,a),u=bs.clone(A,g0);const h=(s+1)*3,f=new Array(h);let p=0;for(l=0;l<e-1;l++){const y=n[l],g=n[l+1],_=r?o[l]:o,x=r?o[l+1]:o;p=I2(y,g,a,i,_,x,f,p)}vd.length=0;const d=n[e-1],m=i.cartesianToCartographic(d,Ph);m.height=r?o[e-1]:o;const v=i.cartographicToCartesian(m,br);return Ne.pack(v,f,h-3),f},Dt.generateCartesianArc=function(t){const n=Dt.generateArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=Ne.unpack(n,o*3);return i},Dt.generateCartesianRhumbArc=function(t){const n=Dt.generateRhumbArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=Ne.unpack(n,o*3);return i};const Th=w.ArcType,M2=w.Cartesian3,D2=w.Math;function y0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=y2(t.positions,M2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===Th.GEODESIC||n===Th.RHUMB){let s;n===Th.GEODESIC?(s=D2.chordLength(e,i.maximumRadius),Dt.numberOfPoints):(s=e,Dt.numberOfPointsRhumbLine);const l=Dt.extractHeights(r,i);n===Th.GEODESIC?r=Dt.generateCartesianArc({positions:r,minDistance:s,ellipsoid:i,height:l}):r=Dt.generateCartesianRhumbArc({positions:r,granularity:s,ellipsoid:i,height:l})}return r}}function xd(t,n="GEODESIC",e){const o=t.map(c.lbhToXyz).map(h=>w.Cartesian3.fromArray(h));let r;if(e>0&&n!=="NONE"){if(r=y0({arcType:w.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:w.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let a=0;const s=[0],l=r.length;for(let h=1;h<l;++h)a+=w.Cartesian3.distance(r[h-1],r[h]),s.push(a);const u=r.map(h=>c.xyzToLbh([h.x,h.y,h.z]));return{timePosRots:s.map((h,f)=>[s[f],u[f],void 0]),distances:s}}function v0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function _d(t,n){const e=w.Matrix4.clone(w.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:a="YForwardZUp"}=t;if(i){const[s,l,u]=i;w.Transforms.eastNorthUpToFixedFrame(w.Cartesian3.fromDegrees(s,l,u),void 0,e)}if(o){const s=new w.Quaternion;a==="YForwardZUp"?_h(o,s):a==="XForwardZUp"&&$v(o,s);const l=w.Matrix3.fromQuaternion(s);w.Matrix4.multiply(e,w.Matrix4.fromRotationTranslation(l),e)}return r&&w.Matrix4.multiplyByScale(e,oi(r),e),v0(e,n)}const R2=new w.Matrix4;function w0(t,n){const e=w.Matrix4.fromArray(t,0,R2);return w.Matrix4.inverse(e,e),v0(e,n)}const U2=new w.Matrix4,O2=new w.Cartesian3;function b0(t,n,e){const[i,o,r]=n,a=w.Cartesian3.fromDegrees(i,o,r,void 0,O2),s=w.Matrix4.fromArray(t,0,U2),l=w.Matrix4.multiplyByPoint(s,a,a),{x:u,y:A,z:h}=l;return e=e||[0,0,0],e[0]=u,e[1]=A,e[2]=h,e}const L2=new w.Matrix4,z2=new w.Cartesian3,k2=new w.Cartographic;function xr(t,n,e){const[i,o,r]=n,a=w.Cartesian3.fromElements(i,o,r,z2),s=w.Matrix4.fromArray(t,0,L2),l=w.Matrix4.multiplyByPoint(s,a,a),u=w.Cartographic.fromCartesian(l,void 0,k2);return e=e||[0,0,0],e[0]=w.Math.toDegrees(u.longitude),e[1]=w.Math.toDegrees(u.latitude),e[2]=u.height,e}function wn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=_d({position:e,rotation:i,scale:o,initialRotationMode:r}),s=w0(a);return[n.map(u=>b0(s,u)),a,s]}function _r(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=_d({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>xr(a,l)),a]}function x0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=Xe.Cartesian3.fromDegrees(...t[e]),o=Xe.Cartesian3.fromDegrees(...t[e+1]),r=Xe.Cartesian3.fromDegrees(...t[e+2]),a=Xe.Cartesian3.angleBetween(Xe.Cartesian3.subtract(i,o,new Xe.Cartesian3),Xe.Cartesian3.subtract(r,o,new Xe.Cartesian3));n.push(isNaN(a)?0:Xe.Math.toDegrees(a))}return n}function Cd(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>De(i)))),t.holes&&t.holes.forEach(i=>{e=Cd(i,e)}),e}function Dn(t){return typeof t=="string"?c.ESSceneObject.context.getStrFromEnv(t):new w.Resource({url:c.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 Sd extends c.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[a,s,l]=c.getReactFuncs(e),[u,A,h]=c.getReactFuncs(i),f=new w.Cartesian3,p=()=>{let d=a();d&&(d=[...d],n.editingHeightOffset&&(d[2]-=n.editingHeightOffset),w.Cartesian3.fromDegrees(...d,void 0,f))};p(),this.dispose(l.disposableOn(p)),this.dispose(r.preUpdate.addEventListener(()=>{if(w.Cartesian3.ZERO.equals(f))return;const d=Ni(r,f,o);d!==void 0?A([d,d,d]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${d??"undefined"}`)}))}}function Q2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:w.Matrix4.toArray(w.Matrix4.IDENTITY);let e,i,o,r;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))r=w.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=w.Cartesian3.add(r,w.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new w.Cartesian3),i=w.Cartesian3.add(r,w.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new w.Cartesian3),o=w.Cartesian3.add(r,w.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new w.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];r=w.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=w.Cartesian3.add(r,w.Cartesian3.fromArray([f,0,0]),new w.Cartesian3),i=w.Cartesian3.add(r,w.Cartesian3.fromArray([0,f,0]),new w.Cartesian3),o=w.Cartesian3.add(r,w.Cartesian3.fromArray([0,0,f]),new w.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let a,s,l,u,A,h;return w.Matrix4.IDENTITY.equals(w.Matrix4.fromArray(n))?(a=De(e),u=De(w.Cartesian3.add(r,w.Cartesian3.subtract(r,e,new w.Cartesian3),new w.Cartesian3)),s=De(i),A=De(w.Cartesian3.add(r,w.Cartesian3.subtract(r,i,new w.Cartesian3),new w.Cartesian3)),l=De(o),h=De(w.Cartesian3.add(r,w.Cartesian3.subtract(r,o,new w.Cartesian3),new w.Cartesian3))):(a=xr(n,[e.x,e.y,e.z]),u=xr(n,[-e.x,-e.y,-e.z]),s=xr(n,[i.x,i.y,i.z]),A=xr(n,[-i.x,-i.y,-i.z]),l=xr(n,[o.x,o.y,o.z]),h=xr(n,[-o.x,-o.y,-o.z])),!a||!u||!s||!A||!l||!h?"无法生成包围盒,请检查包围盒是否正确":[w.Math.toRadians(Math.min(a[0],u[0],s[0],A[0],l[0],h[0])),w.Math.toRadians(Math.min(a[1],u[1],s[1],A[1],l[1],h[1])),w.Math.toRadians(Math.max(a[0],u[0],s[0],A[0],l[0],h[0])),w.Math.toRadians(Math.max(a[1],u[1],s[1],A[1],l[1],h[1])),Math.min(a[2],u[2],s[2],A[2],l[2],h[2]),Math.max(a[2],u[2],s[2],A[2],l[2],h[2])]}const _0=c.createProcessingFromAsyncFunc(async(t,n)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},i={},o=[];if(await c.step(t,async l=>new Promise(async(u,A)=>{for(let h=0;h<n.length;h++){const f=n[h];await fetch(f).then(p=>p.json()).then(p=>{p&&!Reflect.has(p,"success")?i[f]=p:o.push({index:h,url:f,message:p.message}),h==n.length-1&&u()}).catch(p=>{o.push({index:h,url:f,message:p}),h==n.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],a=[],s=[];for(const l in i){const u=i[l];a.push(u.geometricError??u.root.geometricError??0);const A=Q2(u);r.push(A),s.push({content:{uri:l},boundingVolume:{region:A},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...a),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(l=>l[0])),Math.min(...r.map(l=>l[1])),Math.max(...r.map(l=>l[2])),Math.max(...r.map(l=>l[3])),Math.min(...r.map(l=>l[4])),Math.max(...r.map(l=>l[5]))],e.tilesUrl.root.children=s),e});function V2(t){return new Promise((n,e)=>{_0.restart(void 0,t),_0.completeEvent.don(i=>{n(i)})})}class Ed extends c.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(c.react(0)));const[i,o,r]=c.getReactFuncs(e);{const a=()=>{const s=i();if(s){const{center:l,minPos:u,maxPos:A}=c.getMinMaxCorner(s);this._center.value=l,this._radius.value=c.geoDistance(u,A)/2}else this._center.value=void 0};a(),this.dispose(r.disposableOn(a))}}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 C0(t){return new w.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new w.Color(.2,.3,.6,1),blendColor:new w.Color(0,1,.699,1),specularMap:w.Material.DefaultImageId,normalMap:w.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;
@@ -401,7 +401,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
401
401
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b,C=!0,M=!1;return{s:function(){F=F.call(I)},n:function(){var R=F.next();return C=R.done,R},e:function(R){M=!0,b=R},f:function(){try{C||F.return==null||F.return()}finally{if(M)throw b}}}}function u(I,D){(D==null||D>I.length)&&(D=I.length);for(var F=0,S=new Array(D);F<D;F++)S[F]=I[F];return S}function A(I,D){for(var F=0;F<D.length;F++){var S=D[F];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}var h=s(4832).FillLayoutArray,f=s(8669).members,p=s(8500).SegmentVector,d=s(9063).ProgramConfigurationSet,m=s(9631),v=m.LineIndexArray,y=m.TriangleIndexArray,g=s(1438),_=s(9187),x=s(937),E=s(8583),B=s(1786).register,P=function(){function I(S){(function(T,b){if(!(T instanceof b))throw new TypeError("Cannot call a class as a function")})(this,I),this.zoom=S.zoom,this.overscaling=S.overscaling,this.layers=S.layers,this.layerIds=this.layers.map(function(T){return T.id}),this.index=S.index,this.layoutVertexArray=new h,this.indexArray=new y,this.indexArray2=new v,this.programConfigurations=new d(f,S.layers,S.zoom),this.segments=new p,this.segments2=new p}var D,F;return D=I,(F=[{key:"populate",value:function(S,T){var b,C=l(S);try{for(C.s();!(b=C.n()).done;){var M=b.value,R=M.feature,U=M.index,O=M.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},R)){var z=g(R);this.addFeature(R,z),T.featureIndex.insert(R,z,U,O,this.index)}}}catch(k){C.e(k)}finally{C.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(S){this.layoutVertexBuffer=S.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=S.createIndexBuffer(this.indexArray),this.indexBuffer2=S.createIndexBuffer(this.indexArray2),this.programConfigurations.upload(S)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}},{key:"addFeature",value:function(S,T){var b,C=l(x(T,500));try{for(C.s();!(b=C.n()).done;){var M,R=b.value,U=0,O=l(R);try{for(O.s();!(M=O.n()).done;)U+=M.value.length}catch(ce){O.e(ce)}finally{O.f()}var z,k=this.segments.prepareSegment(U,this.layoutVertexArray,this.indexArray),Q=k.vertexLength,N=[],j=[],J=l(R);try{for(J.s();!(z=J.n()).done;){var ee=z.value;if(ee.length!==0){ee!==R[0]&&j.push(N.length/2);var ie=this.segments2.prepareSegment(ee.length,this.layoutVertexArray,this.indexArray2),oe=ie.vertexLength;this.layoutVertexArray.emplaceBack(ee[0].x,ee[0].y),this.indexArray2.emplaceBack(oe+ee.length-1,oe),N.push(ee[0].x),N.push(ee[0].y);for(var ue=1;ue<ee.length;ue++)this.layoutVertexArray.emplaceBack(ee[ue].x,ee[ue].y),this.indexArray2.emplaceBack(oe+ue-1,oe+ue),N.push(ee[ue].x),N.push(ee[ue].y);ie.vertexLength+=ee.length,ie.primitiveLength+=ee.length}}}catch(ce){J.e(ce)}finally{J.f()}var le=_(N,j);E(le.length%3==0);for(var re=0;re<le.length;re+=3)this.indexArray.emplaceBack(Q+le[re],Q+le[re+1],Q+le[re+2]);k.vertexLength+=U,k.primitiveLength+=le.length/3}}catch(ce){C.e(ce)}finally{C.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,S)}}])&&A(D.prototype,F),Object.defineProperty(D,"prototype",{writable:!1}),I}();B("FillBucket",P,{omit:["layers"]}),r.exports=P},163:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4)},8294:function(r,a,s){function l(T,b){var C=typeof Symbol<"u"&&T[Symbol.iterator]||T["@@iterator"];if(!C){if(Array.isArray(T)||(C=function(k,Q){if(k){if(typeof k=="string")return u(k,Q);var N=Object.prototype.toString.call(k).slice(8,-1);return N==="Object"&&k.constructor&&(N=k.constructor.name),N==="Map"||N==="Set"?Array.from(k):N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N)?u(k,Q):void 0}}(T))||b){C&&(T=C);var M=0,R=function(){};return{s:R,n:function(){return M>=T.length?{done:!0}:{done:!1,value:T[M++]}},e:function(k){throw k},f:R}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
402
402
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U,O=!0,z=!1;return{s:function(){C=C.call(T)},n:function(){var k=C.next();return O=k.done,k},e:function(k){z=!0,U=k},f:function(){try{O||C.return==null||C.return()}finally{if(z)throw U}}}}function u(T,b){(b==null||b>T.length)&&(b=T.length);for(var C=0,M=new Array(b);C<b;C++)M[C]=T[C];return M}function A(T,b){for(var C=0;C<b.length;C++){var M=b[C];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(T,M.key,M)}}var h=s(4832).FillExtrusionLayoutArray,f=s(163).members,p=s(8500),d=p.SegmentVector,m=p.MAX_VERTEX_ARRAY_LENGTH,v=s(9063).ProgramConfigurationSet,y=s(9631).TriangleIndexArray,g=s(1438),_=s(900),x=s(9187),E=s(937),B=s(8583),P=s(1786).register,I=Math.pow(2,13);function D(T,b,C,M,R,U,O,z){T.emplaceBack(b,C,2*Math.floor(M*I)+O,R*I*2,U*I*2,Math.round(z))}var F=function(){function T(M){(function(R,U){if(!(R instanceof U))throw new TypeError("Cannot call a class as a function")})(this,T),this.zoom=M.zoom,this.overscaling=M.overscaling,this.layers=M.layers,this.layerIds=this.layers.map(function(R){return R.id}),this.index=M.index,this.layoutVertexArray=new h,this.indexArray=new y,this.programConfigurations=new v(f,M.layers,M.zoom),this.segments=new d}var b,C;return b=T,(C=[{key:"populate",value:function(M,R){var U,O=l(M);try{for(O.s();!(U=O.n()).done;){var z=U.value,k=z.feature,Q=z.index,N=z.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},k)){var j=g(k);this.addFeature(k,j),R.featureIndex.insert(k,j,Q,N,this.index)}}}catch(J){O.e(J)}finally{O.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(M){this.layoutVertexBuffer=M.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=M.createIndexBuffer(this.indexArray),this.programConfigurations.upload(M)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(M,R){var U,O,z=l(E(R,500));try{for(z.s();!(U=z.n()).done;){var k,Q=U.value,N=0,j=l(Q);try{for(j.s();!(k=j.n()).done;)N+=k.value.length}catch(ye){j.e(ye)}finally{j.f()}var J,ee=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),ie=l(Q);try{for(ie.s();!(J=ie.n()).done;){var oe=J.value;if(oe.length!==0&&!((O=oe).every(function(ye){return ye.x<0})||O.every(function(ye){return ye.x>_})||O.every(function(ye){return ye.y<0})||O.every(function(ye){return ye.y>_})))for(var ue=0,le=0;le<oe.length;le++){var re=oe[le];if(le>=1){var ce=oe[le-1];if(!S(re,ce)){ee.vertexLength+4>m&&(ee=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var $=re.sub(ce)._perp()._unit(),q=ce.dist(re);ue+q>32768&&(ue=0),D(this.layoutVertexArray,re.x,re.y,$.x,$.y,0,0,ue),D(this.layoutVertexArray,re.x,re.y,$.x,$.y,0,1,ue),ue+=q,D(this.layoutVertexArray,ce.x,ce.y,$.x,$.y,0,0,ue),D(this.layoutVertexArray,ce.x,ce.y,$.x,$.y,0,1,ue);var G=ee.vertexLength;this.indexArray.emplaceBack(G,G+1,G+2),this.indexArray.emplaceBack(G+1,G+2,G+3),ee.vertexLength+=4,ee.primitiveLength+=2}}}}}catch(ye){ie.e(ye)}finally{ie.f()}ee.vertexLength+N>m&&(ee=this.segments.prepareSegment(N,this.layoutVertexArray,this.indexArray));var Z,K=[],W=[],H=ee.vertexLength,X=l(Q);try{for(X.s();!(Z=X.n()).done;){var Y=Z.value;if(Y.length!==0){Y!==Q[0]&&W.push(K.length/2);for(var se=0;se<Y.length;se++){var Ae=Y[se];D(this.layoutVertexArray,Ae.x,Ae.y,0,0,1,1,0),K.push(Ae.x),K.push(Ae.y)}}}}catch(ye){X.e(ye)}finally{X.f()}var fe=x(K,W);B(fe.length%3==0);for(var pe=0;pe<fe.length;pe+=3)this.indexArray.emplaceBack(H+fe[pe],H+fe[pe+1],H+fe[pe+2]);ee.primitiveLength+=fe.length/3,ee.vertexLength+=N}}catch(ye){z.e(ye)}finally{z.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,M)}}])&&A(b.prototype,C),Object.defineProperty(b,"prototype",{writable:!1}),T}();function S(T,b){return T.x===b.x&&(T.x<0||T.x>_)||T.y===b.y&&(T.y<0||T.y>_)}P("FillExtrusionBucket",F,{omit:["layers"]}),r.exports=F},7832:function(r,a,s){function l(v){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},l(v)}function u(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function A(v,y){return A=Object.setPrototypeOf||function(g,_){return g.__proto__=_,g},A(v,y)}function h(v,y){if(y&&(l(y)==="object"||typeof y=="function"))return y;if(y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(v)}function f(v){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},f(v)}var p=s(6677),d=s(1786).register,m=function(v){(function(B,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(P&&P.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),Object.defineProperty(B,"prototype",{writable:!1}),P&&A(B,P)})(E,v);var y,g,_,x=(g=E,_=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var B,P=f(g);if(_){var I=f(this).constructor;B=Reflect.construct(P,arguments,I)}else B=P.apply(this,arguments);return h(this,B)});function E(){return u(this,E),x.apply(this,arguments)}return y=E,Object.defineProperty(y,"prototype",{writable:!1}),y}(p);d("HeatmapBucket",m,{omit:["layers"]}),r.exports=m},9379:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4)},6905:function(r,a,s){function l(I,D){var F=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!F){if(Array.isArray(I)||(F=function(R,U){if(R){if(typeof R=="string")return u(R,U);var O=Object.prototype.toString.call(R).slice(8,-1);return O==="Object"&&R.constructor&&(O=R.constructor.name),O==="Map"||O==="Set"?Array.from(R):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?u(R,U):void 0}}(I))||D){F&&(I=F);var S=0,T=function(){};return{s:T,n:function(){return S>=I.length?{done:!0}:{done:!1,value:I[S++]}},e:function(R){throw R},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
403
403
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b,C=!0,M=!1;return{s:function(){F=F.call(I)},n:function(){var R=F.next();return C=R.done,R},e:function(R){M=!0,b=R},f:function(){try{C||F.return==null||F.return()}finally{if(M)throw b}}}}function u(I,D){(D==null||D>I.length)&&(D=I.length);for(var F=0,S=new Array(D);F<D;F++)S[F]=I[F];return S}function A(I,D){for(var F=0;F<D.length;F++){var S=D[F];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}var h=s(4832).LineLayoutArray,f=s(9379).members,p=s(8500).SegmentVector,d=s(9063).ProgramConfigurationSet,m=s(9631).TriangleIndexArray,v=s(1438),y=s(900),g=s(8929).VectorTileFeature.types,_=s(1786).register,x=Math.cos(Math.PI/180*37.5),E=Math.pow(2,14)/.5;function B(I,D,F,S,T,b,C){I.emplaceBack(D.x,D.y,S?1:0,T?1:-1,Math.round(63*F.x)+128,Math.round(63*F.y)+128,1+(b===0?0:b<0?-1:1)|(.5*C&63)<<2,.5*C>>6)}var P=function(){function I(S){(function(T,b){if(!(T instanceof b))throw new TypeError("Cannot call a class as a function")})(this,I),this.zoom=S.zoom,this.overscaling=S.overscaling,this.layers=S.layers,this.layerIds=this.layers.map(function(T){return T.id}),this.index=S.index,this.layoutVertexArray=new h,this.indexArray=new m,this.programConfigurations=new d(f,S.layers,S.zoom),this.segments=new p}var D,F;return D=I,(F=[{key:"populate",value:function(S,T){var b,C=l(S);try{for(C.s();!(b=C.n()).done;){var M=b.value,R=M.feature,U=M.index,O=M.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},R)){var z=v(R);this.addFeature(R,z),T.featureIndex.insert(R,z,U,O,this.index)}}}catch(k){C.e(k)}finally{C.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(S){this.layoutVertexBuffer=S.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=S.createIndexBuffer(this.indexArray),this.programConfigurations.upload(S)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(S,T){var b,C=this.layers[0].layout,M=C.get("line-join").evaluate(S),R=C.get("line-cap"),U=C.get("line-miter-limit"),O=C.get("line-round-limit"),z=l(T);try{for(z.s();!(b=z.n()).done;){var k=b.value;this.addLine(k,S,M,R,U,O)}}catch(Q){z.e(Q)}finally{z.f()}}},{key:"addLine",value:function(S,T,b,C,M,R){for(var U=g[T.type]==="Polygon",O=S.length;O>=2&&S[O-1].equals(S[O-2]);)O--;for(var z=0;z<O-1&&S[z].equals(S[z+1]);)z++;if(!(O<(U?3:2))){b==="bevel"&&(M=1.05);var k=y/(512*this.overscaling)*15,Q=S[z],N=this.segments.prepareSegment(10*O,this.layoutVertexArray,this.indexArray);this.distance=0;var j,J,ee,ie=C,oe=U?"butt":C,ue=!0,le=void 0,re=void 0,ce=void 0,$=void 0;this.e1=this.e2=this.e3=-1,U&&(j=S[O-2],$=Q.sub(j)._unit()._perp());for(var q=z;q<O;q++)if(!(re=U&&q===O-1?S[z+1]:S[q+1])||!S[q].equals(re)){$&&(ce=$),j&&(le=j),j=S[q],$=re?re.sub(j)._unit()._perp():ce;var G=(ce=ce||$).add($);G.x===0&&G.y===0||G._unit();var Z=G.x*$.x+G.y*$.y,K=Z!==0?1/Z:1/0,W=Z<x&&le&&re;if(W&&q>z){var H=j.dist(le);if(H>2*k){var X=j.sub(j.sub(le)._mult(k/H)._round());this.distance+=X.dist(le),this.addCurrentVertex(X,this.distance,ce.mult(1),0,0,!1,N),le=X}}var Y=le&&re,se=Y?b:re?ie:oe;if(Y&&se==="round"&&(K<R?se="miter":K<=2&&(se="fakeround")),se==="miter"&&K>M&&(se="bevel"),se==="bevel"&&(K>2&&(se="flipbevel"),K<M&&(se="miter")),le&&(this.distance+=j.dist(le)),se==="miter")G._mult(K),this.addCurrentVertex(j,this.distance,G,0,0,!1,N);else if(se==="flipbevel"){if(K>100)G=$.clone().mult(-1);else{var Ae=ce.x*$.y-ce.y*$.x>0?-1:1,fe=K*ce.add($).mag()/ce.sub($).mag();G._perp()._mult(fe*Ae)}this.addCurrentVertex(j,this.distance,G,0,0,!1,N),this.addCurrentVertex(j,this.distance,G.mult(-1),0,0,!1,N)}else if(se==="bevel"||se==="fakeround"){var pe=ce.x*$.y-ce.y*$.x>0,ye=-Math.sqrt(K*K-1);if(pe?(ee=0,J=ye):(J=0,ee=ye),ue||this.addCurrentVertex(j,this.distance,ce,J,ee,!1,N),se==="fakeround"){for(var Ce=Math.floor(8*(.5-(Z-.5))),Se=void 0,Ue=0;Ue<Ce;Ue++)Se=$.mult((Ue+1)/(Ce+1))._add(ce)._unit(),this.addPieSliceVertex(j,this.distance,Se,pe,N);this.addPieSliceVertex(j,this.distance,G,pe,N);for(var Ie=Ce-1;Ie>=0;Ie--)Se=ce.mult((Ie+1)/(Ce+1))._add($)._unit(),this.addPieSliceVertex(j,this.distance,Se,pe,N)}re&&this.addCurrentVertex(j,this.distance,$,-J,-ee,!1,N)}else se==="butt"?(ue||this.addCurrentVertex(j,this.distance,ce,0,0,!1,N),re&&this.addCurrentVertex(j,this.distance,$,0,0,!1,N)):se==="square"?(ue||(this.addCurrentVertex(j,this.distance,ce,1,1,!1,N),this.e1=this.e2=-1),re&&this.addCurrentVertex(j,this.distance,$,-1,-1,!1,N)):se==="round"&&(ue||(this.addCurrentVertex(j,this.distance,ce,0,0,!1,N),this.addCurrentVertex(j,this.distance,ce,1,1,!0,N),this.e1=this.e2=-1),re&&(this.addCurrentVertex(j,this.distance,$,-1,-1,!0,N),this.addCurrentVertex(j,this.distance,$,0,0,!1,N)));if(W&&q<O-1){var Le=j.dist(re);if(Le>2*k){var je=j.add(re.sub(j)._mult(k/Le)._round());this.distance+=je.dist(j),this.addCurrentVertex(je,this.distance,$.mult(1),0,0,!1,N),j=je}}ue=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,T)}}},{key:"addCurrentVertex",value:function(S,T,b,C,M,R,U){var O,z=this.layoutVertexArray,k=this.indexArray;O=b.clone(),C&&O._sub(b.perp()._mult(C)),B(z,S,O,R,!1,C,T),this.e3=U.vertexLength++,this.e1>=0&&this.e2>=0&&(k.emplaceBack(this.e1,this.e2,this.e3),U.primitiveLength++),this.e1=this.e2,this.e2=this.e3,O=b.mult(-1),M&&O._sub(b.perp()._mult(M)),B(z,S,O,R,!0,-M,T),this.e3=U.vertexLength++,this.e1>=0&&this.e2>=0&&(k.emplaceBack(this.e1,this.e2,this.e3),U.primitiveLength++),this.e1=this.e2,this.e2=this.e3,T>E/2&&(this.distance=0,this.addCurrentVertex(S,this.distance,b,C,M,R,U))}},{key:"addPieSliceVertex",value:function(S,T,b,C,M){b=b.mult(C?-1:1);var R=this.layoutVertexArray,U=this.indexArray;B(R,S,b,!1,C,0,T),this.e3=M.vertexLength++,this.e1>=0&&this.e2>=0&&(U.emplaceBack(this.e1,this.e2,this.e3),M.primitiveLength++),C?this.e2=this.e3:this.e1=this.e3}}])&&A(D.prototype,F),Object.defineProperty(D,"prototype",{writable:!1}),I}();_("LineBucket",P,{omit:["layers"]}),r.exports=P},1203:function(r,a,s){var l=s(6693).createLayout,u={symbolLayoutAttributes:l([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),dynamicLayoutAttributes:l([{name:"a_projected_pos",components:3,type:"Float32"}],4),placementOpacityAttributes:l([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),collisionVertexAttributes:l([{name:"a_placed",components:2,type:"Uint8"}],4),collisionBox:l([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),collisionBoxLayout:l([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),collisionCircleLayout:l([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),placement:l([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),glyphOffset:l([{type:"Float32",name:"offsetX"}]),lineVertex:l([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}])};r.exports=u},5571:function(r,a,s){function l(q,G){var Z=typeof Symbol<"u"&&q[Symbol.iterator]||q["@@iterator"];if(!Z){if(Array.isArray(q)||(Z=function(se,Ae){if(se){if(typeof se=="string")return u(se,Ae);var fe=Object.prototype.toString.call(se).slice(8,-1);return fe==="Object"&&se.constructor&&(fe=se.constructor.name),fe==="Map"||fe==="Set"?Array.from(se):fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe)?u(se,Ae):void 0}}(q))||G){Z&&(q=Z);var K=0,W=function(){};return{s:W,n:function(){return K>=q.length?{done:!0}:{done:!1,value:q[K++]}},e:function(se){throw se},f:W}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
404
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,X=!0,Y=!1;return{s:function(){Z=Z.call(q)},n:function(){var se=Z.next();return X=se.done,se},e:function(se){Y=!0,H=se},f:function(){try{X||Z.return==null||Z.return()}finally{if(Y)throw H}}}}function u(q,G){(G==null||G>q.length)&&(G=q.length);for(var Z=0,K=new Array(G);Z<G;Z++)K[Z]=q[Z];return K}function A(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function h(q,G){for(var Z=0;Z<G.length;Z++){var K=G[Z];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(q,K.key,K)}}function f(q,G,Z){return G&&h(q.prototype,G),Object.defineProperty(q,"prototype",{writable:!1}),q}var p=s(1203),d=p.symbolLayoutAttributes,m=p.collisionVertexAttributes,v=p.collisionBoxLayout,y=p.collisionCircleLayout,g=p.dynamicLayoutAttributes,_=s(4832),x=_.SymbolLayoutArray,E=_.SymbolDynamicLayoutArray,B=_.SymbolOpacityArray,P=_.CollisionBoxLayoutArray,I=_.CollisionCircleLayoutArray,D=_.CollisionVertexArray,F=_.PlacedSymbolArray,S=_.GlyphOffsetArray,T=_.SymbolLineVertexArray,b=s(5550),C=s(8500).SegmentVector,M=s(9063).ProgramConfigurationSet,R=s(9631),U=R.TriangleIndexArray,O=R.LineIndexArray,z=s(1447),k=s(8376),Q=s(6584),N=s(1438),j=s(8929).VectorTileFeature.types,J=s(7899),ee=(s(1397),s(724).getSizeData),ie=s(1786).register,oe=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ue(q,G,Z,K,W,H,X,Y){q.emplaceBack(G,Z,Math.round(64*K),Math.round(64*W),H,X,Y?Y[0]:0,Y?Y[1]:0)}function le(q,G,Z){q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z)}var re=function(){function q(G){A(this,q),this.layoutVertexArray=new x,this.indexArray=new U,this.programConfigurations=G,this.segments=new C,this.dynamicLayoutVertexArray=new E,this.opacityVertexArray=new B,this.placedSymbolArray=new F}return f(q,[{key:"upload",value:function(G,Z){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,d.members),this.indexBuffer=G.createIndexBuffer(this.indexArray,Z),this.programConfigurations.upload(G),this.dynamicLayoutVertexBuffer=G.createVertexBuffer(this.dynamicLayoutVertexArray,g.members,!0),this.opacityVertexBuffer=G.createVertexBuffer(this.opacityVertexArray,oe,!0),this.opacityVertexBuffer.itemSize=1}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}]),q}();ie("SymbolBuffers",re);var ce=function(){function q(G,Z,K){A(this,q),this.layoutVertexArray=new G,this.layoutAttributes=Z,this.indexArray=new K,this.segments=new C,this.collisionVertexArray=new D}return f(q,[{key:"upload",value:function(G){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=G.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=G.createVertexBuffer(this.collisionVertexArray,m.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),q}();ie("CollisionBuffers",ce);var $=function(){function q(G){A(this,q),this.collisionBoxArray=G.collisionBoxArray,this.zoom=G.zoom,this.overscaling=G.overscaling,this.layers=G.layers,this.layerIds=this.layers.map(function(W){return W.id}),this.index=G.index,this.pixelRatio=G.pixelRatio;var Z=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ee(this.zoom,Z["text-size"]),this.iconSizeData=ee(this.zoom,Z["icon-size"]);var K=this.layers[0].layout;this.sortFeaturesByY=K.get("text-allow-overlap")||K.get("icon-allow-overlap")||K.get("text-ignore-placement")||K.get("icon-ignore-placement")}return f(q,[{key:"createArrays",value:function(){this.text=new re(new M(d.members,this.layers,this.zoom,function(G){return/^text/.test(G)})),this.icon=new re(new M(d.members,this.layers,this.zoom,function(G){return/^icon/.test(G)})),this.collisionBox=new ce(P,v.members,O),this.collisionCircle=new ce(I,y.members,U),this.glyphOffsetArray=new S,this.lineVertexArray=new T}},{key:"populate",value:function(G,Z){var K=this.layers[0],W=K.layout,H=W.get("text-font"),X=W.get("text-field"),Y=W.get("icon-image"),se=(X.value.kind!=="constant"||X.value.value.length>0)&&(H.value.kind!=="constant"||H.value.value.length>0),Ae=Y.value.kind!=="constant"||Y.value.value&&Y.value.value.length>0;if(this.features=[],se||Ae){var fe,pe=Z.iconDependencies,ye=Z.glyphDependencies,Ce={zoom:this.zoom},Se=l(G);try{for(Se.s();!(fe=Se.n()).done;){var Ue=fe.value,Ie=Ue.feature,Le=Ue.index,je=Ue.sourceLayerIndex;if(K._featureFilter(Ce,Ie)){var Oe=void 0;se&&(Oe=K.getValueAndResolveTokens("text-field",Ie),Oe=z(Oe,K,Ie));var dt=void 0;if(Ae&&(dt=K.getValueAndResolveTokens("icon-image",Ie)),Oe||dt){var Tt={text:Oe,icon:dt,index:Le,sourceLayerIndex:je,geometry:N(Ie),properties:Ie.properties,type:j[Ie.type]};if(Ie.id!==void 0&&(Tt.id=Ie.id),this.features.push(Tt),dt&&(pe[dt]=!0),Oe){for(var it=H.evaluate(Ie).join(","),gn=ye[it]=ye[it]||{},At=W.get("text-rotation-alignment")==="map"&&W.get("symbol-placement")==="line",Vi=Q.allowsVerticalWritingMode(Oe),mi=0;mi<Oe.length;mi++)if(gn[Oe.charCodeAt(mi)]=!0,At&&Vi){var mr=J.lookup[Oe.charAt(mi)];mr&&(gn[mr.charCodeAt(0)]=!0)}}}}}}catch(z7){Se.e(z7)}finally{Se.f()}W.get("symbol-placement")==="line"&&(this.features=k(this.features))}}},{key:"isEmpty",value:function(){return this.symbolInstances.length===0}},{key:"upload",value:function(G){this.text.upload(G,this.sortFeaturesByY),this.icon.upload(G,this.sortFeaturesByY),this.collisionBox.upload(G),this.collisionCircle.upload(G)}},{key:"destroy",value:function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()}},{key:"addToLineVertexArray",value:function(G,Z){var K=this.lineVertexArray.length;if(G.segment!==void 0){for(var W=G.dist(Z[G.segment+1]),H=G.dist(Z[G.segment]),X={},Y=G.segment+1;Y<Z.length;Y++)X[Y]={x:Z[Y].x,y:Z[Y].y,tileUnitDistanceFromAnchor:W},Y<Z.length-1&&(W+=Z[Y+1].dist(Z[Y]));for(var se=G.segment||0;se>=0;se--)X[se]={x:Z[se].x,y:Z[se].y,tileUnitDistanceFromAnchor:H},se>0&&(H+=Z[se-1].dist(Z[se]));for(var Ae=0;Ae<Z.length;Ae++){var fe=X[Ae];this.lineVertexArray.emplaceBack(fe.x,fe.y,fe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:K,lineLength:this.lineVertexArray.length-K}}},{key:"addSymbols",value:function(G,Z,K,W,H,X,Y,se,Ae,fe){var pe,ye=G.indexArray,Ce=G.layoutVertexArray,Se=G.dynamicLayoutVertexArray,Ue=G.segments.prepareSegment(4*Z.length,G.layoutVertexArray,G.indexArray),Ie=this.glyphOffsetArray.length,Le=Ue.vertexLength,je=l(Z);try{for(je.s();!(pe=je.n()).done;){var Oe=pe.value,dt=Oe.tl,Tt=Oe.tr,it=Oe.bl,gn=Oe.br,At=Oe.tex,Vi=Ue.vertexLength,mi=Oe.glyphOffset[1];ue(Ce,se.x,se.y,dt.x,mi+dt.y,At.x,At.y,K),ue(Ce,se.x,se.y,Tt.x,mi+Tt.y,At.x+At.w,At.y,K),ue(Ce,se.x,se.y,it.x,mi+it.y,At.x,At.y+At.h,K),ue(Ce,se.x,se.y,gn.x,mi+gn.y,At.x+At.w,At.y+At.h,K),le(Se,se,0),ye.emplaceBack(Vi,Vi+1,Vi+2),ye.emplaceBack(Vi+1,Vi+2,Vi+3),Ue.vertexLength+=4,Ue.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oe.glyphOffset[0])}}catch(mr){je.e(mr)}finally{je.f()}G.placedSymbolArray.emplaceBack(se.x,se.y,Ie,this.glyphOffsetArray.length-Ie,Le,Ae,fe,se.segment,K?K[0]:0,K?K[1]:0,W[0],W[1],Y,!1),G.programConfigurations.populatePaintArrays(G.layoutVertexArray.length,X)}},{key:"_addCollisionDebugVertex",value:function(G,Z,K,W,H){return Z.emplaceBack(0,0),G.emplaceBack(K.x,K.y,W.x,W.y,Math.round(H.x),Math.round(H.y))}},{key:"addCollisionDebugVertices",value:function(G,Z,K,W,H,X,Y,se){var Ae=H.segments.prepareSegment(4,H.layoutVertexArray,H.indexArray),fe=Ae.vertexLength,pe=H.layoutVertexArray,ye=H.collisionVertexArray;if(this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new b(G,Z)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new b(K,Z)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new b(K,W)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new b(G,W)),Ae.vertexLength+=4,se){var Ce=H.indexArray;Ce.emplaceBack(fe,fe+1,fe+2),Ce.emplaceBack(fe,fe+2,fe+3),Ae.primitiveLength+=2}else{var Se=H.indexArray;Se.emplaceBack(fe,fe+1),Se.emplaceBack(fe+1,fe+2),Se.emplaceBack(fe+2,fe+3),Se.emplaceBack(fe+3,fe),Ae.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var G,Z=l(this.symbolInstances);try{for(Z.s();!(G=Z.n()).done;){var K=G.value;K.textCollisionFeature={boxStartIndex:K.textBoxStartIndex,boxEndIndex:K.textBoxEndIndex},K.iconCollisionFeature={boxStartIndex:K.iconBoxStartIndex,boxEndIndex:K.iconBoxEndIndex};for(var W=0;W<2;W++){var H=K[W===0?"textCollisionFeature":"iconCollisionFeature"];if(H)for(var X=H.boxStartIndex;X<H.boxEndIndex;X++){var Y=this.collisionBoxArray.get(X),se=Y.x1,Ae=Y.y1,fe=Y.x2,pe=Y.y2,ye=Y.radius>0;this.addCollisionDebugVertices(se,Ae,fe,pe,ye?this.collisionCircle:this.collisionBox,Y.anchorPoint,K,ye)}}}}catch(Ce){Z.e(Ce)}finally{Z.f()}}},{key:"deserializeCollisionBoxes",value:function(G,Z,K,W,H){for(var X={},Y=Z;Y<K;Y++){var se=G.get(Y);if(se.radius===0){X.textBox={x1:se.x1,y1:se.y1,x2:se.x2,y2:se.y2,anchorPointX:se.anchorPointX,anchorPointY:se.anchorPointY};break}X.textCircles||(X.textCircles=[]),X.textCircles.push(se.anchorPointX,se.anchorPointY,se.radius,se.signedDistanceFromAnchor,1)}for(var Ae=W;Ae<H;Ae++){var fe=G.get(Ae);if(fe.radius===0){X.iconBox={x1:fe.x1,y1:fe.y1,x2:fe.x2,y2:fe.y2,anchorPointX:fe.anchorPointX,anchorPointY:fe.anchorPointY};break}}return X}},{key:"hasTextData",value:function(){return this.text.segments.get().length>0}},{key:"hasIconData",value:function(){return this.icon.segments.get().length>0}},{key:"hasCollisionBoxData",value:function(){return this.collisionBox.segments.get().length>0}},{key:"hasCollisionCircleData",value:function(){return this.collisionCircle.segments.get().length>0}},{key:"sortFeatures",value:function(G){var Z=this;if(this.sortFeaturesByY&&this.sortedAngle!==G&&(this.sortedAngle=G,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var K=[],W=0;W<this.symbolInstances.length;W++)K.push(W);var H=Math.sin(G),X=Math.cos(G);K.sort(function(je,Oe){var dt=Z.symbolInstances[je],Tt=Z.symbolInstances[Oe];return(H*dt.anchor.x+X*dt.anchor.y|0)-(H*Tt.anchor.x+X*Tt.anchor.y|0)||Tt.featureIndex-dt.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var Y=0,se=K;Y<se.length;Y++){var Ae,fe=se[Y],pe=l(this.symbolInstances[fe].placedTextSymbolIndices);try{for(pe.s();!(Ae=pe.n()).done;)for(var ye=Ae.value,Ce=this.text.placedSymbolArray.get(ye),Se=Ce.vertexStartIndex+4*Ce.numGlyphs,Ue=Ce.vertexStartIndex;Ue<Se;Ue+=4)this.text.indexArray.emplaceBack(Ue,Ue+1,Ue+2),this.text.indexArray.emplaceBack(Ue+1,Ue+2,Ue+3)}catch(je){pe.e(je)}finally{pe.f()}var Ie=this.icon.placedSymbolArray.get(fe);if(Ie.numGlyphs){var Le=Ie.vertexStartIndex;this.icon.indexArray.emplaceBack(Le,Le+1,Le+2),this.icon.indexArray.emplaceBack(Le+1,Le+2,Le+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),q}();ie("SymbolBucket",$,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),$.MAX_GLYPHS=65535,$.addDynamicAttributes=le,r.exports=$},900:function(r){r.exports=8192},5346:function(r,a,s){function l(I,D){var F=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!F){if(Array.isArray(I)||(F=function(R,U){if(R){if(typeof R=="string")return u(R,U);var O=Object.prototype.toString.call(R).slice(8,-1);return O==="Object"&&R.constructor&&(O=R.constructor.name),O==="Map"||O==="Set"?Array.from(R):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?u(R,U):void 0}}(I))||D){F&&(I=F);var S=0,T=function(){};return{s:T,n:function(){return S>=I.length?{done:!0}:{done:!1,value:I[S++]}},e:function(R){throw R},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
404
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,X=!0,Y=!1;return{s:function(){Z=Z.call(q)},n:function(){var se=Z.next();return X=se.done,se},e:function(se){Y=!0,H=se},f:function(){try{X||Z.return==null||Z.return()}finally{if(Y)throw H}}}}function u(q,G){(G==null||G>q.length)&&(G=q.length);for(var Z=0,K=new Array(G);Z<G;Z++)K[Z]=q[Z];return K}function A(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function h(q,G){for(var Z=0;Z<G.length;Z++){var K=G[Z];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(q,K.key,K)}}function f(q,G,Z){return G&&h(q.prototype,G),Object.defineProperty(q,"prototype",{writable:!1}),q}var p=s(1203),d=p.symbolLayoutAttributes,m=p.collisionVertexAttributes,v=p.collisionBoxLayout,y=p.collisionCircleLayout,g=p.dynamicLayoutAttributes,_=s(4832),x=_.SymbolLayoutArray,E=_.SymbolDynamicLayoutArray,B=_.SymbolOpacityArray,P=_.CollisionBoxLayoutArray,I=_.CollisionCircleLayoutArray,D=_.CollisionVertexArray,F=_.PlacedSymbolArray,S=_.GlyphOffsetArray,T=_.SymbolLineVertexArray,b=s(5550),C=s(8500).SegmentVector,M=s(9063).ProgramConfigurationSet,R=s(9631),U=R.TriangleIndexArray,O=R.LineIndexArray,z=s(1447),k=s(8376),Q=s(6584),N=s(1438),j=s(8929).VectorTileFeature.types,J=s(7899),ee=(s(1397),s(724).getSizeData),ie=s(1786).register,oe=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ue(q,G,Z,K,W,H,X,Y){q.emplaceBack(G,Z,Math.round(64*K),Math.round(64*W),H,X,Y?Y[0]:0,Y?Y[1]:0)}function le(q,G,Z){q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z)}var re=function(){function q(G){A(this,q),this.layoutVertexArray=new x,this.indexArray=new U,this.programConfigurations=G,this.segments=new C,this.dynamicLayoutVertexArray=new E,this.opacityVertexArray=new B,this.placedSymbolArray=new F}return f(q,[{key:"upload",value:function(G,Z){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,d.members),this.indexBuffer=G.createIndexBuffer(this.indexArray,Z),this.programConfigurations.upload(G),this.dynamicLayoutVertexBuffer=G.createVertexBuffer(this.dynamicLayoutVertexArray,g.members,!0),this.opacityVertexBuffer=G.createVertexBuffer(this.opacityVertexArray,oe,!0),this.opacityVertexBuffer.itemSize=1}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}]),q}();ie("SymbolBuffers",re);var ce=function(){function q(G,Z,K){A(this,q),this.layoutVertexArray=new G,this.layoutAttributes=Z,this.indexArray=new K,this.segments=new C,this.collisionVertexArray=new D}return f(q,[{key:"upload",value:function(G){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=G.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=G.createVertexBuffer(this.collisionVertexArray,m.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),q}();ie("CollisionBuffers",ce);var $=function(){function q(G){A(this,q),this.collisionBoxArray=G.collisionBoxArray,this.zoom=G.zoom,this.overscaling=G.overscaling,this.layers=G.layers,this.layerIds=this.layers.map(function(W){return W.id}),this.index=G.index,this.pixelRatio=G.pixelRatio;var Z=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ee(this.zoom,Z["text-size"]),this.iconSizeData=ee(this.zoom,Z["icon-size"]);var K=this.layers[0].layout;this.sortFeaturesByY=K.get("text-allow-overlap")||K.get("icon-allow-overlap")||K.get("text-ignore-placement")||K.get("icon-ignore-placement")}return f(q,[{key:"createArrays",value:function(){this.text=new re(new M(d.members,this.layers,this.zoom,function(G){return/^text/.test(G)})),this.icon=new re(new M(d.members,this.layers,this.zoom,function(G){return/^icon/.test(G)})),this.collisionBox=new ce(P,v.members,O),this.collisionCircle=new ce(I,y.members,U),this.glyphOffsetArray=new S,this.lineVertexArray=new T}},{key:"populate",value:function(G,Z){var K=this.layers[0],W=K.layout,H=W.get("text-font"),X=W.get("text-field"),Y=W.get("icon-image"),se=(X.value.kind!=="constant"||X.value.value.length>0)&&(H.value.kind!=="constant"||H.value.value.length>0),Ae=Y.value.kind!=="constant"||Y.value.value&&Y.value.value.length>0;if(this.features=[],se||Ae){var fe,pe=Z.iconDependencies,ye=Z.glyphDependencies,Ce={zoom:this.zoom},Se=l(G);try{for(Se.s();!(fe=Se.n()).done;){var Ue=fe.value,Ie=Ue.feature,Le=Ue.index,je=Ue.sourceLayerIndex;if(K._featureFilter(Ce,Ie)){var Oe=void 0;se&&(Oe=K.getValueAndResolveTokens("text-field",Ie),Oe=z(Oe,K,Ie));var dt=void 0;if(Ae&&(dt=K.getValueAndResolveTokens("icon-image",Ie)),Oe||dt){var Tt={text:Oe,icon:dt,index:Le,sourceLayerIndex:je,geometry:N(Ie),properties:Ie.properties,type:j[Ie.type]};if(Ie.id!==void 0&&(Tt.id=Ie.id),this.features.push(Tt),dt&&(pe[dt]=!0),Oe){for(var it=H.evaluate(Ie).join(","),gn=ye[it]=ye[it]||{},At=W.get("text-rotation-alignment")==="map"&&W.get("symbol-placement")==="line",Vi=Q.allowsVerticalWritingMode(Oe),mi=0;mi<Oe.length;mi++)if(gn[Oe.charCodeAt(mi)]=!0,At&&Vi){var mr=J.lookup[Oe.charAt(mi)];mr&&(gn[mr.charCodeAt(0)]=!0)}}}}}}catch(k7){Se.e(k7)}finally{Se.f()}W.get("symbol-placement")==="line"&&(this.features=k(this.features))}}},{key:"isEmpty",value:function(){return this.symbolInstances.length===0}},{key:"upload",value:function(G){this.text.upload(G,this.sortFeaturesByY),this.icon.upload(G,this.sortFeaturesByY),this.collisionBox.upload(G),this.collisionCircle.upload(G)}},{key:"destroy",value:function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()}},{key:"addToLineVertexArray",value:function(G,Z){var K=this.lineVertexArray.length;if(G.segment!==void 0){for(var W=G.dist(Z[G.segment+1]),H=G.dist(Z[G.segment]),X={},Y=G.segment+1;Y<Z.length;Y++)X[Y]={x:Z[Y].x,y:Z[Y].y,tileUnitDistanceFromAnchor:W},Y<Z.length-1&&(W+=Z[Y+1].dist(Z[Y]));for(var se=G.segment||0;se>=0;se--)X[se]={x:Z[se].x,y:Z[se].y,tileUnitDistanceFromAnchor:H},se>0&&(H+=Z[se-1].dist(Z[se]));for(var Ae=0;Ae<Z.length;Ae++){var fe=X[Ae];this.lineVertexArray.emplaceBack(fe.x,fe.y,fe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:K,lineLength:this.lineVertexArray.length-K}}},{key:"addSymbols",value:function(G,Z,K,W,H,X,Y,se,Ae,fe){var pe,ye=G.indexArray,Ce=G.layoutVertexArray,Se=G.dynamicLayoutVertexArray,Ue=G.segments.prepareSegment(4*Z.length,G.layoutVertexArray,G.indexArray),Ie=this.glyphOffsetArray.length,Le=Ue.vertexLength,je=l(Z);try{for(je.s();!(pe=je.n()).done;){var Oe=pe.value,dt=Oe.tl,Tt=Oe.tr,it=Oe.bl,gn=Oe.br,At=Oe.tex,Vi=Ue.vertexLength,mi=Oe.glyphOffset[1];ue(Ce,se.x,se.y,dt.x,mi+dt.y,At.x,At.y,K),ue(Ce,se.x,se.y,Tt.x,mi+Tt.y,At.x+At.w,At.y,K),ue(Ce,se.x,se.y,it.x,mi+it.y,At.x,At.y+At.h,K),ue(Ce,se.x,se.y,gn.x,mi+gn.y,At.x+At.w,At.y+At.h,K),le(Se,se,0),ye.emplaceBack(Vi,Vi+1,Vi+2),ye.emplaceBack(Vi+1,Vi+2,Vi+3),Ue.vertexLength+=4,Ue.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oe.glyphOffset[0])}}catch(mr){je.e(mr)}finally{je.f()}G.placedSymbolArray.emplaceBack(se.x,se.y,Ie,this.glyphOffsetArray.length-Ie,Le,Ae,fe,se.segment,K?K[0]:0,K?K[1]:0,W[0],W[1],Y,!1),G.programConfigurations.populatePaintArrays(G.layoutVertexArray.length,X)}},{key:"_addCollisionDebugVertex",value:function(G,Z,K,W,H){return Z.emplaceBack(0,0),G.emplaceBack(K.x,K.y,W.x,W.y,Math.round(H.x),Math.round(H.y))}},{key:"addCollisionDebugVertices",value:function(G,Z,K,W,H,X,Y,se){var Ae=H.segments.prepareSegment(4,H.layoutVertexArray,H.indexArray),fe=Ae.vertexLength,pe=H.layoutVertexArray,ye=H.collisionVertexArray;if(this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new b(G,Z)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new b(K,Z)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new b(K,W)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new b(G,W)),Ae.vertexLength+=4,se){var Ce=H.indexArray;Ce.emplaceBack(fe,fe+1,fe+2),Ce.emplaceBack(fe,fe+2,fe+3),Ae.primitiveLength+=2}else{var Se=H.indexArray;Se.emplaceBack(fe,fe+1),Se.emplaceBack(fe+1,fe+2),Se.emplaceBack(fe+2,fe+3),Se.emplaceBack(fe+3,fe),Ae.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var G,Z=l(this.symbolInstances);try{for(Z.s();!(G=Z.n()).done;){var K=G.value;K.textCollisionFeature={boxStartIndex:K.textBoxStartIndex,boxEndIndex:K.textBoxEndIndex},K.iconCollisionFeature={boxStartIndex:K.iconBoxStartIndex,boxEndIndex:K.iconBoxEndIndex};for(var W=0;W<2;W++){var H=K[W===0?"textCollisionFeature":"iconCollisionFeature"];if(H)for(var X=H.boxStartIndex;X<H.boxEndIndex;X++){var Y=this.collisionBoxArray.get(X),se=Y.x1,Ae=Y.y1,fe=Y.x2,pe=Y.y2,ye=Y.radius>0;this.addCollisionDebugVertices(se,Ae,fe,pe,ye?this.collisionCircle:this.collisionBox,Y.anchorPoint,K,ye)}}}}catch(Ce){Z.e(Ce)}finally{Z.f()}}},{key:"deserializeCollisionBoxes",value:function(G,Z,K,W,H){for(var X={},Y=Z;Y<K;Y++){var se=G.get(Y);if(se.radius===0){X.textBox={x1:se.x1,y1:se.y1,x2:se.x2,y2:se.y2,anchorPointX:se.anchorPointX,anchorPointY:se.anchorPointY};break}X.textCircles||(X.textCircles=[]),X.textCircles.push(se.anchorPointX,se.anchorPointY,se.radius,se.signedDistanceFromAnchor,1)}for(var Ae=W;Ae<H;Ae++){var fe=G.get(Ae);if(fe.radius===0){X.iconBox={x1:fe.x1,y1:fe.y1,x2:fe.x2,y2:fe.y2,anchorPointX:fe.anchorPointX,anchorPointY:fe.anchorPointY};break}}return X}},{key:"hasTextData",value:function(){return this.text.segments.get().length>0}},{key:"hasIconData",value:function(){return this.icon.segments.get().length>0}},{key:"hasCollisionBoxData",value:function(){return this.collisionBox.segments.get().length>0}},{key:"hasCollisionCircleData",value:function(){return this.collisionCircle.segments.get().length>0}},{key:"sortFeatures",value:function(G){var Z=this;if(this.sortFeaturesByY&&this.sortedAngle!==G&&(this.sortedAngle=G,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var K=[],W=0;W<this.symbolInstances.length;W++)K.push(W);var H=Math.sin(G),X=Math.cos(G);K.sort(function(je,Oe){var dt=Z.symbolInstances[je],Tt=Z.symbolInstances[Oe];return(H*dt.anchor.x+X*dt.anchor.y|0)-(H*Tt.anchor.x+X*Tt.anchor.y|0)||Tt.featureIndex-dt.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var Y=0,se=K;Y<se.length;Y++){var Ae,fe=se[Y],pe=l(this.symbolInstances[fe].placedTextSymbolIndices);try{for(pe.s();!(Ae=pe.n()).done;)for(var ye=Ae.value,Ce=this.text.placedSymbolArray.get(ye),Se=Ce.vertexStartIndex+4*Ce.numGlyphs,Ue=Ce.vertexStartIndex;Ue<Se;Ue+=4)this.text.indexArray.emplaceBack(Ue,Ue+1,Ue+2),this.text.indexArray.emplaceBack(Ue+1,Ue+2,Ue+3)}catch(je){pe.e(je)}finally{pe.f()}var Ie=this.icon.placedSymbolArray.get(fe);if(Ie.numGlyphs){var Le=Ie.vertexStartIndex;this.icon.indexArray.emplaceBack(Le,Le+1,Le+2),this.icon.indexArray.emplaceBack(Le+1,Le+2,Le+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),q}();ie("SymbolBucket",$,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),$.MAX_GLYPHS=65535,$.addDynamicAttributes=le,r.exports=$},900:function(r){r.exports=8192},5346:function(r,a,s){function l(I,D){var F=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!F){if(Array.isArray(I)||(F=function(R,U){if(R){if(typeof R=="string")return u(R,U);var O=Object.prototype.toString.call(R).slice(8,-1);return O==="Object"&&R.constructor&&(O=R.constructor.name),O==="Map"||O==="Set"?Array.from(R):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?u(R,U):void 0}}(I))||D){F&&(I=F);var S=0,T=function(){};return{s:T,n:function(){return S>=I.length?{done:!0}:{done:!1,value:I[S++]}},e:function(R){throw R},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
405
405
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b,C=!0,M=!1;return{s:function(){F=F.call(I)},n:function(){var R=F.next();return C=R.done,R},e:function(R){M=!0,b=R},f:function(){try{C||F.return==null||F.return()}finally{if(M)throw b}}}}function u(I,D){(D==null||D>I.length)&&(D=I.length);for(var F=0,S=new Array(D);F<D;F++)S[F]=I[F];return S}function A(I,D){for(var F=0;F<D.length;F++){var S=D[F];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}s(5550);var h=s(1438),f=s(900),p=s(1693),d=s(1412),m=s(621),v=s(8929),y=s(3614),g=s(3076),_=s(8316).arraysIntersect,x=(s(4792).OverscaledTileID,s(1786).register),E=s(4832).FeatureIndexArray,B=function(){function I(S,T,b,C){(function(M,R){if(!(M instanceof R))throw new TypeError("Cannot call a class as a function")})(this,I),this.tileID=S,this.overscaling=T,this.x=S.canonical.x,this.y=S.canonical.y,this.z=S.canonical.z,this.grid=b||new d(f,16,0),this.featureIndexArray=C||new E}var D,F;return D=I,(F=[{key:"insert",value:function(S,T,b,C,M){var R=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(b,C,M);for(var U=0;U<T.length;U++){for(var O=T[U],z=[1/0,1/0,-1/0,-1/0],k=0;k<O.length;k++){var Q=O[k];z[0]=Math.min(z[0],Q.x),z[1]=Math.min(z[1],Q.y),z[2]=Math.max(z[2],Q.x),z[3]=Math.max(z[3],Q.y)}this.grid.insert(R,z[0],z[1],z[2],z[3])}}},{key:"query",value:function(S,T){this.vtLayers||(this.vtLayers=new v.VectorTile(new y(this.rawTileData)).layers,this.sourceLayerCoder=new m(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));for(var b={},C=S.params||{},M=f/S.tileSize/S.scale,R=p(C.filter),U=S.queryGeometry,O=S.additionalRadius*M,z=1/0,k=1/0,Q=-1/0,N=-1/0,j=0;j<U.length;j++)for(var J=U[j],ee=0;ee<J.length;ee++){var ie=J[ee];z=Math.min(z,ie.x),k=Math.min(k,ie.y),Q=Math.max(Q,ie.x),N=Math.max(N,ie.y)}var oe=this.grid.query(z-O,k-O,Q+O,N+O);oe.sort(P),this.filterMatching(b,oe,this.featureIndexArray,U,R,C.layers,T,S.bearing,M);var ue=S.collisionIndex?S.collisionIndex.queryRenderedSymbols(U,this.tileID,f/S.tileSize,S.collisionBoxArray,S.sourceID,S.bucketInstanceIds):[];return ue.sort(),this.filterMatching(b,ue,S.collisionBoxArray,U,R,C.layers,T,S.bearing,M),b}},{key:"filterMatching",value:function(S,T,b,C,M,R,U,O,z){for(var k,Q=0;Q<T.length;Q++){var N=T[Q];if(N!==k){k=N;var j=b.get(N),J=this.bucketLayerIDs[j.bucketIndex];if(!R||_(R,J)){var ee=this.sourceLayerCoder.decode(j.sourceLayerIndex),ie=this.vtLayers[ee].feature(j.featureIndex);if(M({zoom:this.tileID.overscaledZ},ie))for(var oe=null,ue=0;ue<J.length;ue++){var le=J[ue];if(!(R&&R.indexOf(le)<0)){var re=U[le];if(re&&(re.type==="symbol"||(oe||(oe=h(ie)),re.queryIntersectsFeature(C,ie,oe,this.z,O,z)))){var ce=new g(ie,this.z,this.x,this.y);ce.layer=re.serialize();var $=S[le];$===void 0&&($=S[le]=[]),$.push({featureIndex:N,feature:ce})}}}}}}}},{key:"hasLayer",value:function(S){var T,b=l(this.bucketLayerIDs);try{for(b.s();!(T=b.n()).done;){var C,M=l(T.value);try{for(M.s();!(C=M.n()).done;)if(S===C.value)return!0}catch(R){M.e(R)}finally{M.f()}}}catch(R){b.e(R)}finally{b.f()}return!1}}])&&A(D.prototype,F),Object.defineProperty(D,"prototype",{writable:!1}),I}();function P(I,D){return D-I}x("FeatureIndex",B,{omit:["rawTileData","sourceLayerCoder","collisionIndex"]}),r.exports=B},9631:function(r,a,s){r.exports={LineIndexArray:s(4832).LineIndexArray,TriangleIndexArray:s(4832).TriangleIndexArray}},1438:function(r,a,s){var l=s(8316),u=s(900),A={min:-1*Math.pow(2,15),max:Math.pow(2,15)-1};r.exports=function(h){for(var f=u/h.extent,p=h.loadGeometry(),d=0;d<p.length;d++)for(var m=p[d],v=0;v<m.length;v++){var y=m[v];y.x=Math.round(y.x*f),y.y=Math.round(y.y*f),(y.x<A.min||y.x>A.max||y.y<A.min||y.y>A.max)&&l.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return p}},3326:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos",type:"Int16",components:2}])},9063:function(r,a,s){function l(S,T){var b=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!b){if(Array.isArray(S)||(b=function(z,k){if(z){if(typeof z=="string")return u(z,k);var Q=Object.prototype.toString.call(z).slice(8,-1);return Q==="Object"&&z.constructor&&(Q=z.constructor.name),Q==="Map"||Q==="Set"?Array.from(z):Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q)?u(z,k):void 0}}(S))||T){b&&(S=b);var C=0,M=function(){};return{s:M,n:function(){return C>=S.length?{done:!0}:{done:!1,value:S[C++]}},e:function(z){throw z},f:M}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
406
406
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var R,U=!0,O=!1;return{s:function(){b=b.call(S)},n:function(){var z=b.next();return U=z.done,z},e:function(z){O=!0,R=z},f:function(){try{U||b.return==null||b.return()}finally{if(O)throw R}}}}function u(S,T){(T==null||T>S.length)&&(T=S.length);for(var b=0,C=new Array(T);b<T;b++)C[b]=S[b];return C}function A(S,T){if(!(S instanceof T))throw new TypeError("Cannot call a class as a function")}function h(S,T){for(var b=0;b<T.length;b++){var C=T[b];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(S,C.key,C)}}function f(S,T,b){return T&&h(S.prototype,T),b&&h(S,b),Object.defineProperty(S,"prototype",{writable:!1}),S}var p=s(9207).j,d=(s(6016),s(1786).register),m=s(5615).PossiblyEvaluatedPropertyValue,v=s(4832),y=v.StructArrayLayout1f4,g=v.StructArrayLayout2f8,_=v.StructArrayLayout4f16;function x(S){return[p(255*S.r,255*S.g),p(255*S.b,255*S.a)]}var E=function(){function S(T,b,C){A(this,S),this.value=T,this.name=b,this.type=C,this.statistics={max:-1/0}}return f(S,[{key:"defines",value:function(){return["#define HAS_UNIFORM_u_".concat(this.name)]}},{key:"populatePaintArray",value:function(){}},{key:"upload",value:function(){}},{key:"destroy",value:function(){}},{key:"setUniforms",value:function(T,b,C,M){var R=M.constantOr(this.value),U=T.gl;this.type==="color"?U.uniform4f(b.uniforms["u_".concat(this.name)],R.r,R.g,R.b,R.a):U.uniform1f(b.uniforms["u_".concat(this.name)],R)}}]),S}(),B=function(){function S(T,b,C){A(this,S),this.expression=T,this.name=b,this.type=C,this.statistics={max:-1/0};var M=C==="color"?g:y;this.paintVertexAttributes=[{name:"a_".concat(b),type:"Float32",components:C==="color"?2:1,offset:0}],this.paintVertexArray=new M}return f(S,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(T,b){var C=this.paintVertexArray,M=C.length;C.reserve(T);var R=this.expression.evaluate({zoom:0},b);if(this.type==="color")for(var U=x(R),O=M;O<T;O++)C.emplaceBack(U[0],U[1]);else{for(var z=M;z<T;z++)C.emplaceBack(R);this.statistics.max=Math.max(this.statistics.max,R)}}},{key:"upload",value:function(T){this.paintVertexArray&&(this.paintVertexBuffer=T.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"setUniforms",value:function(T,b){T.gl.uniform1f(b.uniforms["a_".concat(this.name,"_t")],0)}}]),S}(),P=function(){function S(T,b,C,M,R){A(this,S),this.expression=T,this.name=b,this.type=C,this.useIntegerZoom=M,this.zoom=R,this.statistics={max:-1/0};var U=C==="color"?_:g;this.paintVertexAttributes=[{name:"a_".concat(b),type:"Float32",components:C==="color"?4:2,offset:0}],this.paintVertexArray=new U}return f(S,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(T,b){var C=this.paintVertexArray,M=C.length;C.reserve(T);var R=this.expression.evaluate({zoom:this.zoom},b),U=this.expression.evaluate({zoom:this.zoom+1},b);if(this.type==="color")for(var O=x(R),z=x(U),k=M;k<T;k++)C.emplaceBack(O[0],O[1],z[0],z[1]);else{for(var Q=M;Q<T;Q++)C.emplaceBack(R,U);this.statistics.max=Math.max(this.statistics.max,R,U)}}},{key:"upload",value:function(T){this.paintVertexArray&&(this.paintVertexBuffer=T.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"interpolationFactor",value:function(T){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(T),this.zoom,this.zoom+1):this.expression.interpolationFactor(T,this.zoom,this.zoom+1)}},{key:"setUniforms",value:function(T,b,C){T.gl.uniform1f(b.uniforms["a_".concat(this.name,"_t")],this.interpolationFactor(C.zoom))}}]),S}(),I=function(){function S(){A(this,S),this.binders={},this.cacheKey="",this._buffers=[]}return f(S,[{key:"populatePaintArrays",value:function(T,b){for(var C in this.binders)this.binders[C].populatePaintArray(T,b)}},{key:"defines",value:function(){var T=[];for(var b in this.binders)T.push.apply(T,this.binders[b].defines());return T}},{key:"setUniforms",value:function(T,b,C,M){for(var R in this.binders)this.binders[R].setUniforms(T,b,M,C.get(R))}},{key:"getPaintVertexBuffers",value:function(){return this._buffers}},{key:"upload",value:function(T){for(var b in this.binders)this.binders[b].upload(T);var C=[];for(var M in this.binders){var R=this.binders[M];(R instanceof B||R instanceof P)&&R.paintVertexBuffer&&C.push(R.paintVertexBuffer)}this._buffers=C}},{key:"destroy",value:function(){for(var T in this.binders)this.binders[T].destroy()}}],[{key:"createDynamic",value:function(T,b,C){var M=new S,R=[];for(var U in T.paint._values)if(C(U)){var O=T.paint.get(U);if(O instanceof m&&O.property.specification["property-function"]){var z=F(U,T.type),k=O.property.specification.type,Q=O.property.useIntegerZoom;O.value.kind==="constant"?(M.binders[U]=new E(O.value,z,k),R.push("/u_".concat(z))):O.value.kind==="source"?(M.binders[U]=new B(O.value,z,k),R.push("/a_".concat(z))):(M.binders[U]=new P(O.value,z,k,Q,b),R.push("/z_".concat(z)))}}return M.cacheKey=R.sort().join(""),M}}]),S}(),D=function(){function S(T,b,C){var M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0};A(this,S),this.programConfigurations={};var R,U=l(b);try{for(U.s();!(R=U.n()).done;){var O=R.value;this.programConfigurations[O.id]=I.createDynamic(O,C,M),this.programConfigurations[O.id].layoutAttributes=T}}catch(z){U.e(z)}finally{U.f()}}return f(S,[{key:"populatePaintArrays",value:function(T,b){for(var C in this.programConfigurations)this.programConfigurations[C].populatePaintArrays(T,b)}},{key:"get",value:function(T){return this.programConfigurations[T]}},{key:"upload",value:function(T){for(var b in this.programConfigurations)this.programConfigurations[b].upload(T)}},{key:"destroy",value:function(){for(var T in this.programConfigurations)this.programConfigurations[T].destroy()}}]),S}();function F(S,T){return{"text-opacity":"opacity","icon-opacity":"opacity","text-color":"fill_color","icon-color":"fill_color","text-halo-color":"halo_color","icon-halo-color":"halo_color","text-halo-blur":"halo_blur","icon-halo-blur":"halo_blur","text-halo-width":"halo_width","icon-halo-width":"halo_width","line-gap-width":"gapwidth"}[S]||S.replace("".concat(T,"-"),"").replace(/-/g,"_")}d("ConstantBinder",E),d("SourceExpressionBinder",B),d("CompositeExpressionBinder",P),d("ProgramConfiguration",I,{omit:["_buffers"]}),d("ProgramConfigurationSet",D),r.exports={ProgramConfiguration:I,ProgramConfigurationSet:D}},2596:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}])},8500:function(r,a,s){function l(m,v){(v==null||v>m.length)&&(v=m.length);for(var y=0,g=new Array(v);y<v;y++)g[y]=m[y];return g}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function A(m,v){for(var y=0;y<v.length;y++){var g=v[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}var h=s(8316).warnOnce,f=s(1786).register,p=Math.pow(2,16)-1,d=function(){function m(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];u(this,m),this.segments=g}var v,y;return v=m,(y=[{key:"prepareSegment",value:function(g,_,x){var E=this.segments[this.segments.length-1];return g>p&&h("Max vertices per segment is ".concat(p,": bucket requested ").concat(g)),(!E||E.vertexLength+g>r.exports.MAX_VERTEX_ARRAY_LENGTH)&&(E={vertexOffset:_.length,primitiveOffset:x.length,vertexLength:0,primitiveLength:0},this.segments.push(E)),E}},{key:"get",value:function(){return this.segments}},{key:"destroy",value:function(){var g,_=function(B,P){var I=typeof Symbol<"u"&&B[Symbol.iterator]||B["@@iterator"];if(!I){if(Array.isArray(B)||(I=function(C,M){if(C){if(typeof C=="string")return l(C,M);var R=Object.prototype.toString.call(C).slice(8,-1);return R==="Object"&&C.constructor&&(R=C.constructor.name),R==="Map"||R==="Set"?Array.from(C):R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R)?l(C,M):void 0}}(B))||P){I&&(B=I);var D=0,F=function(){};return{s:F,n:function(){return D>=B.length?{done:!0}:{done:!1,value:B[D++]}},e:function(C){throw C},f:F}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
407
407
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var S,T=!0,b=!1;return{s:function(){I=I.call(B)},n:function(){var C=I.next();return T=C.done,C},e:function(C){b=!0,S=C},f:function(){try{T||I.return==null||I.return()}finally{if(b)throw S}}}}(this.segments);try{for(_.s();!(g=_.n()).done;){var x=g.value;for(var E in x.vaos)x.vaos[E].destroy()}}catch(B){_.e(B)}finally{_.f()}}}])&&A(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),m}();f("SegmentVector",d),r.exports={SegmentVector:d,MAX_VERTEX_ARRAY_LENGTH:p}},3892:function(r){function a(l,u){for(var A=0;A<u.length;A++){var h=u[A];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(l,h.key,h)}}var s=function(){function l(h,f,p){(function(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")})(this,l),this.column=h,this.row=f,this.zoom=p}var u,A;return u=l,(A=[{key:"clone",value:function(){return new l(this.column,this.row,this.zoom)}},{key:"zoomTo",value:function(h){return this.clone()._zoomTo(h)}},{key:"sub",value:function(h){return this.clone()._sub(h)}},{key:"_zoomTo",value:function(h){var f=Math.pow(2,h-this.zoom);return this.column*=f,this.row*=f,this.zoom=h,this}},{key:"_sub",value:function(h){return h=h.zoomTo(this.zoom),this.column-=h.column,this.row-=h.row,this}}])&&a(u.prototype,A),Object.defineProperty(u,"prototype",{writable:!1}),l}();r.exports=s},9069:function(r,a,s){function l(f){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},l(f)}function u(f,p){for(var d=0;d<p.length;d++){var m=p[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}var A=s(8316).wrap,h=function(){function f(v,y){if(function(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}(this,f),isNaN(v)||isNaN(y))throw new Error("Invalid LngLat object: (".concat(v,", ").concat(y,")"));if(this.lng=+v,this.lat=+y,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}var p,d,m;return p=f,m=[{key:"convert",value:function(v){if(v instanceof f)return v;if(Array.isArray(v)&&(v.length===2||v.length===3))return new f(Number(v[0]),Number(v[1]));if(!Array.isArray(v)&&l(v)==="object"&&v!==null)return new f(Number(v.lng),Number(v.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}],(d=[{key:"wrap",value:function(){return new f(A(this.lng,-180,180),this.lat)}},{key:"toArray",value:function(){return[this.lng,this.lat]}},{key:"toString",value:function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}},{key:"toBounds",value:function(v){var y=360*v/40075017,g=y/Math.cos(Math.PI/180*this.lat);return new(s(4899))(new f(this.lng-g,this.lat-y),new f(this.lng+g,this.lat+y))}}])&&u(p.prototype,d),m&&u(p,m),Object.defineProperty(p,"prototype",{writable:!1}),f}();r.exports=h},4899:function(r,a,s){function l(h,f){for(var p=0;p<f.length;p++){var d=f[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(h,d.key,d)}}var u=s(9069),A=function(){function h(m,v){(function(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")})(this,h),m&&(v?this.setSouthWest(m).setNorthEast(v):m.length===4?this.setSouthWest([m[0],m[1]]).setNorthEast([m[2],m[3]]):this.setSouthWest(m[0]).setNorthEast(m[1]))}var f,p,d;return f=h,d=[{key:"convert",value:function(m){return!m||m instanceof h?m:new h(m)}}],(p=[{key:"setNorthEast",value:function(m){return this._ne=m instanceof u?new u(m.lng,m.lat):u.convert(m),this}},{key:"setSouthWest",value:function(m){return this._sw=m instanceof u?new u(m.lng,m.lat):u.convert(m),this}},{key:"extend",value:function(m){var v,y,g=this._sw,_=this._ne;if(m instanceof u)v=m,y=m;else{if(!(m instanceof h))return Array.isArray(m)?m.every(Array.isArray)?this.extend(h.convert(m)):this.extend(u.convert(m)):this;if(v=m._sw,y=m._ne,!v||!y)return this}return g||_?(g.lng=Math.min(v.lng,g.lng),g.lat=Math.min(v.lat,g.lat),_.lng=Math.max(y.lng,_.lng),_.lat=Math.max(y.lat,_.lat)):(this._sw=new u(v.lng,v.lat),this._ne=new u(y.lng,y.lat)),this}},{key:"getCenter",value:function(){return new u((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}},{key:"getSouthWest",value:function(){return this._sw}},{key:"getNorthEast",value:function(){return this._ne}},{key:"getNorthWest",value:function(){return new u(this.getWest(),this.getNorth())}},{key:"getSouthEast",value:function(){return new u(this.getEast(),this.getSouth())}},{key:"getWest",value:function(){return this._sw.lng}},{key:"getSouth",value:function(){return this._sw.lat}},{key:"getEast",value:function(){return this._ne.lng}},{key:"getNorth",value:function(){return this._ne.lat}},{key:"toArray",value:function(){return[this._sw.toArray(),this._ne.toArray()]}},{key:"toString",value:function(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}},{key:"isEmpty",value:function(){return!(this._sw&&this._ne)}}])&&l(f.prototype,p),d&&l(f,d),Object.defineProperty(f,"prototype",{writable:!1}),h}();r.exports=A},7773:function(r,a,s){function l(P,I){for(var D=0;D<I.length;D++){var F=I[D];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(P,F.key,F)}}var u=s(9069),A=s(5550),h=s(3892),f=s(8316),p=s(2643).number,d=s(1803),m=s(4792),v=(m.CanonicalTileID,m.UnwrappedTileID),y=s(900),g=s(3226),_=g.vec4,x=g.mat4,E=g.mat2,B=function(){function P(F,S,T){(function(b,C){if(!(b instanceof C))throw new TypeError("Cannot call a class as a function")})(this,P),this.tileSize=512,this._renderWorldCopies=T===void 0||T,this._minZoom=F||0,this._maxZoom=S||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new u(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={}}var I,D;return I=P,(D=[{key:"clone",value:function(){var F=new P(this._minZoom,this._maxZoom,this._renderWorldCopies);return F.tileSize=this.tileSize,F.latRange=this.latRange,F.width=this.width,F.height=this.height,F._center=this._center,F.zoom=this.zoom,F.angle=this.angle,F._fov=this._fov,F._pitch=this._pitch,F._unmodified=this._unmodified,F._calcMatrices(),F}},{key:"minZoom",get:function(){return this._minZoom},set:function(F){this._minZoom!==F&&(this._minZoom=F,this.zoom=Math.max(this.zoom,F))}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(F){this._maxZoom!==F&&(this._maxZoom=F,this.zoom=Math.min(this.zoom,F))}},{key:"renderWorldCopies",get:function(){return this._renderWorldCopies}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"centerPoint",get:function(){return this.size._div(2)}},{key:"size",get:function(){return new A(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(F){var S=-f.wrap(F,-180,180)*Math.PI/180;this.angle!==S&&(this._unmodified=!1,this.angle=S,this._calcMatrices(),this.rotationMatrix=E.create(),E.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}},{key:"pitch",get:function(){return this._pitch/Math.PI*180},set:function(F){var S=f.clamp(F,0,60)/180*Math.PI;this._pitch!==S&&(this._unmodified=!1,this._pitch=S,this._calcMatrices())}},{key:"fov",get:function(){return this._fov/Math.PI*180},set:function(F){F=Math.max(.01,Math.min(60,F)),this._fov!==F&&(this._unmodified=!1,this._fov=F/180*Math.PI,this._calcMatrices())}},{key:"zoom",get:function(){return this._zoom},set:function(F){var S=Math.min(Math.max(F,this.minZoom),this.maxZoom);this._zoom!==S&&(this._unmodified=!1,this._zoom=S,this.scale=this.zoomScale(S),this.tileZoom=Math.floor(S),this.zoomFraction=S-this.tileZoom,this._constrain(),this._calcMatrices())}},{key:"center",get:function(){return this._center},set:function(F){F.lat===this._center.lat&&F.lng===this._center.lng||(this._unmodified=!1,this._center=F,this._constrain(),this._calcMatrices())}},{key:"coveringZoomLevel",value:function(F){return(F.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/F.tileSize))}},{key:"getVisibleUnwrappedCoordinates",value:function(F){var S=this.pointCoordinate(new A(0,0),0),T=this.pointCoordinate(new A(this.width,0),0),b=Math.floor(S.column),C=Math.floor(T.column),M=[new v(0,F)];if(this._renderWorldCopies)for(var R=b;R<=C;R++)R!==0&&M.push(new v(R,F));return M}},{key:"coveringTiles",value:function(F){var S=this.coveringZoomLevel(F),T=S;if(F.minzoom!==void 0&&S<F.minzoom)return[];F.maxzoom!==void 0&&S>F.maxzoom&&(S=F.maxzoom);var b=this.pointCoordinate(this.centerPoint,S),C=new A(b.column-.5,b.row-.5),M=[this.pointCoordinate(new A(0,0),S),this.pointCoordinate(new A(this.width,0),S),this.pointCoordinate(new A(this.width,this.height),S),this.pointCoordinate(new A(0,this.height),S)];return d(S,M,F.reparseOverscaled?T:S,this._renderWorldCopies).sort(function(R,U){return C.dist(R.canonical)-C.dist(U.canonical)})}},{key:"resize",value:function(F,S){this.width=F,this.height=S,this.pixelsToGLUnits=[2/F,-2/S],this._constrain(),this._calcMatrices()}},{key:"unmodified",get:function(){return this._unmodified}},{key:"zoomScale",value:function(F){return Math.pow(2,F)}},{key:"scaleZoom",value:function(F){return Math.log(F)/Math.LN2}},{key:"project",value:function(F){return new A(this.lngX(F.lng),this.latY(F.lat))}},{key:"unproject",value:function(F){return new u(this.xLng(F.x),this.yLat(F.y))}},{key:"x",get:function(){return this.lngX(this.center.lng)}},{key:"y",get:function(){return this.latY(this.center.lat)}},{key:"point",get:function(){return new A(this.x,this.y)}},{key:"lngX",value:function(F){return(180+F)*this.worldSize/360}},{key:"latY",value:function(F){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+F*Math.PI/360)))*this.worldSize/360}},{key:"xLng",value:function(F){return 360*F/this.worldSize-180}},{key:"yLat",value:function(F){var S=180-360*F/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(S*Math.PI/180))-90}},{key:"setLocationAtPoint",value:function(F,S){var T=this.pointCoordinate(S)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(F)._sub(T)),this._renderWorldCopies&&(this.center=this.center.wrap())}},{key:"locationPoint",value:function(F){return this.coordinatePoint(this.locationCoordinate(F))}},{key:"pointLocation",value:function(F){return this.coordinateLocation(this.pointCoordinate(F))}},{key:"locationCoordinate",value:function(F){return new h(this.lngX(F.lng)/this.tileSize,this.latY(F.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)}},{key:"coordinateLocation",value:function(F){var S=F.zoomTo(this.zoom);return new u(this.xLng(S.column*this.tileSize),this.yLat(S.row*this.tileSize))}},{key:"pointCoordinate",value:function(F,S){S===void 0&&(S=this.tileZoom);var T=[F.x,F.y,0,1],b=[F.x,F.y,1,1];_.transformMat4(T,T,this.pixelMatrixInverse),_.transformMat4(b,b,this.pixelMatrixInverse);var C=T[3],M=b[3],R=T[1]/C,U=b[1]/M,O=T[2]/C,z=b[2]/M,k=O===z?0:(0-O)/(z-O);return new h(p(T[0]/C,b[0]/M,k)/this.tileSize,p(R,U,k)/this.tileSize,this.zoom)._zoomTo(S)}},{key:"coordinatePoint",value:function(F){var S=F.zoomTo(this.zoom),T=[S.column*this.tileSize,S.row*this.tileSize,0,1];return _.transformMat4(T,T,this.pixelMatrix),new A(T[0]/T[3],T[1]/T[3])}},{key:"calculatePosMatrix",value:function(F){var S=F.key;if(this._posMatrixCache[S])return this._posMatrixCache[S];var T=F.canonical,b=this.worldSize/this.zoomScale(T.z),C=T.x+Math.pow(2,T.z)*F.wrap,M=x.identity(new Float64Array(16));return x.translate(M,M,[C*b,T.y*b,0]),x.scale(M,M,[b/y,b/y,1]),x.multiply(M,this.projMatrix,M),this._posMatrixCache[S]=new Float32Array(M),this._posMatrixCache[S]}},{key:"_constrain",value:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var F,S,T,b,C=-90,M=90,R=-180,U=180,O=this.size,z=this._unmodified;if(this.latRange){var k=this.latRange;C=this.latY(k[1]),F=(M=this.latY(k[0]))-C<O.y?O.y/(M-C):0}if(this.lngRange){var Q=this.lngRange;R=this.lngX(Q[0]),S=(U=this.lngX(Q[1]))-R<O.x?O.x/(U-R):0}var N=Math.max(S||0,F||0);if(N)return this.center=this.unproject(new A(S?(U+R)/2:this.x,F?(M+C)/2:this.y)),this.zoom+=this.scaleZoom(N),this._unmodified=z,void(this._constraining=!1);if(this.latRange){var j=this.y,J=O.y/2;j-J<C&&(b=C+J),j+J>M&&(b=M-J)}if(this.lngRange){var ee=this.x,ie=O.x/2;ee-ie<R&&(T=R+ie),ee+ie>U&&(T=U-ie)}T===void 0&&b===void 0||(this.center=this.unproject(new A(T!==void 0?T:this.x,b!==void 0?b:this.y))),this._unmodified=z,this._constraining=!1}}},{key:"_calcMatrices",value:function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var F=this._fov/2,S=Math.PI/2+this._pitch,T=Math.sin(F)*this.cameraToCenterDistance/Math.sin(Math.PI-S-F),b=1.01*(Math.cos(Math.PI/2-this._pitch)*T+this.cameraToCenterDistance),C=new Float64Array(16);x.perspective(C,this._fov,this.width/this.height,1,b),x.scale(C,C,[1,-1,1]),x.translate(C,C,[0,0,-this.cameraToCenterDistance]),x.rotateX(C,C,this._pitch),x.rotateZ(C,C,this.angle),x.translate(C,C,[-this.x,-this.y,0]);var M=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(x.scale(C,C,[1,1,M,1]),this.projMatrix=C,C=x.create(),x.scale(C,C,[this.width/2,-this.height/2,1]),x.translate(C,C,[1,-1,0]),this.pixelMatrix=x.multiply(new Float64Array(16),C,this.projMatrix),!(C=x.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=C,this._posMatrixCache={}}}}])&&l(I.prototype,D),Object.defineProperty(I,"prototype",{writable:!1}),P}();r.exports=B},129:function(r,a,s){function l(h,f,p){return Object.defineProperty(h,"prototype",{writable:!1}),h}var u=s(6016),A=l(function h(f,p,d){(function(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")})(this,h),this.blendFunction=f,this.blendColor=p,this.mask=d});A.Replace=[1,0],A.disabled=new A(A.Replace,u.transparent,[!1,!1,!1,!1]),A.unblended=new A(A.Replace,u.transparent,[!0,!0,!0,!0]),A.alphaBlended=new A([1,771],u.transparent,[!0,!0,!0,!0]),r.exports=A},206:function(r,a,s){function l(oe,ue){for(var le=0;le<ue.length;le++){var re=ue[le];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(oe,re.key,re)}}var u=s(7612),A=s(3292),h=s(5197),f=(s(6937),s(2749),s(129)),p=s(8316),d=s(2578),m=d.ClearColor,v=d.ClearDepth,y=d.ClearStencil,g=d.ColorMask,_=d.DepthMask,x=d.StencilMask,E=d.StencilFunc,B=d.StencilOp,P=d.StencilTest,I=d.DepthRange,D=d.DepthTest,F=d.DepthFunc,S=d.Blend,T=d.BlendFunc,b=d.BlendColor,C=d.Program,M=d.LineWidth,R=d.ActiveTextureUnit,U=d.Viewport,O=d.BindFramebuffer,z=d.BindRenderbuffer,k=d.BindTexture,Q=d.BindVertexBuffer,N=d.BindElementBuffer,j=d.BindVertexArrayOES,J=d.PixelStoreUnpack,ee=d.PixelStoreUnpackPremultiplyAlpha,ie=function(){function oe(re){(function(ce,$){if(!(ce instanceof $))throw new TypeError("Cannot call a class as a function")})(this,oe),this.gl=re,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.lineWidthRange=re.getParameter(re.ALIASED_LINE_WIDTH_RANGE),this.clearColor=new m(this),this.clearDepth=new v(this),this.clearStencil=new y(this),this.colorMask=new g(this),this.depthMask=new _(this),this.stencilMask=new x(this),this.stencilFunc=new E(this),this.stencilOp=new B(this),this.stencilTest=new P(this),this.depthRange=new I(this),this.depthTest=new D(this),this.depthFunc=new F(this),this.blend=new S(this),this.blendFunc=new T(this),this.blendColor=new b(this),this.program=new C(this),this.lineWidth=new M(this),this.activeTexture=new R(this),this.viewport=new U(this),this.bindFramebuffer=new O(this),this.bindRenderbuffer=new z(this),this.bindTexture=new k(this),this.bindVertexBuffer=new Q(this),this.bindElementBuffer=new N(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new j(this),this.pixelStoreUnpack=new J(this),this.pixelStoreUnpackPremultiplyAlpha=new ee(this),this.extTextureFilterAnisotropic=re.getExtension("EXT_texture_filter_anisotropic")||re.getExtension("MOZ_EXT_texture_filter_anisotropic")||re.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=re.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=re.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&re.getExtension("OES_texture_half_float_linear")}var ue,le;return ue=oe,(le=[{key:"createIndexBuffer",value:function(re,ce){return new u(this,re,ce)}},{key:"createVertexBuffer",value:function(re,ce,$){return new A(this,re,ce,$)}},{key:"createRenderbuffer",value:function(re,ce,$){var q=this.gl,G=q.createRenderbuffer();return this.bindRenderbuffer.set(G),q.renderbufferStorage(q.RENDERBUFFER,re,ce,$),this.bindRenderbuffer.set(null),G}},{key:"createFramebuffer",value:function(re,ce){return new h(this,re,ce)}},{key:"clear",value:function(re){var ce=re.color,$=re.depth,q=this.gl,G=0;ce&&(G|=q.COLOR_BUFFER_BIT,this.clearColor.set(ce),this.colorMask.set([!0,!0,!0,!0])),$!==void 0&&(G|=q.DEPTH_BUFFER_BIT,this.clearDepth.set($),this.depthMask.set(!0)),q.clear(G)}},{key:"setDepthMode",value:function(re){re.func!==this.gl.ALWAYS||re.mask?(this.depthTest.set(!0),this.depthFunc.set(re.func),this.depthMask.set(re.mask),this.depthRange.set(re.range)):this.depthTest.set(!1)}},{key:"setStencilMode",value:function(re){re.func!==this.gl.ALWAYS||re.mask?(this.stencilTest.set(!0),this.stencilMask.set(re.mask),this.stencilOp.set([re.fail,re.depthFail,re.pass]),this.stencilFunc.set({func:re.test.func,ref:re.ref,mask:re.test.mask})):this.stencilTest.set(!1)}},{key:"setColorMode",value:function(re){p.deepEqual(re.blendFunction,f.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(re.blendFunction),this.blendColor.set(re.blendColor)),this.colorMask.set(re.mask)}}])&&l(ue.prototype,le),Object.defineProperty(ue,"prototype",{writable:!1}),oe}();r.exports=ie},6937:function(r){function a(l,u,A){return Object.defineProperty(l,"prototype",{writable:!1}),l}var s=a(function l(u,A,h){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,l),this.func=u,this.mask=A,this.range=h});s.ReadOnly=!1,s.ReadWrite=!0,s.disabled=new s(519,s.ReadOnly,[0,1]),r.exports=s},5197:function(r,a,s){function l(p,d){for(var m=0;m<d.length;m++){var v=d[m];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(p,v.key,v)}}var u=s(2578),A=u.ColorAttachment,h=u.DepthAttachment,f=function(){function p(v,y,g){(function(E,B){if(!(E instanceof B))throw new TypeError("Cannot call a class as a function")})(this,p),this.context=v,this.width=y,this.height=g;var _=v.gl,x=this.framebuffer=_.createFramebuffer();this.colorAttachment=new A(v,x),this.depthAttachment=new h(v,x)}var d,m;return d=p,(m=[{key:"destroy",value:function(){var v=this.context.gl,y=this.colorAttachment.get();y&&v.deleteTexture(y);var g=this.depthAttachment.get();g&&v.deleteRenderbuffer(g),v.deleteFramebuffer(this.framebuffer)}}])&&l(d.prototype,m),Object.defineProperty(d,"prototype",{writable:!1}),p}();r.exports=f},7612:function(r,a,s){function l(h,f){for(var p=0;p<f.length;p++){var d=f[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(h,d.key,d)}}var u=s(8583),A=function(){function h(d,m,v){(function(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")})(this,h),this.context=d;var y=d.gl;this.buffer=y.createBuffer(),this.dynamicDraw=!!v,this.unbindVAO(),d.bindElementBuffer.set(this.buffer),y.bufferData(y.ELEMENT_ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer}var f,p;return f=h,(p=[{key:"unbindVAO",value:function(){this.context.extVertexArrayObject&&this.context.bindVertexArrayOES.set(null)}},{key:"bind",value:function(){this.context.bindElementBuffer.set(this.buffer)}},{key:"updateData",value:function(d){var m=this.context.gl;u(this.dynamicDraw),this.unbindVAO(),this.bind(),m.bufferSubData(m.ELEMENT_ARRAY_BUFFER,0,d.arrayBuffer)}},{key:"destroy",value:function(){var d=this.context.gl;this.buffer&&(d.deleteBuffer(this.buffer),delete this.buffer)}}])&&l(f.prototype,p),Object.defineProperty(f,"prototype",{writable:!1}),h}();r.exports=A},2749:function(r){function a(u,A,h){return Object.defineProperty(u,"prototype",{writable:!1}),u}var s=7680,l=a(function u(A,h,f,p,d,m){(function(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")})(this,u),this.test=A,this.ref=h,this.mask=f,this.fail=p,this.depthFail=d,this.pass=m});l.disabled=new l({func:519,mask:0},0,0,s,s,s),r.exports=l},2578:function(r,a,s){function l(q){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},l(q)}function u(q,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(G&&G.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),Object.defineProperty(q,"prototype",{writable:!1}),G&&A(q,G)}function A(q,G){return A=Object.setPrototypeOf||function(Z,K){return Z.__proto__=K,Z},A(q,G)}function h(q){var G=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var Z,K=p(q);if(G){var W=p(this).constructor;Z=Reflect.construct(K,arguments,W)}else Z=K.apply(this,arguments);return f(this,Z)}}function f(q,G){if(G&&(l(G)==="object"||typeof G=="function"))return G;if(G!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(Z){if(Z===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Z}(q)}function p(q){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(G){return G.__proto__||Object.getPrototypeOf(G)},p(q)}function d(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function m(q,G){for(var Z=0;Z<G.length;Z++){var K=G[Z];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(q,K.key,K)}}function v(q,G,Z){return G&&m(q.prototype,G),Object.defineProperty(q,"prototype",{writable:!1}),q}var y=s(6016),g=s(8316),_=function(){function q(G){d(this,q),this.context=G,this.current=y.transparent}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G.r===Z.r&&G.g===Z.g&&G.b===Z.b&&G.a===Z.a||(this.context.gl.clearColor(G.r,G.g,G.b,G.a),this.current=G)}}]),q}(),x=function(){function q(G){d(this,q),this.context=G,this.current=1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.clearDepth(G),this.current=G)}}]),q}(),E=function(){function q(G){d(this,q),this.context=G,this.current=0}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.clearStencil(G),this.current=G)}}]),q}(),B=function(){function q(G){d(this,q),this.context=G,this.current=[!0,!0,!0,!0]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]&&G[2]===Z[2]&&G[3]===Z[3]||(this.context.gl.colorMask(G[0],G[1],G[2],G[3]),this.current=G)}}]),q}(),P=function(){function q(G){d(this,q),this.context=G,this.current=!0}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.depthMask(G),this.current=G)}}]),q}(),I=function(){function q(G){d(this,q),this.context=G,this.current=255}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.stencilMask(G),this.current=G)}}]),q}(),D=function(){function q(G){d(this,q),this.context=G,this.current={func:G.gl.ALWAYS,ref:0,mask:255}}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G.func===Z.func&&G.ref===Z.ref&&G.mask===Z.mask||(this.context.gl.stencilFunc(G.func,G.ref,G.mask),this.current=G)}}]),q}(),F=function(){function q(G){d(this,q),this.context=G;var Z=this.context.gl;this.current=[Z.KEEP,Z.KEEP,Z.KEEP]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]&&G[2]===Z[2]||(this.context.gl.stencilOp(G[0],G[1],G[2]),this.current=G)}}]),q}(),S=function(){function q(G){d(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;G?Z.enable(Z.STENCIL_TEST):Z.disable(Z.STENCIL_TEST),this.current=G}}}]),q}(),T=function(){function q(G){d(this,q),this.context=G,this.current=[0,1]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]||(this.context.gl.depthRange(G[0],G[1]),this.current=G)}}]),q}(),b=function(){function q(G){d(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;G?Z.enable(Z.DEPTH_TEST):Z.disable(Z.DEPTH_TEST),this.current=G}}}]),q}(),C=function(){function q(G){d(this,q),this.context=G,this.current=G.gl.LESS}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.depthFunc(G),this.current=G)}}]),q}(),M=function(){function q(G){d(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;G?Z.enable(Z.BLEND):Z.disable(Z.BLEND),this.current=G}}}]),q}(),R=function(){function q(G){d(this,q),this.context=G;var Z=this.context.gl;this.current=[Z.ONE,Z.ZERO]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]||(this.context.gl.blendFunc(G[0],G[1]),this.current=G)}}]),q}(),U=function(){function q(G){d(this,q),this.context=G,this.current=y.transparent}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G.r===Z.r&&G.g===Z.g&&G.b===Z.b&&G.a===Z.a||(this.context.gl.blendColor(G.r,G.g,G.b,G.a),this.current=G)}}]),q}(),O=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.useProgram(G),this.current=G)}}]),q}(),z=function(){function q(G){d(this,q),this.context=G,this.current=1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.context.lineWidthRange,K=g.clamp(G,Z[0],Z[1]);this.current!==K&&(this.context.gl.lineWidth(K),this.current=G)}}]),q}(),k=function(){function q(G){d(this,q),this.context=G,this.current=G.gl.TEXTURE0}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.activeTexture(G),this.current=G)}}]),q}(),Q=function(){function q(G){d(this,q),this.context=G;var Z=this.context.gl;this.current=[0,0,Z.drawingBufferWidth,Z.drawingBufferHeight]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]&&G[2]===Z[2]&&G[3]===Z[3]||(this.context.gl.viewport(G[0],G[1],G[2],G[3]),this.current=G)}}]),q}(),N=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindFramebuffer(Z.FRAMEBUFFER,G),this.current=G}}}]),q}(),j=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindRenderbuffer(Z.RENDERBUFFER,G),this.current=G}}}]),q}(),J=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindTexture(Z.TEXTURE_2D,G),this.current=G}}}]),q}(),ee=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindBuffer(Z.ARRAY_BUFFER,G),this.current=G}}}]),q}(),ie=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.context.gl;Z.bindBuffer(Z.ELEMENT_ARRAY_BUFFER,G),this.current=G}}]),q}(),oe=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&this.context.extVertexArrayObject&&(this.context.extVertexArrayObject.bindVertexArrayOES(G),this.current=G)}}]),q}(),ue=function(){function q(G){d(this,q),this.context=G,this.current=4}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.pixelStorei(Z.UNPACK_ALIGNMENT,G),this.current=G}}}]),q}(),le=function(){function q(G){d(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G),this.current=G}}}]),q}(),re=function(){function q(G,Z){d(this,q),this.context=G,this.current=null,this.parent=Z}return v(q,[{key:"get",value:function(){return this.current}}]),q}(),ce=function(q){u(Z,q);var G=h(Z);function Z(K,W){var H;return d(this,Z),(H=G.call(this,K,W)).dirty=!1,H}return v(Z,[{key:"set",value:function(K){if(this.dirty||this.current!==K){var W=this.context.gl;this.context.bindFramebuffer.set(this.parent),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_2D,K,0),this.current=K,this.dirty=!1}}},{key:"setDirty",value:function(){this.dirty=!0}}]),Z}(re),$=function(q){u(Z,q);var G=h(Z);function Z(){return d(this,Z),G.apply(this,arguments)}return v(Z,[{key:"set",value:function(K){if(this.current!==K){var W=this.context.gl;this.context.bindFramebuffer.set(this.parent),W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_ATTACHMENT,W.RENDERBUFFER,K),this.current=K}}}]),Z}(re);r.exports={ClearColor:_,ClearDepth:x,ClearStencil:E,ColorMask:B,DepthMask:P,StencilMask:I,StencilFunc:D,StencilOp:F,StencilTest:S,DepthRange:T,DepthTest:b,DepthFunc:C,Blend:M,BlendFunc:R,BlendColor:U,Program:O,LineWidth:z,ActiveTextureUnit:k,Viewport:Q,BindFramebuffer:N,BindRenderbuffer:j,BindTexture:J,BindVertexBuffer:ee,BindElementBuffer:ie,BindVertexArrayOES:oe,PixelStoreUnpack:ue,PixelStoreUnpackPremultiplyAlpha:le,ColorAttachment:ce,DepthAttachment:$}},3292:function(r,a,s){function l(f,p){for(var d=0;d<p.length;d++){var m=p[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}var u=s(8583),A={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},h=function(){function f(m,v,y,g){(function(x,E){if(!(x instanceof E))throw new TypeError("Cannot call a class as a function")})(this,f),this.length=v.length,this.attributes=y,this.itemSize=v.bytesPerElement,this.dynamicDraw=g,this.context=m;var _=m.gl;this.buffer=_.createBuffer(),m.bindVertexBuffer.set(this.buffer),_.bufferData(_.ARRAY_BUFFER,v.arrayBuffer,this.dynamicDraw?_.DYNAMIC_DRAW:_.STATIC_DRAW),this.dynamicDraw||delete v.arrayBuffer}var p,d;return p=f,(d=[{key:"bind",value:function(){this.context.bindVertexBuffer.set(this.buffer)}},{key:"updateData",value:function(m){u(m.length===this.length);var v=this.context.gl;this.bind(),v.bufferSubData(v.ARRAY_BUFFER,0,m.arrayBuffer)}},{key:"enableAttributes",value:function(m,v){for(var y=0;y<this.attributes.length;y++){var g=this.attributes[y],_=v.attributes[g.name];_!==void 0&&m.enableVertexAttribArray(_)}}},{key:"setVertexAttribPointers",value:function(m,v,y){for(var g=0;g<this.attributes.length;g++){var _=this.attributes[g],x=v.attributes[_.name];x!==void 0&&m.vertexAttribPointer(x,_.components,m[A[_.type]],!1,this.itemSize,_.offset+this.itemSize*(y||0))}}},{key:"destroy",value:function(){var m=this.context.gl;this.buffer&&(m.deleteBuffer(this.buffer),delete this.buffer)}}])&&l(p.prototype,d),Object.defineProperty(p,"prototype",{writable:!1}),f}();r.exports=h},5579:function(r,a,s){var l=s(2235),u=s(3103),A=s(4147).i8,h=s(2062),f=s(3340),p=s(3600),d=s(5060),m=s(7316),v=s(8841),y=s(3316),g=s(650),_=s(56),x=s(9069),E=s(4899),B=s(5550),P=s(1495),I=s(6752),D=s(4781),F=s(1282);r.exports={version:A,supported:l,workerCount:Math.max(Math.floor(u.hardwareConcurrency/2),1),setRTLTextPlugin:D.setRTLTextPlugin,Map:h,NavigationControl:f,GeolocateControl:p,AttributionControl:d,ScaleControl:m,FullscreenControl:v,Popup:y,Marker:g,Style:_,LngLat:x,LngLatBounds:E,Point:B,Evented:P,config:I,BasicRenderer:F,get accessToken(){return I.ACCESS_TOKEN},set accessToken(S){I.ACCESS_TOKEN=S}}},5155:function(r,a,s){function l(f,p){(p==null||p>f.length)&&(p=f.length);for(var d=0,m=new Array(p);d<p;d++)m[d]=f[d];return m}var u=s(7650),A=s(2749),h=s(6937);r.exports=function(f,p,d){var m=d.paint.get("background-color"),v=d.paint.get("background-opacity");if(v!==0){var y,g=f.context,_=g.gl,x=f.transform,E=x.tileSize,B=d.paint.get("background-pattern"),P=B||m.a!==1||v!==1?"translucent":"opaque";if(f.renderPass===P){if(g.setStencilMode(A.disabled),g.setDepthMode(f.depthModeForSublayer(0,P==="opaque"?h.ReadWrite:h.ReadOnly)),g.setColorMode(f.colorModeForRenderPass()),B){if(u.isPatternMissing(B,f))return;y=f.useProgram("backgroundPattern"),u.prepare(B,f,y),f.tileExtentPatternVAO.bind(g,y,f.tileExtentBuffer,[])}else y=f.useProgram("background"),_.uniform4fv(y.uniforms.u_color,[m.r,m.g,m.b,m.a]),f.tileExtentVAO.bind(g,y,f.tileExtentBuffer,[]);_.uniform1f(y.uniforms.u_opacity,v);var I,D=function(S,T){var b=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!b){if(Array.isArray(S)||(b=function(z,k){if(z){if(typeof z=="string")return l(z,k);var Q=Object.prototype.toString.call(z).slice(8,-1);return Q==="Object"&&z.constructor&&(Q=z.constructor.name),Q==="Map"||Q==="Set"?Array.from(z):Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q)?l(z,k):void 0}}(S))||T){b&&(S=b);var C=0,M=function(){};return{s:M,n:function(){return C>=S.length?{done:!0}:{done:!1,value:S[C++]}},e:function(z){throw z},f:M}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
@@ -3102,7 +3102,7 @@ export type IndexJsonType = {
3102
3102
  \`\`\`
3103
3103
  ${qx}
3104
3104
  \`\`\`
3105
- `,_t=class _t extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_data");L(this,"_defaultHeight",{});L(this,"defaultBoundingSphere");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 a=this.dv(c.createProcessingFromAsyncFunc(async u=>{this.dataSource&&r(),this.url&&(typeof this.url=="object"?this._data=this.url:c.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(c.ESSceneObject.context.getStrFromEnv(this.url)).then(A=>A.json()).then(A=>{this._data=A}).catch(A=>{console.warn("ESGeoJson数据加载失败",A)}),this.dataSource=await w.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(A=>{var f,p;const h=[];for(const d of A.entities.values){w.Entity.prototype&&(d.ESSceneObjectID=i),this._isEntityShow(d,e);do{if(d.polygon){h.push(...(f=d.polygon.hierarchy)==null?void 0:f.getValue(w.JulianDate.now()).positions);break}if(d.polyline){h.push(...(p=d.polyline.positions)==null?void 0:p.getValue(w.JulianDate.now()));break}if(d.position){const m=d.position.getValue(w.JulianDate.now());m&&h.push(m);break}}while(!1)}h.length>0&&(this.defaultBoundingSphere=w.BoundingSphere.fromPoints(h))}))})),s=()=>{a.isRunning&&a.cancel(),a.restart()};s();const l=this.dv(c.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(s))}{const a=()=>{var l,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(A){console.error(A)}else{const A=this.dataSource.entities.values;for(let h=0;h<A.length;h++){const f=A[h];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(l=f.polygon.height)==null?void 0:l.getValue(w.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new w.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new w.ConstantProperty(!this.fillGround),f.polygon.heightReference=new w.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?w.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?w.HeightReference.CLAMP_TO_GROUND:w.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new w.ConstantProperty(this.filled??_t.defaults.filled),f.polygon.material=new w.ColorMaterialProperty(new w.Color(...this.fillColor??_t.defaults.fillColor)),f.polygon.outline=new w.ConstantProperty(!1),f.polygon.classificationType=w.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new w.PolylineGraphics;const p=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(w.JulianDate.now()).positions));w.Cartesian3.equals(p[0],p[p.length-1])||p.push(p[0]),f.polyline.positions=p,f.polyline.classificationType=w.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=w.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new w.ConstantProperty(this.stroked??_t.defaults.stroked),f.polyline.width=new w.ConstantProperty(this.strokeWidth??_t.defaults.strokeWidth),f.polyline.material=new w.ColorMaterialProperty(new w.Color(...this.strokeColor??_t.defaults.strokeColor)),f.polyline.clampToGround=new w.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new w.ConstantProperty(this.imageShow??_t.defaults.imageShow),f.billboard.width=new w.ConstantProperty(this.imageSize?this.imageSize[0]:_t.defaults.imageSize[0]),f.billboard.height=new w.ConstantProperty(this.imageSize?this.imageSize[1]:_t.defaults.imageSize[1]);const p=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:_t.defaults.imageUrl;f.billboard.image=new w.ConstantProperty(c.ESSceneObject.context.getStrFromEnv(p)),f.billboard.horizontalOrigin=new w.ConstantProperty(w.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new w.ConstantProperty(w.VerticalOrigin.TOP),f.billboard.heightReference=new w.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?w.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?w.HeightReference.CLAMP_TO_GROUND:w.HeightReference.RELATIVE_TO_GROUND);const d=this.imageAnchor??_t.defaults.imageAnchor,m=this.imageOffset??_t.defaults.imageOffset;if(f.billboard.pixelOffset=new w.ConstantProperty(w.Cartesian2.fromArray([-d[0]*f.billboard.width.getValue(w.JulianDate.now())+m[0],-d[1]*f.billboard.height.getValue(w.JulianDate.now())+m[1]])),f.label=new w.LabelGraphics,!f.label)return;f.label.show=new w.ConstantProperty(this.textShow??_t.defaults.textShow),f.label.heightReference=new w.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?w.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?w.HeightReference.CLAMP_TO_GROUND:w.HeightReference.RELATIVE_TO_GROUND),f.label.text=new w.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??_t.defaults.textDefaultText),f.label.fillColor=new w.ConstantProperty(new w.Color(...this.textColor??_t.defaults.textColor)),f.label.showBackground=new w.ConstantProperty(this.textBackgroundColor!=null);const v=this.textFontSize&&this.textFontSize!=0?this.textFontSize:_t.defaults.textFontSize,y=this.textOffset??_t.defaults.textOffset;f.label.backgroundColor=new w.ConstantProperty(new w.Color(...this.textBackgroundColor??_t.defaults.textBackgroundColor)),f.label.font=new w.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${v}px ${this.textFontFamily??_t.defaults.textFontFamily}`),f.label.horizontalOrigin=new w.ConstantProperty(w.HorizontalOrigin.LEFT),f.label.verticalOrigin=new w.ConstantProperty(w.VerticalOrigin.TOP),f.label.eyeOffset=new w.ConstantProperty(w.Cartesian3.fromArray([0,0,-1]));const g=this.textAnchor??_t.defaults.textAnchor;f.label.pixelOffset=new w.ConstantProperty(w.Cartesian2.fromArray([-g[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(w.JulianDate.now()),f.label.font.getValue(w.JulianDate.now())))+y[0],-g[1]*((this.textBackgroundColor?10:0)+v)+y[1]]))}}}};a();const s=this.dv(c.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.classificationTypeChanged));this.dispose(s.don(a))}{const a=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let u=0;u<l.length;u++){const A=l[u];this._isEntityShow(A,e)}};a();const s=this.ad(c.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(s.don(a))}{const a=()=>{if(this.loadFuncStr)try{const s=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=s}catch(s){console.error(s),this.loadFun=void 0}else this.loadFun=void 0};a(),this.dispose(this.loadFuncStrChanged.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&o.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:a?a/1e3:void 0})}))}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,i="16px sans-serif"){const r=document.createElement("canvas").getContext("2d");return r.font=i,r.measureText(e).width}_isEntityShow(e,i){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0||this.show){e.show=this.show;return}if((o=i.viewer)!=null&&o.camera&&this.show){let r;if(e.polygon&&e.polygon.hierarchy)r=c.getMinMaxCorner(e.polygon.hierarchy.getValue(w.JulianDate.now()).positions.map(l=>De(l))).center;else if(e.polyline&&e.polyline.positions)r=c.getMinMaxCorner(e.polyline.positions.getValue(w.JulianDate.now()).map(l=>De(l))).center;else if(e.position){const l=e.position.getValue(w.JulianDate.now());l&&(r=De(l))}if(!r||isNaN(r[0]))return;const a=c.getDistancesFromPositions([r,Mn(i.viewer.camera)],"NONE")[0];let s=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?s=this.minFeatureVisibleDistance<a&&a<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?s=a>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(s=a<this.maxFeatureVisibleDistance),e.show=this.show&&s}}};L(_t,"defaults",{show:!0,allowPicking:!0,url:Kx,defaultLoadFuncStr:qx,defaultLoadFuncDocStr:MO,data:IO,dataMd:FO,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 Zo=_t;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:c.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:c.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:c.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:c.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:c.reactArrayWithUndefined(void 0),imageAnchor:c.reactArrayWithUndefined(void 0),imageOffset:c.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:c.reactArrayWithUndefined(void 0),textBackgroundColor:c.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:c.reactArrayWithUndefined(void 0),textOffset:c.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Zo||(Zo={})),c.extendClassProps(Zo.prototype,Zo.createDefaultProps);const nc=class nc extends Hn{constructor(e,i){super(e,i);L(this,"_pointFeatures",this.disposeVar(c.react(void 0)));L(this,"_defaultPointsBoundingSphere");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=Mt(o);if(!r)return;const{screenManager:a}=r,s=this.disposeVar(new Zo(i,e.id));{const l=()=>{if(!e.features)return;const u=c.toGeoJson(e.features),A={type:u.type,features:[]};s.url={type:u.type,features:u.features.filter(h=>h.geometry.type.toLowerCase().includes("point")?(A.features.push(h),!1):!0)},this.pointFeatures=A};l(),this.ad(e.featuresChanged.don(l))}this.ad(c.track([s,"show"],[e,"show"])),this.ad(c.track([s,"allowPicking"],[e,"allowPicking"])),this.ad(c.track([s,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(c.track([s,"stroked"],[e,"stroked"])),this.ad(c.track([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(c.track([s,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(c.track([s,"strokeColor"],[e,"strokeColor"])),this.ad(c.track([s,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(c.track([s,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(c.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(c.track([s,"filled"],[e,"filled"])),this.ad(c.track([s,"fillColor"],[e,"fillColor"])),this.ad(c.track([s,"fillMaterial"],[e,"fillMaterial"])),this.ad(c.track([s,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(c.track([s,"fillGround"],[e,"fillGround"])),this.ad(c.track([s,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(c.track([s,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(c.track([s,"heightReference"],[e,"heightReference"]));{const l=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=w.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(h=>Ye(h))).flat(1/0)))};l(),this.ad(this.pointFeaturesChanged.don(l))}{let l={id:"",layer:"",screenObjectIds:[]};const u=()=>{l.id!=""&&(a.remove(l.layer,l.id,{label:l.screenObjectIds}),l={id:"",layer:"",screenObjectIds:[]})};this.ad(()=>{u()});const A=()=>{if(u(),!((e.textShow??c.ESGeoJson.defaults.textShow)&&(e.show??c.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.textFontSize&&e.textFontSize!=0?e.textFontSize:c.ESGeoJson.defaults.textFontSize,p=e.textOffset??c.ESGeoJson.defaults.textOffset,d=e.textAnchor??c.ESGeoJson.defaults.textAnchor,m={heightReference:w.HeightReference[e.heightReference??c.ESGeoJson.defaults.heightReference],fillColor:new w.Color(...e.textColor??c.ESGeoJson.defaults.textColor),showBackground:e.textBackgroundColor!=null,backgroundColor:new w.Color(...e.textBackgroundColor??c.ESGeoJson.defaults.textBackgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${f}px ${e.textFontFamily??c.ESGeoJson.defaults.textFontFamily}`,horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.TOP,eyeOffset:w.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new w.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((v,y)=>{const g=e.textProperty&&e.textProperty!==""&&(v!=null&&v.properties)&&v.properties[e.textProperty]?v.properties[e.textProperty]:e.textDefaultText??c.ESGeoJson.defaults.textDefaultText;m.pixelOffset=w.Cartesian2.fromArray([-d[0]*((e.textBackgroundColor?-14:-f*2)+this._countBytes(g)/2*f)+p[0],-d[1]*((e.textBackgroundColor?10:0)+f)+p[1]]),(v.geometry.type=="Point"?[v.geometry.coordinates]:v.geometry.coordinates).forEach((x,E)=>{const B={index:`${y}${E}`,name:g,position:x,zOrder:e.zIndex??c.ESGeoJson.defaults.zIndex},P=a.addLabel(e.id,e.typeName,m,B);l.id=P.id,l.layer=P.layer,l.screenObjectIds.push(P.screenObjectId)})})};A();const h=this.ad(c.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(h.don(A))}{this.ad(()=>{u()});let l={id:"",layer:"",screenObjectIds:[]};const u=()=>{l.id!=""&&(a.remove(l.layer,l.id,{billboard:l.screenObjectIds}),l={id:"",layer:"",screenObjectIds:[]})},A=()=>{if(u(),!((e.imageShow??c.ESGeoJson.defaults.imageShow)&&(e.show??c.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.imageAnchor??c.ESGeoJson.defaults.imageAnchor,p=e.imageOffset??c.ESGeoJson.defaults.imageOffset,d=e.imageSize?e.imageSize[0]:c.ESGeoJson.defaults.imageSize[0],m=e.imageSize?e.imageSize[1]:c.ESGeoJson.defaults.imageSize[1],v={width:d,height:m,image:c.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:c.ESGeoJson.defaults.imageUrl),horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.TOP,heightReference:w.HeightReference[e.heightReference??c.ESGeoJson.defaults.heightReference],pixelOffset:w.Cartesian2.fromArray([-f[0]*d+p[0],-f[1]*m+p[1]]),distanceDisplayCondition:new w.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((y,g)=>{(y.geometry.type=="Point"?[y.geometry.coordinates]:y.geometry.coordinates).forEach((x,E)=>{const B={index:`${g}${E}`,name:"",position:x,zOrder:e.zIndex??c.ESGeoJson.defaults.zIndex},P=a.addImage(e.id,e.typeName,v,B);l.id=P.id,l.layer=P.layer,l.screenObjectIds.push(P.screenObjectId)})})};A();const h=this.ad(c.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(h.don(A))}this.ad(c.track([s,"classificationType"],[e,"classificationType"])),this.ad(e.flyToEvent.disposableOn(l=>{if(!i.actived)return;if(e.flyInParam){const{position:A,rotation:h,flyDuration:f}=e.flyInParam;return Fe(i.viewer,A,void 0,h,f),!0}let u;s.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=w.BoundingSphere.fromBoundingSpheres([s.defaultBoundingSphere,this._defaultPointsBoundingSphere]):s.defaultBoundingSphere?u=s.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&Rn(i,e,this.id,De(u.center),u.radius,l)}));{const l=async(u,A,h)=>{if(!i.actived)return;const f=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,A)));if(!(!f||!(f!=null&&f.positions)))if(f.type=="Point"||f.type=="MultiPoint")Rn(i,e,this.id,await this._calculateFeatureHeight(f.type=="MultiPoint"?f.positions.flat():f.positions,e.heightReference,i),1e3,h);else{const p=f.type=="Polygon"||f.type=="MultiPolygon"||f.type=="MultiLineString";let d=[];p?d=f.positions.flat(f.type=="MultiPolygon"?2:1).map(g=>this._calculateFeatureHeight(g,e.fillGround?"CLAMP_TO_GROUND":"NONE",i)):d=f.positions.map(g=>this._calculateFeatureHeight(g,e.strokeGround?"CLAMP_TO_GROUND":"NONE",i));const{minPos:m,maxPos:v,center:y}=c.getMinMaxCorner(d);Rn(i,e,this.id,y,c.getDistancesFromPositions([m,v],"NONE")[0],h)}};this.d(e.flyToFeatureEvent.don((u,A,h)=>l(u,A,h))),this.d(e.flyToFeatureIndexEvent.don((u,A)=>l(u,void 0,A)))}}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}_getFeatureByIndexOrProperties(e,i){var s,l,u,A,h,f,p,d;const{sceneObject:o}=this,r=o.features;if(!r)return;const a=Reflect.get(r,"features")||Reflect.get(r,"geometries");if(a){if(i){let m=a.find(v=>(v==null?void 0:v.properties[e])==i);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)||((l=m==null?void 0:m.geometry)==null?void 0:l.coordinates)}}else if(typeof e=="number")return{type:(u=a[e])!=null&&u.coordinates?a[e].type:(h=(A=a[e])==null?void 0:A.geometry)==null?void 0:h.type,positions:((f=a[e])==null?void 0:f.coordinates)||((d=(p=a[e])==null?void 0:p.geometry)==null?void 0:d.coordinates)}}}async _calculateFeatureHeight(e,i,o){const r=[...e];return i=="NONE"?r[2]=r[2]??0:i=="CLAMP_TO_GROUND"||!r[2]?r[2]=await o.getTerrainHeight(r)??0:r[2]+=await o.getTerrainHeight(r)??0,r}_countBytes(e){let i=0;for(let o=0;o<e.length;o++){const r=e.charCodeAt(o);r<=127?i+=1:r<=2047?i+=2:r<=65535?i+=3:i+=4}return i}};L(nc,"type",nc.register("ESCesiumViewer",c.ESGeoJson.type,nc));let fg=nc;const ic=class ic extends sn{constructor(e,i){super(e,i);L(this,"_czmGeoESRectangle");L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Je(i,e.id)),this._czmGeoESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,a=this._geoPolyline;a.arcType="RHUMB",this.dispose(c.track([a,"color"],[e,"strokeColor"])),this.dispose(c.track([a,"width"],[e,"strokeWidth"])),this.dispose(c.track([a,"ground"],[e,"strokeGround"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.show=e.show&&e.stroked,r.show=e.show&&e.filled};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:u,maxPos:A}=c.getMinMaxCorner(l);r.rectangle=[u[0],u[1],A[0],A[1]],r.height=l[0][2],r.extrudedHeight=l[0][2];const h=l.map(m=>(l&&(m[2]=l[0][2]),m)),f=h[0],p=h[1],d=[f,[f[0],p[1],f[2]],p,[p[0],f[1],p[2]]];a.positions=[...d,f]}else r.rectangle=void 0,a.positions=void 0,r.height=0,r.extrudedHeight=0};s(),this.dispose(e.pointsChanged.disposableOn(()=>s()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmGeoESRectangle:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(ic,"type",ic.register("ESCesiumViewer",c.ESGeoRectangle.type,ic));let dg=ic;class Xl extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new zr(e,i));const{geoPolygon:o}=this;this.dispose(c.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(a=>{o.flyTo(a)})),this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"fill"],[this,"filled"])),this.dispose(c.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(c.bind([o,"ground"],[this,"ground"])),this.dispose(c.bind([o,"outline"],[this,"outline"])),this.dispose(c.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(c.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(c.bind([o,"color"],[this,"color"])),this.dispose(c.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const a=Ud([...this.positions,this.positions[0]]);o.positions=a}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:c.reactArray([1,1,1,1]),outlineWidth:1,color:c.reactArrayWithUndefined([1,1,1,.5]),positions:c.reactPositions(void 0),depth:0})})(Xl||(Xl={})),c.extendClassProps(Xl.prototype,Xl.createDefaultProps);const rc=class rc extends sn{constructor(e,i){super(e,i);L(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Xl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"color"],[e,"fillColor"])),this.dispose(c.track([r,"ground"],[e,"ground"]));{const a=()=>{r.ground=e.ground||e.fillGround};a();const s=this.dv(c.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(s.don(a))}{const a=()=>{r.color=e.filled?e.fillColor:$l.defaults.fillStyle.color};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}this.dispose(c.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(rc,"type",rc.register("ESCesiumViewer",$l.type,rc));let pg=rc;const oc=class oc extends He{constructor(e,i){super(e,i);L(this,"_czmModel");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Wt(i,e.id));const r=this._czmModel;this.d(r.readyEvent.don(s=>{var l;r.activeAnimationsJson=(l=r.gltf.animations)==null?void 0:l.map((u,A)=>({index:A,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(s),e.readyEvent.emit(s)})),this.ad(new Ih(o,this._czmModel)),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"color"],[e,"czmColor"])),this.d(c.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(c.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(c.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(c.track([r,"scale"],[e,"scale"])),this.ad(c.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(c.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const s=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};s(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>s(l)))}{const s=()=>{var l,u;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};s(),this.ad(e.czmEnvironmentMapManagerChanged.don(s))}{const s=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,r.rotation=l};s(),this.d(e.rotationChanged.don(s));{const l=()=>{if(s(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(u=>{const A=JSON.parse(JSON.stringify(u));return!A.rotation&&(A.rotation=[0,0,0]),A.rotation[0]+=90,A})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(s=>{r.setMaterial(s)}));{const s=()=>{const l=[...r.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};s(),this.d(r.rotationChanged.don(s))}{const s=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};l(),this.d(s.don(l))}const a=()=>{var s;r.url=c.ESSceneObject.context.getStrFromEnv(Fh(typeof e.url=="string"?e.url:((s=e.url)==null?void 0:s.url)??c.ESGltfModel.defaults.url))};a(),this.d(e.urlChanged.don(a)),this.d(e.setNodePositionEvent.don((s,l)=>{r.setNodeTranslation(s,l)})),this.d(e.setNodeRotationEvent.don((s,l)=>{r.setNodeRotation(s,l)})),this.d(e.setNodeScaleEvent.don((s,l)=>{r.setNodeScale(s,l)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,i){const{sceneObject:o,czmViewer:r,model:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&bn(r,o,i,e,a,!0),!!a):!1}};L(oc,"type",oc.register("ESCesiumViewer",c.ESGltfModel.type,oc));let mg=oc;function Zx(t,n){const e=t[0]-n[0],i=t[1]-n[1],o=t[2]-n[2];return Math.sqrt(e*e+i*i+o*o)}class Yl extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distance",this.disposeVar(c.react(0)));L(this,"_surfaceDistance",this.disposeVar(c.react(0)));L(this,"_height",this.disposeVar(c.react(0)));L(this,"_middlePosition",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_heightPosition",this.disposeVar(c.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 a=this._surfaceDistance.value=c.geoDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="RHUMB"){const a=this._surfaceDistance.value=c.geoRhumbDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="NONE"){const a=c.lbhToXyz(this.positions[0]),s=c.lbhToXyz(this.positions[1]);this._distance.value=Zx(a,s),this._surfaceDistance.value=Zx(c.lbhToXyz(this._middlePosition.value),s),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(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const a=this.disposeVar(new Je(e,i));a.ground=!1,a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"]));{a.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[u,A]=this.positions;a.positions=[u,A,[u[0],u[1],A[2]]]}else a.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&a.flyTo(l)}));const s=this.disposeVar(new bt(e,i));this.dispose(c.track([s,"shadowDom"],[this,"shadowDom"])),this.dispose(c.track([s,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(c.track([s,"show"],[this,"show"]));{const l=()=>{s.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{s.innerHTML=_o(`高度: ${Mh(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(s.pickedEvent.don(l=>{Gi(l)===0&&this.pickedEvent.emit(l)}))}}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:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Yl||(Yl={})),c.extendClassProps(Yl.prototype,Yl.createDefaultProps);const sc=class sc extends sn{constructor(e,i){super(e,i);L(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Yl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(sc,"type",sc.register("ESCesiumViewer",c.ESHeightMeasurement.type,sc));let gg=sc;const yg={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"}]},ac=class ac extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Wt(i,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Rt([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"])),this.d(r.readyEvent.don(m=>{e.readyEvent.emit(m)}));{const m=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),v=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};v(),this.d(m.don(v))}const a=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),A=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),h=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":r.url=a;break;case"police":r.url=s;break;case"pedestrian":r.url=l;break;case"stranger":r.url=u;break;case"suitMan":r.url=A;break;case"suitWoman":r.url=h;break;default:r.url=a;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const p=()=>{const m=e.animation??c.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}m==="walking"?r.activeAnimationsJson=yg.czmAnimationsWalk:m==="standing"?r.activeAnimationsJson=yg.czmAnimationsStand:m==="running"&&(r.activeAnimationsJson=yg.czmAnimationsRun)};p();const d=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(d.disposableOn(()=>p())),this.ad(new Ih(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&bn(r,o,i,e,a,!0),!!a)}};L(ac,"type",ac.register("ESCesiumViewer",c.ESHuman.type,ac));let vg=ac;class $x extends c.Destroyable{constructor(e,i){super();L(this,"_czmGeoCanvasImagePoi");L(this,"flyTo",(e,i)=>{if(this.czmGeoCanvasImagePoi.position){Fe(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Gn,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=i,this._czmGeoCanvasImagePoi=this.disposeVar(new yi(i));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=A=>{let h=A;return A.includes("inner://")&&(h="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Fh(h))},a=()=>{const A=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=A,e.sizeByContent){const f=new Image;f.src=A,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},s=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(s.disposableOn(()=>a())),a(),this.d(c.track([o,"zOrder"],[e,"zOrder"])),this.dispose(c.track([o,"show"],[e,"show"])),this.dispose(c.bind([o,"position"],[e,"position"])),this.ad(c.bind([o,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(c.bind([o,"hoverHighlight"],[e,"hoverHighlight"]));{const A=()=>{o.scale=[e.scale[1],e.scale[2]]};A(),this.dispose(e.scaleChanged.don(A))}const l=()=>{const A=e.anchor,h=e.offset;A?o.originRatioAndOffset=[...A,-h[0],-h[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>l())),l(),this.dispose(o.clickEvent.disposableOn(A=>{const{offsetX:h,offsetY:f}=A,d={type:A.button===0?"leftClick":A.button===2?"rightClick":void 0,add:{mousePos:[h,f]}};e.widgetEvent.emit(d)})),this.dispose(o.hoveredChanged.disposableOn(A=>{if(A===void 0)return;const h={type:A?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(h)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Xx extends c.Destroyable{constructor(e,i,o){super();L(this,"_czmGeoImageModel");L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmGeoImageModel.position)return Rn(this.czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoImageModel=this.disposeVar(new $i(i,e.id));const r=this._czmGeoImageModel;this.ad(i.clickEvent.don(f=>{const p=f==null?void 0:f.pointerEvent;p&&(this._isPointEvent=!0,this._eventInfo={type:p.button==0?"leftClick":p.button==2?"rightClick":"leftClick",add:{mousePos:[p.offsetX,p.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var p,d,m;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((p=this._eventInfo.add)!=null&&p.mousePos)&&Math.abs(f.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((m=this._eventInfo.add)==null?void 0:m.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),c.registerCreatedEventUpdate(this,e,()=>{const f=i.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((p,d)=>{(p==null?void 0:p.sceneObject)==(d==null?void 0:d.sceneObject)||(p==null?void 0:p.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(p!=null&&p.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:p==null?void 0:p.screenPosition}},p.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&p.sceneObject.id==e.id&&(r.scale=[r.scale[0]*1.5,r.scale[1]*1.5])),d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:p==null?void 0:p.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&d.sceneObject.id==e.id&&(r.scale=[r.scale[0]/1.5,r.scale[1]/1.5])))}))});const a=e.sizeByContent,l=(f=>{let p=f;return f.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Fh(p))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=l,u.onload=()=>{if(a)r.size=[u.width/100,u.height/100];else{const f=e.size;r.size=[f[0]/100,f[1]/100]}},r.uri=l,this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.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(Rt([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const A=()=>{const f=e.anchor,p=e.offset;f?r.originRatioAndOffset=[...f,-p[0]/100,-p[1]/100]:r.originRatioAndOffset=[0,0,0,0]},h=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(h.disposableOn(()=>A())),A()}get czmGeoImageModel(){return this._czmGeoImageModel}}const lc=class lc extends jl{constructor(e,i){super(e,i);L(this,"_resetting");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(c.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new c.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new $x(this.sceneObject,this.czmViewer):new Xx(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&a.obj&&a.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(lc,"type",lc.register("ESCesiumViewer",c.ESImageLabel.type,lc));let wg=lc;function DO(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const uc=class uc extends Hn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const a=this.ad(c.reactJson(""));{const u=()=>{if(typeof e.url=="string")a.value=c.ESSceneObject.context.getStrFromEnv(e.url);else{const A=e.url;A.url=c.ESSceneObject.context.getStrFromEnv(A.url),a.value=A}};u(),this.ad(e.urlChanged.don(u))}const s=()=>{var d;if(!a.value)return;const u=(((d=e.options)==null?void 0:d.type)??"auto").toLowerCase(),A=e.options??{};let h={type:"UrlTemplateImageryProvider",url:a.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...A},f=a.value,p=typeof f=="string"?f:f.url;if(u==="auto"){const m=p.toLowerCase();if(m.startsWith("ion://")){const y=+m.substring(6);h={...A,assetId:y,type:"IonImageryProvider"}}else if(m.includes("{x}")||m.includes("{y}")||m.includes("{z}"))h.type="UrlTemplateImageryProvider";else if(m.includes("wmts"))h.type="WebMapTileServiceImageryProvider";else if(m.includes("wms"))h.type="WebMapServiceImageryProvider";else{if(p.includes("/tilemapresource.xml")){const v=p.split("/tilemapresource.xml").join("");typeof f=="string"?f=v:f.url=v,h.url=f}h.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&p.includes("/tilemapresource.xml")){const m=p.split("/tilemapresource.xml").join("");typeof f=="string"?f=m:f.url=m,h.url=f}else if(u==="ion"&&p.startsWith("ion://")){const v=+p.substring(6);h={...A,assetId:v,type:"IonImageryProvider"}}h.type=DO(u)}console.log("imageryProvider",h),r.imageryProvider=h};s();const l=this.dv(c.createNextAnimateFrameEvent(a.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(s))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"alpha"],[e,"opacity"])),this.d(c.bind([r,"alpha"],[e,"czmAlpha"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.ad(c.track([r,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(uc,"type",uc.register("ESCesiumViewer",c.ESImageryLayer.type,uc));let bg=uc;class RO extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_show");L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(c.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new ut(i,this._sceneObject.id)),this._czmTexture=this.dv(new ft(i));const a=e,s=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(c.track([s,"show"],[this,"show"])),this.dispose(c.track([s,"show"],[a,"show"])),this.dispose(c.track([s,"allowPicking"],[a,"allowPicking"])),this.dispose(c.track([s,"rotation"],[a,"rotation"])),this.dispose(c.track([s,"position"],[a,"position"])),this.dispose(c.track([s,"scale"],[a,"scale"])),this.ad(a.allowPickingChanged.don(()=>{s.allowPicking=a.allowPicking,s.pass=a.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const h=a.size/2,f=r[0].map(S=>S*h),p=r[1].map(S=>S*h),d=r[2].map(S=>S*h),m=r[3].map(S=>S*h),v=[...f,...p,...d,...m];let y=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(y=y.reverse());const g=[0,0],_=[1,0],x=[1,1],E=[0,1];let B=[];o=="east"||o=="south"?B=[..._,...g,...E,...x]:o=="west"?B=[..._,...x,...E,...g]:o=="top"?B=[...E,...x,..._,...g]:B=[...g,..._,...x,...E],s.indexTypedArray=new Uint16Array(y),s.attributes={position:{typedArray:new Float32Array(v),componentsPerAttribute:3},st:{typedArray:new Float32Array(B),componentsPerAttribute:2}},l.uri=c.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${a.mode}/${o}.${a.mode!="blueSky"?"png":"jpg"}`);const P=i.getCameraInfo();if(P!=null){const T=c.getDistancesFromPositions([a.position,P.position],"NONE")[0]/(a.size/2*a.autoOpacityFactor);this.changeOpacity(a.autoFollow?1:T)}const I=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!I)return;const{min:D,max:F}=I;s.setLocalAxisedBoundingBox(D,F)};u();const A=this.disposeVar(c.createNextAnimateFrameEvent(a.sizeChanged,a.modeChanged));this.dispose(A.disposableOn(u))}}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 UO extends c.Destroyable{constructor(n,e,i){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{a()}));function a(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const s=e.getCameraInfo();if(s!=null&&(r==null||r.position[0]!=s.position[0]||r.position[1]!=s.position[1]||r.position[2]!=s.position[2]||r.rotation[0]!=s.rotation[0]||r.rotation[1]!=s.rotation[1]||r.rotation[2]!=s.rotation[2])){r=s;const A=c.getDistancesFromPositions([n.position,r.position],"NONE")[0]/(n.size/2*n.autoOpacityFactor);n.autoFollow?(n.position=r.position,o&&(o=!1,i.forEach(h=>{h.changeOpacity(1)}))):i.forEach(h=>{h.changeOpacity(A)})}}a()}}const Bt=class Bt extends He{constructor(e,i){super(e,i);L(this,"_czmSkyBoxComponents",[]);if(!i.viewer){console.warn("viewer is undefined!");return}!Bt._defaultLocalBox&&Bt._firstLoad&&(Bt._firstLoad=!1,Bt._defaultLocalBox=i.xbsjLocalBoxSources),Bt._eSLocalSkyBoxArr.push(e),this.d(()=>{Bt._eSLocalSkyBoxArr.includes(e)&&Bt._eSLocalSkyBoxArr.splice(Bt._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 a in r)if(Object.prototype.hasOwnProperty.call(r,a)){const s=r[a];this._czmSkyBoxComponents.push(this.dv(new RO(e,i,a,s)))}{const a=this.disposeVar(c.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new c.ObjResettingWithEvent(a,()=>(this.ChangeAutoFollow(),new UO(e,i,this._czmSkyBoxComponents))))}{const a=()=>{this.ChangeAutoFollow()},s=this.disposeVar(c.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(s.disposableOn(a))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let i=Bt._eSLocalSkyBoxArr.length-1;i>=0;i--){const o=Bt._eSLocalSkyBoxArr[i];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}i==0&&(e.xbsjLocalBoxSources=Bt._defaultLocalBox)}Bt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Bt._defaultLocalBox)}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.size??c.ESLocalSkyBox.defaults.size;return o.position?(Rn(r,o,i,o.position,a,e,!0),!0):!1}}};L(Bt,"type",Bt.register("ESCesiumViewer",c.ESLocalSkyBox.type,Bt)),L(Bt,"_defaultLocalBox"),L(Bt,"_firstLoad",!0),L(Bt,"_eSLocalSkyBoxArr",[]);let xg=Bt;const ni=class ni extends He{constructor(e,i){super(e,i);L(this,"_geoCustomDivPoi");L(this,"_textFunc",this.disposeVar(c.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new bt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(a=>{(e.allowPicking??c.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(a)})),this.dispose(r.innerHtmlMounted.disposableOn(a=>{const s=a.firstElementChild;s&&(s.style.pointerEvents="auto",s.style.cursor="default",s.onclick=l=>r.pickFromDiv(s,{type:"viewerPicking",pointerEvent:l}))}));{const a=()=>{if(!e.position)return;const l=(this.textFunc??ni.defaultTextFunc_度格式)(e.position);r.innerHTML=_o(l)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(s.disposableOn(a))}{const a=()=>{i.lonLatFormat??(i.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=i.lonLatFormat=="DECIMAL_DEGREE"?ni.defaultTextFunc_度格式:i.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?ni.defaultTextFunc_度分格式:ni.defaultTextFunc_度分秒格式};a(),this.d(i.lonLatFormatChanged.don(()=>{a()}))}}}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,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ni,"type",ni.register("ESCesiumViewer",c.ESLocationMeasurement.type,ni)),L(ni,"defaultTextFunc_度格式",e=>{if(!e)return"";const[i=0,o=0,r=0]=e;return`经度: ${i.toFixed(5)}°
3105
+ `,_t=class _t extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_data");L(this,"_defaultHeight",{});L(this,"defaultBoundingSphere");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 a=this.dv(c.createProcessingFromAsyncFunc(async u=>{this.dataSource&&r(),this.url&&(typeof this.url=="object"?this._data=this.url:c.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(c.ESSceneObject.context.getStrFromEnv(this.url)).then(A=>A.json()).then(A=>{this._data=A}).catch(A=>{console.warn("ESGeoJson数据加载失败",A)}),this.dataSource=await w.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(A=>{var f,p;const h=[];for(const d of A.entities.values){w.Entity.prototype&&(d.ESSceneObjectID=i),this._isEntityShow(d,e);do{if(d.polygon){h.push(...(f=d.polygon.hierarchy)==null?void 0:f.getValue(w.JulianDate.now()).positions);break}if(d.polyline){h.push(...(p=d.polyline.positions)==null?void 0:p.getValue(w.JulianDate.now()));break}if(d.position){const m=d.position.getValue(w.JulianDate.now());m&&h.push(m);break}}while(!1)}h.length>0&&(this.defaultBoundingSphere=w.BoundingSphere.fromPoints(h))}))})),s=()=>{a.isRunning&&a.cancel(),a.restart()};s();const l=this.dv(c.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(s))}{const a=()=>{var l,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(A){console.error(A)}else{const A=this.dataSource.entities.values;for(let h=0;h<A.length;h++){const f=A[h];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(l=f.polygon.height)==null?void 0:l.getValue(w.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new w.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new w.ConstantProperty(!this.fillGround),f.polygon.heightReference=new w.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?w.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?w.HeightReference.CLAMP_TO_GROUND:w.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new w.ConstantProperty(this.filled??_t.defaults.filled),f.polygon.material=new w.ColorMaterialProperty(new w.Color(...this.fillColor??_t.defaults.fillColor)),f.polygon.outline=new w.ConstantProperty(!1),f.polygon.classificationType=w.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new w.PolylineGraphics;const p=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(w.JulianDate.now()).positions));w.Cartesian3.equals(p[0],p[p.length-1])||p.push(p[0]),f.polyline.positions=p,f.polyline.classificationType=w.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=w.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new w.ConstantProperty(this.stroked??_t.defaults.stroked),f.polyline.width=new w.ConstantProperty(this.strokeWidth??_t.defaults.strokeWidth),f.polyline.material=new w.ColorMaterialProperty(new w.Color(...this.strokeColor??_t.defaults.strokeColor)),f.polyline.clampToGround=new w.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new w.ConstantProperty(this.imageShow??_t.defaults.imageShow),f.billboard.width=new w.ConstantProperty(this.imageSize?this.imageSize[0]:_t.defaults.imageSize[0]),f.billboard.height=new w.ConstantProperty(this.imageSize?this.imageSize[1]:_t.defaults.imageSize[1]);const p=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:_t.defaults.imageUrl;f.billboard.image=new w.ConstantProperty(c.ESSceneObject.context.getStrFromEnv(p)),f.billboard.horizontalOrigin=new w.ConstantProperty(w.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new w.ConstantProperty(w.VerticalOrigin.TOP),f.billboard.heightReference=new w.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?w.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?w.HeightReference.CLAMP_TO_GROUND:w.HeightReference.RELATIVE_TO_GROUND);const d=this.imageAnchor??_t.defaults.imageAnchor,m=this.imageOffset??_t.defaults.imageOffset;if(f.billboard.pixelOffset=new w.ConstantProperty(w.Cartesian2.fromArray([-d[0]*f.billboard.width.getValue(w.JulianDate.now())+m[0],-d[1]*f.billboard.height.getValue(w.JulianDate.now())+m[1]])),f.label=new w.LabelGraphics,!f.label)return;f.label.show=new w.ConstantProperty(this.textShow??_t.defaults.textShow),f.label.heightReference=new w.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?w.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?w.HeightReference.CLAMP_TO_GROUND:w.HeightReference.RELATIVE_TO_GROUND),f.label.text=new w.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??_t.defaults.textDefaultText),f.label.fillColor=new w.ConstantProperty(new w.Color(...this.textColor??_t.defaults.textColor)),f.label.showBackground=new w.ConstantProperty(this.textBackgroundColor!=null);const v=this.textFontSize&&this.textFontSize!=0?this.textFontSize:_t.defaults.textFontSize,y=this.textOffset??_t.defaults.textOffset;f.label.backgroundColor=new w.ConstantProperty(new w.Color(...this.textBackgroundColor??_t.defaults.textBackgroundColor)),f.label.font=new w.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${v}px ${this.textFontFamily??_t.defaults.textFontFamily}`),f.label.horizontalOrigin=new w.ConstantProperty(w.HorizontalOrigin.LEFT),f.label.verticalOrigin=new w.ConstantProperty(w.VerticalOrigin.TOP),f.label.eyeOffset=new w.ConstantProperty(w.Cartesian3.fromArray([0,0,-1]));const g=this.textAnchor??_t.defaults.textAnchor;f.label.pixelOffset=new w.ConstantProperty(w.Cartesian2.fromArray([-g[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(w.JulianDate.now()),f.label.font.getValue(w.JulianDate.now())))+y[0],-g[1]*((this.textBackgroundColor?10:0)+v)+y[1]]))}}}};a();const s=this.dv(c.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.classificationTypeChanged));this.dispose(s.don(a))}{const a=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let u=0;u<l.length;u++){const A=l[u];this._isEntityShow(A,e)}};a();const s=this.ad(c.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(s.don(a))}{const a=()=>{if(this.loadFuncStr)try{const s=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=s}catch(s){console.error(s),this.loadFun=void 0}else this.loadFun=void 0};a(),this.dispose(this.loadFuncStrChanged.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&o.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:a?a/1e3:void 0})}))}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,i="16px sans-serif"){const r=document.createElement("canvas").getContext("2d");return r.font=i,r.measureText(e).width}_isEntityShow(e,i){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0)e.show=this.show;else if((o=i.viewer)!=null&&o.camera){if(!this.show){e.show=this.show;return}const r=w.JulianDate.now();let a;if(e.polygon&&e.polygon.hierarchy)a=c.getMinMaxCorner(e.polygon.hierarchy.getValue(r).positions.map(u=>De(u))).center;else if(e.polyline&&e.polyline.positions)a=c.getMinMaxCorner(e.polyline.positions.getValue(r).map(u=>De(u))).center;else if(e.position){const u=e.position.getValue(r);u&&(a=De(u))}if(!a||isNaN(a[0]))return;const s=c.getDistancesFromPositions([a,Mn(i.viewer.camera)],"NONE")[0];let l=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?l=this.minFeatureVisibleDistance<s&&s<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?l=s>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(l=s<this.maxFeatureVisibleDistance),e.show=this.show&&l}}};L(_t,"defaults",{show:!0,allowPicking:!0,url:Kx,defaultLoadFuncStr:qx,defaultLoadFuncDocStr:MO,data:IO,dataMd:FO,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 Zo=_t;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:c.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:c.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:c.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:c.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:c.reactArrayWithUndefined(void 0),imageAnchor:c.reactArrayWithUndefined(void 0),imageOffset:c.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:c.reactArrayWithUndefined(void 0),textBackgroundColor:c.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:c.reactArrayWithUndefined(void 0),textOffset:c.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Zo||(Zo={})),c.extendClassProps(Zo.prototype,Zo.createDefaultProps);const nc=class nc extends Hn{constructor(e,i){super(e,i);L(this,"_pointFeatures",this.disposeVar(c.react(void 0)));L(this,"_defaultPointsBoundingSphere");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=Mt(o);if(!r)return;const{screenManager:a}=r,s=this.disposeVar(new Zo(i,e.id));{const l=()=>{if(!e.features)return;const u=c.toGeoJson(e.features),A={type:u.type,features:[]};s.url={type:u.type,features:u.features.filter(h=>h.geometry.type.toLowerCase().includes("point")?(A.features.push(h),!1):!0)},this.pointFeatures=A};l(),this.ad(e.featuresChanged.don(l))}this.ad(c.track([s,"show"],[e,"show"])),this.ad(c.track([s,"allowPicking"],[e,"allowPicking"])),this.ad(c.track([s,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(c.track([s,"stroked"],[e,"stroked"])),this.ad(c.track([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(c.track([s,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(c.track([s,"strokeColor"],[e,"strokeColor"])),this.ad(c.track([s,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(c.track([s,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(c.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(c.track([s,"filled"],[e,"filled"])),this.ad(c.track([s,"fillColor"],[e,"fillColor"])),this.ad(c.track([s,"fillMaterial"],[e,"fillMaterial"])),this.ad(c.track([s,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(c.track([s,"fillGround"],[e,"fillGround"])),this.ad(c.track([s,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(c.track([s,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(c.track([s,"heightReference"],[e,"heightReference"])),this.ad(c.track([s,"classificationType"],[e,"classificationType"]));{const l=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=w.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(h=>Ye(h))).flat(1/0)))};l(),this.ad(this.pointFeaturesChanged.don(l))}{let l={id:"",layer:"",screenObjectIds:[]};const u=()=>{l.id!=""&&(a.remove(l.layer,l.id,{label:l.screenObjectIds}),l={id:"",layer:"",screenObjectIds:[]})};this.ad(()=>{u()});const A=()=>{if(u(),!((e.textShow??c.ESGeoJson.defaults.textShow)&&(e.show??c.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.textFontSize&&e.textFontSize!=0?e.textFontSize:c.ESGeoJson.defaults.textFontSize,p=e.textOffset??c.ESGeoJson.defaults.textOffset,d=e.textAnchor??c.ESGeoJson.defaults.textAnchor,m={heightReference:w.HeightReference[e.heightReference??c.ESGeoJson.defaults.heightReference],fillColor:new w.Color(...e.textColor??c.ESGeoJson.defaults.textColor),showBackground:e.textBackgroundColor!=null,backgroundColor:new w.Color(...e.textBackgroundColor??c.ESGeoJson.defaults.textBackgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${f}px ${e.textFontFamily??c.ESGeoJson.defaults.textFontFamily}`,horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.TOP,eyeOffset:w.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new w.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((v,y)=>{const g=e.textProperty&&e.textProperty!==""&&(v!=null&&v.properties)&&v.properties[e.textProperty]?v.properties[e.textProperty]:e.textDefaultText??c.ESGeoJson.defaults.textDefaultText;m.pixelOffset=w.Cartesian2.fromArray([-d[0]*((e.textBackgroundColor?-14:0)+this._getTextPixelWidth(g,m.font))+p[0],-d[1]*((e.textBackgroundColor?10:0)+f)+p[1]]),(v.geometry.type=="Point"?[v.geometry.coordinates]:v.geometry.coordinates).forEach((x,E)=>{const B={index:`${y}${E}`,name:g,position:x,zOrder:e.zIndex??c.ESGeoJson.defaults.zIndex,properties:v.properties},P=a.addLabel(e.id,e.typeName,m,B);l.id=P.id,l.layer=P.layer,l.screenObjectIds.push(P.screenObjectId)})})};A();const h=this.ad(c.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(h.don(A))}{this.ad(()=>{u()});let l={id:"",layer:"",screenObjectIds:[]};const u=()=>{l.id!=""&&(a.remove(l.layer,l.id,{billboard:l.screenObjectIds}),l={id:"",layer:"",screenObjectIds:[]})},A=()=>{if(u(),!((e.imageShow??c.ESGeoJson.defaults.imageShow)&&(e.show??c.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.imageAnchor??c.ESGeoJson.defaults.imageAnchor,p=e.imageOffset??c.ESGeoJson.defaults.imageOffset,d=e.imageSize?e.imageSize[0]:c.ESGeoJson.defaults.imageSize[0],m=e.imageSize?e.imageSize[1]:c.ESGeoJson.defaults.imageSize[1],v={width:d,height:m,image:c.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:c.ESGeoJson.defaults.imageUrl),horizontalOrigin:w.HorizontalOrigin.LEFT,verticalOrigin:w.VerticalOrigin.TOP,heightReference:w.HeightReference[e.heightReference??c.ESGeoJson.defaults.heightReference],pixelOffset:w.Cartesian2.fromArray([-f[0]*d+p[0],-f[1]*m+p[1]]),distanceDisplayCondition:new w.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((y,g)=>{(y.geometry.type=="Point"?[y.geometry.coordinates]:y.geometry.coordinates).forEach((x,E)=>{const B={index:`${g}${E}`,name:"",position:x,zOrder:e.zIndex??c.ESGeoJson.defaults.zIndex,properties:y.properties},P=a.addImage(e.id,e.typeName,v,B);l.id=P.id,l.layer=P.layer,l.screenObjectIds.push(P.screenObjectId)})})};A();const h=this.ad(c.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(h.don(A))}this.ad(e.flyToEvent.disposableOn(l=>{if(!i.actived)return;if(e.flyInParam){const{position:A,rotation:h,flyDuration:f}=e.flyInParam;return Fe(i.viewer,A,void 0,h,f),!0}let u;s.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=w.BoundingSphere.fromBoundingSpheres([s.defaultBoundingSphere,this._defaultPointsBoundingSphere]):s.defaultBoundingSphere?u=s.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&Rn(i,e,this.id,De(u.center),u.radius,l)}));{const l=async(u,A,h)=>{if(!i.actived)return;const f=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,A)));if(!(!f||!(f!=null&&f.positions)))if(f.type=="Point"||f.type=="MultiPoint")Rn(i,e,this.id,await this._calculateFeatureHeight(f.type=="MultiPoint"?f.positions.flat():f.positions,e.heightReference,i),1e3,h);else{const p=f.type=="Polygon"||f.type=="MultiPolygon"||f.type=="MultiLineString";let d=[];p?d=f.positions.flat(f.type=="MultiPolygon"?2:1).map(g=>this._calculateFeatureHeight(g,e.fillGround?"CLAMP_TO_GROUND":"NONE",i)):d=f.positions.map(g=>this._calculateFeatureHeight(g,e.strokeGround?"CLAMP_TO_GROUND":"NONE",i));const{minPos:m,maxPos:v,center:y}=c.getMinMaxCorner(d);Rn(i,e,this.id,y,c.getDistancesFromPositions([m,v],"NONE")[0],h)}};this.d(e.flyToFeatureEvent.don((u,A,h)=>l(u,A,h))),this.d(e.flyToFeatureIndexEvent.don((u,A)=>l(u,void 0,A)))}}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}_getFeatureByIndexOrProperties(e,i){var s,l,u,A,h,f,p,d;const{sceneObject:o}=this,r=o.features;if(!r)return;const a=Reflect.get(r,"features")||Reflect.get(r,"geometries");if(a){if(i){let m=a.find(v=>(v==null?void 0:v.properties[e])==i);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)||((l=m==null?void 0:m.geometry)==null?void 0:l.coordinates)}}else if(typeof e=="number")return{type:(u=a[e])!=null&&u.coordinates?a[e].type:(h=(A=a[e])==null?void 0:A.geometry)==null?void 0:h.type,positions:((f=a[e])==null?void 0:f.coordinates)||((d=(p=a[e])==null?void 0:p.geometry)==null?void 0:d.coordinates)}}}async _calculateFeatureHeight(e,i,o){const r=[...e];return i=="NONE"?r[2]=r[2]??0:i=="CLAMP_TO_GROUND"||!r[2]?r[2]=await o.getTerrainHeight(r)??0:r[2]+=await o.getTerrainHeight(r)??0,r}_getTextPixelWidth(e,i="16px sans-serif"){const r=document.createElement("canvas").getContext("2d");return r.font=i,r.measureText(e).width}};L(nc,"type",nc.register("ESCesiumViewer",c.ESGeoJson.type,nc));let fg=nc;const ic=class ic extends sn{constructor(e,i){super(e,i);L(this,"_czmGeoESRectangle");L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Je(i,e.id)),this._czmGeoESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,a=this._geoPolyline;a.arcType="RHUMB",this.dispose(c.track([a,"color"],[e,"strokeColor"])),this.dispose(c.track([a,"width"],[e,"strokeWidth"])),this.dispose(c.track([a,"ground"],[e,"strokeGround"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.show=e.show&&e.stroked,r.show=e.show&&e.filled};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:u,maxPos:A}=c.getMinMaxCorner(l);r.rectangle=[u[0],u[1],A[0],A[1]],r.height=l[0][2],r.extrudedHeight=l[0][2];const h=l.map(m=>(l&&(m[2]=l[0][2]),m)),f=h[0],p=h[1],d=[f,[f[0],p[1],f[2]],p,[p[0],f[1],p[2]]];a.positions=[...d,f]}else r.rectangle=void 0,a.positions=void 0,r.height=0,r.extrudedHeight=0};s(),this.dispose(e.pointsChanged.disposableOn(()=>s()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmGeoESRectangle:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(ic,"type",ic.register("ESCesiumViewer",c.ESGeoRectangle.type,ic));let dg=ic;class Xl extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new zr(e,i));const{geoPolygon:o}=this;this.dispose(c.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(a=>{o.flyTo(a)})),this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"fill"],[this,"filled"])),this.dispose(c.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(c.bind([o,"ground"],[this,"ground"])),this.dispose(c.bind([o,"outline"],[this,"outline"])),this.dispose(c.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(c.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(c.bind([o,"color"],[this,"color"])),this.dispose(c.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const a=Ud([...this.positions,this.positions[0]]);o.positions=a}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:c.reactArray([1,1,1,1]),outlineWidth:1,color:c.reactArrayWithUndefined([1,1,1,.5]),positions:c.reactPositions(void 0),depth:0})})(Xl||(Xl={})),c.extendClassProps(Xl.prototype,Xl.createDefaultProps);const rc=class rc extends sn{constructor(e,i){super(e,i);L(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Xl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"color"],[e,"fillColor"])),this.dispose(c.track([r,"ground"],[e,"ground"]));{const a=()=>{r.ground=e.ground||e.fillGround};a();const s=this.dv(c.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(s.don(a))}{const a=()=>{r.color=e.filled?e.fillColor:$l.defaults.fillStyle.color};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}this.dispose(c.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(rc,"type",rc.register("ESCesiumViewer",$l.type,rc));let pg=rc;const oc=class oc extends He{constructor(e,i){super(e,i);L(this,"_czmModel");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Wt(i,e.id));const r=this._czmModel;this.d(r.readyEvent.don(s=>{var l;r.activeAnimationsJson=(l=r.gltf.animations)==null?void 0:l.map((u,A)=>({index:A,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(s),e.readyEvent.emit(s)})),this.ad(new Ih(o,this._czmModel)),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"color"],[e,"czmColor"])),this.d(c.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(c.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(c.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(c.track([r,"scale"],[e,"scale"])),this.ad(c.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(c.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const s=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};s(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>s(l)))}{const s=()=>{var l,u;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};s(),this.ad(e.czmEnvironmentMapManagerChanged.don(s))}{const s=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,r.rotation=l};s(),this.d(e.rotationChanged.don(s));{const l=()=>{if(s(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(u=>{const A=JSON.parse(JSON.stringify(u));return!A.rotation&&(A.rotation=[0,0,0]),A.rotation[0]+=90,A})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(s=>{r.setMaterial(s)}));{const s=()=>{const l=[...r.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};s(),this.d(r.rotationChanged.don(s))}{const s=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};l(),this.d(s.don(l))}const a=()=>{var s;r.url=c.ESSceneObject.context.getStrFromEnv(Fh(typeof e.url=="string"?e.url:((s=e.url)==null?void 0:s.url)??c.ESGltfModel.defaults.url))};a(),this.d(e.urlChanged.don(a)),this.d(e.setNodePositionEvent.don((s,l)=>{r.setNodeTranslation(s,l)})),this.d(e.setNodeRotationEvent.don((s,l)=>{r.setNodeRotation(s,l)})),this.d(e.setNodeScaleEvent.don((s,l)=>{r.setNodeScale(s,l)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,i){const{sceneObject:o,czmViewer:r,model:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&bn(r,o,i,e,a,!0),!!a):!1}};L(oc,"type",oc.register("ESCesiumViewer",c.ESGltfModel.type,oc));let mg=oc;function Zx(t,n){const e=t[0]-n[0],i=t[1]-n[1],o=t[2]-n[2];return Math.sqrt(e*e+i*i+o*o)}class Yl extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distance",this.disposeVar(c.react(0)));L(this,"_surfaceDistance",this.disposeVar(c.react(0)));L(this,"_height",this.disposeVar(c.react(0)));L(this,"_middlePosition",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_heightPosition",this.disposeVar(c.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 a=this._surfaceDistance.value=c.geoDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="RHUMB"){const a=this._surfaceDistance.value=c.geoRhumbDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="NONE"){const a=c.lbhToXyz(this.positions[0]),s=c.lbhToXyz(this.positions[1]);this._distance.value=Zx(a,s),this._surfaceDistance.value=Zx(c.lbhToXyz(this._middlePosition.value),s),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(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const a=this.disposeVar(new Je(e,i));a.ground=!1,a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"]));{a.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[u,A]=this.positions;a.positions=[u,A,[u[0],u[1],A[2]]]}else a.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&a.flyTo(l)}));const s=this.disposeVar(new bt(e,i));this.dispose(c.track([s,"shadowDom"],[this,"shadowDom"])),this.dispose(c.track([s,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(c.track([s,"show"],[this,"show"]));{const l=()=>{s.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{s.innerHTML=_o(`高度: ${Mh(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(s.pickedEvent.don(l=>{Gi(l)===0&&this.pickedEvent.emit(l)}))}}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:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Yl||(Yl={})),c.extendClassProps(Yl.prototype,Yl.createDefaultProps);const sc=class sc extends sn{constructor(e,i){super(e,i);L(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Yl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(sc,"type",sc.register("ESCesiumViewer",c.ESHeightMeasurement.type,sc));let gg=sc;const yg={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"}]},ac=class ac extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Wt(i,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Rt([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"])),this.d(r.readyEvent.don(m=>{e.readyEvent.emit(m)}));{const m=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),v=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};v(),this.d(m.don(v))}const a=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),A=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),h=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":r.url=a;break;case"police":r.url=s;break;case"pedestrian":r.url=l;break;case"stranger":r.url=u;break;case"suitMan":r.url=A;break;case"suitWoman":r.url=h;break;default:r.url=a;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const p=()=>{const m=e.animation??c.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}m==="walking"?r.activeAnimationsJson=yg.czmAnimationsWalk:m==="standing"?r.activeAnimationsJson=yg.czmAnimationsStand:m==="running"&&(r.activeAnimationsJson=yg.czmAnimationsRun)};p();const d=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(d.disposableOn(()=>p())),this.ad(new Ih(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&bn(r,o,i,e,a,!0),!!a)}};L(ac,"type",ac.register("ESCesiumViewer",c.ESHuman.type,ac));let vg=ac;class $x extends c.Destroyable{constructor(e,i){super();L(this,"_czmGeoCanvasImagePoi");L(this,"flyTo",(e,i)=>{if(this.czmGeoCanvasImagePoi.position){Fe(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Gn,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=i,this._czmGeoCanvasImagePoi=this.disposeVar(new yi(i));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=A=>{let h=A;return A.includes("inner://")&&(h="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Fh(h))},a=()=>{const A=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=A,e.sizeByContent){const f=new Image;f.src=A,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},s=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(s.disposableOn(()=>a())),a(),this.d(c.track([o,"zOrder"],[e,"zOrder"])),this.dispose(c.track([o,"show"],[e,"show"])),this.dispose(c.bind([o,"position"],[e,"position"])),this.ad(c.bind([o,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(c.bind([o,"hoverHighlight"],[e,"hoverHighlight"]));{const A=()=>{o.scale=[e.scale[1],e.scale[2]]};A(),this.dispose(e.scaleChanged.don(A))}const l=()=>{const A=e.anchor,h=e.offset;A?o.originRatioAndOffset=[...A,-h[0],-h[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>l())),l(),this.dispose(o.clickEvent.disposableOn(A=>{const{offsetX:h,offsetY:f}=A,d={type:A.button===0?"leftClick":A.button===2?"rightClick":void 0,add:{mousePos:[h,f]}};e.widgetEvent.emit(d)})),this.dispose(o.hoveredChanged.disposableOn(A=>{if(A===void 0)return;const h={type:A?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(h)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Xx extends c.Destroyable{constructor(e,i,o){super();L(this,"_czmGeoImageModel");L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmGeoImageModel.position)return Rn(this.czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoImageModel=this.disposeVar(new $i(i,e.id));const r=this._czmGeoImageModel;this.ad(i.clickEvent.don(f=>{const p=f==null?void 0:f.pointerEvent;p&&(this._isPointEvent=!0,this._eventInfo={type:p.button==0?"leftClick":p.button==2?"rightClick":"leftClick",add:{mousePos:[p.offsetX,p.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var p,d,m;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((p=this._eventInfo.add)!=null&&p.mousePos)&&Math.abs(f.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((m=this._eventInfo.add)==null?void 0:m.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),c.registerCreatedEventUpdate(this,e,()=>{const f=i.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((p,d)=>{(p==null?void 0:p.sceneObject)==(d==null?void 0:d.sceneObject)||(p==null?void 0:p.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(p!=null&&p.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:p==null?void 0:p.screenPosition}},p.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&p.sceneObject.id==e.id&&(r.scale=[r.scale[0]*1.5,r.scale[1]*1.5])),d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:p==null?void 0:p.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&d.sceneObject.id==e.id&&(r.scale=[r.scale[0]/1.5,r.scale[1]/1.5])))}))});const a=e.sizeByContent,l=(f=>{let p=f;return f.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Fh(p))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=l,u.onload=()=>{if(a)r.size=[u.width/100,u.height/100];else{const f=e.size;r.size=[f[0]/100,f[1]/100]}},r.uri=l,this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.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(Rt([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const A=()=>{const f=e.anchor,p=e.offset;f?r.originRatioAndOffset=[...f,-p[0]/100,-p[1]/100]:r.originRatioAndOffset=[0,0,0,0]},h=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(h.disposableOn(()=>A())),A()}get czmGeoImageModel(){return this._czmGeoImageModel}}const lc=class lc extends jl{constructor(e,i){super(e,i);L(this,"_resetting");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(c.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new c.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new $x(this.sceneObject,this.czmViewer):new Xx(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&a.obj&&a.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(lc,"type",lc.register("ESCesiumViewer",c.ESImageLabel.type,lc));let wg=lc;function DO(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const uc=class uc extends Hn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const a=this.ad(c.reactJson(""));{const u=()=>{if(typeof e.url=="string")a.value=c.ESSceneObject.context.getStrFromEnv(e.url);else{const A=e.url;A.url=c.ESSceneObject.context.getStrFromEnv(A.url),a.value=A}};u(),this.ad(e.urlChanged.don(u))}const s=()=>{var d;if(!a.value)return;const u=(((d=e.options)==null?void 0:d.type)??"auto").toLowerCase(),A=e.options??{};let h={type:"UrlTemplateImageryProvider",url:a.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...A},f=a.value,p=typeof f=="string"?f:f.url;if(u==="auto"){const m=p.toLowerCase();if(m.startsWith("ion://")){const y=+m.substring(6);h={...A,assetId:y,type:"IonImageryProvider"}}else if(m.includes("{x}")||m.includes("{y}")||m.includes("{z}"))h.type="UrlTemplateImageryProvider";else if(m.includes("wmts"))h.type="WebMapTileServiceImageryProvider";else if(m.includes("wms"))h.type="WebMapServiceImageryProvider";else{if(p.includes("/tilemapresource.xml")){const v=p.split("/tilemapresource.xml").join("");typeof f=="string"?f=v:f.url=v,h.url=f}h.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&p.includes("/tilemapresource.xml")){const m=p.split("/tilemapresource.xml").join("");typeof f=="string"?f=m:f.url=m,h.url=f}else if(u==="ion"&&p.startsWith("ion://")){const v=+p.substring(6);h={...A,assetId:v,type:"IonImageryProvider"}}h.type=DO(u)}console.log("imageryProvider",h),r.imageryProvider=h};s();const l=this.dv(c.createNextAnimateFrameEvent(a.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(s))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"alpha"],[e,"opacity"])),this.d(c.bind([r,"alpha"],[e,"czmAlpha"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.ad(c.track([r,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(uc,"type",uc.register("ESCesiumViewer",c.ESImageryLayer.type,uc));let bg=uc;class RO extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_show");L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(c.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new ut(i,this._sceneObject.id)),this._czmTexture=this.dv(new ft(i));const a=e,s=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(c.track([s,"show"],[this,"show"])),this.dispose(c.track([s,"show"],[a,"show"])),this.dispose(c.track([s,"allowPicking"],[a,"allowPicking"])),this.dispose(c.track([s,"rotation"],[a,"rotation"])),this.dispose(c.track([s,"position"],[a,"position"])),this.dispose(c.track([s,"scale"],[a,"scale"])),this.ad(a.allowPickingChanged.don(()=>{s.allowPicking=a.allowPicking,s.pass=a.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const h=a.size/2,f=r[0].map(S=>S*h),p=r[1].map(S=>S*h),d=r[2].map(S=>S*h),m=r[3].map(S=>S*h),v=[...f,...p,...d,...m];let y=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(y=y.reverse());const g=[0,0],_=[1,0],x=[1,1],E=[0,1];let B=[];o=="east"||o=="south"?B=[..._,...g,...E,...x]:o=="west"?B=[..._,...x,...E,...g]:o=="top"?B=[...E,...x,..._,...g]:B=[...g,..._,...x,...E],s.indexTypedArray=new Uint16Array(y),s.attributes={position:{typedArray:new Float32Array(v),componentsPerAttribute:3},st:{typedArray:new Float32Array(B),componentsPerAttribute:2}},l.uri=c.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${a.mode}/${o}.${a.mode!="blueSky"?"png":"jpg"}`);const P=i.getCameraInfo();if(P!=null){const T=c.getDistancesFromPositions([a.position,P.position],"NONE")[0]/(a.size/2*a.autoOpacityFactor);this.changeOpacity(a.autoFollow?1:T)}const I=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!I)return;const{min:D,max:F}=I;s.setLocalAxisedBoundingBox(D,F)};u();const A=this.disposeVar(c.createNextAnimateFrameEvent(a.sizeChanged,a.modeChanged));this.dispose(A.disposableOn(u))}}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 UO extends c.Destroyable{constructor(n,e,i){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{a()}));function a(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const s=e.getCameraInfo();if(s!=null&&(r==null||r.position[0]!=s.position[0]||r.position[1]!=s.position[1]||r.position[2]!=s.position[2]||r.rotation[0]!=s.rotation[0]||r.rotation[1]!=s.rotation[1]||r.rotation[2]!=s.rotation[2])){r=s;const A=c.getDistancesFromPositions([n.position,r.position],"NONE")[0]/(n.size/2*n.autoOpacityFactor);n.autoFollow?(n.position=r.position,o&&(o=!1,i.forEach(h=>{h.changeOpacity(1)}))):i.forEach(h=>{h.changeOpacity(A)})}}a()}}const Bt=class Bt extends He{constructor(e,i){super(e,i);L(this,"_czmSkyBoxComponents",[]);if(!i.viewer){console.warn("viewer is undefined!");return}!Bt._defaultLocalBox&&Bt._firstLoad&&(Bt._firstLoad=!1,Bt._defaultLocalBox=i.xbsjLocalBoxSources),Bt._eSLocalSkyBoxArr.push(e),this.d(()=>{Bt._eSLocalSkyBoxArr.includes(e)&&Bt._eSLocalSkyBoxArr.splice(Bt._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 a in r)if(Object.prototype.hasOwnProperty.call(r,a)){const s=r[a];this._czmSkyBoxComponents.push(this.dv(new RO(e,i,a,s)))}{const a=this.disposeVar(c.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new c.ObjResettingWithEvent(a,()=>(this.ChangeAutoFollow(),new UO(e,i,this._czmSkyBoxComponents))))}{const a=()=>{this.ChangeAutoFollow()},s=this.disposeVar(c.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(s.disposableOn(a))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let i=Bt._eSLocalSkyBoxArr.length-1;i>=0;i--){const o=Bt._eSLocalSkyBoxArr[i];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}i==0&&(e.xbsjLocalBoxSources=Bt._defaultLocalBox)}Bt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Bt._defaultLocalBox)}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.size??c.ESLocalSkyBox.defaults.size;return o.position?(Rn(r,o,i,o.position,a,e,!0),!0):!1}}};L(Bt,"type",Bt.register("ESCesiumViewer",c.ESLocalSkyBox.type,Bt)),L(Bt,"_defaultLocalBox"),L(Bt,"_firstLoad",!0),L(Bt,"_eSLocalSkyBoxArr",[]);let xg=Bt;const ni=class ni extends He{constructor(e,i){super(e,i);L(this,"_geoCustomDivPoi");L(this,"_textFunc",this.disposeVar(c.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new bt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(a=>{(e.allowPicking??c.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(a)})),this.dispose(r.innerHtmlMounted.disposableOn(a=>{const s=a.firstElementChild;s&&(s.style.pointerEvents="auto",s.style.cursor="default",s.onclick=l=>r.pickFromDiv(s,{type:"viewerPicking",pointerEvent:l}))}));{const a=()=>{if(!e.position)return;const l=(this.textFunc??ni.defaultTextFunc_度格式)(e.position);r.innerHTML=_o(l)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(s.disposableOn(a))}{const a=()=>{i.lonLatFormat??(i.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=i.lonLatFormat=="DECIMAL_DEGREE"?ni.defaultTextFunc_度格式:i.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?ni.defaultTextFunc_度分格式:ni.defaultTextFunc_度分秒格式};a(),this.d(i.lonLatFormatChanged.don(()=>{a()}))}}}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,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ni,"type",ni.register("ESCesiumViewer",c.ESLocationMeasurement.type,ni)),L(ni,"defaultTextFunc_度格式",e=>{if(!e)return"";const[i=0,o=0,r=0]=e;return`经度: ${i.toFixed(5)}°
3106
3106
  纬度: ${o.toFixed(5)}°
3107
3107
  高度: ${r.toFixed(2)}m`}),L(ni,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[i,o,r]=Md(e,!0);return`经度: ${i}
3108
3108
  纬度: ${o}
@@ -3843,8 +3843,8 @@ return material;
3843
3843
  material.alpha = fragColor.a;
3844
3844
 
3845
3845
  return material;
3846
- }`},translucent:!0}),NV(),HV(),GV(),KV(),ZV(),$V(),XV(),VV(),l3(),u3(),h3(),D3(),w.Camera.DEFAULT_VIEW_RECTANGLE=w.Rectangle.fromDegrees(70,5,140,55);function ON(){return new Promise((t,n)=>w.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class LN extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Mt(s);if(l&&(l.destroy(),Qv(s,void 0)),w.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=QV;await s.promise(ON());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=w.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=w.JulianDate.fromDate(new Date(e.currentTime));w.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=w.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new pE(A,e);Qv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const zN=new w.EllipsoidTerrainProvider;class iE extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??zN}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class rE extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof bt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof bt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof bt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof bt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class kN extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class QN extends c.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class VN extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new QN(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class NN extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new VN(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class oE extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new kN(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new NN(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class sE extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,p]=u;try{(async()=>{const{scene:d,camera:m}=i,v=Ze(A),y=m.getPickRay(v);if(y){let E;if(h?E=await d.pickFromRayMostDetailed(y,this.objectsToExclude):E=d.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=De(E.position);return B?f(B):p(new Error("positionFromCartesian failed"))}if(!(d.terrainProvider instanceof w.EllipsoidTerrainProvider)){const B=d.globe.pick(y,d);if(!B)return p(new Error("scene.globe.pick failed"));const P=De(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):p(new Error("positionFromCartesian failed"))}}const g=d.terrainProvider instanceof w.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,_=i.camera.pickEllipsoid(Ze(A),g);if(!_)return p(new Error("Pick failed"));const x=De(_);return x?f(x):p(new Error("positionFromCartesian failed"))})()}catch(d){p(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,p,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let m=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!m&&w.defined(i.scene.globe)&&(m=await HN(i,Ze(A)));let v;if(m&&m instanceof w.Cesium3DTileFeature){v={};try{m&&m.getPropertyIds().forEach(F=>{v&&(v[F]=m.getProperty(F))})}catch(D){console.warn(D)}}if(!m){const{left:D,top:F}=e.container.getBoundingClientRect();m=(E=document.elementFromPoint(A[0]+D,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;m&&(m.id&&m.id instanceof w.Entity&&m.id.ESSceneObjectID?y=m.id.ESSceneObjectID:m.collection&&m.collection.ESSceneObjectID?y=m.collection.ESSceneObjectID:m.primitive&&m.primitive.ESSceneObjectID?y=m.primitive.ESSceneObjectID:Array.isArray(m)&&m[0]instanceof w.ImageryLayerFeatureInfo?y=m[0].imageryLayer.ESSceneObjectID:m instanceof HTMLElement&&(y=m.dataset.esSceneObjectId));let g=y?c.ESSceneObject.getSceneObject(y):void 0;g&&g.parentID&&(g=c.ESSceneObject.getSceneObject(g.parentID));let _={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){if(g instanceof c.ESEntityCluster){const D=new w.JulianDate;_=m.id instanceof w.Entity?{name:m.id.label.text.getValue(D),properties:(B=m.id.properties)==null?void 0:B.getValue(D),coordinates:Ya(m.id.position.getValue(D))}:(P=m.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(D),coordinates:Ya(F.position.getValue(D))}})}else if(g instanceof c.ESGeoJson){const D=new w.JulianDate;if(!m.id.entityCollection)return;const F=m.id.polygon?"Polygon":m.id.polyline?"LineString":"Point",S=((I=m.id.properties)==null?void 0:I.getValue(D))??{},T=F=="Point"?De(m.id.position.getValue(D)):F=="LineString"?m.id.polyline.positions.getValue(D).map(b=>De(b)):Cd(m.id.polygon.hierarchy.getValue(D));_=g.pickedInfoType=="FeatureCollection"||g.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:F,coordinates:T},properties:S}:{type:F,coordinates:T,properties:S}}else if(g instanceof c.ESGltfModel){let D;Reflect.has(m,"featureId")?D=m.featureId:Reflect.has(m,"instanceId")&&(D=m.instanceId),D&&(m.id=m.primitive.structuralMetadata.getPropertyTable(0).getProperty(m.instanceId,"id"))}g.pickedEvent.emit(new c.ESJPickedResult(m,g,v,_,f,A))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&p(new c.ESJPickedResult);const x=new c.ESJPickedResult(m,g,v,_,f,A);p(x)})()}catch(m){d(m)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function HN(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(w.defined(o))return o}class GN extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Mt(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class WN extends c.Destroyable{constructor(){super();L(this,"cache",new Map);L(this,"maxSize",300);L(this,"_deleteTileEvent",this.disposeVar(new c.Event))}get deleteTileEvent(){return this._deleteTileEvent}deleteTile(e,i){this._deleteTileEvent.emit(e,i)}get(e,i){const o=this.cache.get(e);if(!o)return;if(!i)return o;const r=o.get(i);return r&&(o.delete(i),o.set(i,r)),r}set(e,i,o){let r=this.get(e);if(r||(r=new Map,this.cache.set(e,r)),r.size>=this.maxSize){const a=r.keys().next().value;a&&this.remove(e,a)}r.set(i,o)}remove(e,i){const o=e instanceof Sf?e.sceneObject.id:e;let r=this.get(o);r&&(i?(r.delete(i),r.size===0&&this.cache.delete(o)):this.cache.delete(o),this.deleteTile(o,i))}}const zv=65536*65536,aE=1/zv,jN=12,lE=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),kv=0,Xf=1,bu=2,Yf=5;class qN{constructor(n=new Uint8Array(16)){this.buf=ArrayBuffer.isView(n)?n:new Uint8Array(n),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(n,e,i=this.length){for(;this.pos<i;){const o=this.readVarint(),r=o>>3,a=this.pos;this.type=o&7,n(r,e,this),this.pos===a&&this.skip(o)}return e}readMessage(n,e){return this.readFields(n,e,this.readVarint()+this.pos)}readFixed32(){const n=this.dataView.getUint32(this.pos,!0);return this.pos+=4,n}readSFixed32(){const n=this.dataView.getInt32(this.pos,!0);return this.pos+=4,n}readFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*zv;return this.pos+=8,n}readSFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*zv;return this.pos+=8,n}readFloat(){const n=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,n}readDouble(){const n=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,n}readVarint(n){const e=this.buf;let i,o;return o=e[this.pos++],i=o&127,o<128||(o=e[this.pos++],i|=(o&127)<<7,o<128)||(o=e[this.pos++],i|=(o&127)<<14,o<128)||(o=e[this.pos++],i|=(o&127)<<21,o<128)?i:(o=e[this.pos],i|=(o&15)<<28,KN(i,n,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const n=this.readVarint();return n%2===1?(n+1)/-2:n/2}readBoolean(){return!!this.readVarint()}readString(){const n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=jN&&lE?lE.decode(this.buf.subarray(e,n)):aH(this.buf,e,n)}readBytes(){const n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e}readPackedVarint(n=[],e){const i=this.readPackedEnd();for(;this.pos<i;)n.push(this.readVarint(e));return n}readPackedSVarint(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSVarint());return n}readPackedBoolean(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readBoolean());return n}readPackedFloat(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFloat());return n}readPackedDouble(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readDouble());return n}readPackedFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed32());return n}readPackedSFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed32());return n}readPackedFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed64());return n}readPackedSFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed64());return n}readPackedEnd(){return this.type===bu?this.readVarint()+this.pos:this.pos+1}skip(n){const e=n&7;if(e===kv)for(;this.buf[this.pos++]>127;);else if(e===bu)this.pos=this.readVarint()+this.pos;else if(e===Yf)this.pos+=4;else if(e===Xf)this.pos+=8;else throw new Error(`Unimplemented type: ${e}`)}writeTag(n,e){this.writeVarint(n<<3|e)}realloc(n){let e=this.length||16;for(;e<this.pos+n;)e*=2;if(e!==this.length){const i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeSFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*aE),!0),this.pos+=8}writeSFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*aE),!0),this.pos+=8}writeVarint(n){if(n=+n||0,n>268435455||n<0){ZN(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))}writeSVarint(n){this.writeVarint(n<0?-n*2-1:n*2)}writeBoolean(n){this.writeVarint(+n)}writeString(n){n=String(n),this.realloc(n.length*4),this.pos++;const e=this.pos;this.pos=lH(this.buf,n,this.pos);const i=this.pos-e;i>=128&&uE(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(n){this.realloc(4),this.dataView.setFloat32(this.pos,n,!0),this.pos+=4}writeDouble(n){this.realloc(8),this.dataView.setFloat64(this.pos,n,!0),this.pos+=8}writeBytes(n){const e=n.length;this.writeVarint(e),this.realloc(e);for(let i=0;i<e;i++)this.buf[this.pos++]=n[i]}writeRawMessage(n,e){this.pos++;const i=this.pos;n(e,this);const o=this.pos-i;o>=128&&uE(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeMessage(n,e,i){this.writeTag(n,bu),this.writeRawMessage(e,i)}writePackedVarint(n,e){e.length&&this.writeMessage(n,YN,e)}writePackedSVarint(n,e){e.length&&this.writeMessage(n,JN,e)}writePackedBoolean(n,e){e.length&&this.writeMessage(n,nH,e)}writePackedFloat(n,e){e.length&&this.writeMessage(n,eH,e)}writePackedDouble(n,e){e.length&&this.writeMessage(n,tH,e)}writePackedFixed32(n,e){e.length&&this.writeMessage(n,iH,e)}writePackedSFixed32(n,e){e.length&&this.writeMessage(n,rH,e)}writePackedFixed64(n,e){e.length&&this.writeMessage(n,oH,e)}writePackedSFixed64(n,e){e.length&&this.writeMessage(n,sH,e)}writeBytesField(n,e){this.writeTag(n,bu),this.writeBytes(e)}writeFixed32Field(n,e){this.writeTag(n,Yf),this.writeFixed32(e)}writeSFixed32Field(n,e){this.writeTag(n,Yf),this.writeSFixed32(e)}writeFixed64Field(n,e){this.writeTag(n,Xf),this.writeFixed64(e)}writeSFixed64Field(n,e){this.writeTag(n,Xf),this.writeSFixed64(e)}writeVarintField(n,e){this.writeTag(n,kv),this.writeVarint(e)}writeSVarintField(n,e){this.writeTag(n,kv),this.writeSVarint(e)}writeStringField(n,e){this.writeTag(n,bu),this.writeString(e)}writeFloatField(n,e){this.writeTag(n,Yf),this.writeFloat(e)}writeDoubleField(n,e){this.writeTag(n,Xf),this.writeDouble(e)}writeBooleanField(n,e){this.writeVarintField(n,+e)}}function KN(t,n,e){const i=e.buf;let o,r;if(r=i[e.pos++],o=(r&112)>>4,r<128||(r=i[e.pos++],o|=(r&127)<<3,r<128)||(r=i[e.pos++],o|=(r&127)<<10,r<128)||(r=i[e.pos++],o|=(r&127)<<17,r<128)||(r=i[e.pos++],o|=(r&127)<<24,r<128)||(r=i[e.pos++],o|=(r&1)<<31,r<128))return Qa(t,o,n);throw new Error("Expected varint not more than 10 bytes")}function Qa(t,n,e){return e?n*4294967296+(t>>>0):(n>>>0)*4294967296+(t>>>0)}function ZN(t,n){let e,i;if(t>=0?(e=t%4294967296|0,i=t/4294967296|0):(e=~(-t%4294967296),i=~(-t/4294967296),e^4294967295?e=e+1|0:(e=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),$N(e,i,n),XN(i,n)}function $N(t,n,e){e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos]=t&127}function XN(t,n){const e=(t&7)<<4;n.buf[n.pos++]|=e|((t>>>=3)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127)))))}function uE(t,n,e){const i=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(Math.LN2*7));e.realloc(i);for(let o=e.pos-1;o>=t;o--)e.buf[o+i]=e.buf[o]}function YN(t,n){for(let e=0;e<t.length;e++)n.writeVarint(t[e])}function JN(t,n){for(let e=0;e<t.length;e++)n.writeSVarint(t[e])}function eH(t,n){for(let e=0;e<t.length;e++)n.writeFloat(t[e])}function tH(t,n){for(let e=0;e<t.length;e++)n.writeDouble(t[e])}function nH(t,n){for(let e=0;e<t.length;e++)n.writeBoolean(t[e])}function iH(t,n){for(let e=0;e<t.length;e++)n.writeFixed32(t[e])}function rH(t,n){for(let e=0;e<t.length;e++)n.writeSFixed32(t[e])}function oH(t,n){for(let e=0;e<t.length;e++)n.writeFixed64(t[e])}function sH(t,n){for(let e=0;e<t.length;e++)n.writeSFixed64(t[e])}function aH(t,n,e){let i="",o=n;for(;o<e;){const r=t[o];let a=null,s=r>239?4:r>223?3:r>191?2:1;if(o+s>e)break;let l,u,A;s===1?r<128&&(a=r):s===2?(l=t[o+1],(l&192)===128&&(a=(r&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=t[o+1],u=t[o+2],(l&192)===128&&(u&192)===128&&(a=(r&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=t[o+1],u=t[o+2],A=t[o+3],(l&192)===128&&(u&192)===128&&(A&192)===128&&(a=(r&15)<<18|(l&63)<<12|(u&63)<<6|A&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,i+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),i+=String.fromCharCode(a),o+=s}return i}function lH(t,n,e){for(let i=0,o,r;i<n.length;i++){if(o=n.charCodeAt(i),o>55295&&o<57344)if(r)if(o<56320){t[e++]=239,t[e++]=191,t[e++]=189,r=o;continue}else o=r-55296<<10|o-56320|65536,r=null;else{o>56319||i+1===n.length?(t[e++]=239,t[e++]=191,t[e++]=189):r=o;continue}else r&&(t[e++]=239,t[e++]=191,t[e++]=189,r=null);o<128?t[e++]=o:(o<2048?t[e++]=o>>6|192:(o<65536?t[e++]=o>>12|224:(t[e++]=o>>18|240,t[e++]=o>>12&63|128),t[e++]=o>>6&63|128),t[e++]=o&63|128)}return e}function oo(t,n){this.x=t,this.y=n}oo.prototype={clone(){return new oo(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,n){return this.clone()._rotateAround(t,n)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){const n=t.x-this.x,e=t.y-this.y;return n*n+e*e},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult(t){const n=t[0]*this.x+t[1]*this.y,e=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=e,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){const t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){const n=Math.cos(t),e=Math.sin(t),i=n*this.x-e*this.y,o=e*this.x+n*this.y;return this.x=i,this.y=o,this},_rotateAround(t,n){const e=Math.cos(t),i=Math.sin(t),o=n.x+e*(this.x-n.x)-i*(this.y-n.y),r=n.y+i*(this.x-n.x)+e*(this.y-n.y);return this.x=o,this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:oo},oo.convert=function(t){if(t instanceof oo)return t;if(Array.isArray(t))return new oo(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new oo(+t.x,+t.y);throw new Error("Expected [x, y] or {x, y} point format")};class cE{constructor(n,e,i,o,r){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=n,this._geometry=-1,this._keys=o,this._values=r,n.readFields(uH,this,e)}loadGeometry(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos,i=[];let o,r=1,a=0,s=0,l=0;for(;n.pos<e;){if(a<=0){const u=n.readVarint();r=u&7,a=u>>3}if(a--,r===1||r===2)s+=n.readSVarint(),l+=n.readSVarint(),r===1&&(o&&i.push(o),o=[]),o&&o.push(new oo(s,l));else if(r===7)o&&o.push(o[0].clone());else throw new Error(`unknown command ${r}`)}return o&&i.push(o),i}bbox(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos;let i=1,o=0,r=0,a=0,s=1/0,l=-1/0,u=1/0,A=-1/0;for(;n.pos<e;){if(o<=0){const h=n.readVarint();i=h&7,o=h>>3}if(o--,i===1||i===2)r+=n.readSVarint(),a+=n.readSVarint(),r<s&&(s=r),r>l&&(l=r),a<u&&(u=a),a>A&&(A=a);else if(i!==7)throw new Error(`unknown command ${i}`)}return[s,u,l,A]}toGeoJSON(n,e,i){const o=this.extent*Math.pow(2,i),r=this.extent*n,a=this.extent*e,s=this.loadGeometry();function l(f){return[(f.x+r)*360/o-180,360/Math.PI*Math.atan(Math.exp((1-(f.y+a)*2/o)*Math.PI))-90]}function u(f){return f.map(l)}let A;if(this.type===1){const f=[];for(const d of s)f.push(d[0]);const p=u(f);A=f.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){const f=s.map(u);A=f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}}else if(this.type===3){const f=hH(s),p=[];for(const d of f)p.push(d.map(u));A=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw new Error("unknown feature type");const h={type:"Feature",geometry:A,properties:this.properties};return this.id!=null&&(h.id=this.id),h}}cE.types=["Unknown","Point","LineString","Polygon"];function uH(t,n,e){t===1?n.id=e.readVarint():t===2?cH(e,n):t===3?n.type=e.readVarint():t===4&&(n._geometry=e.pos)}function cH(t,n){const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=n._keys[t.readVarint()],o=n._values[t.readVarint()];n.properties[i]=o}}function hH(t){const n=t.length;if(n<=1)return[t];const e=[];let i,o;for(let r=0;r<n;r++){const a=AH(t[r]);a!==0&&(o===void 0&&(o=a<0),o===a<0?(i&&e.push(i),i=[t[r]]):i&&i.push(t[r]))}return i&&e.push(i),e}function AH(t){let n=0;for(let e=0,i=t.length,o=i-1,r,a;e<i;o=e++)r=t[e],a=t[o],n+=(a.x-r.x)*(r.y+a.y);return n}class fH{constructor(n,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=n,this._keys=[],this._values=[],this._features=[],n.readFields(dH,this,e),this.length=this._features.length}feature(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];const e=this._pbf.readVarint()+this._pbf.pos;return new cE(this._pbf,e,this.extent,this._keys,this._values)}}function dH(t,n,e){t===15?n.version=e.readVarint():t===1?n.name=e.readString():t===5?n.extent=e.readVarint():t===2?n._features.push(e.pos):t===3?n._keys.push(e.readString()):t===4&&n._values.push(pH(e))}function pH(t){let n=null;const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=t.readVarint()>>3;n=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}if(n==null)throw new Error("unknown feature value");return n}class mH{constructor(n,e){this.layers=n.readFields(gH,{},e)}}function gH(t,n,e){if(t===3){const i=new fH(e,e.readVarint()+e.pos);i.length&&(n[i.name]=i)}}class yH extends c.Destroyable{constructor(){super();L(this,"pendingRequests",new Map);L(this,"urlMap",new Map);L(this,"tileSchemes",new Map)}add(e){const i=e.sceneObject.id,o=e.mvtLayerJson.mainJson,r=e.sceneObject.scheme??"xyz";let a=this.urlMap.get(i),s=this.tileSchemes.get(i);if(a||(a=new Map,this.urlMap.set(i,a)),(!s||r!=s)&&this.tileSchemes.set(i,r),typeof o=="string")a.set("customSource",[o]);else if(typeof o=="object"){const l=o.sources;for(const u in l){const A=l[u];A.type==="vector"&&Reflect.has(A,"tiles")&&a.set(u,A.tiles)}}}remove(e){const i=e.sceneObject.id;this.urlMap.delete(i),this.tileSchemes.delete(i),this.pendingRequests.delete(i)}async fetchTile(e,i){var h,f,p,d,m;if((h=this.pendingRequests.get(e))!=null&&h.has(i))return;(f=this.pendingRequests.get(e))==null||f.add(i);const[o,r,a]=i.split("-").map(Number),l=this.tileSchemes.get(e)==="tms"?Math.pow(2,o)-a-1:a,u={tileKey:i,sources:new Map},A=this.urlMap.get(e);if(!A)return u;for(const[v,y]of A.entries()){if(u.sources.has(v)||u.sources.set(v,new Map),!y.length||!y[0].includes("{z}"))continue;const g=y[0].replace("{z}",o.toString()).replace("{x}",r.toString()).replace("{y}",l.toString());try{const _=await Xe.Resource.fetchArrayBuffer({url:g});if(!_)continue;const x=new qN(_),E=new mH(x);for(const B in E.layers)if(Object.prototype.hasOwnProperty.call(E.layers,B)){const P=E.layers[B],I=[];for(let D=0;D<P.length;D++){const F=P.feature(D);I.push(F.toGeoJSON(r,a,o))}(p=u.sources.get(v))==null||p.set(B,I)}}catch(_){console.error(`Failed to load tile ${i}:`,_)}}return(d=this.pendingRequests.get(e))==null||d.delete(i),((m=this.pendingRequests.get(e))==null?void 0:m.size)===0&&this.pendingRequests.delete(e),u}}class vH extends c.Destroyable{constructor(e,i){super();L(this,"renderedTiles",new Map);this.screenManager=e,this.styleManager=i}renderTile(e,i){const o=[];for(const[a,s]of i.sources.entries())for(const[l,u]of s.entries()){const A=this.styleManager.getStyle(e,a,l);if(A.maxzoom||A.minzoom){const h=Number.parseInt(i.tileKey.split("-")[0]);if(A.maxzoom&&h>A.maxzoom||A.minzoom&&h<A.minzoom)continue}for(const h of u){let f,p;A.labelStyle&&(f=this.screenManager.addLabel(e,"VectorTile",A.labelStyle,{position:h.geometry.coordinates,name:h.properties.NAME??h.properties.name,index:h.id}).screenObjectId),A.billboardStyle&&(p=this.screenManager.addImage(e,"VectorTile",A.billboardStyle,{position:h.geometry.coordinates,name:h.properties.NAME??h.properties.name,index:h.id}).screenObjectId),f&&o.push(f),p&&o.push(p)}}let r=this.renderedTiles.get(e);r||(r=new Map,this.renderedTiles.set(e,r)),r.set(i.tileKey,o)}update(e,i,o){var a;const r=(a=this.renderedTiles.get(e))==null?void 0:a.get(i);r&&this.screenManager.update("VectorTile",e,r,{all:{show:o}})}remove(e,i){const o=this.renderedTiles.get(e);if(i){const r=o==null?void 0:o.get(i);r&&(this.screenManager.remove("VectorTile",e,r),o==null||o.delete(i),(o==null?void 0:o.size)===0&&this.renderedTiles.delete(e))}else{const r=o==null?void 0:o.values();r&&(this.screenManager.remove("VectorTile",e,Array.from(r).flat()),this.renderedTiles.delete(e))}}removeAll(){const e=this.renderedTiles.keys();for(const i of e)this.remove(i)}}class wH extends c.Destroyable{constructor(){super();L(this,"defaultStyle",new Map)}add(e){const i=e.sceneObject.id,o=e.mvtLayerJson.pointJson;for(const r of o)this.setDefaultStyle(i,`${r.source}-${r["source-layer"]}`,bH(r))}remove(e){const i=e.sceneObject.id;this.defaultStyle.delete(i)}setDefaultStyle(e,i,o){let r=this.defaultStyle.get(e);r||(r=new Map,this.defaultStyle.set(e,r)),r.set(i,o)}getStyle(e,i,o){var r;return((r=this.defaultStyle.get(e))==null?void 0:r.get(`${i}-${o}`))??{}}}function bH(t){const n={labelStyle:{},billboardStyle:{},polygonStyle:{},polylineStyle:{}},{billboardStyle:e,labelStyle:i}=n;if(Reflect.has(t,"minzoom")&&(n.minzoom=t.minzoom),Reflect.has(t,"maxzoom")&&(n.maxzoom=t.maxzoom),Reflect.has(t,"type")&&t.type==="symbol"&&Reflect.has(t,"layout")){const o=t.layout;if(Reflect.has(o,"icon-image")){e.image=o["icon-image"];const{horizontalOrigin:r,verticalOrigin:a}=hE(o["icon-anchor"]??"center");if(e.horizontalOrigin=r,e.verticalOrigin=a,Reflect.has(t,"paint")){const s=t.paint;e.color=w.Color.fromCssColorString(s["icon-color"]??"#FF0000").withAlpha(s["icon-opacity"]??1)}e.rotation=w.Math.toRadians(o["icon-rotate"]??0),e.scale=o["icon-size"]??1,e.show=(o.visibility??"visible")==="visible"}if(Reflect.has(o,"text-field")){i.text=o["text-field"];const{horizontalOrigin:r,verticalOrigin:a}=hE(o["text-anchor"]??"center");if(i.horizontalOrigin=r,i.verticalOrigin=a,Reflect.has(t,"paint")){const s=t.paint;i.fillColor=w.Color.fromCssColorString(s["text-color"]??"#FFFFFF").withAlpha(s["text-opacity"]??1)}i.font=`${o["text-size"]??16}px ${o["text-font"]??"sans-serif"}`,i.show=(o.visibility??"visible")==="visible"}}return n}function hE(t){let n=w.HorizontalOrigin.CENTER,e=w.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":n=w.HorizontalOrigin.LEFT;break;case"right":n=w.HorizontalOrigin.RIGHT;break;case"top":e=w.VerticalOrigin.TOP;break;case"bottom":e=w.VerticalOrigin.BOTTOM;break;case"top-left":n=w.HorizontalOrigin.LEFT,e=w.VerticalOrigin.TOP;break;case"top-right":n=w.HorizontalOrigin.RIGHT,e=w.VerticalOrigin.TOP;break;case"bottom-left":n=w.HorizontalOrigin.LEFT,e=w.VerticalOrigin.BOTTOM;break;case"bottom-right":n=w.HorizontalOrigin.RIGHT,e=w.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:n,verticalOrigin:e}}class xH extends c.Destroyable{constructor(){super();L(this,"callbacks",new Map)}registerEvent(e,i,o){var a;const r=`${e}-${i}`;this.callbacks.has(r)||this.callbacks.set(r,[]),(a=this.callbacks.get(r))==null||a.push(o)}dispatchEvent(e){var o;const i=`${e.tileKey}-${e.type}`;(o=this.callbacks.get(i))==null||o.forEach(r=>r(e.data))}}class _H extends c.Destroyable{constructor(e){super();L(this,"czmESMVTLayers",new Map);L(this,"tilesCache",new WN);L(this,"tileLoader",new yH);L(this,"tileRenderer");L(this,"styleManager",new wH);L(this,"eventManager",new xH);L(this,"lastImageryTileMap",new Map);this.viewer=e;const i=Mt(e);i&&(this.tileRenderer=new vH(i.screenManager,this.styleManager)),this.ad(this.tilesCache.deleteTileEvent.don((r,a)=>{this.tileRenderer.remove(r,a)}));const o=e.scene.preUpdate.addEventListener(()=>this.czmESMVTLayers.size>0&&this.refreshVisibleTiles());this.ad(()=>o&&o())}add(e){if(this.czmESMVTLayers.has(e.sceneObject.id)){console.log(`ESMVTLayer${e.sceneObject.id}已经添加过,跳过本次添加`);return}this.czmESMVTLayers.set(e.sceneObject.id,e),this.tileLoader.add(e),this.styleManager.add(e)}remove(e){this.czmESMVTLayers.delete(e.sceneObject.id),this.tileLoader.remove(e),this.styleManager.remove(e),this.tilesCache.remove(e)}async refreshVisibleTiles(){const e=this.viewer;if(!e)return;const i=new Map;for(const[o,r]of this.czmESMVTLayers.entries()){if(!r)continue;const a={tilingScheme:{type:"WebMercatorTilingScheme"},rectangle:r.sceneObject.rectangle,tileHeight:r.sceneObject.tileSize,tileWidth:r.sceneObject.tileSize,maximumLevel:r.sceneObject.maximumLevel,minimumLevel:r.sceneObject.minimumLevel};!i.has(o)&&i.set(o,new Set(B0(e.scene.globe._surface._tilesToRender,e.scene.terrainProvider,a).map(s=>`${s.level}-${s.x}-${s.y}`)))}await this.updateTiles(i)}async updateTiles(e){var o;for await(const r of this.czmESMVTLayers.keys()){const a=e.get(r)??new Set,s=this.lastImageryTileMap.get(r);if(s&&CH(a,s))continue;this.lastImageryTileMap.set(r,a);const l=new Set(((o=this.tilesCache.get(r))==null?void 0:o.keys())??[]);for(const A of l)this.tileRenderer.update(r,A,a.has(A));let u=[];for(const A of a)l.has(A)||(u.push(A),u.length>=100&&(await Promise.all(u.map(async h=>{let f=this.tilesCache.get(r,h);f||(f=await this.tileLoader.fetchTile(r,h),f&&this.tilesCache.set(r,h,f)),f&&this.tileRenderer.renderTile(r,f)})),u=[]));u.length>0&&await Promise.all(u.map(async A=>{let h=this.tilesCache.get(r,A);h||(h=await this.tileLoader.fetchTile(r,A),h&&this.tilesCache.set(r,A,h)),h&&this.tileRenderer.renderTile(r,h)}))}}}function CH(t,n){if(t.size!==n.size)return!1;for(const e of t)if(!n.has(e))return!1;return!0}const AE=["label","billboard","rectangle"];class SH extends c.Destroyable{constructor(e,i){super();L(this,"id",c.createGuid());L(this,"position",w.Cartesian3.ZERO);L(this,"label");L(this,"billboard");L(this,"rectangle");L(this,"zOrder");L(this,"labelRefCount",1);L(this,"billboardRefCount",1);L(this,"rectangleRefCount",1);L(this,"_showEvent",this.disposeVar(new c.Event));this.id=e,this.position=i,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e)}}class EH extends c.Destroyable{constructor(e){super();L(this,"objects",new Map);L(this,"screenManager");L(this,"czmViewer");L(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=Ye(o.position),s=this.getOrCreateObject(r,a);if(s.label)return s.labelRefCount++,r;const l=this.screenManager.labelCollection.add({...i,position:a,id:r,text:o.name});return l.ESSceneObjectID=e,s.label=l,s.zOrder=o.zOrder,r}addImage(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=Ye(o.position),s=this.getOrCreateObject(r,a);if(s.billboard)return s.billboardRefCount++,r;const l=this.screenManager.billboardCollection.add({...i,position:a,id:r});return l.ESSceneObjectID=e,s.billboard=l,s.zOrder=o.zOrder,r}addRectangle(e,i,o,r){const a=this.makeScreenObjectId(e,o.index??c.createGuid()),s=Ye(o.position),l=this.getOrCreateObject(a,s);if(l.rectangle)return l.rectangleRefCount++,a;const u=this.screenManager.rectangleCollection.add({...c.getElementBounds(i.element),...i,id:a,position:s,callback:r});return r(!0),l.rectangle=u,l.zOrder=o.zOrder,a}update(e,i){const o=Array.isArray(e)?e:[e];for(const r of o){const a=this.objects.get(r);if(a)for(const s of AE){const l=Object.assign({},i[s],(i==null?void 0:i.all)??{});if(!l)continue;const u=a[s];if(u)for(const A in l)A!=="position"&&A!=="id"&&(u[A]=l[A])}}return!0}remove(e){const i=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(i)){for(const o of i){const r=this.objects.get(o);r&&(r.label&&(r.labelRefCount>1?r.labelRefCount--:(this.screenManager.labelCollection.remove(r.label),r.label=void 0)),r.billboard&&(r.billboardRefCount>1?r.billboardRefCount--:(this.screenManager.billboardCollection.remove(r.billboard),r.billboard=void 0)),r.rectangle&&(r.rectangleRefCount>1?r.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0)),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(i)){const r=Array.isArray(i[o])?i[o]:[i[o]];for(const a of r){if(!a)continue;const s=this.objects.get(a);if(!s)continue;const l=s[o];l&&(this.screenManager.collectionMap[o].remove(l),s[o]=void 0),this.tryDeleteEmpty(a)}}return!0}}makeScreenObjectId(e,i){return`${e}_${i}`}getOrCreateObject(e,i){let o=this.objects.get(e);return o||(o=new SH(e,i),this.objects.set(e,o)),o}tryDeleteEmpty(e){const i=this.objects.get(e);i&&!i.label&&!i.billboard&&!i.rectangle&&this.objects.delete(e)}}function PH(t,n){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&AE.includes(i)){const o=n[i];if(!o)continue;if(o instanceof w.Label||o instanceof w.Billboard){const r=o.computeScreenSpacePosition(t.scene);let a=w[o instanceof w.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,r),{x:s,y:l,width:u,height:A}=a;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],l),e[2]=Math.max(e[2],s+u),e[3]=Math.max(e[3],l+A)}else{let{x:r,y:a,width:s,height:l}=o;e[0]=Math.min(e[0],r),e[1]=Math.min(e[1],a),e[2]=Math.max(e[2],r+s),e[3]=Math.max(e[3],a+l)}}return new w.Rectangle(...e)}class BH extends c.Destroyable{constructor(e){super();L(this,"rectangleCollisionCheck",new w.RectangleCollisionChecker);L(this,"screenManager");L(this,"enable",!1);L(this,"forceRebuildNext",!1);L(this,"avoidanceLayers",[]);L(this,"_processingQueue",[]);L(this,"_isProcessing",!1);L(this,"BATCH_SIZE",1e3);L(this,"_cache",new Map);L(this,"_lastCameraState",{});L(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const i=this.screenManager.getLayer(this.avoidanceLayers[e]);i.layerIsEffective()&&i.objects.forEach((o,r)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,i){this.enable=(e==null?void 0:e.enabled)??!1,i?e!=null&&e.enabled?this.avoidanceLayers.includes(i)||this.avoidanceLayers.push(i):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=i):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,i=e.positionWC,o=e.directionWC,r=this._lastCameraState.position,a=this._lastCameraState.direction;if(!r||!a)return this._updateLastCameraState(),!0;const s=w.Cartesian3.distanceSquared(i,r),l=w.Cartesian3.distanceSquared(o,a);return s>this.CAMERA_MOVE_THRESHOLD||l>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=w.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=w.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let i=0;i<this.avoidanceLayers.length;i++){const o=this.screenManager.getLayer(this.avoidanceLayers[i]);o.layerIsEffective()&&o.objects.forEach((r,a)=>{this._processingQueue.push(r)})}this._processingQueue.sort((i,o)=>(o.zOrder||0)-(i.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,i=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<i;){const r=e.shift();this._updateSingleObject(r),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const i=e.id.toString(),o=this._cache.get(i),r=w.Cartesian3.clone(e.position);let a;if(o&&w.Cartesian3.equalsEpsilon(o.worldPos,r,1e-6))a=o.rect,this.rectangleCollisionCheck.remove(i,a);else{if(a=PH(this.screenManager.viewer,e),isNaN(a.width)||isNaN(a.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(i,{rect:a,worldPos:r,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(a)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),a))}catch(i){console.error("ScreenManager update object error",i)}}}class fE extends c.Destroyable{constructor(){super();L(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class dE extends c.Destroyable{constructor(e){super();L(this,"layers",new Map);L(this,"czmViewer");L(this,"viewer");L(this,"avoidanceManager");L(this,"labelCollection");L(this,"billboardCollection");L(this,"rectangleCollection",this.ad(new fE));L(this,"canvasCollection",this.ad(new fE));L(this,"collectionMap");L(this,"_refreshEvent",this.ad(new c.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new BH(this)),this.labelCollection=new w.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new w.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(c.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(i=>i.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let i=this.layers.get(e);return i||(i=new EH(this),this.layers.set(e,i),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),i}addLabel(e,i,o,r){const s=this.getLayer(i).addLabel(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addImage(e,i,o,r){const s=this.getLayer(i).addImage(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addRectangle(e,i,o,r,a){const l=this.getLayer(i).addRectangle(e,o,r,a);return this.refresh(),{layer:i,id:e,screenObjectId:l}}update(e,i,o,r){const a=this.getLayer(e);return!o||o.length===0?!1:(a.update(o,r),this.refresh(),!0)}remove(e,i,o){const r=this.getLayer(e);if(!r.remove(o)){console.warn(`屏幕管理器,删除${i}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,i){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,i),this.refresh()}}function Mt(t){return c.getExtProp(t,"_viewerExtensions")}function Qv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class pE extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");L(this,"_screenManager");L(this,"_vectorTIlesManager");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new oE(this.viewer)),this._terrainManager=this.dv(new iE(this.viewer)),this._labelManager=this.dv(new rE(this.viewer)),this._poiContext=this.disposeVar(new H0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new GN(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new sE(i)),this._screenManager=this.ad(new dE(i)),this._vectorTIlesManager=this.ad(new _H(i.viewer)),this.ad(c.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}get vectorTIlesManager(){return this._vectorTIlesManager}}var mE=new w.Cartesian3,gE=new w.Cartesian3;function yE(t,n,e){let i=w.Matrix4.clone(t.transform);t.lookAtTransform(w.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=w.Cartesian3.normalize(r,mE),s=w.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=w.Cartesian3.cross(t.direction,a,gE);else var l=w.Cartesian3.cross(t.up,a,gE);var u=l;if(e){var A=w.Cartesian3.cross(a,l,mE);u=A}var h=w.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,p=f.longitude,d=f.latitude;w.Cartesian3.fromRadians(p,d,o,void 0,t.position),t.lookAtTransform(i)}function vE(t,n){yE(t,n,!1)}function wE(t,n){yE(t,-n,!0)}class TH extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&vE(r,A*h),a.MoveBackword&&vE(r,-A*h),a.MoveLeft&&wE(r,-A*h),a.MoveRight&&wE(r,A*h));{const{rotateSpeed:f}=this.controller,p=w.Math.toRadians(f*A);a.RotateRight?r.lookRight(p):a.RotateLeft?r.lookRight(-p):a.RotateUp?r.lookDown(-p):a.RotateDown&&r.lookDown(p)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class Jf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
3847
- `))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=Jf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=Jf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class IH extends c.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Jf(this)),this._cameraOp=this.dv(new TH(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const sd=class sd extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"_keyStatusMap",this.dv(c.react(sd.defaultKeyStatusMap)));L(this,"_speed",this.dv(c.react(1)));L(this,"_rotateSpeed",this.dv(c.react(.01)));L(this,"_alwaysWithCamera",this.dv(c.react(!1)));L(this,"_keyDownEvent",this.dv(new c.Event));L(this,"_keyUpEvent",this.dv(new c.Event));L(this,"_abortEvent",this.dv(new c.Event));this._firstPersonController=e,this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new IH(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};L(sd,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let ed=sd;function FH(t,n){t.lookRight(w.Math.toRadians(n.movementX)*.1),t.lookDown(w.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=w.Math.clamp(e,-w.Math.PI_OVER_TWO,w.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class MH extends c.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;FH(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const ad=class ad extends c.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new MH(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=ad.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(ad,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Vv=ad;class DH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Vv(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class RH extends c.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new DH(this)));L(this,"_keyboardCameraController",this.dv(new ed(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function bE(t){t.removeInputAction(w.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(w.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(w.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(w.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(w.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(w.ScreenSpaceEventType.MIDDLE_UP)}function Nv(t,n,e,i=void 0){const r=t.camera,a=new w.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new w.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new w.Ray),u=r.getPickRay(s,new w.Ray),A=0,h,f;if(!l||!u)return;r.frustum instanceof w.OrthographicFrustum?(h=l.origin,f=u.origin,w.Cartesian3.add(r.direction,h,h),w.Cartesian3.add(r.direction,f,f),w.Cartesian3.subtract(h,r.position,h),w.Cartesian3.subtract(f,r.position,f),w.Cartesian3.normalize(h,h),w.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction);let p=w.Cartesian3.dot(h,f);p<1&&(A=Math.acos(p)),A=n.startPosition.x>n.endPosition.x?A:-A;const d=e._horizontalRotationAxis;if(w.defined(i)?r.look(i,-A):w.defined(d)?r.look(d,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new w.Ray),u=r.getPickRay(s,new w.Ray),A=0,!(!l||!u))if(r.frustum instanceof w.OrthographicFrustum?(h=l.origin,f=u.origin,w.Cartesian3.add(r.direction,h,h),w.Cartesian3.add(r.direction,f,f),w.Cartesian3.subtract(h,r.position,h),w.Cartesian3.subtract(f,r.position,f),w.Cartesian3.normalize(h,h),w.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction),p=w.Cartesian3.dot(h,f),p<1&&(A=Math.acos(p)),A=n.startPosition.y>n.endPosition.y?A:-A,i=i??d,w.defined(i)){const m=r.direction,v=w.Cartesian3.negate(i,new w.Cartesian3),y=w.Cartesian3.equalsEpsilon(m,i,w.Math.EPSILON2),g=w.Cartesian3.equalsEpsilon(m,v,w.Math.EPSILON2);if(!y&&!g){p=w.Cartesian3.dot(m,i);let _=w.Math.acosClamped(p);A>0&&A>_&&(A=_-w.Math.EPSILON4),p=w.Cartesian3.dot(m,v),_=w.Math.acosClamped(p),A<0&&-A>_&&(A=-_+w.Math.EPSILON4);const x=w.Cartesian3.cross(i,m,new w.Cartesian3);r.look(x,A)}else(y&&A<0||g&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class UH extends c.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const h=Ye(n.position),f=i.camera.positionWC,p=w.Cartesian3.distance(h,f);n.viewDistance=p}c.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=zi.defaults.offsetRotation}=n,u=[...l];c.Vector.set(r,0,0,0),s&&(n.relativeRotation??zi.defaults.relativeRotation)&&(c.Vector.add(s,r,r),u[0]+=90),c.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=c.Vector.add(n.offsetRotation??zi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class zi extends c.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new c.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new UH(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=ys(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(zi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(zi||(zi={})),c.extendClassProps(zi.prototype,zi.createDefaultProps);class xu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new zi(e)),this._geoPolylinePath=this.dv(new aa(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(c.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(c.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(c.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(c.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(c.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new c.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new OH(this,e);if(this.lineMode==="manual")return new LH(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(xu||(xu={})),c.extendClassProps(xu.prototype,xu.createDefaultProps);class OH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class LH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class zH extends c.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class kH extends c.Destroyable{constructor(n,e){super();const i=this.dv(new c.ESSceneObjectWithId);i.id=n;const o=this.dv(c.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new c.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new zH(r,e)}))}}class _u extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new zi(e)),this.d(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new c.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new kH(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(_u||(_u={})),c.extendClassProps(_u.prototype,_u.createDefaultProps);class QH extends c.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new w.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},w.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:w.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*w.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*w.Math.PI*2/this.cycle;e.setView({destination:w.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*w.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class VH extends c.Destroyable{constructor(e){super();L(this,"_height",this.dv(c.react(1e7)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_latitude",this.dv(c.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new QH(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class NH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new w.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new w.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=w.Cartesian3.fromDegrees(...this.position);a&&(this._transform=w.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=w.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=w.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new w.Cartesian3(0,i,o);e.flyTo({destination:w.Matrix4.multiplyByPoint(this._transform,r,new w.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*w.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new w.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(w.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class HH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new NH(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class GH extends c.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new RH(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=ed.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new VH(e)),this._rotatePoint=this.dv(new HH(e)),this._followController=this.dv(new _u(e)),this._pathCameraController=this.dv(new xu(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=w.Cartesian3.fromDegrees(e[0],e[1],(l??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=c.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const h=c.getDistancesFromPositions(A,"NONE"),f=h[h.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const p=x0(A);this._pathCameraController.polylinePath.rotationRadius=!l||p==!1?[0]:p.map(d=>d/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new w.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&bE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},w.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(w.ScreenSpaceEventType.LEFT_UP)},w.ScreenSpaceEventType.LEFT_UP)},w.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},w.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(w.ScreenSpaceEventType.RIGHT_UP)},w.ScreenSpaceEventType.RIGHT_UP)},w.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},w.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(w.ScreenSpaceEventType.MIDDLE_UP)},w.ScreenSpaceEventType.MIDDLE_UP)},w.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&bE(o),r.lookEventTypes=w.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=w.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[w.CameraEventType.MIDDLE_DRAG,w.CameraEventType.PINCH,{eventType:w.CameraEventType.LEFT_DRAG,modifier:w.KeyboardEventModifier.CTRL},{eventType:w.CameraEventType.RIGHT_DRAG,modifier:w.KeyboardEventModifier.CTRL}],r.translateEventTypes=w.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[w.CameraEventType.WHEEL,w.CameraEventType.PINCH,{eventType:w.CameraEventType.RIGHT_DRAG,modifier:w.KeyboardEventModifier.SHIFT}])}}const WH=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class jH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new w.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ze(s.scale),maximumSize:ri(s.maximumSize),color:Be(s.color),position:Ye(s.position)});(()=>{o.removeAll();for(let s of WH)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class Cu extends c.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(w.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(Cu||(Cu={})),c.extendClassProps(Cu.prototype,Cu.createDefaultProps);const qH=`
3846
+ }`},translucent:!0});function ON(){Object.defineProperties(w.Billboard.prototype,{_positionFromParent:{get(){return!1},set(t){}}})}NV(),HV(),GV(),KV(),ZV(),$V(),XV(),VV(),l3(),u3(),h3(),D3(),ON(),w.Camera.DEFAULT_VIEW_RECTANGLE=w.Rectangle.fromDegrees(70,5,140,55);function LN(){return new Promise((t,n)=>w.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class zN extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Mt(s);if(l&&(l.destroy(),Qv(s,void 0)),w.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=QV;await s.promise(LN());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=w.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=w.JulianDate.fromDate(new Date(e.currentTime));w.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=w.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new pE(A,e);Qv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const kN=new w.EllipsoidTerrainProvider;class iE extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??kN}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class rE extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof bt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof bt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof bt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof bt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class QN extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class VN extends c.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class NN extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new VN(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class HN extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new NN(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class oE extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new QN(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new HN(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class sE extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,p]=u;try{(async()=>{const{scene:d,camera:m}=i,v=Ze(A),y=m.getPickRay(v);if(y){let E;if(h?E=await d.pickFromRayMostDetailed(y,this.objectsToExclude):E=d.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=De(E.position);return B?f(B):p(new Error("positionFromCartesian failed"))}if(!(d.terrainProvider instanceof w.EllipsoidTerrainProvider)){const B=d.globe.pick(y,d);if(!B)return p(new Error("scene.globe.pick failed"));const P=De(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):p(new Error("positionFromCartesian failed"))}}const g=d.terrainProvider instanceof w.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,_=i.camera.pickEllipsoid(Ze(A),g);if(!_)return p(new Error("Pick failed"));const x=De(_);return x?f(x):p(new Error("positionFromCartesian failed"))})()}catch(d){p(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,p,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let m=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!m&&w.defined(i.scene.globe)&&(m=await GN(i,Ze(A)));let v;if(m&&m instanceof w.Cesium3DTileFeature){v={};try{m&&m.getPropertyIds().forEach(F=>{v&&(v[F]=m.getProperty(F))})}catch(D){console.warn(D)}}if(!m){const{left:D,top:F}=e.container.getBoundingClientRect();m=(E=document.elementFromPoint(A[0]+D,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;m&&(m.id&&m.id instanceof w.Entity&&m.id.ESSceneObjectID?y=m.id.ESSceneObjectID:m.primitive&&m.primitive.ESSceneObjectID?y=m.primitive.ESSceneObjectID:m.collection&&m.collection.ESSceneObjectID?y=m.collection.ESSceneObjectID:Array.isArray(m)&&m[0]instanceof w.ImageryLayerFeatureInfo?y=m[0].imageryLayer.ESSceneObjectID:m instanceof HTMLElement&&(y=m.dataset.esSceneObjectId));let g=y?c.ESSceneObject.getSceneObject(y):void 0;g&&g.parentID&&(g=c.ESSceneObject.getSceneObject(g.parentID));let _={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){if(g instanceof c.ESEntityCluster){const D=new w.JulianDate;_=m.id instanceof w.Entity?{name:m.id.label.text.getValue(D),properties:(B=m.id.properties)==null?void 0:B.getValue(D),coordinates:Ya(m.id.position.getValue(D))}:(P=m.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(D),coordinates:Ya(F.position.getValue(D))}})}else if(g instanceof c.ESGeoJson){const D=new w.JulianDate;let F,S,T;m.id.entityCollection?(F=m.id.polygon?"Polygon":m.id.polyline?"LineString":"Point",T=((I=m.id.properties)==null?void 0:I.getValue(D))??{},S=F=="Point"?De(m.id.position.getValue(D)):F=="LineString"?m.id.polyline.positions.getValue(D).map(b=>De(b)):Cd(m.id.polygon.hierarchy.getValue(D))):(m.primitive instanceof w.Billboard||m.primitive instanceof w.Label)&&(F="Point",typeof m.id=="object"&&(T=m.id),S=De(m.primitive.position)),_=g.pickedInfoType=="FeatureCollection"||g.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:F,coordinates:S},properties:T}:{type:F,coordinates:S,properties:T}}else if(g instanceof c.ESGltfModel){let D;Reflect.has(m,"featureId")?D=m.featureId:Reflect.has(m,"instanceId")&&(D=m.instanceId),D&&(m.id=m.primitive.structuralMetadata.getPropertyTable(0).getProperty(m.instanceId,"id"))}g.pickedEvent.emit(new c.ESJPickedResult(m,g,v,_,f,A))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&p(new c.ESJPickedResult);const x=new c.ESJPickedResult(m,g,v,_,f,A);p(x)})()}catch(m){d(m)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function GN(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(w.defined(o))return o}class WN extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Mt(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}class jN extends c.Destroyable{constructor(){super();L(this,"cache",new Map);L(this,"maxSize",300);L(this,"_deleteTileEvent",this.disposeVar(new c.Event))}get deleteTileEvent(){return this._deleteTileEvent}deleteTile(e,i){this._deleteTileEvent.emit(e,i)}get(e,i){const o=this.cache.get(e);if(!o)return;if(!i)return o;const r=o.get(i);return r&&(o.delete(i),o.set(i,r)),r}set(e,i,o){let r=this.get(e);if(r||(r=new Map,this.cache.set(e,r)),r.size>=this.maxSize){const a=r.keys().next().value;a&&this.remove(e,a)}r.set(i,o)}remove(e,i){const o=e instanceof Sf?e.sceneObject.id:e;let r=this.get(o);r&&(i?(r.delete(i),r.size===0&&this.cache.delete(o)):this.cache.delete(o),this.deleteTile(o,i))}}const zv=65536*65536,aE=1/zv,qN=12,lE=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),kv=0,Xf=1,bu=2,Yf=5;class KN{constructor(n=new Uint8Array(16)){this.buf=ArrayBuffer.isView(n)?n:new Uint8Array(n),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(n,e,i=this.length){for(;this.pos<i;){const o=this.readVarint(),r=o>>3,a=this.pos;this.type=o&7,n(r,e,this),this.pos===a&&this.skip(o)}return e}readMessage(n,e){return this.readFields(n,e,this.readVarint()+this.pos)}readFixed32(){const n=this.dataView.getUint32(this.pos,!0);return this.pos+=4,n}readSFixed32(){const n=this.dataView.getInt32(this.pos,!0);return this.pos+=4,n}readFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*zv;return this.pos+=8,n}readSFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*zv;return this.pos+=8,n}readFloat(){const n=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,n}readDouble(){const n=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,n}readVarint(n){const e=this.buf;let i,o;return o=e[this.pos++],i=o&127,o<128||(o=e[this.pos++],i|=(o&127)<<7,o<128)||(o=e[this.pos++],i|=(o&127)<<14,o<128)||(o=e[this.pos++],i|=(o&127)<<21,o<128)?i:(o=e[this.pos],i|=(o&15)<<28,ZN(i,n,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const n=this.readVarint();return n%2===1?(n+1)/-2:n/2}readBoolean(){return!!this.readVarint()}readString(){const n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=qN&&lE?lE.decode(this.buf.subarray(e,n)):lH(this.buf,e,n)}readBytes(){const n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e}readPackedVarint(n=[],e){const i=this.readPackedEnd();for(;this.pos<i;)n.push(this.readVarint(e));return n}readPackedSVarint(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSVarint());return n}readPackedBoolean(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readBoolean());return n}readPackedFloat(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFloat());return n}readPackedDouble(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readDouble());return n}readPackedFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed32());return n}readPackedSFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed32());return n}readPackedFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed64());return n}readPackedSFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed64());return n}readPackedEnd(){return this.type===bu?this.readVarint()+this.pos:this.pos+1}skip(n){const e=n&7;if(e===kv)for(;this.buf[this.pos++]>127;);else if(e===bu)this.pos=this.readVarint()+this.pos;else if(e===Yf)this.pos+=4;else if(e===Xf)this.pos+=8;else throw new Error(`Unimplemented type: ${e}`)}writeTag(n,e){this.writeVarint(n<<3|e)}realloc(n){let e=this.length||16;for(;e<this.pos+n;)e*=2;if(e!==this.length){const i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeSFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*aE),!0),this.pos+=8}writeSFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*aE),!0),this.pos+=8}writeVarint(n){if(n=+n||0,n>268435455||n<0){$N(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))}writeSVarint(n){this.writeVarint(n<0?-n*2-1:n*2)}writeBoolean(n){this.writeVarint(+n)}writeString(n){n=String(n),this.realloc(n.length*4),this.pos++;const e=this.pos;this.pos=uH(this.buf,n,this.pos);const i=this.pos-e;i>=128&&uE(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(n){this.realloc(4),this.dataView.setFloat32(this.pos,n,!0),this.pos+=4}writeDouble(n){this.realloc(8),this.dataView.setFloat64(this.pos,n,!0),this.pos+=8}writeBytes(n){const e=n.length;this.writeVarint(e),this.realloc(e);for(let i=0;i<e;i++)this.buf[this.pos++]=n[i]}writeRawMessage(n,e){this.pos++;const i=this.pos;n(e,this);const o=this.pos-i;o>=128&&uE(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeMessage(n,e,i){this.writeTag(n,bu),this.writeRawMessage(e,i)}writePackedVarint(n,e){e.length&&this.writeMessage(n,JN,e)}writePackedSVarint(n,e){e.length&&this.writeMessage(n,eH,e)}writePackedBoolean(n,e){e.length&&this.writeMessage(n,iH,e)}writePackedFloat(n,e){e.length&&this.writeMessage(n,tH,e)}writePackedDouble(n,e){e.length&&this.writeMessage(n,nH,e)}writePackedFixed32(n,e){e.length&&this.writeMessage(n,rH,e)}writePackedSFixed32(n,e){e.length&&this.writeMessage(n,oH,e)}writePackedFixed64(n,e){e.length&&this.writeMessage(n,sH,e)}writePackedSFixed64(n,e){e.length&&this.writeMessage(n,aH,e)}writeBytesField(n,e){this.writeTag(n,bu),this.writeBytes(e)}writeFixed32Field(n,e){this.writeTag(n,Yf),this.writeFixed32(e)}writeSFixed32Field(n,e){this.writeTag(n,Yf),this.writeSFixed32(e)}writeFixed64Field(n,e){this.writeTag(n,Xf),this.writeFixed64(e)}writeSFixed64Field(n,e){this.writeTag(n,Xf),this.writeSFixed64(e)}writeVarintField(n,e){this.writeTag(n,kv),this.writeVarint(e)}writeSVarintField(n,e){this.writeTag(n,kv),this.writeSVarint(e)}writeStringField(n,e){this.writeTag(n,bu),this.writeString(e)}writeFloatField(n,e){this.writeTag(n,Yf),this.writeFloat(e)}writeDoubleField(n,e){this.writeTag(n,Xf),this.writeDouble(e)}writeBooleanField(n,e){this.writeVarintField(n,+e)}}function ZN(t,n,e){const i=e.buf;let o,r;if(r=i[e.pos++],o=(r&112)>>4,r<128||(r=i[e.pos++],o|=(r&127)<<3,r<128)||(r=i[e.pos++],o|=(r&127)<<10,r<128)||(r=i[e.pos++],o|=(r&127)<<17,r<128)||(r=i[e.pos++],o|=(r&127)<<24,r<128)||(r=i[e.pos++],o|=(r&1)<<31,r<128))return Qa(t,o,n);throw new Error("Expected varint not more than 10 bytes")}function Qa(t,n,e){return e?n*4294967296+(t>>>0):(n>>>0)*4294967296+(t>>>0)}function $N(t,n){let e,i;if(t>=0?(e=t%4294967296|0,i=t/4294967296|0):(e=~(-t%4294967296),i=~(-t/4294967296),e^4294967295?e=e+1|0:(e=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),XN(e,i,n),YN(i,n)}function XN(t,n,e){e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos]=t&127}function YN(t,n){const e=(t&7)<<4;n.buf[n.pos++]|=e|((t>>>=3)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127)))))}function uE(t,n,e){const i=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(Math.LN2*7));e.realloc(i);for(let o=e.pos-1;o>=t;o--)e.buf[o+i]=e.buf[o]}function JN(t,n){for(let e=0;e<t.length;e++)n.writeVarint(t[e])}function eH(t,n){for(let e=0;e<t.length;e++)n.writeSVarint(t[e])}function tH(t,n){for(let e=0;e<t.length;e++)n.writeFloat(t[e])}function nH(t,n){for(let e=0;e<t.length;e++)n.writeDouble(t[e])}function iH(t,n){for(let e=0;e<t.length;e++)n.writeBoolean(t[e])}function rH(t,n){for(let e=0;e<t.length;e++)n.writeFixed32(t[e])}function oH(t,n){for(let e=0;e<t.length;e++)n.writeSFixed32(t[e])}function sH(t,n){for(let e=0;e<t.length;e++)n.writeFixed64(t[e])}function aH(t,n){for(let e=0;e<t.length;e++)n.writeSFixed64(t[e])}function lH(t,n,e){let i="",o=n;for(;o<e;){const r=t[o];let a=null,s=r>239?4:r>223?3:r>191?2:1;if(o+s>e)break;let l,u,A;s===1?r<128&&(a=r):s===2?(l=t[o+1],(l&192)===128&&(a=(r&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=t[o+1],u=t[o+2],(l&192)===128&&(u&192)===128&&(a=(r&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=t[o+1],u=t[o+2],A=t[o+3],(l&192)===128&&(u&192)===128&&(A&192)===128&&(a=(r&15)<<18|(l&63)<<12|(u&63)<<6|A&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,i+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),i+=String.fromCharCode(a),o+=s}return i}function uH(t,n,e){for(let i=0,o,r;i<n.length;i++){if(o=n.charCodeAt(i),o>55295&&o<57344)if(r)if(o<56320){t[e++]=239,t[e++]=191,t[e++]=189,r=o;continue}else o=r-55296<<10|o-56320|65536,r=null;else{o>56319||i+1===n.length?(t[e++]=239,t[e++]=191,t[e++]=189):r=o;continue}else r&&(t[e++]=239,t[e++]=191,t[e++]=189,r=null);o<128?t[e++]=o:(o<2048?t[e++]=o>>6|192:(o<65536?t[e++]=o>>12|224:(t[e++]=o>>18|240,t[e++]=o>>12&63|128),t[e++]=o>>6&63|128),t[e++]=o&63|128)}return e}function oo(t,n){this.x=t,this.y=n}oo.prototype={clone(){return new oo(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,n){return this.clone()._rotateAround(t,n)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){const n=t.x-this.x,e=t.y-this.y;return n*n+e*e},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult(t){const n=t[0]*this.x+t[1]*this.y,e=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=e,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){const t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){const n=Math.cos(t),e=Math.sin(t),i=n*this.x-e*this.y,o=e*this.x+n*this.y;return this.x=i,this.y=o,this},_rotateAround(t,n){const e=Math.cos(t),i=Math.sin(t),o=n.x+e*(this.x-n.x)-i*(this.y-n.y),r=n.y+i*(this.x-n.x)+e*(this.y-n.y);return this.x=o,this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:oo},oo.convert=function(t){if(t instanceof oo)return t;if(Array.isArray(t))return new oo(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new oo(+t.x,+t.y);throw new Error("Expected [x, y] or {x, y} point format")};class cE{constructor(n,e,i,o,r){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=n,this._geometry=-1,this._keys=o,this._values=r,n.readFields(cH,this,e)}loadGeometry(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos,i=[];let o,r=1,a=0,s=0,l=0;for(;n.pos<e;){if(a<=0){const u=n.readVarint();r=u&7,a=u>>3}if(a--,r===1||r===2)s+=n.readSVarint(),l+=n.readSVarint(),r===1&&(o&&i.push(o),o=[]),o&&o.push(new oo(s,l));else if(r===7)o&&o.push(o[0].clone());else throw new Error(`unknown command ${r}`)}return o&&i.push(o),i}bbox(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos;let i=1,o=0,r=0,a=0,s=1/0,l=-1/0,u=1/0,A=-1/0;for(;n.pos<e;){if(o<=0){const h=n.readVarint();i=h&7,o=h>>3}if(o--,i===1||i===2)r+=n.readSVarint(),a+=n.readSVarint(),r<s&&(s=r),r>l&&(l=r),a<u&&(u=a),a>A&&(A=a);else if(i!==7)throw new Error(`unknown command ${i}`)}return[s,u,l,A]}toGeoJSON(n,e,i){const o=this.extent*Math.pow(2,i),r=this.extent*n,a=this.extent*e,s=this.loadGeometry();function l(f){return[(f.x+r)*360/o-180,360/Math.PI*Math.atan(Math.exp((1-(f.y+a)*2/o)*Math.PI))-90]}function u(f){return f.map(l)}let A;if(this.type===1){const f=[];for(const d of s)f.push(d[0]);const p=u(f);A=f.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){const f=s.map(u);A=f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}}else if(this.type===3){const f=AH(s),p=[];for(const d of f)p.push(d.map(u));A=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw new Error("unknown feature type");const h={type:"Feature",geometry:A,properties:this.properties};return this.id!=null&&(h.id=this.id),h}}cE.types=["Unknown","Point","LineString","Polygon"];function cH(t,n,e){t===1?n.id=e.readVarint():t===2?hH(e,n):t===3?n.type=e.readVarint():t===4&&(n._geometry=e.pos)}function hH(t,n){const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=n._keys[t.readVarint()],o=n._values[t.readVarint()];n.properties[i]=o}}function AH(t){const n=t.length;if(n<=1)return[t];const e=[];let i,o;for(let r=0;r<n;r++){const a=fH(t[r]);a!==0&&(o===void 0&&(o=a<0),o===a<0?(i&&e.push(i),i=[t[r]]):i&&i.push(t[r]))}return i&&e.push(i),e}function fH(t){let n=0;for(let e=0,i=t.length,o=i-1,r,a;e<i;o=e++)r=t[e],a=t[o],n+=(a.x-r.x)*(r.y+a.y);return n}class dH{constructor(n,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=n,this._keys=[],this._values=[],this._features=[],n.readFields(pH,this,e),this.length=this._features.length}feature(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];const e=this._pbf.readVarint()+this._pbf.pos;return new cE(this._pbf,e,this.extent,this._keys,this._values)}}function pH(t,n,e){t===15?n.version=e.readVarint():t===1?n.name=e.readString():t===5?n.extent=e.readVarint():t===2?n._features.push(e.pos):t===3?n._keys.push(e.readString()):t===4&&n._values.push(mH(e))}function mH(t){let n=null;const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=t.readVarint()>>3;n=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}if(n==null)throw new Error("unknown feature value");return n}class gH{constructor(n,e){this.layers=n.readFields(yH,{},e)}}function yH(t,n,e){if(t===3){const i=new dH(e,e.readVarint()+e.pos);i.length&&(n[i.name]=i)}}class vH extends c.Destroyable{constructor(){super();L(this,"pendingRequests",new Map);L(this,"urlMap",new Map);L(this,"tileSchemes",new Map)}add(e){const i=e.sceneObject.id,o=e.mvtLayerJson.mainJson,r=e.sceneObject.scheme??"xyz";let a=this.urlMap.get(i),s=this.tileSchemes.get(i);if(a||(a=new Map,this.urlMap.set(i,a)),(!s||r!=s)&&this.tileSchemes.set(i,r),typeof o=="string")a.set("customSource",[o]);else if(typeof o=="object"){const l=o.sources;for(const u in l){const A=l[u];A.type==="vector"&&Reflect.has(A,"tiles")&&a.set(u,A.tiles)}}}remove(e){const i=e.sceneObject.id;this.urlMap.delete(i),this.tileSchemes.delete(i),this.pendingRequests.delete(i)}async fetchTile(e,i){var h,f,p,d,m;if((h=this.pendingRequests.get(e))!=null&&h.has(i))return;(f=this.pendingRequests.get(e))==null||f.add(i);const[o,r,a]=i.split("-").map(Number),l=this.tileSchemes.get(e)==="tms"?Math.pow(2,o)-a-1:a,u={tileKey:i,sources:new Map},A=this.urlMap.get(e);if(!A)return u;for(const[v,y]of A.entries()){if(u.sources.has(v)||u.sources.set(v,new Map),!y.length||!y[0].includes("{z}"))continue;const g=y[0].replace("{z}",o.toString()).replace("{x}",r.toString()).replace("{y}",l.toString());try{const _=await Xe.Resource.fetchArrayBuffer({url:g});if(!_)continue;const x=new KN(_),E=new gH(x);for(const B in E.layers)if(Object.prototype.hasOwnProperty.call(E.layers,B)){const P=E.layers[B],I=[];for(let D=0;D<P.length;D++){const F=P.feature(D);I.push(F.toGeoJSON(r,a,o))}(p=u.sources.get(v))==null||p.set(B,I)}}catch(_){console.error(`Failed to load tile ${i}:`,_)}}return(d=this.pendingRequests.get(e))==null||d.delete(i),((m=this.pendingRequests.get(e))==null?void 0:m.size)===0&&this.pendingRequests.delete(e),u}}class wH extends c.Destroyable{constructor(e,i){super();L(this,"renderedTiles",new Map);this.screenManager=e,this.styleManager=i}renderTile(e,i){const o=[];for(const[a,s]of i.sources.entries())for(const[l,u]of s.entries()){const A=this.styleManager.getStyle(e,a,l);if(A.maxzoom||A.minzoom){const h=Number.parseInt(i.tileKey.split("-")[0]);if(A.maxzoom&&h>A.maxzoom||A.minzoom&&h<A.minzoom)continue}for(const h of u){let f,p;A.labelStyle&&(f=this.screenManager.addLabel(e,"VectorTile",A.labelStyle,{position:h.geometry.coordinates,name:h.properties.NAME??h.properties.name,index:h.id}).screenObjectId),A.billboardStyle&&(p=this.screenManager.addImage(e,"VectorTile",A.billboardStyle,{position:h.geometry.coordinates,name:h.properties.NAME??h.properties.name,index:h.id}).screenObjectId),f&&o.push(f),p&&o.push(p)}}let r=this.renderedTiles.get(e);r||(r=new Map,this.renderedTiles.set(e,r)),r.set(i.tileKey,o)}update(e,i,o){var a;const r=(a=this.renderedTiles.get(e))==null?void 0:a.get(i);r&&this.screenManager.update("VectorTile",e,r,{all:{show:o}})}remove(e,i){const o=this.renderedTiles.get(e);if(i){const r=o==null?void 0:o.get(i);r&&(this.screenManager.remove("VectorTile",e,r),o==null||o.delete(i),(o==null?void 0:o.size)===0&&this.renderedTiles.delete(e))}else{const r=o==null?void 0:o.values();r&&(this.screenManager.remove("VectorTile",e,Array.from(r).flat()),this.renderedTiles.delete(e))}}removeAll(){const e=this.renderedTiles.keys();for(const i of e)this.remove(i)}}class bH extends c.Destroyable{constructor(){super();L(this,"defaultStyle",new Map)}add(e){const i=e.sceneObject.id,o=e.mvtLayerJson.pointJson;for(const r of o)this.setDefaultStyle(i,`${r.source}-${r["source-layer"]}`,xH(r))}remove(e){const i=e.sceneObject.id;this.defaultStyle.delete(i)}setDefaultStyle(e,i,o){let r=this.defaultStyle.get(e);r||(r=new Map,this.defaultStyle.set(e,r)),r.set(i,o)}getStyle(e,i,o){var r;return((r=this.defaultStyle.get(e))==null?void 0:r.get(`${i}-${o}`))??{}}}function xH(t){const n={labelStyle:{},billboardStyle:{},polygonStyle:{},polylineStyle:{}},{billboardStyle:e,labelStyle:i}=n;if(Reflect.has(t,"minzoom")&&(n.minzoom=t.minzoom),Reflect.has(t,"maxzoom")&&(n.maxzoom=t.maxzoom),Reflect.has(t,"type")&&t.type==="symbol"&&Reflect.has(t,"layout")){const o=t.layout;if(Reflect.has(o,"icon-image")){e.image=o["icon-image"];const{horizontalOrigin:r,verticalOrigin:a}=hE(o["icon-anchor"]??"center");if(e.horizontalOrigin=r,e.verticalOrigin=a,Reflect.has(t,"paint")){const s=t.paint;e.color=w.Color.fromCssColorString(s["icon-color"]??"#FF0000").withAlpha(s["icon-opacity"]??1)}e.rotation=w.Math.toRadians(o["icon-rotate"]??0),e.scale=o["icon-size"]??1,e.show=(o.visibility??"visible")==="visible"}if(Reflect.has(o,"text-field")){i.text=o["text-field"];const{horizontalOrigin:r,verticalOrigin:a}=hE(o["text-anchor"]??"center");if(i.horizontalOrigin=r,i.verticalOrigin=a,Reflect.has(t,"paint")){const s=t.paint;i.fillColor=w.Color.fromCssColorString(s["text-color"]??"#FFFFFF").withAlpha(s["text-opacity"]??1)}i.font=`${o["text-size"]??16}px ${o["text-font"]??"sans-serif"}`,i.show=(o.visibility??"visible")==="visible"}}return n}function hE(t){let n=w.HorizontalOrigin.CENTER,e=w.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":n=w.HorizontalOrigin.LEFT;break;case"right":n=w.HorizontalOrigin.RIGHT;break;case"top":e=w.VerticalOrigin.TOP;break;case"bottom":e=w.VerticalOrigin.BOTTOM;break;case"top-left":n=w.HorizontalOrigin.LEFT,e=w.VerticalOrigin.TOP;break;case"top-right":n=w.HorizontalOrigin.RIGHT,e=w.VerticalOrigin.TOP;break;case"bottom-left":n=w.HorizontalOrigin.LEFT,e=w.VerticalOrigin.BOTTOM;break;case"bottom-right":n=w.HorizontalOrigin.RIGHT,e=w.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:n,verticalOrigin:e}}class _H extends c.Destroyable{constructor(){super();L(this,"callbacks",new Map)}registerEvent(e,i,o){var a;const r=`${e}-${i}`;this.callbacks.has(r)||this.callbacks.set(r,[]),(a=this.callbacks.get(r))==null||a.push(o)}dispatchEvent(e){var o;const i=`${e.tileKey}-${e.type}`;(o=this.callbacks.get(i))==null||o.forEach(r=>r(e.data))}}class CH extends c.Destroyable{constructor(e){super();L(this,"czmESMVTLayers",new Map);L(this,"tilesCache",new jN);L(this,"tileLoader",new vH);L(this,"tileRenderer");L(this,"styleManager",new bH);L(this,"eventManager",new _H);L(this,"lastImageryTileMap",new Map);this.viewer=e;const i=Mt(e);i&&(this.tileRenderer=new wH(i.screenManager,this.styleManager)),this.ad(this.tilesCache.deleteTileEvent.don((r,a)=>{this.tileRenderer.remove(r,a)}));const o=e.scene.preUpdate.addEventListener(()=>this.czmESMVTLayers.size>0&&this.refreshVisibleTiles());this.ad(()=>o&&o())}add(e){if(this.czmESMVTLayers.has(e.sceneObject.id)){console.log(`ESMVTLayer${e.sceneObject.id}已经添加过,跳过本次添加`);return}this.czmESMVTLayers.set(e.sceneObject.id,e),this.tileLoader.add(e),this.styleManager.add(e)}remove(e){this.czmESMVTLayers.delete(e.sceneObject.id),this.tileLoader.remove(e),this.styleManager.remove(e),this.tilesCache.remove(e)}async refreshVisibleTiles(){const e=this.viewer;if(!e)return;const i=new Map;for(const[o,r]of this.czmESMVTLayers.entries()){if(!r)continue;const a={tilingScheme:{type:"WebMercatorTilingScheme"},rectangle:r.sceneObject.rectangle,tileHeight:r.sceneObject.tileSize,tileWidth:r.sceneObject.tileSize,maximumLevel:r.sceneObject.maximumLevel,minimumLevel:r.sceneObject.minimumLevel};!i.has(o)&&i.set(o,new Set(B0(e.scene.globe._surface._tilesToRender,e.scene.terrainProvider,a).map(s=>`${s.level}-${s.x}-${s.y}`)))}await this.updateTiles(i)}async updateTiles(e){var o;for await(const r of this.czmESMVTLayers.keys()){const a=e.get(r)??new Set,s=this.lastImageryTileMap.get(r);if(s&&SH(a,s))continue;this.lastImageryTileMap.set(r,a);const l=new Set(((o=this.tilesCache.get(r))==null?void 0:o.keys())??[]);for(const A of l)this.tileRenderer.update(r,A,a.has(A));let u=[];for(const A of a)l.has(A)||(u.push(A),u.length>=100&&(await Promise.all(u.map(async h=>{let f=this.tilesCache.get(r,h);f||(f=await this.tileLoader.fetchTile(r,h),f&&this.tilesCache.set(r,h,f)),f&&this.tileRenderer.renderTile(r,f)})),u=[]));u.length>0&&await Promise.all(u.map(async A=>{let h=this.tilesCache.get(r,A);h||(h=await this.tileLoader.fetchTile(r,A),h&&this.tilesCache.set(r,A,h)),h&&this.tileRenderer.renderTile(r,h)}))}}}function SH(t,n){if(t.size!==n.size)return!1;for(const e of t)if(!n.has(e))return!1;return!0}const AE=["label","billboard","rectangle"];class EH extends c.Destroyable{constructor(e,i){super();L(this,"id",c.createGuid());L(this,"position",w.Cartesian3.ZERO);L(this,"label");L(this,"billboard");L(this,"rectangle");L(this,"zOrder");L(this,"labelRefCount",1);L(this,"billboardRefCount",1);L(this,"rectangleRefCount",1);L(this,"_showEvent",this.disposeVar(new c.Event));this.id=e,this.position=i,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e)}}class PH extends c.Destroyable{constructor(e){super();L(this,"objects",new Map);L(this,"screenManager");L(this,"czmViewer");L(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=Ye(o.position),s=this.getOrCreateObject(r,a);if(s.label)return s.labelRefCount++,r;const l=this.screenManager.labelCollection.add({...i,position:a,id:o.properties??r,text:o.name});return l.ESSceneObjectID=e,s.label=l,s.zOrder=o.zOrder,r}addImage(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=Ye(o.position),s=this.getOrCreateObject(r,a);if(s.billboard)return s.billboardRefCount++,r;const l=this.screenManager.billboardCollection.add({...i,position:a,id:o.properties??r});return l.ESSceneObjectID=e,s.billboard=l,s.zOrder=o.zOrder,r}addRectangle(e,i,o,r){const a=this.makeScreenObjectId(e,o.index??c.createGuid()),s=Ye(o.position),l=this.getOrCreateObject(a,s);if(l.rectangle)return l.rectangleRefCount++,a;const u=this.screenManager.rectangleCollection.add({...c.getElementBounds(i.element),...i,id:o.properties??a,position:s,callback:r});return r(!0),l.rectangle=u,l.zOrder=o.zOrder,a}update(e,i){const o=Array.isArray(e)?e:[e];for(const r of o){const a=this.objects.get(r);if(a)for(const s of AE){const l=Object.assign({},i[s],(i==null?void 0:i.all)??{});if(!l)continue;const u=a[s];if(u)for(const A in l)A!=="position"&&A!=="id"&&(u[A]=l[A])}}return!0}remove(e){const i=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(i)){for(const o of i){const r=this.objects.get(o);r&&(r.label&&(r.labelRefCount>1?r.labelRefCount--:(this.screenManager.labelCollection.remove(r.label),r.label=void 0)),r.billboard&&(r.billboardRefCount>1?r.billboardRefCount--:(this.screenManager.billboardCollection.remove(r.billboard),r.billboard=void 0)),r.rectangle&&(r.rectangleRefCount>1?r.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0)),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(i)){const r=Array.isArray(i[o])?i[o]:[i[o]];for(const a of r){if(!a)continue;const s=this.objects.get(a);if(!s)continue;const l=s[o];l&&(this.screenManager.collectionMap[o].remove(l),s[o]=void 0),this.tryDeleteEmpty(a)}}return!0}}makeScreenObjectId(e,i){return`${e}_${i}`}getOrCreateObject(e,i){let o=this.objects.get(e);return o||(o=new EH(e,i),this.objects.set(e,o)),o}tryDeleteEmpty(e){const i=this.objects.get(e);i&&!i.label&&!i.billboard&&!i.rectangle&&this.objects.delete(e)}}function BH(t,n){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&AE.includes(i)){const o=n[i];if(!o)continue;if(o instanceof w.Label||o instanceof w.Billboard){const r=o.computeScreenSpacePosition(t.scene);let a=w[o instanceof w.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,r),{x:s,y:l,width:u,height:A}=a;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],l),e[2]=Math.max(e[2],s+u),e[3]=Math.max(e[3],l+A)}else{let{x:r,y:a,width:s,height:l}=o;e[0]=Math.min(e[0],r),e[1]=Math.min(e[1],a),e[2]=Math.max(e[2],r+s),e[3]=Math.max(e[3],a+l)}}return new w.Rectangle(...e)}class TH extends c.Destroyable{constructor(e){super();L(this,"rectangleCollisionCheck",new w.RectangleCollisionChecker);L(this,"screenManager");L(this,"enable",!1);L(this,"forceRebuildNext",!1);L(this,"avoidanceLayers",[]);L(this,"_processingQueue",[]);L(this,"_isProcessing",!1);L(this,"BATCH_SIZE",1e3);L(this,"_cache",new Map);L(this,"_lastCameraState",{});L(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const i=this.screenManager.getLayer(this.avoidanceLayers[e]);i.layerIsEffective()&&i.objects.forEach((o,r)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,i){this.enable=(e==null?void 0:e.enabled)??!1,i?e!=null&&e.enabled?this.avoidanceLayers.includes(i)||this.avoidanceLayers.push(i):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=i):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,i=e.positionWC,o=e.directionWC,r=this._lastCameraState.position,a=this._lastCameraState.direction;if(!r||!a)return this._updateLastCameraState(),!0;const s=w.Cartesian3.distanceSquared(i,r),l=w.Cartesian3.distanceSquared(o,a);return s>this.CAMERA_MOVE_THRESHOLD||l>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=w.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=w.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let i=0;i<this.avoidanceLayers.length;i++){const o=this.screenManager.getLayer(this.avoidanceLayers[i]);o.layerIsEffective()&&o.objects.forEach((r,a)=>{this._processingQueue.push(r)})}this._processingQueue.sort((i,o)=>(o.zOrder||0)-(i.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,i=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<i;){const r=e.shift();this._updateSingleObject(r),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const i=e.id.toString(),o=this._cache.get(i),r=w.Cartesian3.clone(e.position);let a;if(o&&w.Cartesian3.equalsEpsilon(o.worldPos,r,1e-6))a=o.rect,this.rectangleCollisionCheck.remove(i,a);else{if(a=BH(this.screenManager.viewer,e),isNaN(a.width)||isNaN(a.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(i,{rect:a,worldPos:r,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(a)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),a))}catch(i){console.error("ScreenManager update object error",i)}}}class fE extends c.Destroyable{constructor(){super();L(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class dE extends c.Destroyable{constructor(e){super();L(this,"layers",new Map);L(this,"czmViewer");L(this,"viewer");L(this,"avoidanceManager");L(this,"labelCollection");L(this,"billboardCollection");L(this,"rectangleCollection",this.ad(new fE));L(this,"canvasCollection",this.ad(new fE));L(this,"collectionMap");L(this,"_refreshEvent",this.ad(new c.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new TH(this)),this.labelCollection=new w.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new w.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(c.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(i=>i.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let i=this.layers.get(e);return i||(i=new PH(this),this.layers.set(e,i),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),i}addLabel(e,i,o,r){const s=this.getLayer(i).addLabel(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addImage(e,i,o,r){const s=this.getLayer(i).addImage(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addRectangle(e,i,o,r,a){const l=this.getLayer(i).addRectangle(e,o,r,a);return this.refresh(),{layer:i,id:e,screenObjectId:l}}update(e,i,o,r){const a=this.getLayer(e);return!o||o.length===0?!1:(a.update(o,r),this.refresh(),!0)}remove(e,i,o){const r=this.getLayer(e);if(!r.remove(o)){console.warn(`屏幕管理器,删除${i}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,i){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,i),this.refresh()}}function Mt(t){return c.getExtProp(t,"_viewerExtensions")}function Qv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class pE extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");L(this,"_screenManager");L(this,"_vectorTIlesManager");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new oE(this.viewer)),this._terrainManager=this.dv(new iE(this.viewer)),this._labelManager=this.dv(new rE(this.viewer)),this._poiContext=this.disposeVar(new H0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new WN(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new sE(i)),this._screenManager=this.ad(new dE(i)),this._vectorTIlesManager=this.ad(new CH(i.viewer)),this.ad(c.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}get vectorTIlesManager(){return this._vectorTIlesManager}}var mE=new w.Cartesian3,gE=new w.Cartesian3;function yE(t,n,e){let i=w.Matrix4.clone(t.transform);t.lookAtTransform(w.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=w.Cartesian3.normalize(r,mE),s=w.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=w.Cartesian3.cross(t.direction,a,gE);else var l=w.Cartesian3.cross(t.up,a,gE);var u=l;if(e){var A=w.Cartesian3.cross(a,l,mE);u=A}var h=w.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,p=f.longitude,d=f.latitude;w.Cartesian3.fromRadians(p,d,o,void 0,t.position),t.lookAtTransform(i)}function vE(t,n){yE(t,n,!1)}function wE(t,n){yE(t,-n,!0)}class IH extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&vE(r,A*h),a.MoveBackword&&vE(r,-A*h),a.MoveLeft&&wE(r,-A*h),a.MoveRight&&wE(r,A*h));{const{rotateSpeed:f}=this.controller,p=w.Math.toRadians(f*A);a.RotateRight?r.lookRight(p):a.RotateLeft?r.lookRight(-p):a.RotateUp?r.lookDown(-p):a.RotateDown&&r.lookDown(p)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class Jf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
3847
+ `))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=Jf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=Jf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class FH extends c.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Jf(this)),this._cameraOp=this.dv(new IH(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const sd=class sd extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"_keyStatusMap",this.dv(c.react(sd.defaultKeyStatusMap)));L(this,"_speed",this.dv(c.react(1)));L(this,"_rotateSpeed",this.dv(c.react(.01)));L(this,"_alwaysWithCamera",this.dv(c.react(!1)));L(this,"_keyDownEvent",this.dv(new c.Event));L(this,"_keyUpEvent",this.dv(new c.Event));L(this,"_abortEvent",this.dv(new c.Event));this._firstPersonController=e,this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new FH(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};L(sd,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let ed=sd;function MH(t,n){t.lookRight(w.Math.toRadians(n.movementX)*.1),t.lookDown(w.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=w.Math.clamp(e,-w.Math.PI_OVER_TWO,w.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class DH extends c.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;MH(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const ad=class ad extends c.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new DH(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=ad.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(ad,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Vv=ad;class RH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Vv(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class UH extends c.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new RH(this)));L(this,"_keyboardCameraController",this.dv(new ed(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function bE(t){t.removeInputAction(w.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(w.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(w.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(w.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(w.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(w.ScreenSpaceEventType.MIDDLE_UP)}function Nv(t,n,e,i=void 0){const r=t.camera,a=new w.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new w.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new w.Ray),u=r.getPickRay(s,new w.Ray),A=0,h,f;if(!l||!u)return;r.frustum instanceof w.OrthographicFrustum?(h=l.origin,f=u.origin,w.Cartesian3.add(r.direction,h,h),w.Cartesian3.add(r.direction,f,f),w.Cartesian3.subtract(h,r.position,h),w.Cartesian3.subtract(f,r.position,f),w.Cartesian3.normalize(h,h),w.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction);let p=w.Cartesian3.dot(h,f);p<1&&(A=Math.acos(p)),A=n.startPosition.x>n.endPosition.x?A:-A;const d=e._horizontalRotationAxis;if(w.defined(i)?r.look(i,-A):w.defined(d)?r.look(d,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new w.Ray),u=r.getPickRay(s,new w.Ray),A=0,!(!l||!u))if(r.frustum instanceof w.OrthographicFrustum?(h=l.origin,f=u.origin,w.Cartesian3.add(r.direction,h,h),w.Cartesian3.add(r.direction,f,f),w.Cartesian3.subtract(h,r.position,h),w.Cartesian3.subtract(f,r.position,f),w.Cartesian3.normalize(h,h),w.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction),p=w.Cartesian3.dot(h,f),p<1&&(A=Math.acos(p)),A=n.startPosition.y>n.endPosition.y?A:-A,i=i??d,w.defined(i)){const m=r.direction,v=w.Cartesian3.negate(i,new w.Cartesian3),y=w.Cartesian3.equalsEpsilon(m,i,w.Math.EPSILON2),g=w.Cartesian3.equalsEpsilon(m,v,w.Math.EPSILON2);if(!y&&!g){p=w.Cartesian3.dot(m,i);let _=w.Math.acosClamped(p);A>0&&A>_&&(A=_-w.Math.EPSILON4),p=w.Cartesian3.dot(m,v),_=w.Math.acosClamped(p),A<0&&-A>_&&(A=-_+w.Math.EPSILON4);const x=w.Cartesian3.cross(i,m,new w.Cartesian3);r.look(x,A)}else(y&&A<0||g&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class OH extends c.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const h=Ye(n.position),f=i.camera.positionWC,p=w.Cartesian3.distance(h,f);n.viewDistance=p}c.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=zi.defaults.offsetRotation}=n,u=[...l];c.Vector.set(r,0,0,0),s&&(n.relativeRotation??zi.defaults.relativeRotation)&&(c.Vector.add(s,r,r),u[0]+=90),c.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=c.Vector.add(n.offsetRotation??zi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class zi extends c.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new c.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new OH(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=ys(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(zi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(zi||(zi={})),c.extendClassProps(zi.prototype,zi.createDefaultProps);class xu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new zi(e)),this._geoPolylinePath=this.dv(new aa(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(c.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(c.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(c.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(c.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(c.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new c.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new LH(this,e);if(this.lineMode==="manual")return new zH(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(xu||(xu={})),c.extendClassProps(xu.prototype,xu.createDefaultProps);class LH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class zH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class kH extends c.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class QH extends c.Destroyable{constructor(n,e){super();const i=this.dv(new c.ESSceneObjectWithId);i.id=n;const o=this.dv(c.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new c.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new kH(r,e)}))}}class _u extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new zi(e)),this.d(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new c.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new QH(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(_u||(_u={})),c.extendClassProps(_u.prototype,_u.createDefaultProps);class VH extends c.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new w.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},w.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:w.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*w.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*w.Math.PI*2/this.cycle;e.setView({destination:w.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*w.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class NH extends c.Destroyable{constructor(e){super();L(this,"_height",this.dv(c.react(1e7)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_latitude",this.dv(c.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new VH(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class HH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new w.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new w.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=w.Cartesian3.fromDegrees(...this.position);a&&(this._transform=w.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=w.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=w.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new w.Cartesian3(0,i,o);e.flyTo({destination:w.Matrix4.multiplyByPoint(this._transform,r,new w.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*w.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new w.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(w.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class GH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new HH(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class WH extends c.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new UH(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=ed.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new NH(e)),this._rotatePoint=this.dv(new GH(e)),this._followController=this.dv(new _u(e)),this._pathCameraController=this.dv(new xu(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=w.Cartesian3.fromDegrees(e[0],e[1],(l??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=c.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const h=c.getDistancesFromPositions(A,"NONE"),f=h[h.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const p=x0(A);this._pathCameraController.polylinePath.rotationRadius=!l||p==!1?[0]:p.map(d=>d/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new w.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&bE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},w.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(w.ScreenSpaceEventType.LEFT_UP)},w.ScreenSpaceEventType.LEFT_UP)},w.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},w.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(w.ScreenSpaceEventType.RIGHT_UP)},w.ScreenSpaceEventType.RIGHT_UP)},w.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},w.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(w.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(w.ScreenSpaceEventType.MIDDLE_UP)},w.ScreenSpaceEventType.MIDDLE_UP)},w.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&bE(o),r.lookEventTypes=w.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=w.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[w.CameraEventType.MIDDLE_DRAG,w.CameraEventType.PINCH,{eventType:w.CameraEventType.LEFT_DRAG,modifier:w.KeyboardEventModifier.CTRL},{eventType:w.CameraEventType.RIGHT_DRAG,modifier:w.KeyboardEventModifier.CTRL}],r.translateEventTypes=w.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[w.CameraEventType.WHEEL,w.CameraEventType.PINCH,{eventType:w.CameraEventType.RIGHT_DRAG,modifier:w.KeyboardEventModifier.SHIFT}])}}const jH=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class qH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new w.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ze(s.scale),maximumSize:ri(s.maximumSize),color:Be(s.color),position:Ye(s.position)});(()=>{o.removeAll();for(let s of jH)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class Cu extends c.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(w.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(Cu||(Cu={})),c.extendClassProps(Cu.prototype,Cu.createDefaultProps);const KH=`
3848
3848
  float getDistance(sampler2D depthTexture, vec2 texCoords)
3849
3849
  {
3850
3850
  float depth = czm_unpackDepth(texture(depthTexture, texCoords));
@@ -3880,7 +3880,7 @@ return material;
3880
3880
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
3881
3881
  out_FragColor = alphaBlend(finalFogColor, sceneColor);
3882
3882
  }
3883
- `;class KH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"postProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(i.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new w.PostProcessStage({name:"earthsdk3_fog",fragmentShader:qH,uniforms:{fogByDistance:new w.Cartesian4(10,0,1e3,.9),fogColor:w.Color.WHITE}}),i.scene.postProcessStages.add(this.postProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const ZH=`
3883
+ `;class ZH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"postProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(i.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new w.PostProcessStage({name:"earthsdk3_fog",fragmentShader:KH,uniforms:{fogByDistance:new w.Cartesian4(10,0,1e3,.9),fogColor:w.Color.WHITE}}),i.scene.postProcessStages.add(this.postProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const $H=`
3884
3884
  uniform sampler2D colorTexture;
3885
3885
  in vec2 v_textureCoordinates;
3886
3886
 
@@ -3907,7 +3907,7 @@ void main(void){
3907
3907
 
3908
3908
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), 0.5);
3909
3909
  }
3910
- `;class $H extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"rainPostProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(i.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new w.PostProcessStage({name:"earthsdk3_rain",fragmentShader:ZH}),i.scene.postProcessStages.add(this.rainPostProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const XH=`
3910
+ `;class XH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"rainPostProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(i.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new w.PostProcessStage({name:"earthsdk3_rain",fragmentShader:$H}),i.scene.postProcessStages.add(this.rainPostProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const YH=`
3911
3911
  uniform sampler2D colorTexture; //输入的场景渲染照片
3912
3912
  in vec2 v_textureCoordinates;
3913
3913
 
@@ -3938,7 +3938,7 @@ void main(void){
3938
3938
  finalColor=(vec3(c)); //屏幕上雪的颜色
3939
3939
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5); //将雪和三维场景融合
3940
3940
  }
3941
- `,YH=`
3941
+ `,JH=`
3942
3942
  #extension GL_OES_standard_derivatives : enable
3943
3943
  uniform sampler2D colorTexture;
3944
3944
  uniform sampler2D depthTexture;
@@ -3978,7 +3978,7 @@ void main() {
3978
3978
  }
3979
3979
  out_FragColor = mix(color, vec4(1.0), dotNumWC*alpha);
3980
3980
  }
3981
- `;class JH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"_alpha",this.dv(c.react(0)));L(this,"snow");L(this,"snowCover");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}let{snow:o,snowCover:r}=this;const a=()=>{o&&(i.scene.postProcessStages.remove(o),o=void 0)};this.d(a);const s=()=>{r&&(i.scene.postProcessStages.remove(r),r=void 0)};this.d(s);const l=()=>{if(!r)return;const A=w.Math.clamp(this.alpha,0,1);r.uniforms.alpha=A};l(),this.d(this.alphaChanged.don(l));const u=()=>{a(),s(),(this.show??!0)&&(o=new w.PostProcessStage({name:"earthsdk3_snow",fragmentShader:XH}),i.scene.postProcessStages.add(o),r=new w.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:YH,uniforms:{alpha:this.alpha}}),i.scene.postProcessStages.add(r),l())};u(),this.d(this.showChanged.don(u))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get alpha(){return this._alpha.value}set alpha(e){this._alpha.value=e}get alphaChanged(){return this._alpha.changed}}class e7 extends c.Destroyable{constructor(e){super();L(this,"rain");L(this,"cloud");L(this,"snow");L(this,"fog");L(this,"depthOfField");const i=e.viewer;if(!i)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new $H(e)),r=this.dv(new jH(e)),a=this.dv(new JH(e)),s=this.dv(new KH(e)),l=this.dv(new Cu(e));this.rain=o,this.cloud=r,this.snow=a,this.fog=s,this.depthOfField=l;{const{scene:u}=i,A=()=>{u.sun&&(u.sun.show=e.sun??at.defaults.sun),u.globe.enableLighting=e.sun??at.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?r.show=!0:r.show=!1,e.snow>0&&e.snow<=1?(a.show=!0,a.alpha=e.snow):a.show=!1,e.fog>0&&e.fog<=1?s.show=!0:s.show=!1,e.depthOfField>0&&e.depthOfField<=1?l.show=!0:l.show=!1};A();const h=this.dv(c.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(h.don(A))}}}const Hv=w.BoundingRectangle,t7=w.Color,so=w.defined,n7=w.destroyObject,xE=w.DeveloperError,i7=w.RenderState,r7=w.ShaderSource,o7=w._shadersViewportQuadFS,s7=w.BlendingState,_E=w.Material;function td(t){this.show=!0;let n;so(n)||(n=new Hv),this.rectangle=Hv.clone(n),so(t)||(t=_E.fromType(_E.ColorType,{color:new t7(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}td.prototype.update=function(t){if(this.show){if(!so(this.material))throw new xE("this.material must be defined.");if(!so(this.rectangle))throw new xE("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var n=this._rs;(!so(n)||!Hv.equals(n.viewport,this.rectangle))&&(this._rs=i7.fromCache({blending:s7.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var i=t.context;if(this._material!==this.material||!so(this._overlayCommand)){this._material=this.material,so(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new r7({sources:[this._material.shaderSource,o7]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(i),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},td.prototype.isDestroyed=function(){return!1},td.prototype.destroy=function(){return so(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),n7(this)};function CE(t){const{positiveX:n,negativeX:e,positiveY:i,negativeY:o,positiveZ:r,negativeZ:a}=t;if(!n||!e||!i||!o||!r||!a){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:c.ESSceneObject.context.getStrFromEnv(n),negativeX:c.ESSceneObject.context.getStrFromEnv(e),positiveY:c.ESSceneObject.context.getStrFromEnv(i),negativeY:c.ESSceneObject.context.getStrFromEnv(o),positiveZ:c.ESSceneObject.context.getStrFromEnv(r),negativeZ:c.ESSceneObject.context.getStrFromEnv(a)}}const a7=`in vec3 v_outerPositionWC;
3981
+ `;class e7 extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"_alpha",this.dv(c.react(0)));L(this,"snow");L(this,"snowCover");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}let{snow:o,snowCover:r}=this;const a=()=>{o&&(i.scene.postProcessStages.remove(o),o=void 0)};this.d(a);const s=()=>{r&&(i.scene.postProcessStages.remove(r),r=void 0)};this.d(s);const l=()=>{if(!r)return;const A=w.Math.clamp(this.alpha,0,1);r.uniforms.alpha=A};l(),this.d(this.alphaChanged.don(l));const u=()=>{a(),s(),(this.show??!0)&&(o=new w.PostProcessStage({name:"earthsdk3_snow",fragmentShader:YH}),i.scene.postProcessStages.add(o),r=new w.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:JH,uniforms:{alpha:this.alpha}}),i.scene.postProcessStages.add(r),l())};u(),this.d(this.showChanged.don(u))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get alpha(){return this._alpha.value}set alpha(e){this._alpha.value=e}get alphaChanged(){return this._alpha.changed}}class t7 extends c.Destroyable{constructor(e){super();L(this,"rain");L(this,"cloud");L(this,"snow");L(this,"fog");L(this,"depthOfField");const i=e.viewer;if(!i)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new XH(e)),r=this.dv(new qH(e)),a=this.dv(new e7(e)),s=this.dv(new ZH(e)),l=this.dv(new Cu(e));this.rain=o,this.cloud=r,this.snow=a,this.fog=s,this.depthOfField=l;{const{scene:u}=i,A=()=>{u.sun&&(u.sun.show=e.sun??at.defaults.sun),u.globe.enableLighting=e.sun??at.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?r.show=!0:r.show=!1,e.snow>0&&e.snow<=1?(a.show=!0,a.alpha=e.snow):a.show=!1,e.fog>0&&e.fog<=1?s.show=!0:s.show=!1,e.depthOfField>0&&e.depthOfField<=1?l.show=!0:l.show=!1};A();const h=this.dv(c.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(h.don(A))}}}const Hv=w.BoundingRectangle,n7=w.Color,so=w.defined,i7=w.destroyObject,xE=w.DeveloperError,r7=w.RenderState,o7=w.ShaderSource,s7=w._shadersViewportQuadFS,a7=w.BlendingState,_E=w.Material;function td(t){this.show=!0;let n;so(n)||(n=new Hv),this.rectangle=Hv.clone(n),so(t)||(t=_E.fromType(_E.ColorType,{color:new n7(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}td.prototype.update=function(t){if(this.show){if(!so(this.material))throw new xE("this.material must be defined.");if(!so(this.rectangle))throw new xE("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var n=this._rs;(!so(n)||!Hv.equals(n.viewport,this.rectangle))&&(this._rs=r7.fromCache({blending:a7.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var i=t.context;if(this._material!==this.material||!so(this._overlayCommand)){this._material=this.material,so(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new o7({sources:[this._material.shaderSource,s7]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(i),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},td.prototype.isDestroyed=function(){return!1},td.prototype.destroy=function(){return so(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),i7(this)};function CE(t){const{positiveX:n,negativeX:e,positiveY:i,negativeY:o,positiveZ:r,negativeZ:a}=t;if(!n||!e||!i||!o||!r||!a){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:c.ESSceneObject.context.getStrFromEnv(n),negativeX:c.ESSceneObject.context.getStrFromEnv(e),positiveY:c.ESSceneObject.context.getStrFromEnv(i),negativeY:c.ESSceneObject.context.getStrFromEnv(o),positiveZ:c.ESSceneObject.context.getStrFromEnv(r),negativeZ:c.ESSceneObject.context.getStrFromEnv(a)}}const l7=`in vec3 v_outerPositionWC;
3982
3982
 
3983
3983
  uniform vec3 u_hsbShift;
3984
3984
 
@@ -4057,7 +4057,7 @@ void main (void)
4057
4057
  out_FragColor = color;
4058
4058
  // ------------------ skybox vtxf end -------------------
4059
4059
  }
4060
- `,ao=w.Cartesian3,hr=w.defined,l7=w.destroyObject,u7=w.Ellipsoid,SE=w.EllipsoidGeometry,c7=w.GeometryPipeline,Va=w.Math,Ar=w.Matrix4,h7=w.VertexFormat,A7=w.BufferUsage,f7=w.DrawCommand,d7=w.RenderState,p7=w.ShaderProgram,EE=w.ShaderSource,m7=w.VertexArray,PE=w._shadersAtmosphereCommon,BE=w._shadersSkyAtmosphereCommon,g7=w._shadersSkyAtmosphereVS,y7=w.Axis,v7=w.BlendingState,w7=w.CullFace,TE=w.SceneMode,nd=w.Transforms,b7=w.Matrix3,IE=w.DeveloperError,x7=w.loadCubeMap,_7=w.CubeMap;function Na(t,n){t=t??u7.WGS84,this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=ao.multiplyByScalar(t.radii,e,new ao);this._scaleMatrix=Ar.fromScale(i),this._modelMatrix=new Ar,this._command=new f7({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new ao(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new ao(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new ao;const o=new ao;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new b7,Ar.getMatrix3(r._eunMatrix||Ar.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(Na.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Na.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Gv=new Ar;Na.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==TE.SCENE3D&&e!==TE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const d=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!hr(o.positiveX)||!hr(o.negativeX)||!hr(o.positiveY)||!hr(o.negativeY)||!hr(o.positiveZ)||!hr(o.negativeZ))throw new IE("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new IE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?x7(d,this._sources).then(function(m){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=m}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new _7({context:d,source:o}))}const r=Ar.fromRotationTranslation(t.context.uniformState.inverseViewRotation,ao.ZERO,Gv),a=Ar.multiplyTransformation(r,y7.Y_UP_TO_Z_UP,Gv),s=Ar.multiply(this._scaleMatrix,a,Gv);Ar.clone(s,this._modelMatrix);const l=t.context,u=C7(this),A=t.globeTranslucencyState.translucent,h=this.perFragmentAtmosphere||A||!hr(n)||!n.show,f=this._command;if(nd.eastUpNorthToFixedFrame=nd.eastUpNorthToFixedFrame||nd.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=nd.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!hr(f.vertexArray)){const d=SE.createGeometry(new SE({radii:new ao(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:h7.POSITION_ONLY}));f.vertexArray=m7.fromGeometry({context:l,geometry:d,attributeLocations:c7.createAttributeLocations(d),bufferUsage:A7.STATIC_DRAW}),f.renderState=d7.fromCache({cull:{enabled:!0,face:w7.FRONT},blending:v7.ALPHA_BLEND,depthMask:!1})}const p=u|h<<2|A<<3;if(p!==this._flags){this._flags=p;const d=[];u&&d.push("COLOR_CORRECT"),h&&d.push("PER_FRAGMENT_ATMOSPHERE"),A&&d.push("GLOBE_TRANSLUCENT");const m=new EE({defines:d,sources:[PE,BE,g7]}),v=new EE({defines:d,sources:[PE,BE,a7]});this._spSkyAtmosphere=p7.fromCache({context:l,vertexShaderSource:m,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(hr(this._cubeMap))return f};function C7(t){return!(Va.equalsEpsilon(t.hueShift,0,Va.EPSILON7)&&Va.equalsEpsilon(t.saturationShift,0,Va.EPSILON7)&&Va.equalsEpsilon(t.brightnessShift,0,Va.EPSILON7))}Na.prototype.isDestroyed=function(){return!1},Na.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),l7(this)};const Xa=class Xa extends c.Destroyable{constructor(e,i){super();L(this,"_navigationManager");L(this,"_envManager");L(this,"_reu",(e,i)=>c.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new GH(r)),this._envManager=this.dv(new e7(r)),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Xa.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=CE(this._czmViewer.xbsjLocalBoxSources);if(s)return new Xa.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends c.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new c.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=at.latestDefaultAccessToken??at.currentDefaultAccessToken;w.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=w.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(c.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=w.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=w.JulianDate.fromDate(new Date(r.currentTime));w.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(gi(o.clockViewModel,"currentTime",s=>{const l=w.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=w.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=w.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new w.SunLight,l=new w.DirectionalLight({direction:o.scene.camera.directionWC});class u extends c.Destroyable{constructor(){super();const h=r.flashLighting??!1;o.scene.light=h?l:s,h&&this.dispose(o.scene.preRender.addEventListener(function(f,p){l.direction=w.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new c.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(d,m)=>c.registerEventUpdate(this,d,m),h=at.defaults,f=(d,m)=>A(r[d+"Changed"],()=>{if(!Reflect.has(r,d))throw new Error(`!Reflect.has(czmViewer, ${d})`);if(!Reflect.has(h,d))throw new Error(`!Reflect.has(CzmViewer.defaults, ${d})`);m(r[d]??h[d])}),p=(d,m)=>A(r[d+"Changed"],()=>{if(!Reflect.has(r,d))throw new Error(`!Reflect.has(czmViewer, ${d})`);m(r[d])});f("splitPosition",d=>o.scene.splitPosition=d),f("resolutionScale",d=>o.resolutionScale=d),f("msaaSamples",d=>o.scene.msaaSamples=d),p("shadows",d=>o.shadows=d),f("scenePpsfxaaEnabled",d=>s.postProcessStages.fxaa.enabled=d),p("scenePpsAmbientOcclusionEnabled",d=>s.postProcessStages.ambientOcclusion.enabled=d),p("scenePpsAmbientOcclusionAmbientOcclusionOnly",d=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=d),p("scenePpsAmbientOcclusionIntensity",d=>s.postProcessStages.ambientOcclusion.uniforms.intensity=d),p("scenePpsAmbientOcclusionBias",d=>s.postProcessStages.ambientOcclusion.uniforms.bias=d),p("scenePpsAmbientOcclusionLengthCap",d=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=d),p("scenePpsAmbientOcclusionStepSize",d=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=d),p("scenePpsAmbientOcclusionBlurStepSize",d=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=d),p("scenePpsBloomEnabled",d=>s.postProcessStages.bloom.enabled=d),p("scenePpsBloomGlowOnly",d=>s.postProcessStages.bloom.uniforms.glowOnly=d),p("scenePpsBloomContrast",d=>s.postProcessStages.bloom.uniforms.contrast=d),p("scenePpsBloomBrightness",d=>s.postProcessStages.bloom.uniforms.brightness=d),p("scenePpsBloomDelta",d=>s.postProcessStages.bloom.uniforms.delta=d),p("scenePpsBloomSigma",d=>s.postProcessStages.bloom.uniforms.sigma=d),p("scenePpsBloomStepSize",d=>s.postProcessStages.bloom.uniforms.stepSize=d),f("globeShow",d=>s.globe.show=d),f("depthTestAgainstTerrain",d=>{s.globe.depthTestAgainstTerrain=d}),s.globe.translucency.enabled=!0,f("terrainOpacity",d=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=c.clamp(d,0,1)}),f("sceneGlobeShadows",d=>s.globe.shadows=w.ShadowMode[d]),p("sceneGlobeTerrainExaggeration",d=>s.globe.terrainExaggeration=d),p("sceneGlobeTerrainExaggerationRelativeHeight",d=>s.globe.terrainExaggerationRelativeHeight=d),p("sceneGlobeVerticalExaggeration",d=>s.globe.verticalExaggeration=d),p("sceneGlobeVerticalExaggerationRelativeHeight",d=>s.globe.verticalExaggerationRelativeHeight=d),p("sceneGlobeBackFaceCulling",d=>s.globe.backFaceCulling=d),p("sceneGlobeShowSkirts",d=>s.globe.showSkirts=d),p("sceneGlobeShowWaterEffect",d=>s.globe.showWaterEffect=d),p("sceneGlobeBaseColor",d=>s.globe.baseColor=Be(d)),p("sceneGlobeCartographicLimitRectangle",d=>s.globe.cartographicLimitRectangle=gt(d)),p("sceneGlobeClippingPlanes",d=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=el(d??{enabled:!1});return}bh(s.globe.clippingPlanes,d)}),p("sceneGlobeClippingPolygons",d=>{s.globe.clippingPolygons=d?xh(d):void 0}),f("sceneSunGlowFactor",d=>s.sun&&(s.sun.glowFactor=d)),f("moon",d=>s.moon&&(s.moon.show=d)),f("sceneMoonOnlySunLighting",d=>s.moon&&(s.moon.onlySunLighting=d)),f("sceneMoonTextureUrl",d=>s.moon&&(s.moon.textureUrl=c.ESSceneObject.context.getStrFromEnv(d))),p("sceneSkyBoxShow",d=>s._xbsjOriginSkyBox.show=d),f("sceneSkyBoxSources",d=>s._xbsjOriginSkyBox.sources=d&&CE(d)),p("atmosphere",d=>o.scene._xbsjOriginSkyAtmosphere.show=d),p("sceneBackgroundColor",d=>o.scene.backgroundColor=Be(d)),f("sceneFogEnabled",d=>s.fog.enabled=d),f("sceneFogDensity",d=>s.fog.density=d),f("sceneFogScreenSpaceErrorFactor",d=>s.fog.screenSpaceErrorFactor=d),f("sceneFogMinimumBrightness",d=>s.fog.minimumBrightness=d),f("sceneDebugShowFramesPerSecond",d=>s.debugShowFramesPerSecond=d),f("sceneDebugShowCommands",d=>s.debugShowCommands=d),f("sceneDebugShowFrustums",d=>s.debugShowFrustums=d),f("sceneDebugShowFrustumPlanes",d=>s.debugShowFrustumPlanes=d),f("sceneDebugShowDepthFrustum",d=>s.debugShowDepthFrustum=d),f("sceneGlobeUndergroundColor",d=>u.undergroundColor=Be(d)),f("sceneGlobeUndergroundColorAlphaByDistance",d=>u.undergroundColorAlphaByDistance=gr(d)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",d=>u.translucency.backFaceAlphaByDistance=d&&gr(d)),p("sceneGlobeTranslucencyFrontFaceAlphaByDistance",d=>u.translucency.frontFaceAlphaByDistance=d&&gr(d)),f("sceneGlobeTranslucencyRectangle",d=>u.translucency.rectangle=gt(d)),f("sceneSplitPosition",d=>s.splitPosition=c.clamp(d,0,1)),f("sceneSsccEnableCollisionDetection",d=>s.screenSpaceCameraController.enableCollisionDetection=d),f("sceneSsccZoomFactor",d=>s.screenSpaceCameraController._zoomFactor=d);{const d=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};d(),this.d(r.showCesiumInspectorChanged.don(d))}f("cesiumInspectorWireframe",d=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=d)});{const d=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};d(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(d))}this.ad(new c.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Dv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};L(Xa,"BackGroundResetting",class extends c.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new td;r.material=w.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),L(Xa,"LocalSkyBoxResetting",class extends c.Destroyable{constructor(o,r,a){super();L(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new Na(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let Wv=Xa;function S7(t,n,e,i,o){var r=w.Cartesian3.subtract(t,e,new w.Cartesian3),a=w.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function E7(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=w.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[S7(a,l,s,u,A),r]}const P7=w.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function B7(t){return-Math.log2(t/P7)}var jv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function T7(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=jv[++e];);const i=n/jv[e-1]|0;return[i*jv[e-1],i,e]}class I7 extends c.Destroyable{constructor(){super();L(this,"_lengthInPixels",this.disposeVar(c.react(100)));L(this,"_resolution",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInPixels",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInMeters",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInStr",this.disposeVar(c.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=T7(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class F7 extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!0)));L(this,"_resolution",this.dv(c.react(void 0)));L(this,"_center",this.dv(c.react(void 0)));L(this,"_zoom",this.dv(c.react(void 0)));L(this,"_legend",this.dv(new I7));this._czmViewer=e;{const i=this.dv(c.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(c.sleep(1e3));const l=await o.promise(E7(this._czmViewer));if(l){const[u,A]=l;r=u,a=B7(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(c.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function M7(t,n){try{const e=w.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=w.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return w.Matrix4.clone(w.Matrix4.IDENTITY,n)}}const{combine:D7}=w,{ShaderDestination:as}=w,FE={name:"FlattenedPipelineStage"};FE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,as.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",as.BOTH),i.addUniform("vec4","u_flattenedBound",as.BOTH),i.addUniform("bool","u_flattened",as.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",as.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",as.BOTH),i.addUniform("bool","u_flattenDiscard",as.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??w.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??w.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=w.Matrix4.multiply(r,n.xbsjElevationMatrix??w.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new w.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??w.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=w.Matrix4.multiply(n.xbsjElevationMatrixInv??w.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new w.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=D7(o,t.uniformMap)}};function ME(){Object.defineProperties(w.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&w.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new w.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function DE(){Object.defineProperties(w.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function RE(){const t=w.Model3DTileContent.prototype.update;w.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function UE(){const t=w.ModelSceneGraph.prototype.configurePipeline;w.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(FE),i}}ME(),DE(),RE(),UE();const R7=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:c.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:c.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:c.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:c.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:c.reactArray([]),sceneGlobeUndergroundColor:c.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:c.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:c.reactJson(at.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:c.reactArray([1,1,1,1]),xbsjLocalBoxSources:c.reactJsonWithUndefined(void 0),sceneBackgroundColor:c.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),U7=`
4060
+ `,ao=w.Cartesian3,hr=w.defined,u7=w.destroyObject,c7=w.Ellipsoid,SE=w.EllipsoidGeometry,h7=w.GeometryPipeline,Va=w.Math,Ar=w.Matrix4,A7=w.VertexFormat,f7=w.BufferUsage,d7=w.DrawCommand,p7=w.RenderState,m7=w.ShaderProgram,EE=w.ShaderSource,g7=w.VertexArray,PE=w._shadersAtmosphereCommon,BE=w._shadersSkyAtmosphereCommon,y7=w._shadersSkyAtmosphereVS,v7=w.Axis,w7=w.BlendingState,b7=w.CullFace,TE=w.SceneMode,nd=w.Transforms,x7=w.Matrix3,IE=w.DeveloperError,_7=w.loadCubeMap,C7=w.CubeMap;function Na(t,n){t=t??c7.WGS84,this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=ao.multiplyByScalar(t.radii,e,new ao);this._scaleMatrix=Ar.fromScale(i),this._modelMatrix=new Ar,this._command=new d7({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new ao(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new ao(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new ao;const o=new ao;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new x7,Ar.getMatrix3(r._eunMatrix||Ar.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(Na.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Na.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Gv=new Ar;Na.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==TE.SCENE3D&&e!==TE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const d=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!hr(o.positiveX)||!hr(o.negativeX)||!hr(o.positiveY)||!hr(o.negativeY)||!hr(o.positiveZ)||!hr(o.negativeZ))throw new IE("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new IE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?_7(d,this._sources).then(function(m){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=m}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new C7({context:d,source:o}))}const r=Ar.fromRotationTranslation(t.context.uniformState.inverseViewRotation,ao.ZERO,Gv),a=Ar.multiplyTransformation(r,v7.Y_UP_TO_Z_UP,Gv),s=Ar.multiply(this._scaleMatrix,a,Gv);Ar.clone(s,this._modelMatrix);const l=t.context,u=S7(this),A=t.globeTranslucencyState.translucent,h=this.perFragmentAtmosphere||A||!hr(n)||!n.show,f=this._command;if(nd.eastUpNorthToFixedFrame=nd.eastUpNorthToFixedFrame||nd.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=nd.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!hr(f.vertexArray)){const d=SE.createGeometry(new SE({radii:new ao(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:A7.POSITION_ONLY}));f.vertexArray=g7.fromGeometry({context:l,geometry:d,attributeLocations:h7.createAttributeLocations(d),bufferUsage:f7.STATIC_DRAW}),f.renderState=p7.fromCache({cull:{enabled:!0,face:b7.FRONT},blending:w7.ALPHA_BLEND,depthMask:!1})}const p=u|h<<2|A<<3;if(p!==this._flags){this._flags=p;const d=[];u&&d.push("COLOR_CORRECT"),h&&d.push("PER_FRAGMENT_ATMOSPHERE"),A&&d.push("GLOBE_TRANSLUCENT");const m=new EE({defines:d,sources:[PE,BE,y7]}),v=new EE({defines:d,sources:[PE,BE,l7]});this._spSkyAtmosphere=m7.fromCache({context:l,vertexShaderSource:m,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(hr(this._cubeMap))return f};function S7(t){return!(Va.equalsEpsilon(t.hueShift,0,Va.EPSILON7)&&Va.equalsEpsilon(t.saturationShift,0,Va.EPSILON7)&&Va.equalsEpsilon(t.brightnessShift,0,Va.EPSILON7))}Na.prototype.isDestroyed=function(){return!1},Na.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),u7(this)};const Xa=class Xa extends c.Destroyable{constructor(e,i){super();L(this,"_navigationManager");L(this,"_envManager");L(this,"_reu",(e,i)=>c.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new WH(r)),this._envManager=this.dv(new t7(r)),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Xa.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=CE(this._czmViewer.xbsjLocalBoxSources);if(s)return new Xa.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends c.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new c.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=at.latestDefaultAccessToken??at.currentDefaultAccessToken;w.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=w.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(c.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=w.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=w.JulianDate.fromDate(new Date(r.currentTime));w.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(gi(o.clockViewModel,"currentTime",s=>{const l=w.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=w.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=w.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new w.SunLight,l=new w.DirectionalLight({direction:o.scene.camera.directionWC});class u extends c.Destroyable{constructor(){super();const h=r.flashLighting??!1;o.scene.light=h?l:s,h&&this.dispose(o.scene.preRender.addEventListener(function(f,p){l.direction=w.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new c.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(d,m)=>c.registerEventUpdate(this,d,m),h=at.defaults,f=(d,m)=>A(r[d+"Changed"],()=>{if(!Reflect.has(r,d))throw new Error(`!Reflect.has(czmViewer, ${d})`);if(!Reflect.has(h,d))throw new Error(`!Reflect.has(CzmViewer.defaults, ${d})`);m(r[d]??h[d])}),p=(d,m)=>A(r[d+"Changed"],()=>{if(!Reflect.has(r,d))throw new Error(`!Reflect.has(czmViewer, ${d})`);m(r[d])});f("splitPosition",d=>o.scene.splitPosition=d),f("resolutionScale",d=>o.resolutionScale=d),f("msaaSamples",d=>o.scene.msaaSamples=d),p("shadows",d=>o.shadows=d),f("scenePpsfxaaEnabled",d=>s.postProcessStages.fxaa.enabled=d),p("scenePpsAmbientOcclusionEnabled",d=>s.postProcessStages.ambientOcclusion.enabled=d),p("scenePpsAmbientOcclusionAmbientOcclusionOnly",d=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=d),p("scenePpsAmbientOcclusionIntensity",d=>s.postProcessStages.ambientOcclusion.uniforms.intensity=d),p("scenePpsAmbientOcclusionBias",d=>s.postProcessStages.ambientOcclusion.uniforms.bias=d),p("scenePpsAmbientOcclusionLengthCap",d=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=d),p("scenePpsAmbientOcclusionStepSize",d=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=d),p("scenePpsAmbientOcclusionBlurStepSize",d=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=d),p("scenePpsBloomEnabled",d=>s.postProcessStages.bloom.enabled=d),p("scenePpsBloomGlowOnly",d=>s.postProcessStages.bloom.uniforms.glowOnly=d),p("scenePpsBloomContrast",d=>s.postProcessStages.bloom.uniforms.contrast=d),p("scenePpsBloomBrightness",d=>s.postProcessStages.bloom.uniforms.brightness=d),p("scenePpsBloomDelta",d=>s.postProcessStages.bloom.uniforms.delta=d),p("scenePpsBloomSigma",d=>s.postProcessStages.bloom.uniforms.sigma=d),p("scenePpsBloomStepSize",d=>s.postProcessStages.bloom.uniforms.stepSize=d),f("globeShow",d=>s.globe.show=d),f("depthTestAgainstTerrain",d=>{s.globe.depthTestAgainstTerrain=d}),s.globe.translucency.enabled=!0,f("terrainOpacity",d=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=c.clamp(d,0,1)}),f("sceneGlobeShadows",d=>s.globe.shadows=w.ShadowMode[d]),p("sceneGlobeTerrainExaggeration",d=>s.globe.terrainExaggeration=d),p("sceneGlobeTerrainExaggerationRelativeHeight",d=>s.globe.terrainExaggerationRelativeHeight=d),p("sceneGlobeVerticalExaggeration",d=>s.globe.verticalExaggeration=d),p("sceneGlobeVerticalExaggerationRelativeHeight",d=>s.globe.verticalExaggerationRelativeHeight=d),p("sceneGlobeBackFaceCulling",d=>s.globe.backFaceCulling=d),p("sceneGlobeShowSkirts",d=>s.globe.showSkirts=d),p("sceneGlobeShowWaterEffect",d=>s.globe.showWaterEffect=d),p("sceneGlobeBaseColor",d=>s.globe.baseColor=Be(d)),p("sceneGlobeCartographicLimitRectangle",d=>s.globe.cartographicLimitRectangle=gt(d)),p("sceneGlobeClippingPlanes",d=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=el(d??{enabled:!1});return}bh(s.globe.clippingPlanes,d)}),p("sceneGlobeClippingPolygons",d=>{s.globe.clippingPolygons=d?xh(d):void 0}),f("sceneSunGlowFactor",d=>s.sun&&(s.sun.glowFactor=d)),f("moon",d=>s.moon&&(s.moon.show=d)),f("sceneMoonOnlySunLighting",d=>s.moon&&(s.moon.onlySunLighting=d)),f("sceneMoonTextureUrl",d=>s.moon&&(s.moon.textureUrl=c.ESSceneObject.context.getStrFromEnv(d))),p("sceneSkyBoxShow",d=>s._xbsjOriginSkyBox.show=d),f("sceneSkyBoxSources",d=>s._xbsjOriginSkyBox.sources=d&&CE(d)),p("atmosphere",d=>o.scene._xbsjOriginSkyAtmosphere.show=d),p("sceneBackgroundColor",d=>o.scene.backgroundColor=Be(d)),f("sceneFogEnabled",d=>s.fog.enabled=d),f("sceneFogDensity",d=>s.fog.density=d),f("sceneFogScreenSpaceErrorFactor",d=>s.fog.screenSpaceErrorFactor=d),f("sceneFogMinimumBrightness",d=>s.fog.minimumBrightness=d),f("sceneDebugShowFramesPerSecond",d=>s.debugShowFramesPerSecond=d),f("sceneDebugShowCommands",d=>s.debugShowCommands=d),f("sceneDebugShowFrustums",d=>s.debugShowFrustums=d),f("sceneDebugShowFrustumPlanes",d=>s.debugShowFrustumPlanes=d),f("sceneDebugShowDepthFrustum",d=>s.debugShowDepthFrustum=d),f("sceneGlobeUndergroundColor",d=>u.undergroundColor=Be(d)),f("sceneGlobeUndergroundColorAlphaByDistance",d=>u.undergroundColorAlphaByDistance=gr(d)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",d=>u.translucency.backFaceAlphaByDistance=d&&gr(d)),p("sceneGlobeTranslucencyFrontFaceAlphaByDistance",d=>u.translucency.frontFaceAlphaByDistance=d&&gr(d)),f("sceneGlobeTranslucencyRectangle",d=>u.translucency.rectangle=gt(d)),f("sceneSplitPosition",d=>s.splitPosition=c.clamp(d,0,1)),f("sceneSsccEnableCollisionDetection",d=>s.screenSpaceCameraController.enableCollisionDetection=d),f("sceneSsccZoomFactor",d=>s.screenSpaceCameraController._zoomFactor=d);{const d=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};d(),this.d(r.showCesiumInspectorChanged.don(d))}f("cesiumInspectorWireframe",d=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=d)});{const d=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};d(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(d))}this.ad(new c.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Dv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};L(Xa,"BackGroundResetting",class extends c.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new td;r.material=w.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),L(Xa,"LocalSkyBoxResetting",class extends c.Destroyable{constructor(o,r,a){super();L(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new Na(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let Wv=Xa;function E7(t,n,e,i,o){var r=w.Cartesian3.subtract(t,e,new w.Cartesian3),a=w.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function P7(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=w.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[E7(a,l,s,u,A),r]}const B7=w.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function T7(t){return-Math.log2(t/B7)}var jv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function I7(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=jv[++e];);const i=n/jv[e-1]|0;return[i*jv[e-1],i,e]}class F7 extends c.Destroyable{constructor(){super();L(this,"_lengthInPixels",this.disposeVar(c.react(100)));L(this,"_resolution",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInPixels",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInMeters",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInStr",this.disposeVar(c.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=I7(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class M7 extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!0)));L(this,"_resolution",this.dv(c.react(void 0)));L(this,"_center",this.dv(c.react(void 0)));L(this,"_zoom",this.dv(c.react(void 0)));L(this,"_legend",this.dv(new F7));this._czmViewer=e;{const i=this.dv(c.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(c.sleep(1e3));const l=await o.promise(P7(this._czmViewer));if(l){const[u,A]=l;r=u,a=T7(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(c.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function D7(t,n){try{const e=w.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=w.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return w.Matrix4.clone(w.Matrix4.IDENTITY,n)}}const{combine:R7}=w,{ShaderDestination:as}=w,FE={name:"FlattenedPipelineStage"};FE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,as.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",as.BOTH),i.addUniform("vec4","u_flattenedBound",as.BOTH),i.addUniform("bool","u_flattened",as.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",as.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",as.BOTH),i.addUniform("bool","u_flattenDiscard",as.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??w.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??w.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=w.Matrix4.multiply(r,n.xbsjElevationMatrix??w.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new w.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??w.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=w.Matrix4.multiply(n.xbsjElevationMatrixInv??w.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new w.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=R7(o,t.uniformMap)}};function ME(){Object.defineProperties(w.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&w.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new w.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function DE(){Object.defineProperties(w.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function RE(){const t=w.Model3DTileContent.prototype.update;w.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function UE(){const t=w.ModelSceneGraph.prototype.configurePipeline;w.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(FE),i}}ME(),DE(),RE(),UE();const U7=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:c.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:c.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:c.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:c.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:c.reactArray([]),sceneGlobeUndergroundColor:c.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:c.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:c.reactJson(at.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:c.reactArray([1,1,1,1]),xbsjLocalBoxSources:c.reactJsonWithUndefined(void 0),sceneBackgroundColor:c.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),O7=`
4061
4061
  #### 示例代码1
4062
4062
  \`\`\`
4063
4063
  async function initCesiumViewer(container, czmViewer) {
@@ -4132,7 +4132,7 @@ async function initCesiumViewer(container, czmViewer) {
4132
4132
  return viewer;
4133
4133
  }
4134
4134
  \`\`\`
4135
- `,O7=`async function initCesiumViewer(container, czmViewer) {
4135
+ `,L7=`async function initCesiumViewer(container, czmViewer) {
4136
4136
  const viewer = await XE2.g.defaultCreateCesiumViewerFunc(container, czmViewer);
4137
4137
 
4138
4138
  // 若原Czm版权信息展示位置遮挡重要信息,可将以下语句解注释,在别的位置展示
@@ -4140,13 +4140,13 @@ async function initCesiumViewer(container, czmViewer) {
4140
4140
 
4141
4141
  return viewer;
4142
4142
  }
4143
- `;function L7(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
4143
+ `;function z7(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
4144
4144
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
4145
4145
  gitee地址:${t}
4146
- `;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Gt=class Gt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",Zf);L(this,"_moveObjectsProcess",this.ad(NS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new RV(this)),this.ad(new UV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kV(this)})),this._viewerLegend=this.dv(new F7(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new LN(this.subContainer,this,o=>this._viewer.value=o,i.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&&Mt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=w.Cartographic.fromDegrees(e[0],e[1],e[2],Gt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:ys(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=w.Cartesian3.fromDegrees(...e),r=w.Transforms.eastNorthUpToFixedFrame(o),a=w.Matrix4.inverse(r,new w.Matrix4),s=w.Matrix4.multiplyByPoint(a,i.positionWC,new w.Cartesian3),l=w.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=w.Math.toDegrees(u);let A=w.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-w.Math.PI:w.Math.PI),A=w.Math.toDegrees(A);const h=ys(i),f=h[0]-A,p=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:p}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&sl(s,a,r)}flyTo(e,i,o="default"){var p;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(p=this.viewer)==null?void 0:p.camera;return f&&sl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&sl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:ys(e)}}transformFlyParam(e,i){if("position"in i){const o=w.Cartesian3.fromDegrees(...e),r=w.Transforms.eastNorthUpToFixedFrame(o),a=w.Matrix4.inverse(r,new w.Matrix4),s=w.Matrix4.multiplyByPoint(a,Ye(i.position),new w.Cartesian3),l=w.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=w.Math.toDegrees(u);let A=w.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-w.Math.PI:w.Math.PI),A=w.Math.toDegrees(A);const h=i.rotation[0]-A,f=i.rotation[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:i.flyDuration??1,hDelta:h,pDelta:f}}else{const o=Ye(e);let r={heading:w.Math.toRadians(i.heading),pitch:w.Math.toRadians(i.pitch),roll:0};const a=new w.HeadingPitchRoll;if(i.distance){a.heading=r.heading,a.pitch=r.pitch,a.roll=0,a.heading-=w.Math.PI_OVER_TWO;const l=w.Transforms.headingPitchRollToFixedFrame(o,a,void 0,void 0),u=w.Matrix4.multiplyByPointAsVector(l,w.Cartesian3.UNIT_X,new w.Cartesian3);w.Cartesian3.multiplyByScalar(u,i.distance,u),w.Cartesian3.subtract(o,u,o)}i.hDelta&&(r.heading+=w.Math.toRadians(i.hDelta)),i.pDelta&&(r.pitch+=w.Math.toRadians(i.pDelta));const s=De(o);return s?{position:s,rotation:[w.Math.toDegrees(r.heading),w.Math.toDegrees(r.pitch),w.Math.toDegrees(r.roll)],flyDuration:i.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),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={version:w.VERSION},e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=w.Cartographic.fromDegrees(e,i,void 0,Gt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await R0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(Ye(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Gt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Gt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Gt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return wn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=e instanceof w.Cartesian3?e:Ye(e),o=new w.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Gt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",O7,U7,!0),new c.FunctionProperty([],()=>Gt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Gt,"type",Gt.register("ESCesiumViewer",Gt)),L(Gt,"getCesiumIonToken",L7),L(Gt,"currentDefaultAccessToken",w.Ion.defaultAccessToken),L(Gt,"latestDefaultAccessToken"),L(Gt,"ObjectsToExcludeWrapper",zV),L(Gt,"defaults",{...c.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,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:w.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:w.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}),L(Gt,"getHeightsScartchCarto",new w.Cartographic);let at=Gt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...R7()})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps),ne.copyright=void 0;try{const t="earthsdk3-cesium",n="3.6.0-beta.3",e="2025-11-18T02:12:17.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="3eb5b31c6dea17071e3840bfc40ded19a24f5985",s=((Date.now()-1763431937e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
4146
+ `;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Gt=class Gt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",Zf);L(this,"_moveObjectsProcess",this.ad(NS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new RV(this)),this.ad(new UV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kV(this)})),this._viewerLegend=this.dv(new M7(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new zN(this.subContainer,this,o=>this._viewer.value=o,i.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&&Mt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=w.Cartographic.fromDegrees(e[0],e[1],e[2],Gt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:ys(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=w.Cartesian3.fromDegrees(...e),r=w.Transforms.eastNorthUpToFixedFrame(o),a=w.Matrix4.inverse(r,new w.Matrix4),s=w.Matrix4.multiplyByPoint(a,i.positionWC,new w.Cartesian3),l=w.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=w.Math.toDegrees(u);let A=w.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-w.Math.PI:w.Math.PI),A=w.Math.toDegrees(A);const h=ys(i),f=h[0]-A,p=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:p}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&sl(s,a,r)}flyTo(e,i,o="default"){var p;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(p=this.viewer)==null?void 0:p.camera;return f&&sl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&sl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:ys(e)}}transformFlyParam(e,i){if("position"in i){const o=w.Cartesian3.fromDegrees(...e),r=w.Transforms.eastNorthUpToFixedFrame(o),a=w.Matrix4.inverse(r,new w.Matrix4),s=w.Matrix4.multiplyByPoint(a,Ye(i.position),new w.Cartesian3),l=w.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=w.Math.toDegrees(u);let A=w.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-w.Math.PI:w.Math.PI),A=w.Math.toDegrees(A);const h=i.rotation[0]-A,f=i.rotation[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:i.flyDuration??1,hDelta:h,pDelta:f}}else{const o=Ye(e);let r={heading:w.Math.toRadians(i.heading),pitch:w.Math.toRadians(i.pitch),roll:0};const a=new w.HeadingPitchRoll;if(i.distance){a.heading=r.heading,a.pitch=r.pitch,a.roll=0,a.heading-=w.Math.PI_OVER_TWO;const l=w.Transforms.headingPitchRollToFixedFrame(o,a,void 0,void 0),u=w.Matrix4.multiplyByPointAsVector(l,w.Cartesian3.UNIT_X,new w.Cartesian3);w.Cartesian3.multiplyByScalar(u,i.distance,u),w.Cartesian3.subtract(o,u,o)}i.hDelta&&(r.heading+=w.Math.toRadians(i.hDelta)),i.pDelta&&(r.pitch+=w.Math.toRadians(i.pDelta));const s=De(o);return s?{position:s,rotation:[w.Math.toDegrees(r.heading),w.Math.toDegrees(r.pitch),w.Math.toDegrees(r.roll)],flyDuration:i.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),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={version:w.VERSION},e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=w.Cartographic.fromDegrees(e,i,void 0,Gt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await R0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(Ye(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Gt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Gt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Gt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return wn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=e instanceof w.Cartesian3?e:Ye(e),o=new w.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Gt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",L7,O7,!0),new c.FunctionProperty([],()=>Gt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Gt,"type",Gt.register("ESCesiumViewer",Gt)),L(Gt,"getCesiumIonToken",z7),L(Gt,"currentDefaultAccessToken",w.Ion.defaultAccessToken),L(Gt,"latestDefaultAccessToken"),L(Gt,"ObjectsToExcludeWrapper",zV),L(Gt,"defaults",{...c.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,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:w.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:w.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:w.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}),L(Gt,"getHeightsScartchCarto",new w.Cartographic);let at=Gt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...U7()})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps),ne.copyright=void 0;try{const t="earthsdk3-cesium",n="3.6.0-beta.4",e="2025-11-18T09:13:53.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="4a9c24099a441199e22c1cf61db58dd0d2fa26ec",s=((Date.now()-1763457233e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
4147
4147
  %c${o?o+`
4148
4148
  `:""}当前网站正在使用${t},此软件版权归${i}所有
4149
- `;ne.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","3eb5b31c6dea17071e3840bfc40ded19a24f5985")},get info(){return l},get date(){return"2025-11-18T02:12:17.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.3"},get name(){return"earthsdk3-cesium"},get commitId(){return"3eb5b31c6dea17071e3840bfc40ded19a24f5985"},print(){console.info(this.info,`
4149
+ `;ne.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","4a9c24099a441199e22c1cf61db58dd0d2fa26ec")},get info(){return l},get date(){return"2025-11-18T09:13:53.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.4"},get name(){return"earthsdk3-cesium"},get commitId(){return"4a9c24099a441199e22c1cf61db58dd0d2fa26ec"},print(){console.info(this.info,`
4150
4150
  font-size: 18px;
4151
4151
  font-weight: 1000;
4152
4152
  line-height: 1;
@@ -4163,4 +4163,4 @@ async function initCesiumViewer(container, czmViewer) {
4163
4163
  color: rgb(0, 120, 215);
4164
4164
  padding-bottom: 2px;
4165
4165
  padding-left: 35px;
4166
- `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=ne.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&ne.copyright.print()}catch{}return LE(),ne.BaseEditingWrapper=cn,ne.CircularAppendEditing=OS,ne.CircularAppendEditingWrapper=_v,ne.CircularInsertEditing=zS,ne.CircularInsertEditingWrapper=Cv,ne.CurrentPositionsCenter=Ed,ne.CurrentScale=Sd,ne.CurrentSceneScalePoi=I0,ne.CursorFloatDiv=YP,ne.CursorInfo=JP,ne.Czm3DTiles=$e,ne.CzmCameraChanged=Ch,ne.CzmCanvasAndDivSwitchPoi=tB,ne.CzmCanvasPoi=Vd,ne.CzmCircle=Ro,ne.CzmCircleGroundPrimitive=Qr,ne.CzmCircleOutlinePrimitive=Vr,ne.CzmCirclePrimitive=kr,ne.CzmClippingPlanes=la,ne.CzmClock=ze,ne.CzmCustomPrimitive=ut,ne.CzmDivPoi=Nd,ne.CzmES3DTileset=ua,ne.CzmESAlarm=jm,ne.CzmESApertureEffect=qm,ne.CzmESAreaMeasurement=Km,ne.CzmESBlastParticleSystem=Zm,ne.CzmESBoxClipping=$m,ne.CzmESCameraView=Xm,ne.CzmESCameraVisibleRange=Ym,ne.CzmESCar=Jm,ne.CzmESCityBasePoint=tg,ne.CzmESClassification=ng,ne.CzmESClippingPlane=Hm,ne.CzmESCustomPrimitive=Kg,ne.CzmESCzml=ig,ne.CzmESDataMesh=rg,ne.CzmESDirectionMeasurement=og,ne.CzmESDistanceMeasurement=sg,ne.CzmESDynamicWater=Zg,ne.CzmESEntityCluster=$g,ne.CzmESExcavate=ag,ne.CzmESFireParticleSystem=lg,ne.CzmESGeHistoryImagery=Xg,ne.CzmESGeoBezierPath=cg,ne.CzmESGeoDiv=hg,ne.CzmESGeoDivTextPoi=Ag,ne.CzmESGeoExtrudedPolygon=sv,ne.CzmESGeoJson=fg,ne.CzmESGeoLineString=da,ne.CzmESGeoPoints=dv,ne.CzmESGeoPolygon=Ln,ne.CzmESGeoPolygonImpl=Ti,ne.CzmESGeoRectangle=dg,ne.CzmESGeoSmoothPolygon=pg,ne.CzmESGeoVector=sn,ne.CzmESGeoWater=Yg,ne.CzmESGltfModel=mg,ne.CzmESHeatMap=fv,ne.CzmESHeightMeasurement=gg,ne.CzmESHuman=vg,ne.CzmESHumanPoi=av,ne.CzmESImageLabel=wg,ne.CzmESImageryLayer=bg,ne.CzmESKml=Ug,ne.CzmESLabel=jl,ne.CzmESLocalCircle=Og,ne.CzmESLocalLineString=Lg,ne.CzmESLocalLineStringZ=zg,ne.CzmESLocalPolygon=kg,ne.CzmESLocalPolygonZ=Qg,ne.CzmESLocalRectangle=Vg,ne.CzmESLocalSkyBox=xg,ne.CzmESLocalVector=df,ne.CzmESLocationMeasurement=_g,ne.CzmESMVTLayer=Sf,ne.CzmESMsTileset=cv,ne.CzmESNavigator=Ng,ne.CzmESObjectWithLocation=He,ne.CzmESParticleSystemPrimitive=Cg,ne.CzmESPath=Hg,ne.CzmESPipeFence=Jg,ne.CzmESPipeline=ey,ne.CzmESPipeserTileset=ny,ne.CzmESPit=ay,ne.CzmESPoi2D=Sg,ne.CzmESPoi3D=Eg,ne.CzmESPolygonFence=Gg,ne.CzmESPolygonFlattenedPlane=Wm,ne.CzmESPolygonWithHole=ly,ne.CzmESRectangle=Wg,ne.CzmESRoad=jg,ne.CzmESRtsFeatureEditing=uv,ne.CzmESRtsTileset=lv,ne.CzmESScale=qg,ne.CzmESSignalTransmission=yy,ne.CzmESSkylineAnalysis=Av,ne.CzmESStaticMesh=hv,ne.CzmESSubmergingAnalysis=Pg,ne.CzmESSunshineAnalysis=Xy,ne.CzmESSurfaceAreaMeasurement=tv,ne.CzmESTerrainLayer=Bg,ne.CzmESTextLabel=Tg,ne.CzmESUEWidget=Ig,ne.CzmESUnrealActor=Fg,ne.CzmESVideoFusion=Mg,ne.CzmESViewShed=Dg,ne.CzmESViewerStatusBar=nv,ne.CzmESViewerStatusBarScale=iv,ne.CzmESVisibilityAnalysis=rv,ne.CzmESVisualObject=Hn,ne.CzmESVolumeMeasurement=ov,ne.CzmESWidget=Rg,ne.CzmFlattenedPlane=Xr,ne.CzmGlobeMaterial=No,ne.CzmImageModel=$i,ne.CzmImagery=Zr,ne.CzmModelPrimitive=Wt,ne.CzmParticleSystemPrimitive=wi,ne.CzmPicking=P0,ne.CzmPoint=Wn,ne.CzmPointPrimitiveCollection=Oo,ne.CzmPoisContext=H0,ne.CzmPolygon=Es,ne.CzmPolygonClipping=pa,ne.CzmPolygonGroundPrimitive=Ss,ne.CzmPolygonGroundPrimitiveWithHeight=Mo,ne.CzmPolygonPrimitive=Sr,ne.CzmPolygonPrimitiveWithHeight=Lr,ne.CzmPolygonWithHeight=zr,ne.CzmPolyline=Je,ne.CzmPolylineGroundPrimitive=Ts,ne.CzmPolylinePrimitive=Is,ne.CzmPolylines=li,ne.CzmPolylinesGroundPrimitive=Cs,ne.CzmPolylinesPrimitive=Un,ne.CzmRectangle=Ci,ne.CzmSignalTransmission=Yr,ne.CzmTexture=ft,ne.CzmView=xn,ne.CzmViewDistanceRangeControl=po,ne.CzmWater=Uo,ne.CzmWaterPrimitive=Fl,ne.DoublePointsAppendEditing=Oa,ne.DoublePointsAppendEditingWrapper=bv,ne.DoublePointsModifyEditing=ss,ne.DoublePointsModifyEditingWrapper=xv,ne.ESCesiumViewer=at,ne.ESCustomPrimitive=wf,ne.ESGeHistoryImagery=gf,ne.ESGeoBezierPath=_f,ne.ESGeoSmoothPolygon=$l,ne.ESKml=yf,ne.ESLocalLineString=vf,ne.ESLocalLineStringZ=Zl,ne.ESMVTLayer=mf,ne.ESRoad=xf,ne.ESSignalTransmission=bf,ne.GeoCanvasImagePoi=yi,ne.GeoCanvasMenuPoi=Ps,ne.GeoCanvasPoi=Wi,ne.GeoCanvasPointPoi=Er,ne.GeoCustomDivPoi=bt,ne.GeoDivSwitchPoi=Eo,ne.GeoDivTextPoi=vi,ne.GeoPolylinePath=ma,ne.HeightModifyEditing=VS,ne.HeightModifyEditingWrapper=Fv,ne.ImageLabel2D=$x,ne.ImageLabel3D=Xx,ne.ImageriesManager=oE,ne.LabelManager=rE,ne.LineStringAppendEditing=US,ne.LineStringAppendEditingWrapper=Sv,ne.LineStringInsertEditing=LS,ne.LineStringInsertEditingWrapper=Ev,ne.PickingManager=sE,ne.PlaceEditing=Li,ne.PlaceEditingWrapper=yv,ne.PolylinePath=aa,ne.ResourceHandler=_s,ne.RotationEditing=pi,ne.RotationEditingWrapper=vv,ne.ScaleEditing=ur,ne.ScaleEditingWrapper=wv,ne.ScatterAppendEditing=kS,ne.ScatterAppendEditingWrapper=Pv,ne.ScatterModifyEditing=QS,ne.ScatterModifyEditingWrapper=Bv,ne.ScreenManager=dE,ne.SharedTexturePool=V0,ne.SmoothMoving=T0,ne.TerrainManager=iE,ne.TextLabel2D=Jx,ne.TextLabel3D=e_,ne.ToGCJ02WebMercatorTilingScheme=px,ne.ToWGS84WebMercatorTilingScheme=mx,ne.TranslationEditing=lr,ne.TranslationEditingWrapper=Kf,ne.ViewerExtensions=pE,ne.VisibilityAppendEditing=La,ne.VisibilityAppendEditingWrapper=Tv,ne.VisibilityModifyEditing=za,ne.VisibilityModifyEditingWrapper=Iv,ne.Widget2D=Pr,ne.Widget3D=FA,ne.WinPosFromCartesian=Eh,ne.XbsjGroundPolylinePrimitive=Bi,ne._ESEditModeInstance=Zf,ne.angleToHumanStr=rl,ne.areaToHumanStr=tP,ne.bindNorthRotation=Rt,ne.calculateImageTiles=B0,ne.capture=R0,ne.checkAndConvertImage=eP,ne.computeCutPoint=IS,ne.computeCzmModelMatrix=lt,ne.computePickingInfoWithCoordinates=fd,ne.createClippingPlaneCollection=el,ne.createClippingPolygonCollection=xh,ne.createGeoBoudingSphereReactFromPositions=D0,ne.createHelperLine=a2,ne.createInfoPoi=Rd,ne.createInnerClassFromJson=Id,ne.createInnerHtmlWithWhiteTextBlackBackground=_o,ne.createMaterialFromJson=o0,ne.createMaterialRef=ai,ne.createMoveObjectsProcessing=NS,ne.createPolygonHierarchy=Hi,ne.createTexture=bo,ne.createTextureFromImage=kd,ne.createTilingSchema=si,ne.czmEllipsoidWGS84=z0,ne.czmFlyTo=sl,ne.czmModelActiveAnimationsWithVisible=Ih,ne.czmSubscribeAndEvaluate=gi,ne.defaultFlyToRotation=Gn,ne.distanceToHumanStr=Mh,ne.extendComponentProps=nP,ne.flyTo=Fe,ne.flyWithPosition=Rn,ne.flyWithPositions=Me,ne.flyWithPrimitive=bn,ne.fromCartesian=kE,ne.fromCartesian2=qv,ne.fromCartesian3=Ya,ne.fromCartesian4=Kv,ne.fromCartographic=fo,ne.fromColor=VE,ne.fromDistanceDisplayCondition=GE,ne.fromEllipsoid=YE,ne.fromHeadingPitchRoll=HE,ne.fromNearFarScalar=NE,ne.fromQuaternion=jE,ne.fromRectangle=$E,ne.generateCartesianArc=y0,ne.geoNeareastPointOnRhumbLine=mo,ne.geoNeareastPointOnRhumbLine2=l2,ne.geoPolylineToBezierSpline=Ud,ne.getCameraPosition=Mn,ne.getCameraRotation=ys,ne.getCameraTargetPos=Yv,ne.getCenterAndViewDistance=Od,ne.getCzmCode=K2,ne.getDefaultComponentProps=iP,ne.getDefaultWinPosAndDepth=m2,ne.getDetailedTerrainDistance=L0,ne.getDirectionVectorFromRotation=u0,ne.getDistancesAndTimePosRotsFromPositions=xd,ne.getElevationMatrix=M7,ne.getEllipsoidGeodesicCenter=gd,ne.getFlyToCenterAndRotation=Dh,ne.getFoveatedInterpolationCallback=Px,ne.getFuncFromStr=Fd,ne.getGroundTerrainDistance=O0,ne.getGroundTerrainDistances=U0,ne.getIncludedAngleFromPositions=x0,ne.getInverseModelMatrix=w0,ne.getMinMaxPosition=M0,ne.getModelMatrixFromPosition=_d,ne.getObjectProperties=Co,ne.getPointerEventButton=Gi,ne.getPolygonPointsFromHierarchy=Cd,ne.getQuaternion=ud,ne.getQuaternionWithXForwardZUp=$v,ne.getQuaternionWithYForwardZUp=_h,ne.getResource=Dn,ne.getSceneScaleForScreenPixelSize=Ni,ne.getSharedTexturePool=N0,ne.getTilingSchemeStr=LU,ne.getViewerExtensions=Mt,ne.getWinPos=l0,ne.getXbsjWaterMaterial=C0,ne.hackCesium3DTileset=DE,ne.hackCzmModel3DTileContent=RE,ne.hackModel=ME,ne.hackModelSceneGraph=UE,ne.imgUrlToBase64=So,ne.localPositionToPosition=xr,ne.localPositionsToPositions=_r,ne.merge3dTilesServer=V2,ne.pickHeightPosition=Sh,ne.pickPosition=i0,ne.pickVirtualEarth=vs,ne.pickVirtualPlane=r0,ne.positionAndRotationToQuaternion=ZE,ne.positionFromCartesian=De,ne.positionToCartesian=Ye,ne.positionToHumanStr=Md,ne.positionToLocalPosition=b0,ne.positionsToLocalPositions=wn,ne.positionsToUniqueCartesians=Yt,ne.rectangleIsGlobal=Td,ne.rpToap=Fh,ne.setClippingPlaneCollection=bh,ne.setCylinderGeometry=Dd,ne.setModelMaterial=il,ne.setRectangleGeometry=F0,ne.setViewerExtensions=Qv,ne.toCartesian=oi,ne.toCartesian2=Ze,ne.toCartesian3=ri,ne.toCartesian4=ld,ne.toCartographic=QE,ne.toCoefficients=Bd,ne.toColor=Be,ne.toDistanceDisplayCondition=Ja,ne.toEllipsoid=qe,ne.toHeadingPitchRoll=Zv,ne.toNearFarScalar=gr,ne.toQuaternion=WE,ne.toRectangle=gt,ne.toRgbaString=Cr,ne.updateEnvironmentMapManager=Pd,ne.updateMaterialFromJson=md,ne.waterType=Rh,ne.winPosAndDepthEqual=a0,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"}),ne}({},Cesium,EarthSDK3);
4166
+ `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=ne.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&ne.copyright.print()}catch{}return LE(),ne.BaseEditingWrapper=cn,ne.CircularAppendEditing=OS,ne.CircularAppendEditingWrapper=_v,ne.CircularInsertEditing=zS,ne.CircularInsertEditingWrapper=Cv,ne.CurrentPositionsCenter=Ed,ne.CurrentScale=Sd,ne.CurrentSceneScalePoi=I0,ne.CursorFloatDiv=YP,ne.CursorInfo=JP,ne.Czm3DTiles=$e,ne.CzmCameraChanged=Ch,ne.CzmCanvasAndDivSwitchPoi=tB,ne.CzmCanvasPoi=Vd,ne.CzmCircle=Ro,ne.CzmCircleGroundPrimitive=Qr,ne.CzmCircleOutlinePrimitive=Vr,ne.CzmCirclePrimitive=kr,ne.CzmClippingPlanes=la,ne.CzmClock=ze,ne.CzmCustomPrimitive=ut,ne.CzmDivPoi=Nd,ne.CzmES3DTileset=ua,ne.CzmESAlarm=jm,ne.CzmESApertureEffect=qm,ne.CzmESAreaMeasurement=Km,ne.CzmESBlastParticleSystem=Zm,ne.CzmESBoxClipping=$m,ne.CzmESCameraView=Xm,ne.CzmESCameraVisibleRange=Ym,ne.CzmESCar=Jm,ne.CzmESCityBasePoint=tg,ne.CzmESClassification=ng,ne.CzmESClippingPlane=Hm,ne.CzmESCustomPrimitive=Kg,ne.CzmESCzml=ig,ne.CzmESDataMesh=rg,ne.CzmESDirectionMeasurement=og,ne.CzmESDistanceMeasurement=sg,ne.CzmESDynamicWater=Zg,ne.CzmESEntityCluster=$g,ne.CzmESExcavate=ag,ne.CzmESFireParticleSystem=lg,ne.CzmESGeHistoryImagery=Xg,ne.CzmESGeoBezierPath=cg,ne.CzmESGeoDiv=hg,ne.CzmESGeoDivTextPoi=Ag,ne.CzmESGeoExtrudedPolygon=sv,ne.CzmESGeoJson=fg,ne.CzmESGeoLineString=da,ne.CzmESGeoPoints=dv,ne.CzmESGeoPolygon=Ln,ne.CzmESGeoPolygonImpl=Ti,ne.CzmESGeoRectangle=dg,ne.CzmESGeoSmoothPolygon=pg,ne.CzmESGeoVector=sn,ne.CzmESGeoWater=Yg,ne.CzmESGltfModel=mg,ne.CzmESHeatMap=fv,ne.CzmESHeightMeasurement=gg,ne.CzmESHuman=vg,ne.CzmESHumanPoi=av,ne.CzmESImageLabel=wg,ne.CzmESImageryLayer=bg,ne.CzmESKml=Ug,ne.CzmESLabel=jl,ne.CzmESLocalCircle=Og,ne.CzmESLocalLineString=Lg,ne.CzmESLocalLineStringZ=zg,ne.CzmESLocalPolygon=kg,ne.CzmESLocalPolygonZ=Qg,ne.CzmESLocalRectangle=Vg,ne.CzmESLocalSkyBox=xg,ne.CzmESLocalVector=df,ne.CzmESLocationMeasurement=_g,ne.CzmESMVTLayer=Sf,ne.CzmESMsTileset=cv,ne.CzmESNavigator=Ng,ne.CzmESObjectWithLocation=He,ne.CzmESParticleSystemPrimitive=Cg,ne.CzmESPath=Hg,ne.CzmESPipeFence=Jg,ne.CzmESPipeline=ey,ne.CzmESPipeserTileset=ny,ne.CzmESPit=ay,ne.CzmESPoi2D=Sg,ne.CzmESPoi3D=Eg,ne.CzmESPolygonFence=Gg,ne.CzmESPolygonFlattenedPlane=Wm,ne.CzmESPolygonWithHole=ly,ne.CzmESRectangle=Wg,ne.CzmESRoad=jg,ne.CzmESRtsFeatureEditing=uv,ne.CzmESRtsTileset=lv,ne.CzmESScale=qg,ne.CzmESSignalTransmission=yy,ne.CzmESSkylineAnalysis=Av,ne.CzmESStaticMesh=hv,ne.CzmESSubmergingAnalysis=Pg,ne.CzmESSunshineAnalysis=Xy,ne.CzmESSurfaceAreaMeasurement=tv,ne.CzmESTerrainLayer=Bg,ne.CzmESTextLabel=Tg,ne.CzmESUEWidget=Ig,ne.CzmESUnrealActor=Fg,ne.CzmESVideoFusion=Mg,ne.CzmESViewShed=Dg,ne.CzmESViewerStatusBar=nv,ne.CzmESViewerStatusBarScale=iv,ne.CzmESVisibilityAnalysis=rv,ne.CzmESVisualObject=Hn,ne.CzmESVolumeMeasurement=ov,ne.CzmESWidget=Rg,ne.CzmFlattenedPlane=Xr,ne.CzmGlobeMaterial=No,ne.CzmImageModel=$i,ne.CzmImagery=Zr,ne.CzmModelPrimitive=Wt,ne.CzmParticleSystemPrimitive=wi,ne.CzmPicking=P0,ne.CzmPoint=Wn,ne.CzmPointPrimitiveCollection=Oo,ne.CzmPoisContext=H0,ne.CzmPolygon=Es,ne.CzmPolygonClipping=pa,ne.CzmPolygonGroundPrimitive=Ss,ne.CzmPolygonGroundPrimitiveWithHeight=Mo,ne.CzmPolygonPrimitive=Sr,ne.CzmPolygonPrimitiveWithHeight=Lr,ne.CzmPolygonWithHeight=zr,ne.CzmPolyline=Je,ne.CzmPolylineGroundPrimitive=Ts,ne.CzmPolylinePrimitive=Is,ne.CzmPolylines=li,ne.CzmPolylinesGroundPrimitive=Cs,ne.CzmPolylinesPrimitive=Un,ne.CzmRectangle=Ci,ne.CzmSignalTransmission=Yr,ne.CzmTexture=ft,ne.CzmView=xn,ne.CzmViewDistanceRangeControl=po,ne.CzmWater=Uo,ne.CzmWaterPrimitive=Fl,ne.DoublePointsAppendEditing=Oa,ne.DoublePointsAppendEditingWrapper=bv,ne.DoublePointsModifyEditing=ss,ne.DoublePointsModifyEditingWrapper=xv,ne.ESCesiumViewer=at,ne.ESCustomPrimitive=wf,ne.ESGeHistoryImagery=gf,ne.ESGeoBezierPath=_f,ne.ESGeoSmoothPolygon=$l,ne.ESKml=yf,ne.ESLocalLineString=vf,ne.ESLocalLineStringZ=Zl,ne.ESMVTLayer=mf,ne.ESRoad=xf,ne.ESSignalTransmission=bf,ne.GeoCanvasImagePoi=yi,ne.GeoCanvasMenuPoi=Ps,ne.GeoCanvasPoi=Wi,ne.GeoCanvasPointPoi=Er,ne.GeoCustomDivPoi=bt,ne.GeoDivSwitchPoi=Eo,ne.GeoDivTextPoi=vi,ne.GeoPolylinePath=ma,ne.HeightModifyEditing=VS,ne.HeightModifyEditingWrapper=Fv,ne.ImageLabel2D=$x,ne.ImageLabel3D=Xx,ne.ImageriesManager=oE,ne.LabelManager=rE,ne.LineStringAppendEditing=US,ne.LineStringAppendEditingWrapper=Sv,ne.LineStringInsertEditing=LS,ne.LineStringInsertEditingWrapper=Ev,ne.PickingManager=sE,ne.PlaceEditing=Li,ne.PlaceEditingWrapper=yv,ne.PolylinePath=aa,ne.ResourceHandler=_s,ne.RotationEditing=pi,ne.RotationEditingWrapper=vv,ne.ScaleEditing=ur,ne.ScaleEditingWrapper=wv,ne.ScatterAppendEditing=kS,ne.ScatterAppendEditingWrapper=Pv,ne.ScatterModifyEditing=QS,ne.ScatterModifyEditingWrapper=Bv,ne.ScreenManager=dE,ne.SharedTexturePool=V0,ne.SmoothMoving=T0,ne.TerrainManager=iE,ne.TextLabel2D=Jx,ne.TextLabel3D=e_,ne.ToGCJ02WebMercatorTilingScheme=px,ne.ToWGS84WebMercatorTilingScheme=mx,ne.TranslationEditing=lr,ne.TranslationEditingWrapper=Kf,ne.ViewerExtensions=pE,ne.VisibilityAppendEditing=La,ne.VisibilityAppendEditingWrapper=Tv,ne.VisibilityModifyEditing=za,ne.VisibilityModifyEditingWrapper=Iv,ne.Widget2D=Pr,ne.Widget3D=FA,ne.WinPosFromCartesian=Eh,ne.XbsjGroundPolylinePrimitive=Bi,ne._ESEditModeInstance=Zf,ne.angleToHumanStr=rl,ne.areaToHumanStr=tP,ne.bindNorthRotation=Rt,ne.calculateImageTiles=B0,ne.capture=R0,ne.checkAndConvertImage=eP,ne.computeCutPoint=IS,ne.computeCzmModelMatrix=lt,ne.computePickingInfoWithCoordinates=fd,ne.createClippingPlaneCollection=el,ne.createClippingPolygonCollection=xh,ne.createGeoBoudingSphereReactFromPositions=D0,ne.createHelperLine=a2,ne.createInfoPoi=Rd,ne.createInnerClassFromJson=Id,ne.createInnerHtmlWithWhiteTextBlackBackground=_o,ne.createMaterialFromJson=o0,ne.createMaterialRef=ai,ne.createMoveObjectsProcessing=NS,ne.createPolygonHierarchy=Hi,ne.createTexture=bo,ne.createTextureFromImage=kd,ne.createTilingSchema=si,ne.czmEllipsoidWGS84=z0,ne.czmFlyTo=sl,ne.czmModelActiveAnimationsWithVisible=Ih,ne.czmSubscribeAndEvaluate=gi,ne.defaultFlyToRotation=Gn,ne.distanceToHumanStr=Mh,ne.extendComponentProps=nP,ne.flyTo=Fe,ne.flyWithPosition=Rn,ne.flyWithPositions=Me,ne.flyWithPrimitive=bn,ne.fromCartesian=kE,ne.fromCartesian2=qv,ne.fromCartesian3=Ya,ne.fromCartesian4=Kv,ne.fromCartographic=fo,ne.fromColor=VE,ne.fromDistanceDisplayCondition=GE,ne.fromEllipsoid=YE,ne.fromHeadingPitchRoll=HE,ne.fromNearFarScalar=NE,ne.fromQuaternion=jE,ne.fromRectangle=$E,ne.generateCartesianArc=y0,ne.geoNeareastPointOnRhumbLine=mo,ne.geoNeareastPointOnRhumbLine2=l2,ne.geoPolylineToBezierSpline=Ud,ne.getCameraPosition=Mn,ne.getCameraRotation=ys,ne.getCameraTargetPos=Yv,ne.getCenterAndViewDistance=Od,ne.getCzmCode=K2,ne.getDefaultComponentProps=iP,ne.getDefaultWinPosAndDepth=m2,ne.getDetailedTerrainDistance=L0,ne.getDirectionVectorFromRotation=u0,ne.getDistancesAndTimePosRotsFromPositions=xd,ne.getElevationMatrix=D7,ne.getEllipsoidGeodesicCenter=gd,ne.getFlyToCenterAndRotation=Dh,ne.getFoveatedInterpolationCallback=Px,ne.getFuncFromStr=Fd,ne.getGroundTerrainDistance=O0,ne.getGroundTerrainDistances=U0,ne.getIncludedAngleFromPositions=x0,ne.getInverseModelMatrix=w0,ne.getMinMaxPosition=M0,ne.getModelMatrixFromPosition=_d,ne.getObjectProperties=Co,ne.getPointerEventButton=Gi,ne.getPolygonPointsFromHierarchy=Cd,ne.getQuaternion=ud,ne.getQuaternionWithXForwardZUp=$v,ne.getQuaternionWithYForwardZUp=_h,ne.getResource=Dn,ne.getSceneScaleForScreenPixelSize=Ni,ne.getSharedTexturePool=N0,ne.getTilingSchemeStr=LU,ne.getViewerExtensions=Mt,ne.getWinPos=l0,ne.getXbsjWaterMaterial=C0,ne.hackCesium3DTileset=DE,ne.hackCzmModel3DTileContent=RE,ne.hackModel=ME,ne.hackModelSceneGraph=UE,ne.imgUrlToBase64=So,ne.localPositionToPosition=xr,ne.localPositionsToPositions=_r,ne.merge3dTilesServer=V2,ne.pickHeightPosition=Sh,ne.pickPosition=i0,ne.pickVirtualEarth=vs,ne.pickVirtualPlane=r0,ne.positionAndRotationToQuaternion=ZE,ne.positionFromCartesian=De,ne.positionToCartesian=Ye,ne.positionToHumanStr=Md,ne.positionToLocalPosition=b0,ne.positionsToLocalPositions=wn,ne.positionsToUniqueCartesians=Yt,ne.rectangleIsGlobal=Td,ne.rpToap=Fh,ne.setClippingPlaneCollection=bh,ne.setCylinderGeometry=Dd,ne.setModelMaterial=il,ne.setRectangleGeometry=F0,ne.setViewerExtensions=Qv,ne.toCartesian=oi,ne.toCartesian2=Ze,ne.toCartesian3=ri,ne.toCartesian4=ld,ne.toCartographic=QE,ne.toCoefficients=Bd,ne.toColor=Be,ne.toDistanceDisplayCondition=Ja,ne.toEllipsoid=qe,ne.toHeadingPitchRoll=Zv,ne.toNearFarScalar=gr,ne.toQuaternion=WE,ne.toRectangle=gt,ne.toRgbaString=Cr,ne.updateEnvironmentMapManager=Pd,ne.updateMaterialFromJson=md,ne.waterType=Rh,ne.winPosAndDepthEqual=a0,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"}),ne}({},Cesium,EarthSDK3);