earthsdk3-cesium 3.2.0-beta.9 → 3.3.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-cesium.iife.js +51 -51
- package/dist/earthsdk3-cesium.js +707 -667
- package/dist/earthsdk3-cesium.umd.cjs +70 -70
- package/dist/types/CzmObjects/base/InnerClass/XbsjGroundPolylinePrimitive/GroundPolylinePrimitive.d.ts +148 -0
- package/dist/types/CzmObjects/general/CzmES3DTileset/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/XbsjPolylineGeometry.d.ts +3 -0
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/xbsjCreateODLinesPrimitive.d.ts +29 -0
- package/dist/types/CzmObjects/general/CzmESVideoFusion/XbsjCameraVideo/XbsjCameraVideo.d.ts +18 -0
- package/dist/types/CzmObjects/general/CzmESViewShed/XbsjViewshed/XbsjViewshed.d.ts +16 -0
- package/dist/types/ESCesiumViewer/BackGroundImage/BackGroundImage.d.ts +5 -0
- package/dist/types/ESCesiumViewer/LocalSkyBox/SkyAtmosphere.d.ts +14 -0
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatPipelineStage.d.ts +12 -0
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatTexturePipelineStage.d.ts +11 -0
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixGoogleEarth/cesiumFixGoogleEarth.d.ts +1 -0
- package/dist/types/__declares/cesium.d.ts +405 -0
- package/dist/types/utils/czmUtils/todo/generateCartesianArc/czm/generateCartesianArc.d.ts +8 -0
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/index.d.ts +37 -0
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/lib/spline.d.ts +62 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var EarthSDK3_Cesium=function(ae,it,p,Q){"use strict";var CQ=Object.defineProperty;var xQ=(ae,it,p)=>it in ae?CQ(ae,it,{enumerable:!0,configurable:!0,writable:!0,value:p}):ae[it]=p;var L=(ae,it,p)=>xQ(ae,typeof it!="symbol"?it+"":it,p);var la=typeof document<"u"?document.currentScript:null;function aE(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 C=aE(it);window.Cesium=C;function sE(){Object.keys(C).forEach(t=>{C[t].prototype&&Object.defineProperty(C[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:p.createGuid()})})}class hn extends p.Destroyable{constructor(){super()}}L(hn,"defaults",{enabled:!0}),(t=>{t.createDefaultProps=()=>({enabled:!0})})(hn||(hn={})),p.extendClassProps(hn.prototype,hn.createDefaultProps);class Bn extends Q.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r)=>this.flyTo(o,r))),this.d(n.flyInEvent.don((o,r)=>this.flyIn(o,r))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:s}=o;n.flyInParam={position:r,rotation:s,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")})),this.ad(this.createdEvent.don(()=>{this.ad(p.nextAnimateFrame(()=>{n.createdEvent.emit()}))}))}flyToWithPromise(n,e,i,o,r,s,a){const{sceneObject:l,czmViewer:c}=this,h=c.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:s??0,pDelta:a??0},e);h&&h.then(u=>{})}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;if(!o.actived)return!1;if(i.flyToParam&&(i.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),i.flyInParam){const{position:r,rotation:s,flyDuration:a}=i.flyInParam,l=n??a;return this.flyToWithPromise(e,r,void 0,s,l),!0}return!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;if(!o.actived)return!1;if(i.flyInParam){const{position:r,rotation:s,flyDuration:a}=i.flyInParam,l=n??a;return this.flyToWithPromise(e,r,void 0,s,l),!0}return!1}get czmViewer(){return this.viewer}}class lE extends p.Destroyable{constructor(e){super();L(this,"_currentPosition",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_currentRotation",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_currentHeading",this.disposeVar(p.react(void 0)));L(this,"_isRotating",this.disposeVar(p.react(!1)));L(this,"_isGround",this.disposeVar(p.react(!1)));L(this,"_startPosition",[0,0,0]);L(this,"_startRotation",[0,0,0]);L(this,"_processing",this.disposeVar(p.createProcessingFromAsyncFunc(async(e,i,o,r)=>{const{currentPosition:s,currentRotation:a}=this;if(!s||r<=0||!a){this._currentPosition.value=i,this._currentRotation.value=o;return}const l=this._startPosition;l.splice(0,3,...s);const c=this._startRotation;c.splice(0,3,...a);let h=Date.now();const u=Q.geoHeading(l,i);this._currentHeading.value=u;const f=Q.geoDistance(l,i)/r,d=[o[0]-c[0],o[1]-c[1],o[2]-c[2]],g=i[2]-l[2];await e.promise(new Promise(v=>{e.disposer.dispose(p.animateFrame(()=>{let y=Date.now()-h;y=y<0?0:y,y=y>r?r:y;const m=y*f,w=Q.geoDestination(l,m,u);if(this.isGround&&w){const _=this._czmViewer.getTerrainHeight([w[0],w[1]]);this._currentPosition.value=[w[0],w[1],_??0]}else w&&(w[2]+=g*(y/r)),this._currentPosition.value=w;if(this.isRotating){const[_,E,T]=d,P=y/r;this._currentRotation.value=[c[0]+_*P,c[1]+E*P,c[2]+T*P]}y===r&&(this._currentPosition.value=i,this.isRotating&&(this._currentRotation.value=o),this.isRotating=!1,this.isGround=!1,v())}))}))})));this._czmViewer=e}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(e){this._isRotating.value=e}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(e){this._isGround.value=e}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(e,i,o){this._processing.restart(void 0,e,i,o)}cancel(){this._processing.cancel()}}function vt(t,n){return C.Cartesian3.fromDegrees(...t,void 0,n)}const uE=new C.Cartographic;function Ue(t,n){const e=C.Cartographic.fromCartesian(t,void 0,uE);if(e)return n=n||[0,0,0],n[0]=C.Math.toDegrees(e.longitude),n[1]=C.Math.toDegrees(e.latitude),n[2]=e.height,n}function Xe(t,n){return n=n||new C.Cartesian2,n.x=t[0],n.y=t[1],n}function Ov(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function Mn(t,n){return n=n||new C.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function Ls(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function xf(t,n){return n=n||new C.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Lv(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 Zn(t,n){if(t.length===4)return xf(t,n);if(t.length===3)return Mn(t,n);if(t.length===2)return Xe(t,n);throw new Error("toCartesian error: should not be here!")}function cE(t,n){if(t instanceof C.Cartesian2)return Ov(t,n);if(t instanceof C.Cartesian3)return Ls(t,n);if(t instanceof C.Cartesian4)return Lv(t,n);throw new Error("fromCartesian error: should not be here!")}function hE(t,n){return n=n||new C.Cartographic,n.longitude=C.Math.toRadians(t[0]),n.latitude=C.Math.toRadians(t[1]),n.height=t[2],n}function ua(t,n){return n=n||[0,0,0],n[0]=C.Math.toDegrees(t.longitude),n[1]=C.Math.toDegrees(t.latitude),n[2]=t.height,n}function Ie(t,n){return n=n||new C.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function AE(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 ur(t,n){return n=n||new C.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function fE(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 C.HeadingPitchRoll,n.heading=C.Math.toRadians(t[0]-90),n.pitch=C.Math.toRadians(t[1]),n.roll=C.Math.toRadians(t[2]),n}function dE(t,n){return n=n||[0,0,0],n[0]=C.Math.toDegrees(t.heading+C.Math.PI_OVER_TWO),n[1]=C.Math.toDegrees(t.pitch),n[2]=C.Math.toDegrees(t.roll),n}function zs(t,n){return n=n||new C.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function pE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function mE(t,n){return n=n||new C.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function gE(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 yE=new C.HeadingPitchRoll,vE=new C.Cartesian3;function wE(t,n,e){const i=zv(n,yE),o=vt(t,vE);return C.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function mt(t,n){return n=n||new C.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 bE(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 _E=new C.Cartesian3;function Ke(t,n){return n=n||new C.Ellipsoid,C.Ellipsoid.fromCartesian3(C.Cartesian3.fromArray(t,void 0,_E),n)}function CE(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 ai(t){if(t.type==="GeographicTilingScheme")return new C.GeographicTilingScheme({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),rectangle:t.rectangle&&mt(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new C.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new R_({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new U_({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function Qs(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:s,edgeWidth:a}=t;let l=o&&C.Matrix4.fromArray(o);return n&&(l=l||C.Matrix4.clone(C.Matrix4.IDENTITY,new C.Matrix4),C.Matrix4.multiply(n,l,l)),new C.ClippingPlaneCollection({planes:e&&e.map(c=>new C.ClippingPlane(Mn(c.normal),c.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:s&&Ie(s),edgeWidth:a})}function $c(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 C.ClippingPlane(Mn(r.normal),r.distance));let o=i.modelMatrix&&C.Matrix4.fromArray(i.modelMatrix)||C.Matrix4.clone(C.Matrix4.IDENTITY,new C.Matrix4);e&&C.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Ie(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function Yc(t){const{polygons:n,enabled:e,inverse:i}=t;return new C.ClippingPolygonCollection({polygons:n&&n.map(o=>new C.ClippingPolygon({positions:o.positions.map(r=>vt(r))})),enabled:e,inverse:i})}function Jc(t,n){return Sf(t,C.Cartesian3.UNIT_Y,C.Cartesian3.UNIT_Z,C.Cartesian3.UNIT_X,n)}function Qv(t,n){return Sf(t,C.Cartesian3.UNIT_X,C.Cartesian3.UNIT_Z,new C.Cartesian3(0,-1,0),n)}function Sf(t,n,e,i,o){const[r,s,a]=t,l=C.Quaternion.fromAxisAngle(e,C.Math.toRadians(-r)),c=C.Quaternion.fromAxisAngle(i,C.Math.toRadians(s)),h=C.Quaternion.fromAxisAngle(n,C.Math.toRadians(a)),u=C.Quaternion.clone(C.Quaternion.IDENTITY,o);return C.Quaternion.multiply(h,u,u),C.Quaternion.multiply(c,u,u),C.Quaternion.multiply(l,u,u),u}function cr(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 Vv(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function at(t,n){if(!((!t.localScale||cr(t.localScale,3))&&(!t.localRotation||cr(t.localRotation,3))&&(!t.localPosition||cr(t.localPosition,3))&&(!t.localModelMatrix||cr(t.localModelMatrix,16))&&(!t.scale||cr(t.scale,3))&&(!t.rotation||cr(t.rotation,3))&&(!t.position||cr(t.position,3))&&(!t.modelMatrix||cr(t.modelMatrix,16)))||t.localScale&&!Vv(t.localScale)||t.scale&&!Vv(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??C.Matrix4.clone(C.Matrix4.IDENTITY);if(t.localScale){const[o,r,s]=t.localScale??[1,1,1],a=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,r,s),new C.Matrix4);C.Matrix4.multiply(a,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=C.Quaternion.fromAxisAngle(C.Cartesian3.UNIT_Z,C.Math.toRadians(90)),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=Jc(t.localRotation),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=C.Matrix4.fromTranslation(C.Cartesian3.fromArray(t.localPosition));C.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=C.Matrix4.fromArray(t.localModelMatrix);C.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,o,o),new C.Matrix4);C.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,s]=t.scale??[1,1,1],a=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,r,s),new C.Matrix4);C.Matrix4.multiply(a,i,i)}if(t.rotation){const o=Jc(t.rotation),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=C.Cartesian3.fromDegrees(...t.position),r=C.Transforms.eastNorthUpToFixedFrame(o);C.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=C.Matrix4.fromArray(t.modelMatrix);C.Matrix4.multiply(o,i,i)}return i}const xE=new C.Cartesian3,Vs=new C.HeadingPitchRoll,SE=new C.Matrix4,EE=new C.Cartesian3,PE=new C.Cartographic;function TE(t,n=[0,0,0],e=0,i){const[o,r,s]=t,a=C.Cartesian3.fromDegrees(o,r,s,void 0,xE),l=[...n];for(let h=0;h<3;++h)l[h]=C.Math.RADIANS_PER_DEGREE*l[h];if(e!==0){Vs.heading=l[0],Vs.pitch=l[1],Vs.roll=l[2],Vs.heading-=C.Math.PI_OVER_TWO;const h=C.Transforms.headingPitchRollToFixedFrame(a,Vs,void 0,void 0,SE),u=C.Matrix4.multiplyByPointAsVector(h,C.Cartesian3.UNIT_X,EE);C.Cartesian3.multiplyByScalar(u,e,u),C.Cartesian3.subtract(a,u,a)}const c=C.Cartographic.fromCartesian(a,void 0,PE);if(c)return i=i||[0,0,0],i[0]=c.longitude*180/Math.PI,i[1]=c.latitude*180/Math.PI,i[2]=c.height,i}function Hv(t,n,e,i){return TE(t,n,e,i)}const hr=C.Math.toDegrees;function _n(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=hr(e),n[1]=hr(i),n[2]=o,n):[hr(e),hr(i),o]}function ca(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=hr(e),n[1]=hr(i),n[2]=hr(o),n):[e,i,o].map(hr)}class Hs extends p.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new C.Matrix4);L(this,"_originProjMatrix",new C.Matrix4);L(this,"_changed",new p.Event);this._scene=e;const i=this._scene.camera;C.Matrix4.clone(i.viewMatrix,this._originViewMatrix),C.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){C.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(C.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),C.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(C.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class IE extends p.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class kE extends p.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new p.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new IE(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class Ao extends p.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(p.react(1)));L(this,"_viewDistance",this.disposeVar(p.react(0)));L(this,"_debug",this.disposeVar(p.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new kE(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:s,czmViewer:a}=this,[l,c,h]=p.getReactFuncs(i),[u,A,f]=p.getReactFuncs(s),[d,g,v]=r?p.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let _=1,E=Number.NEGATIVE_INFINITY;do{const T=l(),P=u(),F=d?d():0;if(!T||!P)break;const D=a.getCurrentCameraInfo();if(!D)break;E=Q.cartesianDistance(D.position,P)-(F??0);const[B,S,I,b]=T;if(B>S||S>I||I>b){console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!");break}E>=S&&E<=I?_=1:E<=B||E>=b?_=0:E>B&&E<S?S-B<=0?_=0:_=(E-B)/(S-B):E>I&&E<b?(b<=I&&(_=0),_=(b-E)/(b-I)):(_=1,console.error("不应该运行至此!"))}while(!1);this._viewDistance.value=E,this._visibleAlpha.value=_};y();const m=[a.cameraChanged,h,f];v&&m.push(v);const w=this.disposeVar(p.createNextAnimateFrameEvent(...m));this.dispose(w.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 FE=new C.BoundingSphere(C.Cartesian3.ZERO,0);function Di(t,n,e){var i=FE;C.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 Zt(t){const n=t.length;let e;const i=[];for(let o=0;o<n;++o){const[r,s,a]=t[o],l=C.Cartesian3.fromDegrees(r,s,a);if(!l)continue;const{x:c,y:h,z:u}=l;[c,h,u].every(Number.isFinite)&&(!e||!C.Cartesian3.equals(e,l))&&(e=l,i.push(e))}return i}function fo(t,n,e,i){const o=Q.geoRhumbDistance(t,e),r=Q.geoRhumbHeading(t,e),s=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 s>0?Q.geoRhumbDestination(t,o,n,i):Q.geoRhumbDestination(t,o,n+180,i),[s>0?o:-o,i]}function BE(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const s=Q.geoRhumbDestination(t,i*r,n);s&&o.push(s)}return o}function ME(t,n){return Q.geoNearestPointOnLine(t,n).geometry.coordinates}const Nv=new C.Cartesian3,DE=new C.Ray,RE=new C.Plane(C.Cartesian3.UNIT_X,0);function jc(t,n,e,i){const o=C.Cartesian3.normalize(n,Nv),r=C.Cartesian3.cross(t.camera.right,o,Nv);C.Cartesian3.normalize(r,r);const s=C.Plane.fromPointNormal(n,r,RE),a=t.camera.getPickRay(e,DE);if(a)return C.IntersectionTests.rayPlane(a,s,i)}const Ef=new C.Cartesian3,UE=new C.Ray,OE=new C.Cartographic,LE=new C.Ellipsoid;function ha(t,n,e,i){const o=t.camera.getPickRay(n,UE);if(!o)return;const r=C.Cartesian3.fromElements(e,e,e,Ef),s=C.Cartesian3.add(r,C.Ellipsoid.WGS84.radii,Ef),a=C.Ellipsoid.fromCartesian3(s,LE),l=C.IntersectionTests.rayEllipsoid(o,a);if(l){const c=l.start>0?l.start:l.stop;if(c){const h=C.Ray.getPoint(o,c,Ef),u=C.Cartographic.fromCartesian(h,void 0,OE);return i=i||new C.Cartographic,i.longitude=u.longitude,i.latitude=u.latitude,i.height=e,i}else return}else return}function Aa(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function Gv(t){const n=C.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const Wv=new C.Cartographic,qv=new C.Cartesian3,An=[0,0,0],Ar=[0,0,0],Pf=new C.Cartesian2,Tf=new C.Cartesian3;function If(t,n,e,i,o,r){o.constraintMode="none",Aa([0,0,0],o.startDragPos),r=r||{},Zn(p.getDomEventCurrentTargetPos(t),Pf);const s=e.position;if(!vt(s,Tf))return;const a=Di(n,Tf,i);if(a===void 0||!jc(n,Tf,Pf,qv)||!Ue(qv,An))return;const l=Gv(An[2])*Q.geoDistance(s,An);if(!r.z&&l<a&&Math.abs(s[2]-An[2])<e.dimensions[0]&&An[2]>s[2])return o.constraintMode="z",Aa(An,o.startDragPos),!0;if(!ha(n,Pf,s[2],Wv)||!ua(Wv,An))return;const c=Gv(s[2])*Q.geoDistance(s,An),h=e.dimensions[0];if(!(c>1.05*h)){if(!r.zAxis&&c>.95*h&&c<=1.05*h){o.constraintMode="zAxis",Aa(An,o.startDragPos);return}{const[u,A]=fo(s,e.heading+90,An,Ar);if(!r.x&&u>0&&A&&(Ar[2]=s[2],Q.geoDistance(Ar,An)<a)){o.constraintMode="x",Aa(Ar,o.startDragPos);return}}{const[u,A]=fo(s,e.heading,An,Ar);if(!r.y&&u>0&&A&&(Ar[2]=s[2],Q.geoDistance(Ar,An)<a)){o.constraintMode="y",Aa(Ar,o.startDragPos);return}}r.xy||(o.constraintMode="xy",Aa(An,o.startDragPos))}}async function Kv(t,n,e,i){var a;const o=(a=t.viewer)==null?void 0:a.scene;if(!o)throw new Error("!scene");const r=p.getDomEventCurrentTargetPos(n),s=Zn(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=ha(o,s,e);return l?ua(l):void 0}}let kf,Ff;function Zv(t,n,e,i,o){o=o||new C.Cartesian3,kf=kf||new C.Ray,Ff=Ff||new C.Plane(C.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,kf),s=C.Plane.fromPointNormal(n,e,Ff);return o=C.IntersectionTests.rayPlane(r,s,o),o}function Xv(t){const n=C.Material.fromType(t.type);return Bf(n,t),n}function Cn(t){return t&&Q.ESSceneObject.context.getStrFromEnv(t)||C.Material.DefaultImageId}function zE(t){return{x:t[0],y:t[1]}}function Bf(t,n){n.type==="Color"?t.uniforms.color=Ie(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Ie(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.gapColor=Ie(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.outlineColor=Ie(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.color=Ie(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Ie(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Xe(n.lineCount??[8,8]),t.uniforms.lineThickness=Xe(n.lineThickness??[1,1]),t.uniforms.lineOffset=Xe(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Ie(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Ie(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=Ie(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Ie(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Xe(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Ie(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Ie(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Xe(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Ie(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Ie(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=Cn(n.specularMap),t.uniforms.normalMap=Cn(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=Ie(n.color??[1,0,0,.7]),t.uniforms.rimColor=Ie(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Ie(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Ie(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=zE(n.fadeDirection??[!0,!0]),t.uniforms.time=Xe(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Ie(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=Cn(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=Cn(n.image):n.type==="ElevationBand"?(t.uniforms.color=Cn(n.colors),t.uniforms.heights=Cn(n.heights)):console.warn(`未知材质类型,无法更新 ${n.type}`)}function Xn(t,n){const e=p.react(void 0);let i="";const[o,r,s]=p.getReactFuncs(t),a=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=Xv(l)):e.value&&Bf(e.value,l):(i="",e.value=void 0)}catch{}};return a(),e.dispose(s.disposableOn(a)),e}function Ri(t){const n=Zt(t.positions),e=t.holes&&t.holes.map(i=>Ri(i));return{positions:n,holes:e}}function Mf(t,n){const e=Math.PI/180,i=1/e,o=new C.Cartographic(t[0]*e,t[1]*e,t[2]),r=new C.Cartographic(n[0]*e,n[1]*e,n[2]),s=new C.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new C.Cartographic);if(s)return s.height=(o.height+r.height)*.5,[s.longitude*i,s.latitude*i,s.height]}const $v=new C.Cartesian4,QE=new C.Matrix4;function VE(){return{left:0,top:0,right:0,bottom:0,depth:0}}function Yv(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function Jv(t,n,e){if(t.scene.mode!==C.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,s=t.camera.frustum.projectionMatrix,a=C.Matrix4.multiply(s,r,QE),l=C.Matrix4.multiplyByVector(a,C.Cartesian4.fromElements(n.x,n.y,n.z,1,$v),$v);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const c=o*(l.x*.5+.5),h=i*(l.y*.5+.5),u=o-c,A=i-h,f=l.z;if(!(c<0||h<0||u<0||A<0||f<0||f>1))return e?(e.left=c,e.top=A,e.right=u,e.bottom=h,e.depth=f):e={left:c,top:A,right:u,bottom:h,depth:f},e}const po={left:0,top:0,right:0,bottom:0,depth:0};class eh extends p.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new C.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new p.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new Hs(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=Jv(this._viewer,this._cartesian,po);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?Yv(this._winPos,po)||(e=!0,this._winPos.left=po.left,this._winPos.top=po.top,this._winPos.right=po.right,this._winPos.bottom=po.bottom,this._winPos.depth=po.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){C.Cartesian3.equals(this._cartesian,e)||(C.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function jv(t){const n=C.Math.toRadians(t[0]),e=C.Math.toRadians(t[1]),i=C.Math.toRadians(t[2]),o=C.Matrix3.fromHeadingPitchRoll(new C.HeadingPitchRoll(n,e,i)),r=new C.Cartesian3;return C.Matrix3.multiplyByVector(o,C.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const HE=C.Check,NE=C.defaultValue,mo=C.defined,e0=C.Math.EPSILON10;function GE(t,n,e,i){if(HE.defined("equalsEpsilon",n),!mo(t))return;e=NE(e,!1);const o=mo(i),r=t.length;if(r<2)return t;let s,a=t[0],l,c,h=0,u=-1;for(s=1;s<r;++s)l=t[s],n(a,l,e0)?(mo(c)||(c=t.slice(0,s),h=s-1,u=0),o&&i.push(s)):(mo(c)&&(c.push(l),h=s,o&&(u=i.length)),a=l);return e&&n(t[0],t[r-1],e0)&&(o&&(mo(c)?i.splice(u,0,h):i.push(r-1)),mo(c)?c.length-=1:c=t.slice(0,-1)),mo(c)?c:t}const Ne=C.Cartesian3,fa=C.Cartographic,go=C.defaultValue,yo=C.defined,t0=C.DeveloperError,n0=C.Ellipsoid,WE=C.EllipsoidGeodesic,i0=C.EllipsoidRhumbLine,qE=C.IntersectionTests,Df=C.Math,da=C.Matrix4,vo=C.Plane,Mt={};Mt.numberOfPoints=function(t,n,e){const i=Ne.distance(t,n);return Math.ceil(i/e)},Mt.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 KE=new fa;Mt.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,KE).height}return i};const ZE=new da,XE=new Ne,r0=new Ne,$E=new vo(Ne.UNIT_X,0),o0=new Ne,YE=new vo(Ne.UNIT_X,0),JE=new Ne,jE=new Ne,Rf=[];function a0(t,n,e){const i=Rf;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const s=(e-n)/t;for(o=0;o<t;o++){const a=n+o*s;i[o]=a}return i}const th=new fa,nh=new fa,fr=new Ne,Uf=new Ne,e2=new Ne,Of=new WE;let Ns=new i0;function t2(t,n,e,i,o,r,s,a){const l=i.scaleToGeodeticSurface(t,Uf),c=i.scaleToGeodeticSurface(n,e2),h=Mt.numberOfPoints(t,n,e),u=i.cartesianToCartographic(l,th),A=i.cartesianToCartographic(c,nh),f=a0(h,o,r);Of.setEndPoints(u,A);const d=Of.surfaceDistance/h;let g=a;u.height=o;let v=i.cartographicToCartesian(u,fr);Ne.pack(v,s,g),g+=3;for(let y=1;y<h;y++){const m=Of.interpolateUsingSurfaceDistance(y*d,nh);m.height=f[y],v=i.cartographicToCartesian(m,fr),Ne.pack(v,s,g),g+=3}return g}function n2(t,n,e,i,o,r,s,a){const l=i.cartesianToCartographic(t,th),c=i.cartesianToCartographic(n,nh),h=Mt.numberOfPointsRhumbLine(l,c,e);l.height=0,c.height=0;const u=a0(h,o,r);Ns.ellipsoid.equals(i)||(Ns=new i0(void 0,void 0,i)),Ns.setEndPoints(l,c);const A=Ns.surfaceDistance/h;let f=a;l.height=o;let d=i.cartographicToCartesian(l,fr);Ne.pack(d,s,f),f+=3;for(let g=1;g<h;g++){const v=Ns.interpolateUsingSurfaceDistance(g*A,nh);v.height=u[g],d=i.cartographicToCartesian(v,fr),Ne.pack(d,s,f),f+=3}return f}Mt.wrapLongitude=function(t,n){const e=[],i=[];if(yo(t)&&t.length>0){n=go(n,da.IDENTITY);const o=da.inverseTransformation(n,ZE),r=da.multiplyByPoint(o,Ne.ZERO,XE),s=Ne.normalize(da.multiplyByPointAsVector(o,Ne.UNIT_Y,r0),r0),a=vo.fromPointNormal(r,s,$E),l=Ne.normalize(da.multiplyByPointAsVector(o,Ne.UNIT_X,o0),o0),c=vo.fromPointNormal(r,l,YE);let h=1;e.push(Ne.clone(t[0]));let u=e[0];const A=t.length;for(let f=1;f<A;++f){const d=t[f];if(vo.getPointDistance(c,u)<0||vo.getPointDistance(c,d)<0){const g=qE.lineSegmentPlane(u,d,a,JE);if(yo(g)){const v=Ne.multiplyByScalar(s,5e-9,jE);vo.getPointDistance(a,u)<0&&Ne.negate(v,v),e.push(Ne.add(g,v,new Ne)),i.push(h+1),Ne.negate(v,v),e.push(Ne.add(g,v,new Ne)),h=1}}e.push(Ne.clone(t[f])),h++,u=d}i.push(h)}return{positions:e,lengths:i}},Mt.generateArc=function(t){yo(t)||(t={});const n=t.positions;if(!yo(n))throw new t0("options.positions is required.");const e=n.length,i=go(t.ellipsoid,n0.WGS84);let o=go(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const g=i.scaleToGeodeticSurface(n[0],Uf);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(g,fr);Ne.multiplyByScalar(v,o,v),Ne.add(g,v,g)}return[g.x,g.y,g.z]}let s=t.minDistance;if(!yo(s)){const g=go(t.granularity,Df.RADIANS_PER_DEGREE);s=Df.chordLength(g,i.maximumRadius)}let a=0,l;for(l=0;l<e-1;l++)a+=Mt.numberOfPoints(n[l],n[l+1],s);const c=(a+1)*3,h=new Array(c);let u=0;for(l=0;l<e-1;l++){const g=n[l],v=n[l+1],y=r?o[l]:o,m=r?o[l+1]:o;u=t2(g,v,s,i,y,m,h,u)}Rf.length=0;const A=n[e-1],f=i.cartesianToCartographic(A,th);f.height=r?o[e-1]:o;const d=i.cartographicToCartesian(f,fr);return Ne.pack(d,h,c-3),h};const s0=new fa,i2=new fa;Mt.generateRhumbArc=function(t){yo(t)||(t={});const n=t.positions;if(!yo(n))throw new t0("options.positions is required.");const e=n.length,i=go(t.ellipsoid,n0.WGS84);let o=go(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],Uf);if(o=r?o[0]:o,o!==0){const m=i.geodeticSurfaceNormal(y,fr);Ne.multiplyByScalar(m,o,m),Ne.add(y,m,y)}return[y.x,y.y,y.z]}const s=go(t.granularity,Df.RADIANS_PER_DEGREE);let a=0,l,c=i.cartesianToCartographic(n[0],s0),h;for(l=0;l<e-1;l++)h=i.cartesianToCartographic(n[l+1],i2),a+=Mt.numberOfPointsRhumbLine(c,h,s),c=fa.clone(h,s0);const u=(a+1)*3,A=new Array(u);let f=0;for(l=0;l<e-1;l++){const y=n[l],m=n[l+1],w=r?o[l]:o,_=r?o[l+1]:o;f=n2(y,m,s,i,w,_,A,f)}Rf.length=0;const d=n[e-1],g=i.cartesianToCartographic(d,th);g.height=r?o[e-1]:o;const v=i.cartographicToCartesian(g,fr);return Ne.pack(v,A,u-3),A},Mt.generateCartesianArc=function(t){const n=Mt.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},Mt.generateCartesianRhumbArc=function(t){const n=Mt.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 ih=C.ArcType,r2=C.Cartesian3,o2=C.Math;function l0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=GE(t.positions,r2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===ih.GEODESIC||n===ih.RHUMB){let a;n===ih.GEODESIC?(a=o2.chordLength(e,i.maximumRadius),Mt.numberOfPoints):(a=e,Mt.numberOfPointsRhumbLine);const l=Mt.extractHeights(r,i);n===ih.GEODESIC?r=Mt.generateCartesianArc({positions:r,minDistance:a,ellipsoid:i,height:l}):r=Mt.generateCartesianRhumbArc({positions:r,granularity:a,ellipsoid:i,height:l})}return r}}function Lf(t,n="GEODESIC",e){const o=t.map(Q.lbhToXyz).map(u=>C.Cartesian3.fromArray(u));let r;if(e>0&&n!=="NONE"){if(r=l0({arcType:C.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:C.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let s=0;const a=[0],l=r.length;for(let u=1;u<l;++u)s+=C.Cartesian3.distance(r[u-1],r[u]),a.push(s);const c=r.map(u=>Q.xyzToLbh([u.x,u.y,u.z]));return{timePosRots:a.map((u,A)=>[a[A],c[A],void 0]),distances:a}}function u0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function zf(t,n){const e=C.Matrix4.clone(C.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:s="YForwardZUp"}=t;if(i){const[a,l,c]=i;C.Transforms.eastNorthUpToFixedFrame(C.Cartesian3.fromDegrees(a,l,c),void 0,e)}if(o){const a=new C.Quaternion;s==="YForwardZUp"?Jc(o,a):s==="XForwardZUp"&&Qv(o,a);const l=C.Matrix3.fromQuaternion(a);C.Matrix4.multiply(e,C.Matrix4.fromRotationTranslation(l),e)}return r&&C.Matrix4.multiplyByScale(e,Zn(r),e),u0(e,n)}const a2=new C.Matrix4;function c0(t,n){const e=C.Matrix4.fromArray(t,0,a2);return C.Matrix4.inverse(e,e),u0(e,n)}const s2=new C.Matrix4,l2=new C.Cartesian3;function h0(t,n,e){const[i,o,r]=n,s=C.Cartesian3.fromDegrees(i,o,r,void 0,l2),a=C.Matrix4.fromArray(t,0,s2),l=C.Matrix4.multiplyByPoint(a,s,s),{x:c,y:h,z:u}=l;return e=e||[0,0,0],e[0]=c,e[1]=h,e[2]=u,e}const u2=new C.Matrix4,c2=new C.Cartesian3,h2=new C.Cartographic;function dr(t,n,e){const[i,o,r]=n,s=C.Cartesian3.fromElements(i,o,r,c2),a=C.Matrix4.fromArray(t,0,u2),l=C.Matrix4.multiplyByPoint(a,s,s),c=C.Cartographic.fromCartesian(l,void 0,h2);return e=e||[0,0,0],e[0]=C.Math.toDegrees(c.longitude),e[1]=C.Math.toDegrees(c.latitude),e[2]=c.height,e}function fn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,s=zf({position:e,rotation:i,scale:o,initialRotationMode:r}),a=c0(s);return[n.map(c=>h0(a,c)),s,a]}function pr(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,s=zf({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>dr(s,l)),s]}function A0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=it.Cartesian3.fromDegrees(...t[e]),o=it.Cartesian3.fromDegrees(...t[e+1]),r=it.Cartesian3.fromDegrees(...t[e+2]),s=it.Cartesian3.angleBetween(it.Cartesian3.subtract(i,o,new it.Cartesian3),it.Cartesian3.subtract(r,o,new it.Cartesian3));n.push(isNaN(s)?0:it.Math.toDegrees(s))}return n}function Qf(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>Ue(i)))),t.holes&&t.holes.forEach(i=>{e=Qf(i,e)}),e}function xn(t){return typeof t=="string"?Q.ESSceneObject.context.getStrFromEnv(t):new C.Resource({url:Q.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 Vf extends p.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[s,a,l]=p.getReactFuncs(e),[c,h,u]=p.getReactFuncs(i),A=new C.Cartesian3,f=()=>{let d=s();d&&(d=[...d],n.editingHeightOffset&&(d[2]-=n.editingHeightOffset),C.Cartesian3.fromDegrees(...d,void 0,A))};f(),this.dispose(l.disposableOn(f)),this.dispose(r.preUpdate.addEventListener(()=>{if(C.Cartesian3.ZERO.equals(A))return;const d=Di(r,A,o);d!==void 0?h([d,d,d]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${d??"undefined"}`)}))}}function A2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:C.Matrix4.toArray(C.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=C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new C.Cartesian3),i=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new C.Cartesian3),o=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new C.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const A=t.root.boundingVolume.sphere[3];r=C.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=C.Cartesian3.add(r,C.Cartesian3.fromArray([A,0,0]),new C.Cartesian3),i=C.Cartesian3.add(r,C.Cartesian3.fromArray([0,A,0]),new C.Cartesian3),o=C.Cartesian3.add(r,C.Cartesian3.fromArray([0,0,A]),new C.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let s,a,l,c,h,u;return C.Matrix4.IDENTITY.equals(C.Matrix4.fromArray(n))?(s=Ue(e),c=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,e,new C.Cartesian3),new C.Cartesian3)),a=Ue(i),h=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,i,new C.Cartesian3),new C.Cartesian3)),l=Ue(o),u=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,o,new C.Cartesian3),new C.Cartesian3))):(s=dr(n,[e.x,e.y,e.z]),c=dr(n,[-e.x,-e.y,-e.z]),a=dr(n,[i.x,i.y,i.z]),h=dr(n,[-i.x,-i.y,-i.z]),l=dr(n,[o.x,o.y,o.z]),u=dr(n,[-o.x,-o.y,-o.z])),!s||!c||!a||!h||!l||!u?"无法生成包围盒,请检查包围盒是否正确":[C.Math.toRadians(Math.min(s[0],c[0],a[0],h[0],l[0],u[0])),C.Math.toRadians(Math.min(s[1],c[1],a[1],h[1],l[1],u[1])),C.Math.toRadians(Math.max(s[0],c[0],a[0],h[0],l[0],u[0])),C.Math.toRadians(Math.max(s[1],c[1],a[1],h[1],l[1],u[1])),Math.min(s[2],c[2],a[2],h[2],l[2],u[2]),Math.max(s[2],c[2],a[2],h[2],l[2],u[2])]}const f0=p.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 p.step(t,async l=>new Promise(async(c,h)=>{for(let u=0;u<n.length;u++){const A=n[u];await fetch(A).then(f=>f.json()).then(f=>{f&&!Reflect.has(f,"success")?i[A]=f:o.push({index:u,url:A,message:f.message}),u==n.length-1&&c()}).catch(f=>{o.push({index:u,url:A,message:f}),u==n.length-1&&c()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],s=[],a=[];for(const l in i){const c=i[l];s.push(c.geometricError??c.root.geometricError??0);const h=A2(c);r.push(h),a.push({content:{uri:l},boundingVolume:{region:h},geometricError:c.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...s),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(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=a),e});function f2(t){return new Promise((n,e)=>{f0.restart(void 0,t),f0.completeEvent.don(i=>{n(i)})})}class Hf extends p.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(p.react(0)));const[i,o,r]=p.getReactFuncs(e);{const s=()=>{const a=i();if(a){const{center:l,minPos:c,maxPos:h}=Q.getMinMaxCorner(a);this._center.value=l,this._radius.value=Q.geoDistance(c,h)/2}else this._center.value=void 0};s(),this.dispose(r.disposableOn(s))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function d0(t){return new C.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new C.Color(.2,.3,.6,1),blendColor:new C.Color(0,1,.699,1),specularMap:C.Material.DefaultImageId,normalMap:C.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
1
|
+
var EarthSDK3_Cesium=function(ae,it,p,Q){"use strict";var xQ=Object.defineProperty;var SQ=(ae,it,p)=>it in ae?xQ(ae,it,{enumerable:!0,configurable:!0,writable:!0,value:p}):ae[it]=p;var L=(ae,it,p)=>SQ(ae,typeof it!="symbol"?it+"":it,p);var la=typeof document<"u"?document.currentScript:null;function aE(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 C=aE(it);window.Cesium=C;function sE(){Object.keys(C).forEach(t=>{C[t].prototype&&Object.defineProperty(C[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:p.createGuid()})})}class hn extends p.Destroyable{constructor(){super()}}L(hn,"defaults",{enabled:!0}),(t=>{t.createDefaultProps=()=>({enabled:!0})})(hn||(hn={})),p.extendClassProps(hn.prototype,hn.createDefaultProps);class Bn extends Q.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r)=>this.flyTo(o,r))),this.d(n.flyInEvent.don((o,r)=>this.flyIn(o,r))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:s}=o;n.flyInParam={position:r,rotation:s,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")})),this.ad(this.createdEvent.don(()=>{this.ad(p.nextAnimateFrame(()=>{n.createdEvent.emit()}))}))}flyToWithPromise(n,e,i,o,r,s,a){const{sceneObject:l,czmViewer:c}=this,h=c.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:s??0,pDelta:a??0},e);h&&h.then(u=>{})}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;if(!o.actived)return!1;if(i.flyToParam&&(i.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),i.flyInParam){const{position:r,rotation:s,flyDuration:a}=i.flyInParam,l=n??a;return this.flyToWithPromise(e,r,void 0,s,l),!0}return!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;if(!o.actived)return!1;if(i.flyInParam){const{position:r,rotation:s,flyDuration:a}=i.flyInParam,l=n??a;return this.flyToWithPromise(e,r,void 0,s,l),!0}return!1}get czmViewer(){return this.viewer}}class lE extends p.Destroyable{constructor(e){super();L(this,"_currentPosition",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_currentRotation",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_currentHeading",this.disposeVar(p.react(void 0)));L(this,"_isRotating",this.disposeVar(p.react(!1)));L(this,"_isGround",this.disposeVar(p.react(!1)));L(this,"_startPosition",[0,0,0]);L(this,"_startRotation",[0,0,0]);L(this,"_processing",this.disposeVar(p.createProcessingFromAsyncFunc(async(e,i,o,r)=>{const{currentPosition:s,currentRotation:a}=this;if(!s||r<=0||!a){this._currentPosition.value=i,this._currentRotation.value=o;return}const l=this._startPosition;l.splice(0,3,...s);const c=this._startRotation;c.splice(0,3,...a);let h=Date.now();const u=Q.geoHeading(l,i);this._currentHeading.value=u;const f=Q.geoDistance(l,i)/r,d=[o[0]-c[0],o[1]-c[1],o[2]-c[2]],g=i[2]-l[2];await e.promise(new Promise(v=>{e.disposer.dispose(p.animateFrame(()=>{let y=Date.now()-h;y=y<0?0:y,y=y>r?r:y;const m=y*f,w=Q.geoDestination(l,m,u);if(this.isGround&&w){const _=this._czmViewer.getTerrainHeight([w[0],w[1]]);this._currentPosition.value=[w[0],w[1],_??0]}else w&&(w[2]+=g*(y/r)),this._currentPosition.value=w;if(this.isRotating){const[_,E,T]=d,P=y/r;this._currentRotation.value=[c[0]+_*P,c[1]+E*P,c[2]+T*P]}y===r&&(this._currentPosition.value=i,this.isRotating&&(this._currentRotation.value=o),this.isRotating=!1,this.isGround=!1,v())}))}))})));this._czmViewer=e}get currentPosition(){return this._currentPosition.value}get currentPositionChanged(){return this._currentPosition.changed}get currentRotation(){return this._currentRotation.value}get currentRotationChanged(){return this._currentRotation.changed}get currentHeading(){return this._currentHeading.value}get currentHeadingChanged(){return this._currentHeading.changed}get isRotating(){return this._isRotating.value}set isRotating(e){this._isRotating.value=e}get isRotatingChanged(){return this._isRotating.changed}get isGround(){return this._isGround.value}set isGround(e){this._isGround.value=e}get isGroundChanged(){return this._isGround.changed}get processing(){return this._processing}restart(e,i,o){this._processing.restart(void 0,e,i,o)}cancel(){this._processing.cancel()}}function vt(t,n){return C.Cartesian3.fromDegrees(...t,void 0,n)}const uE=new C.Cartographic;function Ue(t,n){const e=C.Cartographic.fromCartesian(t,void 0,uE);if(e)return n=n||[0,0,0],n[0]=C.Math.toDegrees(e.longitude),n[1]=C.Math.toDegrees(e.latitude),n[2]=e.height,n}function Xe(t,n){return n=n||new C.Cartesian2,n.x=t[0],n.y=t[1],n}function Ov(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function Mn(t,n){return n=n||new C.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function Ls(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function xf(t,n){return n=n||new C.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Lv(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 Zn(t,n){if(t.length===4)return xf(t,n);if(t.length===3)return Mn(t,n);if(t.length===2)return Xe(t,n);throw new Error("toCartesian error: should not be here!")}function cE(t,n){if(t instanceof C.Cartesian2)return Ov(t,n);if(t instanceof C.Cartesian3)return Ls(t,n);if(t instanceof C.Cartesian4)return Lv(t,n);throw new Error("fromCartesian error: should not be here!")}function hE(t,n){return n=n||new C.Cartographic,n.longitude=C.Math.toRadians(t[0]),n.latitude=C.Math.toRadians(t[1]),n.height=t[2],n}function ua(t,n){return n=n||[0,0,0],n[0]=C.Math.toDegrees(t.longitude),n[1]=C.Math.toDegrees(t.latitude),n[2]=t.height,n}function Ie(t,n){return n=n||new C.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function AE(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 ur(t,n){return n=n||new C.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function fE(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 C.HeadingPitchRoll,n.heading=C.Math.toRadians(t[0]-90),n.pitch=C.Math.toRadians(t[1]),n.roll=C.Math.toRadians(t[2]),n}function dE(t,n){return n=n||[0,0,0],n[0]=C.Math.toDegrees(t.heading+C.Math.PI_OVER_TWO),n[1]=C.Math.toDegrees(t.pitch),n[2]=C.Math.toDegrees(t.roll),n}function zs(t,n){return n=n||new C.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function pE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function mE(t,n){return n=n||new C.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function gE(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 yE=new C.HeadingPitchRoll,vE=new C.Cartesian3;function wE(t,n,e){const i=zv(n,yE),o=vt(t,vE);return C.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function mt(t,n){return n=n||new C.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 bE(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 _E=new C.Cartesian3;function Ke(t,n){return n=n||new C.Ellipsoid,C.Ellipsoid.fromCartesian3(C.Cartesian3.fromArray(t,void 0,_E),n)}function CE(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 ai(t){if(t.type==="GeographicTilingScheme")return new C.GeographicTilingScheme({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),rectangle:t.rectangle&&mt(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new C.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new R_({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new U_({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Xe(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Xe(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function Qs(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:s,edgeWidth:a}=t;let l=o&&C.Matrix4.fromArray(o);return n&&(l=l||C.Matrix4.clone(C.Matrix4.IDENTITY,new C.Matrix4),C.Matrix4.multiply(n,l,l)),new C.ClippingPlaneCollection({planes:e&&e.map(c=>new C.ClippingPlane(Mn(c.normal),c.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:s&&Ie(s),edgeWidth:a})}function $c(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 C.ClippingPlane(Mn(r.normal),r.distance));let o=i.modelMatrix&&C.Matrix4.fromArray(i.modelMatrix)||C.Matrix4.clone(C.Matrix4.IDENTITY,new C.Matrix4);e&&C.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Ie(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function Yc(t){const{polygons:n,enabled:e,inverse:i}=t;return new C.ClippingPolygonCollection({polygons:n&&n.map(o=>new C.ClippingPolygon({positions:o.positions.map(r=>vt(r))})),enabled:e,inverse:i})}function Jc(t,n){return Sf(t,C.Cartesian3.UNIT_Y,C.Cartesian3.UNIT_Z,C.Cartesian3.UNIT_X,n)}function Qv(t,n){return Sf(t,C.Cartesian3.UNIT_X,C.Cartesian3.UNIT_Z,new C.Cartesian3(0,-1,0),n)}function Sf(t,n,e,i,o){const[r,s,a]=t,l=C.Quaternion.fromAxisAngle(e,C.Math.toRadians(-r)),c=C.Quaternion.fromAxisAngle(i,C.Math.toRadians(s)),h=C.Quaternion.fromAxisAngle(n,C.Math.toRadians(a)),u=C.Quaternion.clone(C.Quaternion.IDENTITY,o);return C.Quaternion.multiply(h,u,u),C.Quaternion.multiply(c,u,u),C.Quaternion.multiply(l,u,u),u}function cr(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 Vv(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function at(t,n){if(!((!t.localScale||cr(t.localScale,3))&&(!t.localRotation||cr(t.localRotation,3))&&(!t.localPosition||cr(t.localPosition,3))&&(!t.localModelMatrix||cr(t.localModelMatrix,16))&&(!t.scale||cr(t.scale,3))&&(!t.rotation||cr(t.rotation,3))&&(!t.position||cr(t.position,3))&&(!t.modelMatrix||cr(t.modelMatrix,16)))||t.localScale&&!Vv(t.localScale)||t.scale&&!Vv(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??C.Matrix4.clone(C.Matrix4.IDENTITY);if(t.localScale){const[o,r,s]=t.localScale??[1,1,1],a=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,r,s),new C.Matrix4);C.Matrix4.multiply(a,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=C.Quaternion.fromAxisAngle(C.Cartesian3.UNIT_Z,C.Math.toRadians(90)),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=Jc(t.localRotation),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=C.Matrix4.fromTranslation(C.Cartesian3.fromArray(t.localPosition));C.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=C.Matrix4.fromArray(t.localModelMatrix);C.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,o,o),new C.Matrix4);C.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,s]=t.scale??[1,1,1],a=C.Matrix4.fromScale(C.Cartesian3.fromElements(o,r,s),new C.Matrix4);C.Matrix4.multiply(a,i,i)}if(t.rotation){const o=Jc(t.rotation),r=C.Matrix3.fromQuaternion(o);C.Matrix4.multiply(C.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=C.Cartesian3.fromDegrees(...t.position),r=C.Transforms.eastNorthUpToFixedFrame(o);C.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=C.Matrix4.fromArray(t.modelMatrix);C.Matrix4.multiply(o,i,i)}return i}const xE=new C.Cartesian3,Vs=new C.HeadingPitchRoll,SE=new C.Matrix4,EE=new C.Cartesian3,PE=new C.Cartographic;function TE(t,n=[0,0,0],e=0,i){const[o,r,s]=t,a=C.Cartesian3.fromDegrees(o,r,s,void 0,xE),l=[...n];for(let h=0;h<3;++h)l[h]=C.Math.RADIANS_PER_DEGREE*l[h];if(e!==0){Vs.heading=l[0],Vs.pitch=l[1],Vs.roll=l[2],Vs.heading-=C.Math.PI_OVER_TWO;const h=C.Transforms.headingPitchRollToFixedFrame(a,Vs,void 0,void 0,SE),u=C.Matrix4.multiplyByPointAsVector(h,C.Cartesian3.UNIT_X,EE);C.Cartesian3.multiplyByScalar(u,e,u),C.Cartesian3.subtract(a,u,a)}const c=C.Cartographic.fromCartesian(a,void 0,PE);if(c)return i=i||[0,0,0],i[0]=c.longitude*180/Math.PI,i[1]=c.latitude*180/Math.PI,i[2]=c.height,i}function Hv(t,n,e,i){return TE(t,n,e,i)}const hr=C.Math.toDegrees;function _n(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=hr(e),n[1]=hr(i),n[2]=o,n):[hr(e),hr(i),o]}function ca(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=hr(e),n[1]=hr(i),n[2]=hr(o),n):[e,i,o].map(hr)}class Hs extends p.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new C.Matrix4);L(this,"_originProjMatrix",new C.Matrix4);L(this,"_changed",new p.Event);this._scene=e;const i=this._scene.camera;C.Matrix4.clone(i.viewMatrix,this._originViewMatrix),C.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){C.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(C.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),C.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(C.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class IE extends p.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class kE extends p.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new p.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new IE(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class Ao extends p.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(p.react(1)));L(this,"_viewDistance",this.disposeVar(p.react(0)));L(this,"_debug",this.disposeVar(p.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new kE(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:s,czmViewer:a}=this,[l,c,h]=p.getReactFuncs(i),[u,A,f]=p.getReactFuncs(s),[d,g,v]=r?p.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let _=1,E=Number.NEGATIVE_INFINITY;do{const T=l(),P=u(),F=d?d():0;if(!T||!P)break;const D=a.getCurrentCameraInfo();if(!D)break;E=Q.cartesianDistance(D.position,P)-(F??0);const[B,S,I,b]=T;if(B>S||S>I||I>b){console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!");break}E>=S&&E<=I?_=1:E<=B||E>=b?_=0:E>B&&E<S?S-B<=0?_=0:_=(E-B)/(S-B):E>I&&E<b?(b<=I&&(_=0),_=(b-E)/(b-I)):(_=1,console.error("不应该运行至此!"))}while(!1);this._viewDistance.value=E,this._visibleAlpha.value=_};y();const m=[a.cameraChanged,h,f];v&&m.push(v);const w=this.disposeVar(p.createNextAnimateFrameEvent(...m));this.dispose(w.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 FE=new C.BoundingSphere(C.Cartesian3.ZERO,0);function Di(t,n,e){var i=FE;C.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 Zt(t){const n=t.length;let e;const i=[];for(let o=0;o<n;++o){const[r,s,a]=t[o],l=C.Cartesian3.fromDegrees(r,s,a);if(!l)continue;const{x:c,y:h,z:u}=l;[c,h,u].every(Number.isFinite)&&(!e||!C.Cartesian3.equals(e,l))&&(e=l,i.push(e))}return i}function fo(t,n,e,i){const o=Q.geoRhumbDistance(t,e),r=Q.geoRhumbHeading(t,e),s=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 s>0?Q.geoRhumbDestination(t,o,n,i):Q.geoRhumbDestination(t,o,n+180,i),[s>0?o:-o,i]}function BE(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const s=Q.geoRhumbDestination(t,i*r,n);s&&o.push(s)}return o}function ME(t,n){return Q.geoNearestPointOnLine(t,n).geometry.coordinates}const Nv=new C.Cartesian3,DE=new C.Ray,RE=new C.Plane(C.Cartesian3.UNIT_X,0);function jc(t,n,e,i){const o=C.Cartesian3.normalize(n,Nv),r=C.Cartesian3.cross(t.camera.right,o,Nv);C.Cartesian3.normalize(r,r);const s=C.Plane.fromPointNormal(n,r,RE),a=t.camera.getPickRay(e,DE);if(a)return C.IntersectionTests.rayPlane(a,s,i)}const Ef=new C.Cartesian3,UE=new C.Ray,OE=new C.Cartographic,LE=new C.Ellipsoid;function ha(t,n,e,i){const o=t.camera.getPickRay(n,UE);if(!o)return;const r=C.Cartesian3.fromElements(e,e,e,Ef),s=C.Cartesian3.add(r,C.Ellipsoid.WGS84.radii,Ef),a=C.Ellipsoid.fromCartesian3(s,LE),l=C.IntersectionTests.rayEllipsoid(o,a);if(l){const c=l.start>0?l.start:l.stop;if(c){const h=C.Ray.getPoint(o,c,Ef),u=C.Cartographic.fromCartesian(h,void 0,OE);return i=i||new C.Cartographic,i.longitude=u.longitude,i.latitude=u.latitude,i.height=e,i}else return}else return}function Aa(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function Gv(t){const n=C.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const Wv=new C.Cartographic,qv=new C.Cartesian3,An=[0,0,0],Ar=[0,0,0],Pf=new C.Cartesian2,Tf=new C.Cartesian3;function If(t,n,e,i,o,r){o.constraintMode="none",Aa([0,0,0],o.startDragPos),r=r||{},Zn(p.getDomEventCurrentTargetPos(t),Pf);const s=e.position;if(!vt(s,Tf))return;const a=Di(n,Tf,i);if(a===void 0||!jc(n,Tf,Pf,qv)||!Ue(qv,An))return;const l=Gv(An[2])*Q.geoDistance(s,An);if(!r.z&&l<a&&Math.abs(s[2]-An[2])<e.dimensions[0]&&An[2]>s[2])return o.constraintMode="z",Aa(An,o.startDragPos),!0;if(!ha(n,Pf,s[2],Wv)||!ua(Wv,An))return;const c=Gv(s[2])*Q.geoDistance(s,An),h=e.dimensions[0];if(!(c>1.05*h)){if(!r.zAxis&&c>.95*h&&c<=1.05*h){o.constraintMode="zAxis",Aa(An,o.startDragPos);return}{const[u,A]=fo(s,e.heading+90,An,Ar);if(!r.x&&u>0&&A&&(Ar[2]=s[2],Q.geoDistance(Ar,An)<a)){o.constraintMode="x",Aa(Ar,o.startDragPos);return}}{const[u,A]=fo(s,e.heading,An,Ar);if(!r.y&&u>0&&A&&(Ar[2]=s[2],Q.geoDistance(Ar,An)<a)){o.constraintMode="y",Aa(Ar,o.startDragPos);return}}r.xy||(o.constraintMode="xy",Aa(An,o.startDragPos))}}async function Kv(t,n,e,i){var a;const o=(a=t.viewer)==null?void 0:a.scene;if(!o)throw new Error("!scene");const r=p.getDomEventCurrentTargetPos(n),s=Zn(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=ha(o,s,e);return l?ua(l):void 0}}let kf,Ff;function Zv(t,n,e,i,o){o=o||new C.Cartesian3,kf=kf||new C.Ray,Ff=Ff||new C.Plane(C.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,kf),s=C.Plane.fromPointNormal(n,e,Ff);return o=C.IntersectionTests.rayPlane(r,s,o),o}function Xv(t){const n=C.Material.fromType(t.type);return Bf(n,t),n}function Cn(t){return t&&Q.ESSceneObject.context.getStrFromEnv(t)||C.Material.DefaultImageId}function zE(t){return{x:t[0],y:t[1]}}function Bf(t,n){n.type==="Color"?t.uniforms.color=Ie(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Ie(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.gapColor=Ie(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Ie(n.color??[1,1,1,1]),t.uniforms.outlineColor=Ie(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.color=Ie(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=Cn(n.image),t.uniforms.repeat=Xe(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Ie(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Xe(n.lineCount??[8,8]),t.uniforms.lineThickness=Xe(n.lineThickness??[1,1]),t.uniforms.lineOffset=Xe(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Ie(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Ie(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=Ie(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Ie(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Xe(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Ie(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Ie(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Xe(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Ie(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Ie(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=Cn(n.specularMap),t.uniforms.normalMap=Cn(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=Ie(n.color??[1,0,0,.7]),t.uniforms.rimColor=Ie(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Ie(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Ie(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=zE(n.fadeDirection??[!0,!0]),t.uniforms.time=Xe(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Ie(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=Cn(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=Cn(n.image):n.type==="ElevationBand"?(t.uniforms.color=Cn(n.colors),t.uniforms.heights=Cn(n.heights)):console.warn(`未知材质类型,无法更新 ${n.type}`)}function Xn(t,n){const e=p.react(void 0);let i="";const[o,r,s]=p.getReactFuncs(t),a=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=Xv(l)):e.value&&Bf(e.value,l):(i="",e.value=void 0)}catch{}};return a(),e.dispose(s.disposableOn(a)),e}function Ri(t){const n=Zt(t.positions),e=t.holes&&t.holes.map(i=>Ri(i));return{positions:n,holes:e}}function Mf(t,n){const e=Math.PI/180,i=1/e,o=new C.Cartographic(t[0]*e,t[1]*e,t[2]),r=new C.Cartographic(n[0]*e,n[1]*e,n[2]),s=new C.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new C.Cartographic);if(s)return s.height=(o.height+r.height)*.5,[s.longitude*i,s.latitude*i,s.height]}const $v=new C.Cartesian4,QE=new C.Matrix4;function VE(){return{left:0,top:0,right:0,bottom:0,depth:0}}function Yv(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function Jv(t,n,e){if(t.scene.mode!==C.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,s=t.camera.frustum.projectionMatrix,a=C.Matrix4.multiply(s,r,QE),l=C.Matrix4.multiplyByVector(a,C.Cartesian4.fromElements(n.x,n.y,n.z,1,$v),$v);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const c=o*(l.x*.5+.5),h=i*(l.y*.5+.5),u=o-c,A=i-h,f=l.z;if(!(c<0||h<0||u<0||A<0||f<0||f>1))return e?(e.left=c,e.top=A,e.right=u,e.bottom=h,e.depth=f):e={left:c,top:A,right:u,bottom:h,depth:f},e}const po={left:0,top:0,right:0,bottom:0,depth:0};class eh extends p.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new C.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new p.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new Hs(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=Jv(this._viewer,this._cartesian,po);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?Yv(this._winPos,po)||(e=!0,this._winPos.left=po.left,this._winPos.top=po.top,this._winPos.right=po.right,this._winPos.bottom=po.bottom,this._winPos.depth=po.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){C.Cartesian3.equals(this._cartesian,e)||(C.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function jv(t){const n=C.Math.toRadians(t[0]),e=C.Math.toRadians(t[1]),i=C.Math.toRadians(t[2]),o=C.Matrix3.fromHeadingPitchRoll(new C.HeadingPitchRoll(n,e,i)),r=new C.Cartesian3;return C.Matrix3.multiplyByVector(o,C.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const HE=C.Check,NE=C.defaultValue,mo=C.defined,e0=C.Math.EPSILON10;function GE(t,n,e,i){if(HE.defined("equalsEpsilon",n),!mo(t))return;e=NE(e,!1);const o=mo(i),r=t.length;if(r<2)return t;let s,a=t[0],l,c,h=0,u=-1;for(s=1;s<r;++s)l=t[s],n(a,l,e0)?(mo(c)||(c=t.slice(0,s),h=s-1,u=0),o&&i.push(s)):(mo(c)&&(c.push(l),h=s,o&&(u=i.length)),a=l);return e&&n(t[0],t[r-1],e0)&&(o&&(mo(c)?i.splice(u,0,h):i.push(r-1)),mo(c)?c.length-=1:c=t.slice(0,-1)),mo(c)?c:t}const Ne=C.Cartesian3,fa=C.Cartographic,go=C.defaultValue,yo=C.defined,t0=C.DeveloperError,n0=C.Ellipsoid,WE=C.EllipsoidGeodesic,i0=C.EllipsoidRhumbLine,qE=C.IntersectionTests,Df=C.Math,da=C.Matrix4,vo=C.Plane,Mt={};Mt.numberOfPoints=function(t,n,e){const i=Ne.distance(t,n);return Math.ceil(i/e)},Mt.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 KE=new fa;Mt.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,KE).height}return i};const ZE=new da,XE=new Ne,r0=new Ne,$E=new vo(Ne.UNIT_X,0),o0=new Ne,YE=new vo(Ne.UNIT_X,0),JE=new Ne,jE=new Ne,Rf=[];function a0(t,n,e){const i=Rf;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const s=(e-n)/t;for(o=0;o<t;o++){const a=n+o*s;i[o]=a}return i}const th=new fa,nh=new fa,fr=new Ne,Uf=new Ne,e2=new Ne,Of=new WE;let Ns=new i0;function t2(t,n,e,i,o,r,s,a){const l=i.scaleToGeodeticSurface(t,Uf),c=i.scaleToGeodeticSurface(n,e2),h=Mt.numberOfPoints(t,n,e),u=i.cartesianToCartographic(l,th),A=i.cartesianToCartographic(c,nh),f=a0(h,o,r);Of.setEndPoints(u,A);const d=Of.surfaceDistance/h;let g=a;u.height=o;let v=i.cartographicToCartesian(u,fr);Ne.pack(v,s,g),g+=3;for(let y=1;y<h;y++){const m=Of.interpolateUsingSurfaceDistance(y*d,nh);m.height=f[y],v=i.cartographicToCartesian(m,fr),Ne.pack(v,s,g),g+=3}return g}function n2(t,n,e,i,o,r,s,a){const l=i.cartesianToCartographic(t,th),c=i.cartesianToCartographic(n,nh),h=Mt.numberOfPointsRhumbLine(l,c,e);l.height=0,c.height=0;const u=a0(h,o,r);Ns.ellipsoid.equals(i)||(Ns=new i0(void 0,void 0,i)),Ns.setEndPoints(l,c);const A=Ns.surfaceDistance/h;let f=a;l.height=o;let d=i.cartographicToCartesian(l,fr);Ne.pack(d,s,f),f+=3;for(let g=1;g<h;g++){const v=Ns.interpolateUsingSurfaceDistance(g*A,nh);v.height=u[g],d=i.cartographicToCartesian(v,fr),Ne.pack(d,s,f),f+=3}return f}Mt.wrapLongitude=function(t,n){const e=[],i=[];if(yo(t)&&t.length>0){n=go(n,da.IDENTITY);const o=da.inverseTransformation(n,ZE),r=da.multiplyByPoint(o,Ne.ZERO,XE),s=Ne.normalize(da.multiplyByPointAsVector(o,Ne.UNIT_Y,r0),r0),a=vo.fromPointNormal(r,s,$E),l=Ne.normalize(da.multiplyByPointAsVector(o,Ne.UNIT_X,o0),o0),c=vo.fromPointNormal(r,l,YE);let h=1;e.push(Ne.clone(t[0]));let u=e[0];const A=t.length;for(let f=1;f<A;++f){const d=t[f];if(vo.getPointDistance(c,u)<0||vo.getPointDistance(c,d)<0){const g=qE.lineSegmentPlane(u,d,a,JE);if(yo(g)){const v=Ne.multiplyByScalar(s,5e-9,jE);vo.getPointDistance(a,u)<0&&Ne.negate(v,v),e.push(Ne.add(g,v,new Ne)),i.push(h+1),Ne.negate(v,v),e.push(Ne.add(g,v,new Ne)),h=1}}e.push(Ne.clone(t[f])),h++,u=d}i.push(h)}return{positions:e,lengths:i}},Mt.generateArc=function(t){yo(t)||(t={});const n=t.positions;if(!yo(n))throw new t0("options.positions is required.");const e=n.length,i=go(t.ellipsoid,n0.WGS84);let o=go(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const g=i.scaleToGeodeticSurface(n[0],Uf);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(g,fr);Ne.multiplyByScalar(v,o,v),Ne.add(g,v,g)}return[g.x,g.y,g.z]}let s=t.minDistance;if(!yo(s)){const g=go(t.granularity,Df.RADIANS_PER_DEGREE);s=Df.chordLength(g,i.maximumRadius)}let a=0,l;for(l=0;l<e-1;l++)a+=Mt.numberOfPoints(n[l],n[l+1],s);const c=(a+1)*3,h=new Array(c);let u=0;for(l=0;l<e-1;l++){const g=n[l],v=n[l+1],y=r?o[l]:o,m=r?o[l+1]:o;u=t2(g,v,s,i,y,m,h,u)}Rf.length=0;const A=n[e-1],f=i.cartesianToCartographic(A,th);f.height=r?o[e-1]:o;const d=i.cartographicToCartesian(f,fr);return Ne.pack(d,h,c-3),h};const s0=new fa,i2=new fa;Mt.generateRhumbArc=function(t){yo(t)||(t={});const n=t.positions;if(!yo(n))throw new t0("options.positions is required.");const e=n.length,i=go(t.ellipsoid,n0.WGS84);let o=go(t.height,0);const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],Uf);if(o=r?o[0]:o,o!==0){const m=i.geodeticSurfaceNormal(y,fr);Ne.multiplyByScalar(m,o,m),Ne.add(y,m,y)}return[y.x,y.y,y.z]}const s=go(t.granularity,Df.RADIANS_PER_DEGREE);let a=0,l,c=i.cartesianToCartographic(n[0],s0),h;for(l=0;l<e-1;l++)h=i.cartesianToCartographic(n[l+1],i2),a+=Mt.numberOfPointsRhumbLine(c,h,s),c=fa.clone(h,s0);const u=(a+1)*3,A=new Array(u);let f=0;for(l=0;l<e-1;l++){const y=n[l],m=n[l+1],w=r?o[l]:o,_=r?o[l+1]:o;f=n2(y,m,s,i,w,_,A,f)}Rf.length=0;const d=n[e-1],g=i.cartesianToCartographic(d,th);g.height=r?o[e-1]:o;const v=i.cartographicToCartesian(g,fr);return Ne.pack(v,A,u-3),A},Mt.generateCartesianArc=function(t){const n=Mt.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},Mt.generateCartesianRhumbArc=function(t){const n=Mt.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 ih=C.ArcType,r2=C.Cartesian3,o2=C.Math;function l0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=GE(t.positions,r2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===ih.GEODESIC||n===ih.RHUMB){let a;n===ih.GEODESIC?(a=o2.chordLength(e,i.maximumRadius),Mt.numberOfPoints):(a=e,Mt.numberOfPointsRhumbLine);const l=Mt.extractHeights(r,i);n===ih.GEODESIC?r=Mt.generateCartesianArc({positions:r,minDistance:a,ellipsoid:i,height:l}):r=Mt.generateCartesianRhumbArc({positions:r,granularity:a,ellipsoid:i,height:l})}return r}}function Lf(t,n="GEODESIC",e){const o=t.map(Q.lbhToXyz).map(u=>C.Cartesian3.fromArray(u));let r;if(e>0&&n!=="NONE"){if(r=l0({arcType:C.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:C.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let s=0;const a=[0],l=r.length;for(let u=1;u<l;++u)s+=C.Cartesian3.distance(r[u-1],r[u]),a.push(s);const c=r.map(u=>Q.xyzToLbh([u.x,u.y,u.z]));return{timePosRots:a.map((u,A)=>[a[A],c[A],void 0]),distances:a}}function u0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function zf(t,n){const e=C.Matrix4.clone(C.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:s="YForwardZUp"}=t;if(i){const[a,l,c]=i;C.Transforms.eastNorthUpToFixedFrame(C.Cartesian3.fromDegrees(a,l,c),void 0,e)}if(o){const a=new C.Quaternion;s==="YForwardZUp"?Jc(o,a):s==="XForwardZUp"&&Qv(o,a);const l=C.Matrix3.fromQuaternion(a);C.Matrix4.multiply(e,C.Matrix4.fromRotationTranslation(l),e)}return r&&C.Matrix4.multiplyByScale(e,Zn(r),e),u0(e,n)}const a2=new C.Matrix4;function c0(t,n){const e=C.Matrix4.fromArray(t,0,a2);return C.Matrix4.inverse(e,e),u0(e,n)}const s2=new C.Matrix4,l2=new C.Cartesian3;function h0(t,n,e){const[i,o,r]=n,s=C.Cartesian3.fromDegrees(i,o,r,void 0,l2),a=C.Matrix4.fromArray(t,0,s2),l=C.Matrix4.multiplyByPoint(a,s,s),{x:c,y:h,z:u}=l;return e=e||[0,0,0],e[0]=c,e[1]=h,e[2]=u,e}const u2=new C.Matrix4,c2=new C.Cartesian3,h2=new C.Cartographic;function dr(t,n,e){const[i,o,r]=n,s=C.Cartesian3.fromElements(i,o,r,c2),a=C.Matrix4.fromArray(t,0,u2),l=C.Matrix4.multiplyByPoint(a,s,s),c=C.Cartographic.fromCartesian(l,void 0,h2);return e=e||[0,0,0],e[0]=C.Math.toDegrees(c.longitude),e[1]=C.Math.toDegrees(c.latitude),e[2]=c.height,e}function fn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,s=zf({position:e,rotation:i,scale:o,initialRotationMode:r}),a=c0(s);return[n.map(c=>h0(a,c)),s,a]}function pr(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,s=zf({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>dr(s,l)),s]}function A0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=it.Cartesian3.fromDegrees(...t[e]),o=it.Cartesian3.fromDegrees(...t[e+1]),r=it.Cartesian3.fromDegrees(...t[e+2]),s=it.Cartesian3.angleBetween(it.Cartesian3.subtract(i,o,new it.Cartesian3),it.Cartesian3.subtract(r,o,new it.Cartesian3));n.push(isNaN(s)?0:it.Math.toDegrees(s))}return n}function Qf(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>Ue(i)))),t.holes&&t.holes.forEach(i=>{e=Qf(i,e)}),e}function xn(t){return typeof t=="string"?Q.ESSceneObject.context.getStrFromEnv(t):new C.Resource({url:Q.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 Vf extends p.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[s,a,l]=p.getReactFuncs(e),[c,h,u]=p.getReactFuncs(i),A=new C.Cartesian3,f=()=>{let d=s();d&&(d=[...d],n.editingHeightOffset&&(d[2]-=n.editingHeightOffset),C.Cartesian3.fromDegrees(...d,void 0,A))};f(),this.dispose(l.disposableOn(f)),this.dispose(r.preUpdate.addEventListener(()=>{if(C.Cartesian3.ZERO.equals(A))return;const d=Di(r,A,o);d!==void 0?h([d,d,d]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${d??"undefined"}`)}))}}function A2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:C.Matrix4.toArray(C.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=C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new C.Cartesian3),i=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new C.Cartesian3),o=C.Cartesian3.add(r,C.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new C.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const A=t.root.boundingVolume.sphere[3];r=C.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=C.Cartesian3.add(r,C.Cartesian3.fromArray([A,0,0]),new C.Cartesian3),i=C.Cartesian3.add(r,C.Cartesian3.fromArray([0,A,0]),new C.Cartesian3),o=C.Cartesian3.add(r,C.Cartesian3.fromArray([0,0,A]),new C.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let s,a,l,c,h,u;return C.Matrix4.IDENTITY.equals(C.Matrix4.fromArray(n))?(s=Ue(e),c=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,e,new C.Cartesian3),new C.Cartesian3)),a=Ue(i),h=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,i,new C.Cartesian3),new C.Cartesian3)),l=Ue(o),u=Ue(C.Cartesian3.add(r,C.Cartesian3.subtract(r,o,new C.Cartesian3),new C.Cartesian3))):(s=dr(n,[e.x,e.y,e.z]),c=dr(n,[-e.x,-e.y,-e.z]),a=dr(n,[i.x,i.y,i.z]),h=dr(n,[-i.x,-i.y,-i.z]),l=dr(n,[o.x,o.y,o.z]),u=dr(n,[-o.x,-o.y,-o.z])),!s||!c||!a||!h||!l||!u?"无法生成包围盒,请检查包围盒是否正确":[C.Math.toRadians(Math.min(s[0],c[0],a[0],h[0],l[0],u[0])),C.Math.toRadians(Math.min(s[1],c[1],a[1],h[1],l[1],u[1])),C.Math.toRadians(Math.max(s[0],c[0],a[0],h[0],l[0],u[0])),C.Math.toRadians(Math.max(s[1],c[1],a[1],h[1],l[1],u[1])),Math.min(s[2],c[2],a[2],h[2],l[2],u[2]),Math.max(s[2],c[2],a[2],h[2],l[2],u[2])]}const f0=p.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 p.step(t,async l=>new Promise(async(c,h)=>{for(let u=0;u<n.length;u++){const A=n[u];await fetch(A).then(f=>f.json()).then(f=>{f&&!Reflect.has(f,"success")?i[A]=f:o.push({index:u,url:A,message:f.message}),u==n.length-1&&c()}).catch(f=>{o.push({index:u,url:A,message:f}),u==n.length-1&&c()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],s=[],a=[];for(const l in i){const c=i[l];s.push(c.geometricError??c.root.geometricError??0);const h=A2(c);r.push(h),a.push({content:{uri:l},boundingVolume:{region:h},geometricError:c.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...s),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(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=a),e});function f2(t){return new Promise((n,e)=>{f0.restart(void 0,t),f0.completeEvent.don(i=>{n(i)})})}class Hf extends p.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(p.react(0)));const[i,o,r]=p.getReactFuncs(e);{const s=()=>{const a=i();if(a){const{center:l,minPos:c,maxPos:h}=Q.getMinMaxCorner(a);this._center.value=l,this._radius.value=Q.geoDistance(c,h)/2}else this._center.value=void 0};s(),this.dispose(r.disposableOn(s))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function d0(t){return new C.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new C.Color(.2,.3,.6,1),blendColor:new C.Color(0,1,.699,1),specularMap:C.Material.DefaultImageId,normalMap:C.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;
|
|
@@ -734,7 +734,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
734
734
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b,x=!0,U=!1;return{s:function(){B=B.call(F)},n:function(){var k=B.next();return x=k.done,k},e:function(k){U=!0,b=k},f:function(){try{x||B.return==null||B.return()}finally{if(U)throw b}}}}function c(F,D){(D==null||D>F.length)&&(D=F.length);for(var B=0,S=new Array(D);B<D;B++)S[B]=F[B];return S}function h(F,D){for(var B=0;B<D.length;B++){var S=D[B];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(F,S.key,S)}}var u=a(4832).FillLayoutArray,A=a(8669).members,f=a(8500).SegmentVector,d=a(9063).ProgramConfigurationSet,g=a(9631),v=g.LineIndexArray,y=g.TriangleIndexArray,m=a(1438),w=a(9187),_=a(937),E=a(8583),T=a(1786).register,P=function(){function F(S){(function(I,b){if(!(I instanceof b))throw new TypeError("Cannot call a class as a function")})(this,F),this.zoom=S.zoom,this.overscaling=S.overscaling,this.layers=S.layers,this.layerIds=this.layers.map(function(I){return I.id}),this.index=S.index,this.layoutVertexArray=new u,this.indexArray=new y,this.indexArray2=new v,this.programConfigurations=new d(A,S.layers,S.zoom),this.segments=new f,this.segments2=new f}var D,B;return D=F,(B=[{key:"populate",value:function(S,I){var b,x=l(S);try{for(x.s();!(b=x.n()).done;){var U=b.value,k=U.feature,M=U.index,R=U.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},k)){var O=m(k);this.addFeature(k,O),I.featureIndex.insert(k,O,M,R,this.index)}}}catch(z){x.e(z)}finally{x.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(S){this.layoutVertexBuffer=S.createVertexBuffer(this.layoutVertexArray,A),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,I){var b,x=l(_(I,500));try{for(x.s();!(b=x.n()).done;){var U,k=b.value,M=0,R=l(k);try{for(R.s();!(U=R.n()).done;)M+=U.value.length}catch(he){R.e(he)}finally{R.f()}var O,z=this.segments.prepareSegment(M,this.layoutVertexArray,this.indexArray),V=z.vertexLength,H=[],q=[],J=l(k);try{for(J.s();!(O=J.n()).done;){var j=O.value;if(j.length!==0){j!==k[0]&&q.push(H.length/2);var re=this.segments2.prepareSegment(j.length,this.layoutVertexArray,this.indexArray2),oe=re.vertexLength;this.layoutVertexArray.emplaceBack(j[0].x,j[0].y),this.indexArray2.emplaceBack(oe+j.length-1,oe),H.push(j[0].x),H.push(j[0].y);for(var ue=1;ue<j.length;ue++)this.layoutVertexArray.emplaceBack(j[ue].x,j[ue].y),this.indexArray2.emplaceBack(oe+ue-1,oe+ue),H.push(j[ue].x),H.push(j[ue].y);re.vertexLength+=j.length,re.primitiveLength+=j.length}}}catch(he){J.e(he)}finally{J.f()}var ce=w(H,q);E(ce.length%3==0);for(var ne=0;ne<ce.length;ne+=3)this.indexArray.emplaceBack(V+ce[ne],V+ce[ne+1],V+ce[ne+2]);z.vertexLength+=M,z.primitiveLength+=ce.length/3}}catch(he){x.e(he)}finally{x.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,S)}}])&&h(D.prototype,B),Object.defineProperty(D,"prototype",{writable:!1}),F}();T("FillBucket",P,{omit:["layers"]}),r.exports=P},163:function(r,s,a){var l=a(6693).createLayout;r.exports=l([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4)},8294:function(r,s,a){function l(I,b){var x=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!x){if(Array.isArray(I)||(x=function(z,V){if(z){if(typeof z=="string")return c(z,V);var H=Object.prototype.toString.call(z).slice(8,-1);return H==="Object"&&z.constructor&&(H=z.constructor.name),H==="Map"||H==="Set"?Array.from(z):H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H)?c(z,V):void 0}}(I))||b){x&&(I=x);var U=0,k=function(){};return{s:k,n:function(){return U>=I.length?{done:!0}:{done:!1,value:I[U++]}},e:function(z){throw z},f:k}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
735
735
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var M,R=!0,O=!1;return{s:function(){x=x.call(I)},n:function(){var z=x.next();return R=z.done,z},e:function(z){O=!0,M=z},f:function(){try{R||x.return==null||x.return()}finally{if(O)throw M}}}}function c(I,b){(b==null||b>I.length)&&(b=I.length);for(var x=0,U=new Array(b);x<b;x++)U[x]=I[x];return U}function h(I,b){for(var x=0;x<b.length;x++){var U=b[x];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(I,U.key,U)}}var u=a(4832).FillExtrusionLayoutArray,A=a(163).members,f=a(8500),d=f.SegmentVector,g=f.MAX_VERTEX_ARRAY_LENGTH,v=a(9063).ProgramConfigurationSet,y=a(9631).TriangleIndexArray,m=a(1438),w=a(900),_=a(9187),E=a(937),T=a(8583),P=a(1786).register,F=Math.pow(2,13);function D(I,b,x,U,k,M,R,O){I.emplaceBack(b,x,2*Math.floor(U*F)+R,k*F*2,M*F*2,Math.round(O))}var B=function(){function I(U){(function(k,M){if(!(k instanceof M))throw new TypeError("Cannot call a class as a function")})(this,I),this.zoom=U.zoom,this.overscaling=U.overscaling,this.layers=U.layers,this.layerIds=this.layers.map(function(k){return k.id}),this.index=U.index,this.layoutVertexArray=new u,this.indexArray=new y,this.programConfigurations=new v(A,U.layers,U.zoom),this.segments=new d}var b,x;return b=I,(x=[{key:"populate",value:function(U,k){var M,R=l(U);try{for(R.s();!(M=R.n()).done;){var O=M.value,z=O.feature,V=O.index,H=O.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},z)){var q=m(z);this.addFeature(z,q),k.featureIndex.insert(z,q,V,H,this.index)}}}catch(J){R.e(J)}finally{R.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(U){this.layoutVertexBuffer=U.createVertexBuffer(this.layoutVertexArray,A),this.indexBuffer=U.createIndexBuffer(this.indexArray),this.programConfigurations.upload(U)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(U,k){var M,R,O=l(E(k,500));try{for(O.s();!(M=O.n()).done;){var z,V=M.value,H=0,q=l(V);try{for(q.s();!(z=q.n()).done;)H+=z.value.length}catch(ve){q.e(ve)}finally{q.f()}var J,j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),re=l(V);try{for(re.s();!(J=re.n()).done;){var oe=J.value;if(oe.length!==0&&!((R=oe).every(function(ve){return ve.x<0})||R.every(function(ve){return ve.x>w})||R.every(function(ve){return ve.y<0})||R.every(function(ve){return ve.y>w})))for(var ue=0,ce=0;ce<oe.length;ce++){var ne=oe[ce];if(ce>=1){var he=oe[ce-1];if(!S(ne,he)){j.vertexLength+4>g&&(j=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Y=ne.sub(he)._perp()._unit(),Z=he.dist(ne);ue+Z>32768&&(ue=0),D(this.layoutVertexArray,ne.x,ne.y,Y.x,Y.y,0,0,ue),D(this.layoutVertexArray,ne.x,ne.y,Y.x,Y.y,0,1,ue),ue+=Z,D(this.layoutVertexArray,he.x,he.y,Y.x,Y.y,0,0,ue),D(this.layoutVertexArray,he.x,he.y,Y.x,Y.y,0,1,ue);var G=j.vertexLength;this.indexArray.emplaceBack(G,G+1,G+2),this.indexArray.emplaceBack(G+1,G+2,G+3),j.vertexLength+=4,j.primitiveLength+=2}}}}}catch(ve){re.e(ve)}finally{re.f()}j.vertexLength+H>g&&(j=this.segments.prepareSegment(H,this.layoutVertexArray,this.indexArray));var $,X=[],K=[],W=j.vertexLength,ee=l(V);try{for(ee.s();!($=ee.n()).done;){var te=$.value;if(te.length!==0){te!==V[0]&&K.push(X.length/2);for(var se=0;se<te.length;se++){var fe=te[se];D(this.layoutVertexArray,fe.x,fe.y,0,0,1,1,0),X.push(fe.x),X.push(fe.y)}}}}catch(ve){ee.e(ve)}finally{ee.f()}var de=_(X,K);T(de.length%3==0);for(var me=0;me<de.length;me+=3)this.indexArray.emplaceBack(W+de[me],W+de[me+1],W+de[me+2]);j.primitiveLength+=de.length/3,j.vertexLength+=H}}catch(ve){O.e(ve)}finally{O.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,U)}}])&&h(b.prototype,x),Object.defineProperty(b,"prototype",{writable:!1}),I}();function S(I,b){return I.x===b.x&&(I.x<0||I.x>w)||I.y===b.y&&(I.y<0||I.y>w)}P("FillExtrusionBucket",B,{omit:["layers"]}),r.exports=B},7832:function(r,s,a){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 c(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function h(v,y){return h=Object.setPrototypeOf||function(m,w){return m.__proto__=w,m},h(v,y)}function u(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(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}(v)}function A(v){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},A(v)}var f=a(6677),d=a(1786).register,g=function(v){(function(T,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");T.prototype=Object.create(P&&P.prototype,{constructor:{value:T,writable:!0,configurable:!0}}),Object.defineProperty(T,"prototype",{writable:!1}),P&&h(T,P)})(E,v);var y,m,w,_=(m=E,w=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 T,P=A(m);if(w){var F=A(this).constructor;T=Reflect.construct(P,arguments,F)}else T=P.apply(this,arguments);return u(this,T)});function E(){return c(this,E),_.apply(this,arguments)}return y=E,Object.defineProperty(y,"prototype",{writable:!1}),y}(f);d("HeatmapBucket",g,{omit:["layers"]}),r.exports=g},9379:function(r,s,a){var l=a(6693).createLayout;r.exports=l([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4)},6905:function(r,s,a){function l(F,D){var B=typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(!B){if(Array.isArray(F)||(B=function(k,M){if(k){if(typeof k=="string")return c(k,M);var R=Object.prototype.toString.call(k).slice(8,-1);return R==="Object"&&k.constructor&&(R=k.constructor.name),R==="Map"||R==="Set"?Array.from(k):R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R)?c(k,M):void 0}}(F))||D){B&&(F=B);var S=0,I=function(){};return{s:I,n:function(){return S>=F.length?{done:!0}:{done:!1,value:F[S++]}},e:function(k){throw k},f:I}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
736
736
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b,x=!0,U=!1;return{s:function(){B=B.call(F)},n:function(){var k=B.next();return x=k.done,k},e:function(k){U=!0,b=k},f:function(){try{x||B.return==null||B.return()}finally{if(U)throw b}}}}function c(F,D){(D==null||D>F.length)&&(D=F.length);for(var B=0,S=new Array(D);B<D;B++)S[B]=F[B];return S}function h(F,D){for(var B=0;B<D.length;B++){var S=D[B];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(F,S.key,S)}}var u=a(4832).LineLayoutArray,A=a(9379).members,f=a(8500).SegmentVector,d=a(9063).ProgramConfigurationSet,g=a(9631).TriangleIndexArray,v=a(1438),y=a(900),m=a(8929).VectorTileFeature.types,w=a(1786).register,_=Math.cos(Math.PI/180*37.5),E=Math.pow(2,14)/.5;function T(F,D,B,S,I,b,x){F.emplaceBack(D.x,D.y,S?1:0,I?1:-1,Math.round(63*B.x)+128,Math.round(63*B.y)+128,1+(b===0?0:b<0?-1:1)|(.5*x&63)<<2,.5*x>>6)}var P=function(){function F(S){(function(I,b){if(!(I instanceof b))throw new TypeError("Cannot call a class as a function")})(this,F),this.zoom=S.zoom,this.overscaling=S.overscaling,this.layers=S.layers,this.layerIds=this.layers.map(function(I){return I.id}),this.index=S.index,this.layoutVertexArray=new u,this.indexArray=new g,this.programConfigurations=new d(A,S.layers,S.zoom),this.segments=new f}var D,B;return D=F,(B=[{key:"populate",value:function(S,I){var b,x=l(S);try{for(x.s();!(b=x.n()).done;){var U=b.value,k=U.feature,M=U.index,R=U.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},k)){var O=v(k);this.addFeature(k,O),I.featureIndex.insert(k,O,M,R,this.index)}}}catch(z){x.e(z)}finally{x.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(S){this.layoutVertexBuffer=S.createVertexBuffer(this.layoutVertexArray,A),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,I){var b,x=this.layers[0].layout,U=x.get("line-join").evaluate(S),k=x.get("line-cap"),M=x.get("line-miter-limit"),R=x.get("line-round-limit"),O=l(I);try{for(O.s();!(b=O.n()).done;){var z=b.value;this.addLine(z,S,U,k,M,R)}}catch(V){O.e(V)}finally{O.f()}}},{key:"addLine",value:function(S,I,b,x,U,k){for(var M=m[I.type]==="Polygon",R=S.length;R>=2&&S[R-1].equals(S[R-2]);)R--;for(var O=0;O<R-1&&S[O].equals(S[O+1]);)O++;if(!(R<(M?3:2))){b==="bevel"&&(U=1.05);var z=y/(512*this.overscaling)*15,V=S[O],H=this.segments.prepareSegment(10*R,this.layoutVertexArray,this.indexArray);this.distance=0;var q,J,j,re=x,oe=M?"butt":x,ue=!0,ce=void 0,ne=void 0,he=void 0,Y=void 0;this.e1=this.e2=this.e3=-1,M&&(q=S[R-2],Y=V.sub(q)._unit()._perp());for(var Z=O;Z<R;Z++)if(!(ne=M&&Z===R-1?S[O+1]:S[Z+1])||!S[Z].equals(ne)){Y&&(he=Y),q&&(ce=q),q=S[Z],Y=ne?ne.sub(q)._unit()._perp():he;var G=(he=he||Y).add(Y);G.x===0&&G.y===0||G._unit();var $=G.x*Y.x+G.y*Y.y,X=$!==0?1/$:1/0,K=$<_&&ce&≠if(K&&Z>O){var W=q.dist(ce);if(W>2*z){var ee=q.sub(q.sub(ce)._mult(z/W)._round());this.distance+=ee.dist(ce),this.addCurrentVertex(ee,this.distance,he.mult(1),0,0,!1,H),ce=ee}}var te=ce&&ne,se=te?b:ne?re:oe;if(te&&se==="round"&&(X<k?se="miter":X<=2&&(se="fakeround")),se==="miter"&&X>U&&(se="bevel"),se==="bevel"&&(X>2&&(se="flipbevel"),X<U&&(se="miter")),ce&&(this.distance+=q.dist(ce)),se==="miter")G._mult(X),this.addCurrentVertex(q,this.distance,G,0,0,!1,H);else if(se==="flipbevel"){if(X>100)G=Y.clone().mult(-1);else{var fe=he.x*Y.y-he.y*Y.x>0?-1:1,de=X*he.add(Y).mag()/he.sub(Y).mag();G._perp()._mult(de*fe)}this.addCurrentVertex(q,this.distance,G,0,0,!1,H),this.addCurrentVertex(q,this.distance,G.mult(-1),0,0,!1,H)}else if(se==="bevel"||se==="fakeround"){var me=he.x*Y.y-he.y*Y.x>0,ve=-Math.sqrt(X*X-1);if(me?(j=0,J=ve):(J=0,j=ve),ue||this.addCurrentVertex(q,this.distance,he,J,j,!1,H),se==="fakeround"){for(var Se=Math.floor(8*(.5-($-.5))),Ee=void 0,De=0;De<Se;De++)Ee=Y.mult((De+1)/(Se+1))._add(he)._unit(),this.addPieSliceVertex(q,this.distance,Ee,me,H);this.addPieSliceVertex(q,this.distance,G,me,H);for(var Fe=Se-1;Fe>=0;Fe--)Ee=he.mult((Fe+1)/(Se+1))._add(Y)._unit(),this.addPieSliceVertex(q,this.distance,Ee,me,H)}ne&&this.addCurrentVertex(q,this.distance,Y,-J,-j,!1,H)}else se==="butt"?(ue||this.addCurrentVertex(q,this.distance,he,0,0,!1,H),ne&&this.addCurrentVertex(q,this.distance,Y,0,0,!1,H)):se==="square"?(ue||(this.addCurrentVertex(q,this.distance,he,1,1,!1,H),this.e1=this.e2=-1),ne&&this.addCurrentVertex(q,this.distance,Y,-1,-1,!1,H)):se==="round"&&(ue||(this.addCurrentVertex(q,this.distance,he,0,0,!1,H),this.addCurrentVertex(q,this.distance,he,1,1,!0,H),this.e1=this.e2=-1),ne&&(this.addCurrentVertex(q,this.distance,Y,-1,-1,!0,H),this.addCurrentVertex(q,this.distance,Y,0,0,!1,H)));if(K&&Z<R-1){var Le=q.dist(ne);if(Le>2*z){var qe=q.add(ne.sub(q)._mult(z/Le)._round());this.distance+=qe.dist(q),this.addCurrentVertex(qe,this.distance,Y.mult(1),0,0,!1,H),q=qe}}ue=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,I)}}},{key:"addCurrentVertex",value:function(S,I,b,x,U,k,M){var R,O=this.layoutVertexArray,z=this.indexArray;R=b.clone(),x&&R._sub(b.perp()._mult(x)),T(O,S,R,k,!1,x,I),this.e3=M.vertexLength++,this.e1>=0&&this.e2>=0&&(z.emplaceBack(this.e1,this.e2,this.e3),M.primitiveLength++),this.e1=this.e2,this.e2=this.e3,R=b.mult(-1),U&&R._sub(b.perp()._mult(U)),T(O,S,R,k,!0,-U,I),this.e3=M.vertexLength++,this.e1>=0&&this.e2>=0&&(z.emplaceBack(this.e1,this.e2,this.e3),M.primitiveLength++),this.e1=this.e2,this.e2=this.e3,I>E/2&&(this.distance=0,this.addCurrentVertex(S,this.distance,b,x,U,k,M))}},{key:"addPieSliceVertex",value:function(S,I,b,x,U){b=b.mult(x?-1:1);var k=this.layoutVertexArray,M=this.indexArray;T(k,S,b,!1,x,0,I),this.e3=U.vertexLength++,this.e1>=0&&this.e2>=0&&(M.emplaceBack(this.e1,this.e2,this.e3),U.primitiveLength++),x?this.e2=this.e3:this.e1=this.e3}}])&&h(D.prototype,B),Object.defineProperty(D,"prototype",{writable:!1}),F}();w("LineBucket",P,{omit:["layers"]}),r.exports=P},1203:function(r,s,a){var l=a(6693).createLayout,c={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=c},5571:function(r,s,a){function l(Z,G){var $=typeof Symbol<"u"&&Z[Symbol.iterator]||Z["@@iterator"];if(!$){if(Array.isArray(Z)||($=function(se,fe){if(se){if(typeof se=="string")return c(se,fe);var de=Object.prototype.toString.call(se).slice(8,-1);return de==="Object"&&se.constructor&&(de=se.constructor.name),de==="Map"||de==="Set"?Array.from(se):de==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(de)?c(se,fe):void 0}}(Z))||G){$&&(Z=$);var X=0,K=function(){};return{s:K,n:function(){return X>=Z.length?{done:!0}:{done:!1,value:Z[X++]}},e:function(se){throw se},f:K}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
737
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W,ee=!0,te=!1;return{s:function(){$=$.call(Z)},n:function(){var se=$.next();return ee=se.done,se},e:function(se){te=!0,W=se},f:function(){try{ee||$.return==null||$.return()}finally{if(te)throw W}}}}function c(Z,G){(G==null||G>Z.length)&&(G=Z.length);for(var $=0,X=new Array(G);$<G;$++)X[$]=Z[$];return X}function h(Z,G){if(!(Z instanceof G))throw new TypeError("Cannot call a class as a function")}function u(Z,G){for(var $=0;$<G.length;$++){var X=G[$];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(Z,X.key,X)}}function A(Z,G,$){return G&&u(Z.prototype,G),Object.defineProperty(Z,"prototype",{writable:!1}),Z}var f=a(1203),d=f.symbolLayoutAttributes,g=f.collisionVertexAttributes,v=f.collisionBoxLayout,y=f.collisionCircleLayout,m=f.dynamicLayoutAttributes,w=a(4832),_=w.SymbolLayoutArray,E=w.SymbolDynamicLayoutArray,T=w.SymbolOpacityArray,P=w.CollisionBoxLayoutArray,F=w.CollisionCircleLayoutArray,D=w.CollisionVertexArray,B=w.PlacedSymbolArray,S=w.GlyphOffsetArray,I=w.SymbolLineVertexArray,b=a(5550),x=a(8500).SegmentVector,U=a(9063).ProgramConfigurationSet,k=a(9631),M=k.TriangleIndexArray,R=k.LineIndexArray,O=a(1447),z=a(8376),V=a(6584),H=a(1438),q=a(8929).VectorTileFeature.types,J=a(7899),j=(a(1397),a(724).getSizeData),re=a(1786).register,oe=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ue(Z,G,$,X,K,W,ee,te){Z.emplaceBack(G,$,Math.round(64*X),Math.round(64*K),W,ee,te?te[0]:0,te?te[1]:0)}function ce(Z,G,$){Z.emplaceBack(G.x,G.y,$),Z.emplaceBack(G.x,G.y,$),Z.emplaceBack(G.x,G.y,$),Z.emplaceBack(G.x,G.y,$)}var ne=function(){function Z(G){h(this,Z),this.layoutVertexArray=new _,this.indexArray=new M,this.programConfigurations=G,this.segments=new x,this.dynamicLayoutVertexArray=new E,this.opacityVertexArray=new T,this.placedSymbolArray=new B}return A(Z,[{key:"upload",value:function(G,$){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,d.members),this.indexBuffer=G.createIndexBuffer(this.indexArray,$),this.programConfigurations.upload(G),this.dynamicLayoutVertexBuffer=G.createVertexBuffer(this.dynamicLayoutVertexArray,m.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())}}]),Z}();re("SymbolBuffers",ne);var he=function(){function Z(G,$,X){h(this,Z),this.layoutVertexArray=new G,this.layoutAttributes=$,this.indexArray=new X,this.segments=new x,this.collisionVertexArray=new D}return A(Z,[{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,g.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),Z}();re("CollisionBuffers",he);var Y=function(){function Z(G){h(this,Z),this.collisionBoxArray=G.collisionBoxArray,this.zoom=G.zoom,this.overscaling=G.overscaling,this.layers=G.layers,this.layerIds=this.layers.map(function(K){return K.id}),this.index=G.index,this.pixelRatio=G.pixelRatio;var $=this.layers[0]._unevaluatedLayout._values;this.textSizeData=j(this.zoom,$["text-size"]),this.iconSizeData=j(this.zoom,$["icon-size"]);var X=this.layers[0].layout;this.sortFeaturesByY=X.get("text-allow-overlap")||X.get("icon-allow-overlap")||X.get("text-ignore-placement")||X.get("icon-ignore-placement")}return A(Z,[{key:"createArrays",value:function(){this.text=new ne(new U(d.members,this.layers,this.zoom,function(G){return/^text/.test(G)})),this.icon=new ne(new U(d.members,this.layers,this.zoom,function(G){return/^icon/.test(G)})),this.collisionBox=new he(P,v.members,R),this.collisionCircle=new he(F,y.members,M),this.glyphOffsetArray=new S,this.lineVertexArray=new I}},{key:"populate",value:function(G,$){var X=this.layers[0],K=X.layout,W=K.get("text-font"),ee=K.get("text-field"),te=K.get("icon-image"),se=(ee.value.kind!=="constant"||ee.value.value.length>0)&&(W.value.kind!=="constant"||W.value.value.length>0),fe=te.value.kind!=="constant"||te.value.value&&te.value.value.length>0;if(this.features=[],se||fe){var de,me=$.iconDependencies,ve=$.glyphDependencies,Se={zoom:this.zoom},Ee=l(G);try{for(Ee.s();!(de=Ee.n()).done;){var De=de.value,Fe=De.feature,Le=De.index,qe=De.sourceLayerIndex;if(X._featureFilter(Se,Fe)){var Oe=void 0;se&&(Oe=X.getValueAndResolveTokens("text-field",Fe),Oe=O(Oe,X,Fe));var ft=void 0;if(fe&&(ft=X.getValueAndResolveTokens("icon-image",Fe)),Oe||ft){var It={text:Oe,icon:ft,index:Le,sourceLayerIndex:qe,geometry:H(Fe),properties:Fe.properties,type:q[Fe.type]};if(Fe.id!==void 0&&(It.id=Fe.id),this.features.push(It),ft&&(me[ft]=!0),Oe){for(var nt=W.evaluate(Fe).join(","),cn=ve[nt]=ve[nt]||{},ht=K.get("text-rotation-alignment")==="map"&&K.get("symbol-placement")==="line",Mi=V.allowsVerticalWritingMode(Oe),oi=0;oi<Oe.length;oi++)if(cn[Oe.charCodeAt(oi)]=!0,ht&&Mi){var lr=J.lookup[Oe.charAt(oi)];lr&&(cn[lr.charCodeAt(0)]=!0)}}}}}}catch(_Q){Ee.e(_Q)}finally{Ee.f()}K.get("symbol-placement")==="line"&&(this.features=z(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,$){var X=this.lineVertexArray.length;if(G.segment!==void 0){for(var K=G.dist($[G.segment+1]),W=G.dist($[G.segment]),ee={},te=G.segment+1;te<$.length;te++)ee[te]={x:$[te].x,y:$[te].y,tileUnitDistanceFromAnchor:K},te<$.length-1&&(K+=$[te+1].dist($[te]));for(var se=G.segment||0;se>=0;se--)ee[se]={x:$[se].x,y:$[se].y,tileUnitDistanceFromAnchor:W},se>0&&(W+=$[se-1].dist($[se]));for(var fe=0;fe<$.length;fe++){var de=ee[fe];this.lineVertexArray.emplaceBack(de.x,de.y,de.tileUnitDistanceFromAnchor)}}return{lineStartIndex:X,lineLength:this.lineVertexArray.length-X}}},{key:"addSymbols",value:function(G,$,X,K,W,ee,te,se,fe,de){var me,ve=G.indexArray,Se=G.layoutVertexArray,Ee=G.dynamicLayoutVertexArray,De=G.segments.prepareSegment(4*$.length,G.layoutVertexArray,G.indexArray),Fe=this.glyphOffsetArray.length,Le=De.vertexLength,qe=l($);try{for(qe.s();!(me=qe.n()).done;){var Oe=me.value,ft=Oe.tl,It=Oe.tr,nt=Oe.bl,cn=Oe.br,ht=Oe.tex,Mi=De.vertexLength,oi=Oe.glyphOffset[1];ue(Se,se.x,se.y,ft.x,oi+ft.y,ht.x,ht.y,X),ue(Se,se.x,se.y,It.x,oi+It.y,ht.x+ht.w,ht.y,X),ue(Se,se.x,se.y,nt.x,oi+nt.y,ht.x,ht.y+ht.h,X),ue(Se,se.x,se.y,cn.x,oi+cn.y,ht.x+ht.w,ht.y+ht.h,X),ce(Ee,se,0),ve.emplaceBack(Mi,Mi+1,Mi+2),ve.emplaceBack(Mi+1,Mi+2,Mi+3),De.vertexLength+=4,De.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oe.glyphOffset[0])}}catch(lr){qe.e(lr)}finally{qe.f()}G.placedSymbolArray.emplaceBack(se.x,se.y,Fe,this.glyphOffsetArray.length-Fe,Le,fe,de,se.segment,X?X[0]:0,X?X[1]:0,K[0],K[1],te,!1),G.programConfigurations.populatePaintArrays(G.layoutVertexArray.length,ee)}},{key:"_addCollisionDebugVertex",value:function(G,$,X,K,W){return $.emplaceBack(0,0),G.emplaceBack(X.x,X.y,K.x,K.y,Math.round(W.x),Math.round(W.y))}},{key:"addCollisionDebugVertices",value:function(G,$,X,K,W,ee,te,se){var fe=W.segments.prepareSegment(4,W.layoutVertexArray,W.indexArray),de=fe.vertexLength,me=W.layoutVertexArray,ve=W.collisionVertexArray;if(this._addCollisionDebugVertex(me,ve,ee,te.anchor,new b(G,$)),this._addCollisionDebugVertex(me,ve,ee,te.anchor,new b(X,$)),this._addCollisionDebugVertex(me,ve,ee,te.anchor,new b(X,K)),this._addCollisionDebugVertex(me,ve,ee,te.anchor,new b(G,K)),fe.vertexLength+=4,se){var Se=W.indexArray;Se.emplaceBack(de,de+1,de+2),Se.emplaceBack(de,de+2,de+3),fe.primitiveLength+=2}else{var Ee=W.indexArray;Ee.emplaceBack(de,de+1),Ee.emplaceBack(de+1,de+2),Ee.emplaceBack(de+2,de+3),Ee.emplaceBack(de+3,de),fe.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var G,$=l(this.symbolInstances);try{for($.s();!(G=$.n()).done;){var X=G.value;X.textCollisionFeature={boxStartIndex:X.textBoxStartIndex,boxEndIndex:X.textBoxEndIndex},X.iconCollisionFeature={boxStartIndex:X.iconBoxStartIndex,boxEndIndex:X.iconBoxEndIndex};for(var K=0;K<2;K++){var W=X[K===0?"textCollisionFeature":"iconCollisionFeature"];if(W)for(var ee=W.boxStartIndex;ee<W.boxEndIndex;ee++){var te=this.collisionBoxArray.get(ee),se=te.x1,fe=te.y1,de=te.x2,me=te.y2,ve=te.radius>0;this.addCollisionDebugVertices(se,fe,de,me,ve?this.collisionCircle:this.collisionBox,te.anchorPoint,X,ve)}}}}catch(Se){$.e(Se)}finally{$.f()}}},{key:"deserializeCollisionBoxes",value:function(G,$,X,K,W){for(var ee={},te=$;te<X;te++){var se=G.get(te);if(se.radius===0){ee.textBox={x1:se.x1,y1:se.y1,x2:se.x2,y2:se.y2,anchorPointX:se.anchorPointX,anchorPointY:se.anchorPointY};break}ee.textCircles||(ee.textCircles=[]),ee.textCircles.push(se.anchorPointX,se.anchorPointY,se.radius,se.signedDistanceFromAnchor,1)}for(var fe=K;fe<W;fe++){var de=G.get(fe);if(de.radius===0){ee.iconBox={x1:de.x1,y1:de.y1,x2:de.x2,y2:de.y2,anchorPointX:de.anchorPointX,anchorPointY:de.anchorPointY};break}}return ee}},{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 $=this;if(this.sortFeaturesByY&&this.sortedAngle!==G&&(this.sortedAngle=G,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var X=[],K=0;K<this.symbolInstances.length;K++)X.push(K);var W=Math.sin(G),ee=Math.cos(G);X.sort(function(qe,Oe){var ft=$.symbolInstances[qe],It=$.symbolInstances[Oe];return(W*ft.anchor.x+ee*ft.anchor.y|0)-(W*It.anchor.x+ee*It.anchor.y|0)||It.featureIndex-ft.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var te=0,se=X;te<se.length;te++){var fe,de=se[te],me=l(this.symbolInstances[de].placedTextSymbolIndices);try{for(me.s();!(fe=me.n()).done;)for(var ve=fe.value,Se=this.text.placedSymbolArray.get(ve),Ee=Se.vertexStartIndex+4*Se.numGlyphs,De=Se.vertexStartIndex;De<Ee;De+=4)this.text.indexArray.emplaceBack(De,De+1,De+2),this.text.indexArray.emplaceBack(De+1,De+2,De+3)}catch(qe){me.e(qe)}finally{me.f()}var Fe=this.icon.placedSymbolArray.get(de);if(Fe.numGlyphs){var Le=Fe.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)}}}]),Z}();re("SymbolBucket",Y,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),Y.MAX_GLYPHS=65535,Y.addDynamicAttributes=ce,r.exports=Y},900:function(r){r.exports=8192},5346:function(r,s,a){function l(F,D){var B=typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(!B){if(Array.isArray(F)||(B=function(k,M){if(k){if(typeof k=="string")return c(k,M);var R=Object.prototype.toString.call(k).slice(8,-1);return R==="Object"&&k.constructor&&(R=k.constructor.name),R==="Map"||R==="Set"?Array.from(k):R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R)?c(k,M):void 0}}(F))||D){B&&(F=B);var S=0,I=function(){};return{s:I,n:function(){return S>=F.length?{done:!0}:{done:!1,value:F[S++]}},e:function(k){throw k},f:I}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
737
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W,ee=!0,te=!1;return{s:function(){$=$.call(Z)},n:function(){var se=$.next();return ee=se.done,se},e:function(se){te=!0,W=se},f:function(){try{ee||$.return==null||$.return()}finally{if(te)throw W}}}}function c(Z,G){(G==null||G>Z.length)&&(G=Z.length);for(var $=0,X=new Array(G);$<G;$++)X[$]=Z[$];return X}function h(Z,G){if(!(Z instanceof G))throw new TypeError("Cannot call a class as a function")}function u(Z,G){for(var $=0;$<G.length;$++){var X=G[$];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(Z,X.key,X)}}function A(Z,G,$){return G&&u(Z.prototype,G),Object.defineProperty(Z,"prototype",{writable:!1}),Z}var f=a(1203),d=f.symbolLayoutAttributes,g=f.collisionVertexAttributes,v=f.collisionBoxLayout,y=f.collisionCircleLayout,m=f.dynamicLayoutAttributes,w=a(4832),_=w.SymbolLayoutArray,E=w.SymbolDynamicLayoutArray,T=w.SymbolOpacityArray,P=w.CollisionBoxLayoutArray,F=w.CollisionCircleLayoutArray,D=w.CollisionVertexArray,B=w.PlacedSymbolArray,S=w.GlyphOffsetArray,I=w.SymbolLineVertexArray,b=a(5550),x=a(8500).SegmentVector,U=a(9063).ProgramConfigurationSet,k=a(9631),M=k.TriangleIndexArray,R=k.LineIndexArray,O=a(1447),z=a(8376),V=a(6584),H=a(1438),q=a(8929).VectorTileFeature.types,J=a(7899),j=(a(1397),a(724).getSizeData),re=a(1786).register,oe=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ue(Z,G,$,X,K,W,ee,te){Z.emplaceBack(G,$,Math.round(64*X),Math.round(64*K),W,ee,te?te[0]:0,te?te[1]:0)}function ce(Z,G,$){Z.emplaceBack(G.x,G.y,$),Z.emplaceBack(G.x,G.y,$),Z.emplaceBack(G.x,G.y,$),Z.emplaceBack(G.x,G.y,$)}var ne=function(){function Z(G){h(this,Z),this.layoutVertexArray=new _,this.indexArray=new M,this.programConfigurations=G,this.segments=new x,this.dynamicLayoutVertexArray=new E,this.opacityVertexArray=new T,this.placedSymbolArray=new B}return A(Z,[{key:"upload",value:function(G,$){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,d.members),this.indexBuffer=G.createIndexBuffer(this.indexArray,$),this.programConfigurations.upload(G),this.dynamicLayoutVertexBuffer=G.createVertexBuffer(this.dynamicLayoutVertexArray,m.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())}}]),Z}();re("SymbolBuffers",ne);var he=function(){function Z(G,$,X){h(this,Z),this.layoutVertexArray=new G,this.layoutAttributes=$,this.indexArray=new X,this.segments=new x,this.collisionVertexArray=new D}return A(Z,[{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,g.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),Z}();re("CollisionBuffers",he);var Y=function(){function Z(G){h(this,Z),this.collisionBoxArray=G.collisionBoxArray,this.zoom=G.zoom,this.overscaling=G.overscaling,this.layers=G.layers,this.layerIds=this.layers.map(function(K){return K.id}),this.index=G.index,this.pixelRatio=G.pixelRatio;var $=this.layers[0]._unevaluatedLayout._values;this.textSizeData=j(this.zoom,$["text-size"]),this.iconSizeData=j(this.zoom,$["icon-size"]);var X=this.layers[0].layout;this.sortFeaturesByY=X.get("text-allow-overlap")||X.get("icon-allow-overlap")||X.get("text-ignore-placement")||X.get("icon-ignore-placement")}return A(Z,[{key:"createArrays",value:function(){this.text=new ne(new U(d.members,this.layers,this.zoom,function(G){return/^text/.test(G)})),this.icon=new ne(new U(d.members,this.layers,this.zoom,function(G){return/^icon/.test(G)})),this.collisionBox=new he(P,v.members,R),this.collisionCircle=new he(F,y.members,M),this.glyphOffsetArray=new S,this.lineVertexArray=new I}},{key:"populate",value:function(G,$){var X=this.layers[0],K=X.layout,W=K.get("text-font"),ee=K.get("text-field"),te=K.get("icon-image"),se=(ee.value.kind!=="constant"||ee.value.value.length>0)&&(W.value.kind!=="constant"||W.value.value.length>0),fe=te.value.kind!=="constant"||te.value.value&&te.value.value.length>0;if(this.features=[],se||fe){var de,me=$.iconDependencies,ve=$.glyphDependencies,Se={zoom:this.zoom},Ee=l(G);try{for(Ee.s();!(de=Ee.n()).done;){var De=de.value,Fe=De.feature,Le=De.index,qe=De.sourceLayerIndex;if(X._featureFilter(Se,Fe)){var Oe=void 0;se&&(Oe=X.getValueAndResolveTokens("text-field",Fe),Oe=O(Oe,X,Fe));var ft=void 0;if(fe&&(ft=X.getValueAndResolveTokens("icon-image",Fe)),Oe||ft){var It={text:Oe,icon:ft,index:Le,sourceLayerIndex:qe,geometry:H(Fe),properties:Fe.properties,type:q[Fe.type]};if(Fe.id!==void 0&&(It.id=Fe.id),this.features.push(It),ft&&(me[ft]=!0),Oe){for(var nt=W.evaluate(Fe).join(","),cn=ve[nt]=ve[nt]||{},ht=K.get("text-rotation-alignment")==="map"&&K.get("symbol-placement")==="line",Mi=V.allowsVerticalWritingMode(Oe),oi=0;oi<Oe.length;oi++)if(cn[Oe.charCodeAt(oi)]=!0,ht&&Mi){var lr=J.lookup[Oe.charAt(oi)];lr&&(cn[lr.charCodeAt(0)]=!0)}}}}}}catch(CQ){Ee.e(CQ)}finally{Ee.f()}K.get("symbol-placement")==="line"&&(this.features=z(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,$){var X=this.lineVertexArray.length;if(G.segment!==void 0){for(var K=G.dist($[G.segment+1]),W=G.dist($[G.segment]),ee={},te=G.segment+1;te<$.length;te++)ee[te]={x:$[te].x,y:$[te].y,tileUnitDistanceFromAnchor:K},te<$.length-1&&(K+=$[te+1].dist($[te]));for(var se=G.segment||0;se>=0;se--)ee[se]={x:$[se].x,y:$[se].y,tileUnitDistanceFromAnchor:W},se>0&&(W+=$[se-1].dist($[se]));for(var fe=0;fe<$.length;fe++){var de=ee[fe];this.lineVertexArray.emplaceBack(de.x,de.y,de.tileUnitDistanceFromAnchor)}}return{lineStartIndex:X,lineLength:this.lineVertexArray.length-X}}},{key:"addSymbols",value:function(G,$,X,K,W,ee,te,se,fe,de){var me,ve=G.indexArray,Se=G.layoutVertexArray,Ee=G.dynamicLayoutVertexArray,De=G.segments.prepareSegment(4*$.length,G.layoutVertexArray,G.indexArray),Fe=this.glyphOffsetArray.length,Le=De.vertexLength,qe=l($);try{for(qe.s();!(me=qe.n()).done;){var Oe=me.value,ft=Oe.tl,It=Oe.tr,nt=Oe.bl,cn=Oe.br,ht=Oe.tex,Mi=De.vertexLength,oi=Oe.glyphOffset[1];ue(Se,se.x,se.y,ft.x,oi+ft.y,ht.x,ht.y,X),ue(Se,se.x,se.y,It.x,oi+It.y,ht.x+ht.w,ht.y,X),ue(Se,se.x,se.y,nt.x,oi+nt.y,ht.x,ht.y+ht.h,X),ue(Se,se.x,se.y,cn.x,oi+cn.y,ht.x+ht.w,ht.y+ht.h,X),ce(Ee,se,0),ve.emplaceBack(Mi,Mi+1,Mi+2),ve.emplaceBack(Mi+1,Mi+2,Mi+3),De.vertexLength+=4,De.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oe.glyphOffset[0])}}catch(lr){qe.e(lr)}finally{qe.f()}G.placedSymbolArray.emplaceBack(se.x,se.y,Fe,this.glyphOffsetArray.length-Fe,Le,fe,de,se.segment,X?X[0]:0,X?X[1]:0,K[0],K[1],te,!1),G.programConfigurations.populatePaintArrays(G.layoutVertexArray.length,ee)}},{key:"_addCollisionDebugVertex",value:function(G,$,X,K,W){return $.emplaceBack(0,0),G.emplaceBack(X.x,X.y,K.x,K.y,Math.round(W.x),Math.round(W.y))}},{key:"addCollisionDebugVertices",value:function(G,$,X,K,W,ee,te,se){var fe=W.segments.prepareSegment(4,W.layoutVertexArray,W.indexArray),de=fe.vertexLength,me=W.layoutVertexArray,ve=W.collisionVertexArray;if(this._addCollisionDebugVertex(me,ve,ee,te.anchor,new b(G,$)),this._addCollisionDebugVertex(me,ve,ee,te.anchor,new b(X,$)),this._addCollisionDebugVertex(me,ve,ee,te.anchor,new b(X,K)),this._addCollisionDebugVertex(me,ve,ee,te.anchor,new b(G,K)),fe.vertexLength+=4,se){var Se=W.indexArray;Se.emplaceBack(de,de+1,de+2),Se.emplaceBack(de,de+2,de+3),fe.primitiveLength+=2}else{var Ee=W.indexArray;Ee.emplaceBack(de,de+1),Ee.emplaceBack(de+1,de+2),Ee.emplaceBack(de+2,de+3),Ee.emplaceBack(de+3,de),fe.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var G,$=l(this.symbolInstances);try{for($.s();!(G=$.n()).done;){var X=G.value;X.textCollisionFeature={boxStartIndex:X.textBoxStartIndex,boxEndIndex:X.textBoxEndIndex},X.iconCollisionFeature={boxStartIndex:X.iconBoxStartIndex,boxEndIndex:X.iconBoxEndIndex};for(var K=0;K<2;K++){var W=X[K===0?"textCollisionFeature":"iconCollisionFeature"];if(W)for(var ee=W.boxStartIndex;ee<W.boxEndIndex;ee++){var te=this.collisionBoxArray.get(ee),se=te.x1,fe=te.y1,de=te.x2,me=te.y2,ve=te.radius>0;this.addCollisionDebugVertices(se,fe,de,me,ve?this.collisionCircle:this.collisionBox,te.anchorPoint,X,ve)}}}}catch(Se){$.e(Se)}finally{$.f()}}},{key:"deserializeCollisionBoxes",value:function(G,$,X,K,W){for(var ee={},te=$;te<X;te++){var se=G.get(te);if(se.radius===0){ee.textBox={x1:se.x1,y1:se.y1,x2:se.x2,y2:se.y2,anchorPointX:se.anchorPointX,anchorPointY:se.anchorPointY};break}ee.textCircles||(ee.textCircles=[]),ee.textCircles.push(se.anchorPointX,se.anchorPointY,se.radius,se.signedDistanceFromAnchor,1)}for(var fe=K;fe<W;fe++){var de=G.get(fe);if(de.radius===0){ee.iconBox={x1:de.x1,y1:de.y1,x2:de.x2,y2:de.y2,anchorPointX:de.anchorPointX,anchorPointY:de.anchorPointY};break}}return ee}},{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 $=this;if(this.sortFeaturesByY&&this.sortedAngle!==G&&(this.sortedAngle=G,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var X=[],K=0;K<this.symbolInstances.length;K++)X.push(K);var W=Math.sin(G),ee=Math.cos(G);X.sort(function(qe,Oe){var ft=$.symbolInstances[qe],It=$.symbolInstances[Oe];return(W*ft.anchor.x+ee*ft.anchor.y|0)-(W*It.anchor.x+ee*It.anchor.y|0)||It.featureIndex-ft.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var te=0,se=X;te<se.length;te++){var fe,de=se[te],me=l(this.symbolInstances[de].placedTextSymbolIndices);try{for(me.s();!(fe=me.n()).done;)for(var ve=fe.value,Se=this.text.placedSymbolArray.get(ve),Ee=Se.vertexStartIndex+4*Se.numGlyphs,De=Se.vertexStartIndex;De<Ee;De+=4)this.text.indexArray.emplaceBack(De,De+1,De+2),this.text.indexArray.emplaceBack(De+1,De+2,De+3)}catch(qe){me.e(qe)}finally{me.f()}var Fe=this.icon.placedSymbolArray.get(de);if(Fe.numGlyphs){var Le=Fe.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)}}}]),Z}();re("SymbolBucket",Y,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),Y.MAX_GLYPHS=65535,Y.addDynamicAttributes=ce,r.exports=Y},900:function(r){r.exports=8192},5346:function(r,s,a){function l(F,D){var B=typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(!B){if(Array.isArray(F)||(B=function(k,M){if(k){if(typeof k=="string")return c(k,M);var R=Object.prototype.toString.call(k).slice(8,-1);return R==="Object"&&k.constructor&&(R=k.constructor.name),R==="Map"||R==="Set"?Array.from(k):R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R)?c(k,M):void 0}}(F))||D){B&&(F=B);var S=0,I=function(){};return{s:I,n:function(){return S>=F.length?{done:!0}:{done:!1,value:F[S++]}},e:function(k){throw k},f:I}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
738
738
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var b,x=!0,U=!1;return{s:function(){B=B.call(F)},n:function(){var k=B.next();return x=k.done,k},e:function(k){U=!0,b=k},f:function(){try{x||B.return==null||B.return()}finally{if(U)throw b}}}}function c(F,D){(D==null||D>F.length)&&(D=F.length);for(var B=0,S=new Array(D);B<D;B++)S[B]=F[B];return S}function h(F,D){for(var B=0;B<D.length;B++){var S=D[B];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(F,S.key,S)}}a(5550);var u=a(1438),A=a(900),f=a(1693),d=a(1412),g=a(621),v=a(8929),y=a(3614),m=a(3076),w=a(8316).arraysIntersect,_=(a(4792).OverscaledTileID,a(1786).register),E=a(4832).FeatureIndexArray,T=function(){function F(S,I,b,x){(function(U,k){if(!(U instanceof k))throw new TypeError("Cannot call a class as a function")})(this,F),this.tileID=S,this.overscaling=I,this.x=S.canonical.x,this.y=S.canonical.y,this.z=S.canonical.z,this.grid=b||new d(A,16,0),this.featureIndexArray=x||new E}var D,B;return D=F,(B=[{key:"insert",value:function(S,I,b,x,U){var k=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(b,x,U);for(var M=0;M<I.length;M++){for(var R=I[M],O=[1/0,1/0,-1/0,-1/0],z=0;z<R.length;z++){var V=R[z];O[0]=Math.min(O[0],V.x),O[1]=Math.min(O[1],V.y),O[2]=Math.max(O[2],V.x),O[3]=Math.max(O[3],V.y)}this.grid.insert(k,O[0],O[1],O[2],O[3])}}},{key:"query",value:function(S,I){this.vtLayers||(this.vtLayers=new v.VectorTile(new y(this.rawTileData)).layers,this.sourceLayerCoder=new g(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));for(var b={},x=S.params||{},U=A/S.tileSize/S.scale,k=f(x.filter),M=S.queryGeometry,R=S.additionalRadius*U,O=1/0,z=1/0,V=-1/0,H=-1/0,q=0;q<M.length;q++)for(var J=M[q],j=0;j<J.length;j++){var re=J[j];O=Math.min(O,re.x),z=Math.min(z,re.y),V=Math.max(V,re.x),H=Math.max(H,re.y)}var oe=this.grid.query(O-R,z-R,V+R,H+R);oe.sort(P),this.filterMatching(b,oe,this.featureIndexArray,M,k,x.layers,I,S.bearing,U);var ue=S.collisionIndex?S.collisionIndex.queryRenderedSymbols(M,this.tileID,A/S.tileSize,S.collisionBoxArray,S.sourceID,S.bucketInstanceIds):[];return ue.sort(),this.filterMatching(b,ue,S.collisionBoxArray,M,k,x.layers,I,S.bearing,U),b}},{key:"filterMatching",value:function(S,I,b,x,U,k,M,R,O){for(var z,V=0;V<I.length;V++){var H=I[V];if(H!==z){z=H;var q=b.get(H),J=this.bucketLayerIDs[q.bucketIndex];if(!k||w(k,J)){var j=this.sourceLayerCoder.decode(q.sourceLayerIndex),re=this.vtLayers[j].feature(q.featureIndex);if(U({zoom:this.tileID.overscaledZ},re))for(var oe=null,ue=0;ue<J.length;ue++){var ce=J[ue];if(!(k&&k.indexOf(ce)<0)){var ne=M[ce];if(ne&&(ne.type==="symbol"||(oe||(oe=u(re)),ne.queryIntersectsFeature(x,re,oe,this.z,R,O)))){var he=new m(re,this.z,this.x,this.y);he.layer=ne.serialize();var Y=S[ce];Y===void 0&&(Y=S[ce]=[]),Y.push({featureIndex:H,feature:he})}}}}}}}},{key:"hasLayer",value:function(S){var I,b=l(this.bucketLayerIDs);try{for(b.s();!(I=b.n()).done;){var x,U=l(I.value);try{for(U.s();!(x=U.n()).done;)if(S===x.value)return!0}catch(k){U.e(k)}finally{U.f()}}}catch(k){b.e(k)}finally{b.f()}return!1}}])&&h(D.prototype,B),Object.defineProperty(D,"prototype",{writable:!1}),F}();function P(F,D){return D-F}_("FeatureIndex",T,{omit:["rawTileData","sourceLayerCoder","collisionIndex"]}),r.exports=T},9631:function(r,s,a){r.exports={LineIndexArray:a(4832).LineIndexArray,TriangleIndexArray:a(4832).TriangleIndexArray}},1438:function(r,s,a){var l=a(8316),c=a(900),h={min:-1*Math.pow(2,15),max:Math.pow(2,15)-1};r.exports=function(u){for(var A=c/u.extent,f=u.loadGeometry(),d=0;d<f.length;d++)for(var g=f[d],v=0;v<g.length;v++){var y=g[v];y.x=Math.round(y.x*A),y.y=Math.round(y.y*A),(y.x<h.min||y.x>h.max||y.y<h.min||y.y>h.max)&&l.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return f}},3326:function(r,s,a){var l=a(6693).createLayout;r.exports=l([{name:"a_pos",type:"Int16",components:2}])},9063:function(r,s,a){function l(S,I){var b=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!b){if(Array.isArray(S)||(b=function(O,z){if(O){if(typeof O=="string")return c(O,z);var V=Object.prototype.toString.call(O).slice(8,-1);return V==="Object"&&O.constructor&&(V=O.constructor.name),V==="Map"||V==="Set"?Array.from(O):V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V)?c(O,z):void 0}}(S))||I){b&&(S=b);var x=0,U=function(){};return{s:U,n:function(){return x>=S.length?{done:!0}:{done:!1,value:S[x++]}},e:function(O){throw O},f:U}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
739
739
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var k,M=!0,R=!1;return{s:function(){b=b.call(S)},n:function(){var O=b.next();return M=O.done,O},e:function(O){R=!0,k=O},f:function(){try{M||b.return==null||b.return()}finally{if(R)throw k}}}}function c(S,I){(I==null||I>S.length)&&(I=S.length);for(var b=0,x=new Array(I);b<I;b++)x[b]=S[b];return x}function h(S,I){if(!(S instanceof I))throw new TypeError("Cannot call a class as a function")}function u(S,I){for(var b=0;b<I.length;b++){var x=I[b];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}function A(S,I,b){return I&&u(S.prototype,I),b&&u(S,b),Object.defineProperty(S,"prototype",{writable:!1}),S}var f=a(9207).j,d=(a(6016),a(1786).register),g=a(5615).PossiblyEvaluatedPropertyValue,v=a(4832),y=v.StructArrayLayout1f4,m=v.StructArrayLayout2f8,w=v.StructArrayLayout4f16;function _(S){return[f(255*S.r,255*S.g),f(255*S.b,255*S.a)]}var E=function(){function S(I,b,x){h(this,S),this.value=I,this.name=b,this.type=x,this.statistics={max:-1/0}}return A(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(I,b,x,U){var k=U.constantOr(this.value),M=I.gl;this.type==="color"?M.uniform4f(b.uniforms["u_".concat(this.name)],k.r,k.g,k.b,k.a):M.uniform1f(b.uniforms["u_".concat(this.name)],k)}}]),S}(),T=function(){function S(I,b,x){h(this,S),this.expression=I,this.name=b,this.type=x,this.statistics={max:-1/0};var U=x==="color"?m:y;this.paintVertexAttributes=[{name:"a_".concat(b),type:"Float32",components:x==="color"?2:1,offset:0}],this.paintVertexArray=new U}return A(S,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(I,b){var x=this.paintVertexArray,U=x.length;x.reserve(I);var k=this.expression.evaluate({zoom:0},b);if(this.type==="color")for(var M=_(k),R=U;R<I;R++)x.emplaceBack(M[0],M[1]);else{for(var O=U;O<I;O++)x.emplaceBack(k);this.statistics.max=Math.max(this.statistics.max,k)}}},{key:"upload",value:function(I){this.paintVertexArray&&(this.paintVertexBuffer=I.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"setUniforms",value:function(I,b){I.gl.uniform1f(b.uniforms["a_".concat(this.name,"_t")],0)}}]),S}(),P=function(){function S(I,b,x,U,k){h(this,S),this.expression=I,this.name=b,this.type=x,this.useIntegerZoom=U,this.zoom=k,this.statistics={max:-1/0};var M=x==="color"?w:m;this.paintVertexAttributes=[{name:"a_".concat(b),type:"Float32",components:x==="color"?4:2,offset:0}],this.paintVertexArray=new M}return A(S,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(I,b){var x=this.paintVertexArray,U=x.length;x.reserve(I);var k=this.expression.evaluate({zoom:this.zoom},b),M=this.expression.evaluate({zoom:this.zoom+1},b);if(this.type==="color")for(var R=_(k),O=_(M),z=U;z<I;z++)x.emplaceBack(R[0],R[1],O[0],O[1]);else{for(var V=U;V<I;V++)x.emplaceBack(k,M);this.statistics.max=Math.max(this.statistics.max,k,M)}}},{key:"upload",value:function(I){this.paintVertexArray&&(this.paintVertexBuffer=I.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"interpolationFactor",value:function(I){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(I),this.zoom,this.zoom+1):this.expression.interpolationFactor(I,this.zoom,this.zoom+1)}},{key:"setUniforms",value:function(I,b,x){I.gl.uniform1f(b.uniforms["a_".concat(this.name,"_t")],this.interpolationFactor(x.zoom))}}]),S}(),F=function(){function S(){h(this,S),this.binders={},this.cacheKey="",this._buffers=[]}return A(S,[{key:"populatePaintArrays",value:function(I,b){for(var x in this.binders)this.binders[x].populatePaintArray(I,b)}},{key:"defines",value:function(){var I=[];for(var b in this.binders)I.push.apply(I,this.binders[b].defines());return I}},{key:"setUniforms",value:function(I,b,x,U){for(var k in this.binders)this.binders[k].setUniforms(I,b,U,x.get(k))}},{key:"getPaintVertexBuffers",value:function(){return this._buffers}},{key:"upload",value:function(I){for(var b in this.binders)this.binders[b].upload(I);var x=[];for(var U in this.binders){var k=this.binders[U];(k instanceof T||k instanceof P)&&k.paintVertexBuffer&&x.push(k.paintVertexBuffer)}this._buffers=x}},{key:"destroy",value:function(){for(var I in this.binders)this.binders[I].destroy()}}],[{key:"createDynamic",value:function(I,b,x){var U=new S,k=[];for(var M in I.paint._values)if(x(M)){var R=I.paint.get(M);if(R instanceof g&&R.property.specification["property-function"]){var O=B(M,I.type),z=R.property.specification.type,V=R.property.useIntegerZoom;R.value.kind==="constant"?(U.binders[M]=new E(R.value,O,z),k.push("/u_".concat(O))):R.value.kind==="source"?(U.binders[M]=new T(R.value,O,z),k.push("/a_".concat(O))):(U.binders[M]=new P(R.value,O,z,V,b),k.push("/z_".concat(O)))}}return U.cacheKey=k.sort().join(""),U}}]),S}(),D=function(){function S(I,b,x){var U=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0};h(this,S),this.programConfigurations={};var k,M=l(b);try{for(M.s();!(k=M.n()).done;){var R=k.value;this.programConfigurations[R.id]=F.createDynamic(R,x,U),this.programConfigurations[R.id].layoutAttributes=I}}catch(O){M.e(O)}finally{M.f()}}return A(S,[{key:"populatePaintArrays",value:function(I,b){for(var x in this.programConfigurations)this.programConfigurations[x].populatePaintArrays(I,b)}},{key:"get",value:function(I){return this.programConfigurations[I]}},{key:"upload",value:function(I){for(var b in this.programConfigurations)this.programConfigurations[b].upload(I)}},{key:"destroy",value:function(){for(var I in this.programConfigurations)this.programConfigurations[I].destroy()}}]),S}();function B(S,I){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(I,"-"),"").replace(/-/g,"_")}d("ConstantBinder",E),d("SourceExpressionBinder",T),d("CompositeExpressionBinder",P),d("ProgramConfiguration",F,{omit:["_buffers"]}),d("ProgramConfigurationSet",D),r.exports={ProgramConfiguration:F,ProgramConfigurationSet:D}},2596:function(r,s,a){var l=a(6693).createLayout;r.exports=l([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}])},8500:function(r,s,a){function l(g,v){(v==null||v>g.length)&&(v=g.length);for(var y=0,m=new Array(v);y<v;y++)m[y]=g[y];return m}function c(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function h(g,v){for(var y=0;y<v.length;y++){var m=v[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(g,m.key,m)}}var u=a(8316).warnOnce,A=a(1786).register,f=Math.pow(2,16)-1,d=function(){function g(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];c(this,g),this.segments=m}var v,y;return v=g,(y=[{key:"prepareSegment",value:function(m,w,_){var E=this.segments[this.segments.length-1];return m>f&&u("Max vertices per segment is ".concat(f,": bucket requested ").concat(m)),(!E||E.vertexLength+m>r.exports.MAX_VERTEX_ARRAY_LENGTH)&&(E={vertexOffset:w.length,primitiveOffset:_.length,vertexLength:0,primitiveLength:0},this.segments.push(E)),E}},{key:"get",value:function(){return this.segments}},{key:"destroy",value:function(){var m,w=function(T,P){var F=typeof Symbol<"u"&&T[Symbol.iterator]||T["@@iterator"];if(!F){if(Array.isArray(T)||(F=function(x,U){if(x){if(typeof x=="string")return l(x,U);var k=Object.prototype.toString.call(x).slice(8,-1);return k==="Object"&&x.constructor&&(k=x.constructor.name),k==="Map"||k==="Set"?Array.from(x):k==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k)?l(x,U):void 0}}(T))||P){F&&(T=F);var D=0,B=function(){};return{s:B,n:function(){return D>=T.length?{done:!0}:{done:!1,value:T[D++]}},e:function(x){throw x},f:B}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
740
740
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var S,I=!0,b=!1;return{s:function(){F=F.call(T)},n:function(){var x=F.next();return I=x.done,x},e:function(x){b=!0,S=x},f:function(){try{I||F.return==null||F.return()}finally{if(b)throw S}}}}(this.segments);try{for(w.s();!(m=w.n()).done;){var _=m.value;for(var E in _.vaos)_.vaos[E].destroy()}}catch(T){w.e(T)}finally{w.f()}}}])&&h(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),g}();A("SegmentVector",d),r.exports={SegmentVector:d,MAX_VERTEX_ARRAY_LENGTH:f}},3892:function(r){function s(l,c){for(var h=0;h<c.length;h++){var u=c[h];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}var a=function(){function l(u,A,f){(function(d,g){if(!(d instanceof g))throw new TypeError("Cannot call a class as a function")})(this,l),this.column=u,this.row=A,this.zoom=f}var c,h;return c=l,(h=[{key:"clone",value:function(){return new l(this.column,this.row,this.zoom)}},{key:"zoomTo",value:function(u){return this.clone()._zoomTo(u)}},{key:"sub",value:function(u){return this.clone()._sub(u)}},{key:"_zoomTo",value:function(u){var A=Math.pow(2,u-this.zoom);return this.column*=A,this.row*=A,this.zoom=u,this}},{key:"_sub",value:function(u){return u=u.zoomTo(this.zoom),this.column-=u.column,this.row-=u.row,this}}])&&s(c.prototype,h),Object.defineProperty(c,"prototype",{writable:!1}),l}();r.exports=a},9069:function(r,s,a){function l(A){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},l(A)}function c(A,f){for(var d=0;d<f.length;d++){var g=f[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(A,g.key,g)}}var h=a(8316).wrap,u=function(){function A(v,y){if(function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")}(this,A),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 f,d,g;return f=A,g=[{key:"convert",value:function(v){if(v instanceof A)return v;if(Array.isArray(v)&&(v.length===2||v.length===3))return new A(Number(v[0]),Number(v[1]));if(!Array.isArray(v)&&l(v)==="object"&&v!==null)return new A(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 A(h(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,m=y/Math.cos(Math.PI/180*this.lat);return new(a(4899))(new A(this.lng-m,this.lat-y),new A(this.lng+m,this.lat+y))}}])&&c(f.prototype,d),g&&c(f,g),Object.defineProperty(f,"prototype",{writable:!1}),A}();r.exports=u},4899:function(r,s,a){function l(u,A){for(var f=0;f<A.length;f++){var d=A[f];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(u,d.key,d)}}var c=a(9069),h=function(){function u(g,v){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,u),g&&(v?this.setSouthWest(g).setNorthEast(v):g.length===4?this.setSouthWest([g[0],g[1]]).setNorthEast([g[2],g[3]]):this.setSouthWest(g[0]).setNorthEast(g[1]))}var A,f,d;return A=u,d=[{key:"convert",value:function(g){return!g||g instanceof u?g:new u(g)}}],(f=[{key:"setNorthEast",value:function(g){return this._ne=g instanceof c?new c(g.lng,g.lat):c.convert(g),this}},{key:"setSouthWest",value:function(g){return this._sw=g instanceof c?new c(g.lng,g.lat):c.convert(g),this}},{key:"extend",value:function(g){var v,y,m=this._sw,w=this._ne;if(g instanceof c)v=g,y=g;else{if(!(g instanceof u))return Array.isArray(g)?g.every(Array.isArray)?this.extend(u.convert(g)):this.extend(c.convert(g)):this;if(v=g._sw,y=g._ne,!v||!y)return this}return m||w?(m.lng=Math.min(v.lng,m.lng),m.lat=Math.min(v.lat,m.lat),w.lng=Math.max(y.lng,w.lng),w.lat=Math.max(y.lat,w.lat)):(this._sw=new c(v.lng,v.lat),this._ne=new c(y.lng,y.lat)),this}},{key:"getCenter",value:function(){return new c((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 c(this.getWest(),this.getNorth())}},{key:"getSouthEast",value:function(){return new c(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(A.prototype,f),d&&l(A,d),Object.defineProperty(A,"prototype",{writable:!1}),u}();r.exports=h},7773:function(r,s,a){function l(P,F){for(var D=0;D<F.length;D++){var B=F[D];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(P,B.key,B)}}var c=a(9069),h=a(5550),u=a(3892),A=a(8316),f=a(2643).number,d=a(1803),g=a(4792),v=(g.CanonicalTileID,g.UnwrappedTileID),y=a(900),m=a(3226),w=m.vec4,_=m.mat4,E=m.mat2,T=function(){function P(B,S,I){(function(b,x){if(!(b instanceof x))throw new TypeError("Cannot call a class as a function")})(this,P),this.tileSize=512,this._renderWorldCopies=I===void 0||I,this._minZoom=B||0,this._maxZoom=S||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new c(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={}}var F,D;return F=P,(D=[{key:"clone",value:function(){var B=new P(this._minZoom,this._maxZoom,this._renderWorldCopies);return B.tileSize=this.tileSize,B.latRange=this.latRange,B.width=this.width,B.height=this.height,B._center=this._center,B.zoom=this.zoom,B.angle=this.angle,B._fov=this._fov,B._pitch=this._pitch,B._unmodified=this._unmodified,B._calcMatrices(),B}},{key:"minZoom",get:function(){return this._minZoom},set:function(B){this._minZoom!==B&&(this._minZoom=B,this.zoom=Math.max(this.zoom,B))}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(B){this._maxZoom!==B&&(this._maxZoom=B,this.zoom=Math.min(this.zoom,B))}},{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 h(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(B){var S=-A.wrap(B,-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(B){var S=A.clamp(B,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(B){B=Math.max(.01,Math.min(60,B)),this._fov!==B&&(this._unmodified=!1,this._fov=B/180*Math.PI,this._calcMatrices())}},{key:"zoom",get:function(){return this._zoom},set:function(B){var S=Math.min(Math.max(B,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(B){B.lat===this._center.lat&&B.lng===this._center.lng||(this._unmodified=!1,this._center=B,this._constrain(),this._calcMatrices())}},{key:"coveringZoomLevel",value:function(B){return(B.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/B.tileSize))}},{key:"getVisibleUnwrappedCoordinates",value:function(B){var S=this.pointCoordinate(new h(0,0),0),I=this.pointCoordinate(new h(this.width,0),0),b=Math.floor(S.column),x=Math.floor(I.column),U=[new v(0,B)];if(this._renderWorldCopies)for(var k=b;k<=x;k++)k!==0&&U.push(new v(k,B));return U}},{key:"coveringTiles",value:function(B){var S=this.coveringZoomLevel(B),I=S;if(B.minzoom!==void 0&&S<B.minzoom)return[];B.maxzoom!==void 0&&S>B.maxzoom&&(S=B.maxzoom);var b=this.pointCoordinate(this.centerPoint,S),x=new h(b.column-.5,b.row-.5),U=[this.pointCoordinate(new h(0,0),S),this.pointCoordinate(new h(this.width,0),S),this.pointCoordinate(new h(this.width,this.height),S),this.pointCoordinate(new h(0,this.height),S)];return d(S,U,B.reparseOverscaled?I:S,this._renderWorldCopies).sort(function(k,M){return x.dist(k.canonical)-x.dist(M.canonical)})}},{key:"resize",value:function(B,S){this.width=B,this.height=S,this.pixelsToGLUnits=[2/B,-2/S],this._constrain(),this._calcMatrices()}},{key:"unmodified",get:function(){return this._unmodified}},{key:"zoomScale",value:function(B){return Math.pow(2,B)}},{key:"scaleZoom",value:function(B){return Math.log(B)/Math.LN2}},{key:"project",value:function(B){return new h(this.lngX(B.lng),this.latY(B.lat))}},{key:"unproject",value:function(B){return new c(this.xLng(B.x),this.yLat(B.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 h(this.x,this.y)}},{key:"lngX",value:function(B){return(180+B)*this.worldSize/360}},{key:"latY",value:function(B){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+B*Math.PI/360)))*this.worldSize/360}},{key:"xLng",value:function(B){return 360*B/this.worldSize-180}},{key:"yLat",value:function(B){var S=180-360*B/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(S*Math.PI/180))-90}},{key:"setLocationAtPoint",value:function(B,S){var I=this.pointCoordinate(S)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(B)._sub(I)),this._renderWorldCopies&&(this.center=this.center.wrap())}},{key:"locationPoint",value:function(B){return this.coordinatePoint(this.locationCoordinate(B))}},{key:"pointLocation",value:function(B){return this.coordinateLocation(this.pointCoordinate(B))}},{key:"locationCoordinate",value:function(B){return new u(this.lngX(B.lng)/this.tileSize,this.latY(B.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)}},{key:"coordinateLocation",value:function(B){var S=B.zoomTo(this.zoom);return new c(this.xLng(S.column*this.tileSize),this.yLat(S.row*this.tileSize))}},{key:"pointCoordinate",value:function(B,S){S===void 0&&(S=this.tileZoom);var I=[B.x,B.y,0,1],b=[B.x,B.y,1,1];w.transformMat4(I,I,this.pixelMatrixInverse),w.transformMat4(b,b,this.pixelMatrixInverse);var x=I[3],U=b[3],k=I[1]/x,M=b[1]/U,R=I[2]/x,O=b[2]/U,z=R===O?0:(0-R)/(O-R);return new u(f(I[0]/x,b[0]/U,z)/this.tileSize,f(k,M,z)/this.tileSize,this.zoom)._zoomTo(S)}},{key:"coordinatePoint",value:function(B){var S=B.zoomTo(this.zoom),I=[S.column*this.tileSize,S.row*this.tileSize,0,1];return w.transformMat4(I,I,this.pixelMatrix),new h(I[0]/I[3],I[1]/I[3])}},{key:"calculatePosMatrix",value:function(B){var S=B.key;if(this._posMatrixCache[S])return this._posMatrixCache[S];var I=B.canonical,b=this.worldSize/this.zoomScale(I.z),x=I.x+Math.pow(2,I.z)*B.wrap,U=_.identity(new Float64Array(16));return _.translate(U,U,[x*b,I.y*b,0]),_.scale(U,U,[b/y,b/y,1]),_.multiply(U,this.projMatrix,U),this._posMatrixCache[S]=new Float32Array(U),this._posMatrixCache[S]}},{key:"_constrain",value:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var B,S,I,b,x=-90,U=90,k=-180,M=180,R=this.size,O=this._unmodified;if(this.latRange){var z=this.latRange;x=this.latY(z[1]),B=(U=this.latY(z[0]))-x<R.y?R.y/(U-x):0}if(this.lngRange){var V=this.lngRange;k=this.lngX(V[0]),S=(M=this.lngX(V[1]))-k<R.x?R.x/(M-k):0}var H=Math.max(S||0,B||0);if(H)return this.center=this.unproject(new h(S?(M+k)/2:this.x,B?(U+x)/2:this.y)),this.zoom+=this.scaleZoom(H),this._unmodified=O,void(this._constraining=!1);if(this.latRange){var q=this.y,J=R.y/2;q-J<x&&(b=x+J),q+J>U&&(b=U-J)}if(this.lngRange){var j=this.x,re=R.x/2;j-re<k&&(I=k+re),j+re>M&&(I=M-re)}I===void 0&&b===void 0||(this.center=this.unproject(new h(I!==void 0?I:this.x,b!==void 0?b:this.y))),this._unmodified=O,this._constraining=!1}}},{key:"_calcMatrices",value:function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var B=this._fov/2,S=Math.PI/2+this._pitch,I=Math.sin(B)*this.cameraToCenterDistance/Math.sin(Math.PI-S-B),b=1.01*(Math.cos(Math.PI/2-this._pitch)*I+this.cameraToCenterDistance),x=new Float64Array(16);_.perspective(x,this._fov,this.width/this.height,1,b),_.scale(x,x,[1,-1,1]),_.translate(x,x,[0,0,-this.cameraToCenterDistance]),_.rotateX(x,x,this._pitch),_.rotateZ(x,x,this.angle),_.translate(x,x,[-this.x,-this.y,0]);var U=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(_.scale(x,x,[1,1,U,1]),this.projMatrix=x,x=_.create(),_.scale(x,x,[this.width/2,-this.height/2,1]),_.translate(x,x,[1,-1,0]),this.pixelMatrix=_.multiply(new Float64Array(16),x,this.projMatrix),!(x=_.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=x,this._posMatrixCache={}}}}])&&l(F.prototype,D),Object.defineProperty(F,"prototype",{writable:!1}),P}();r.exports=T},129:function(r,s,a){function l(u,A,f){return Object.defineProperty(u,"prototype",{writable:!1}),u}var c=a(6016),h=l(function u(A,f,d){(function(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")})(this,u),this.blendFunction=A,this.blendColor=f,this.mask=d});h.Replace=[1,0],h.disabled=new h(h.Replace,c.transparent,[!1,!1,!1,!1]),h.unblended=new h(h.Replace,c.transparent,[!0,!0,!0,!0]),h.alphaBlended=new h([1,771],c.transparent,[!0,!0,!0,!0]),r.exports=h},206:function(r,s,a){function l(oe,ue){for(var ce=0;ce<ue.length;ce++){var ne=ue[ce];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(oe,ne.key,ne)}}var c=a(7612),h=a(3292),u=a(5197),A=(a(6937),a(2749),a(129)),f=a(8316),d=a(2578),g=d.ClearColor,v=d.ClearDepth,y=d.ClearStencil,m=d.ColorMask,w=d.DepthMask,_=d.StencilMask,E=d.StencilFunc,T=d.StencilOp,P=d.StencilTest,F=d.DepthRange,D=d.DepthTest,B=d.DepthFunc,S=d.Blend,I=d.BlendFunc,b=d.BlendColor,x=d.Program,U=d.LineWidth,k=d.ActiveTextureUnit,M=d.Viewport,R=d.BindFramebuffer,O=d.BindRenderbuffer,z=d.BindTexture,V=d.BindVertexBuffer,H=d.BindElementBuffer,q=d.BindVertexArrayOES,J=d.PixelStoreUnpack,j=d.PixelStoreUnpackPremultiplyAlpha,re=function(){function oe(ne){(function(he,Y){if(!(he instanceof Y))throw new TypeError("Cannot call a class as a function")})(this,oe),this.gl=ne,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.lineWidthRange=ne.getParameter(ne.ALIASED_LINE_WIDTH_RANGE),this.clearColor=new g(this),this.clearDepth=new v(this),this.clearStencil=new y(this),this.colorMask=new m(this),this.depthMask=new w(this),this.stencilMask=new _(this),this.stencilFunc=new E(this),this.stencilOp=new T(this),this.stencilTest=new P(this),this.depthRange=new F(this),this.depthTest=new D(this),this.depthFunc=new B(this),this.blend=new S(this),this.blendFunc=new I(this),this.blendColor=new b(this),this.program=new x(this),this.lineWidth=new U(this),this.activeTexture=new k(this),this.viewport=new M(this),this.bindFramebuffer=new R(this),this.bindRenderbuffer=new O(this),this.bindTexture=new z(this),this.bindVertexBuffer=new V(this),this.bindElementBuffer=new H(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new q(this),this.pixelStoreUnpack=new J(this),this.pixelStoreUnpackPremultiplyAlpha=new j(this),this.extTextureFilterAnisotropic=ne.getExtension("EXT_texture_filter_anisotropic")||ne.getExtension("MOZ_EXT_texture_filter_anisotropic")||ne.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=ne.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=ne.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&ne.getExtension("OES_texture_half_float_linear")}var ue,ce;return ue=oe,(ce=[{key:"createIndexBuffer",value:function(ne,he){return new c(this,ne,he)}},{key:"createVertexBuffer",value:function(ne,he,Y){return new h(this,ne,he,Y)}},{key:"createRenderbuffer",value:function(ne,he,Y){var Z=this.gl,G=Z.createRenderbuffer();return this.bindRenderbuffer.set(G),Z.renderbufferStorage(Z.RENDERBUFFER,ne,he,Y),this.bindRenderbuffer.set(null),G}},{key:"createFramebuffer",value:function(ne,he){return new u(this,ne,he)}},{key:"clear",value:function(ne){var he=ne.color,Y=ne.depth,Z=this.gl,G=0;he&&(G|=Z.COLOR_BUFFER_BIT,this.clearColor.set(he),this.colorMask.set([!0,!0,!0,!0])),Y!==void 0&&(G|=Z.DEPTH_BUFFER_BIT,this.clearDepth.set(Y),this.depthMask.set(!0)),Z.clear(G)}},{key:"setDepthMode",value:function(ne){ne.func!==this.gl.ALWAYS||ne.mask?(this.depthTest.set(!0),this.depthFunc.set(ne.func),this.depthMask.set(ne.mask),this.depthRange.set(ne.range)):this.depthTest.set(!1)}},{key:"setStencilMode",value:function(ne){ne.func!==this.gl.ALWAYS||ne.mask?(this.stencilTest.set(!0),this.stencilMask.set(ne.mask),this.stencilOp.set([ne.fail,ne.depthFail,ne.pass]),this.stencilFunc.set({func:ne.test.func,ref:ne.ref,mask:ne.test.mask})):this.stencilTest.set(!1)}},{key:"setColorMode",value:function(ne){f.deepEqual(ne.blendFunction,A.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(ne.blendFunction),this.blendColor.set(ne.blendColor)),this.colorMask.set(ne.mask)}}])&&l(ue.prototype,ce),Object.defineProperty(ue,"prototype",{writable:!1}),oe}();r.exports=re},6937:function(r){function s(l,c,h){return Object.defineProperty(l,"prototype",{writable:!1}),l}var a=s(function l(c,h,u){(function(A,f){if(!(A instanceof f))throw new TypeError("Cannot call a class as a function")})(this,l),this.func=c,this.mask=h,this.range=u});a.ReadOnly=!1,a.ReadWrite=!0,a.disabled=new a(519,a.ReadOnly,[0,1]),r.exports=a},5197:function(r,s,a){function l(f,d){for(var g=0;g<d.length;g++){var v=d[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(f,v.key,v)}}var c=a(2578),h=c.ColorAttachment,u=c.DepthAttachment,A=function(){function f(v,y,m){(function(E,T){if(!(E instanceof T))throw new TypeError("Cannot call a class as a function")})(this,f),this.context=v,this.width=y,this.height=m;var w=v.gl,_=this.framebuffer=w.createFramebuffer();this.colorAttachment=new h(v,_),this.depthAttachment=new u(v,_)}var d,g;return d=f,(g=[{key:"destroy",value:function(){var v=this.context.gl,y=this.colorAttachment.get();y&&v.deleteTexture(y);var m=this.depthAttachment.get();m&&v.deleteRenderbuffer(m),v.deleteFramebuffer(this.framebuffer)}}])&&l(d.prototype,g),Object.defineProperty(d,"prototype",{writable:!1}),f}();r.exports=A},7612:function(r,s,a){function l(u,A){for(var f=0;f<A.length;f++){var d=A[f];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(u,d.key,d)}}var c=a(8583),h=function(){function u(d,g,v){(function(m,w){if(!(m instanceof w))throw new TypeError("Cannot call a class as a function")})(this,u),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,g.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer}var A,f;return A=u,(f=[{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 g=this.context.gl;c(this.dynamicDraw),this.unbindVAO(),this.bind(),g.bufferSubData(g.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(A.prototype,f),Object.defineProperty(A,"prototype",{writable:!1}),u}();r.exports=h},2749:function(r){function s(c,h,u){return Object.defineProperty(c,"prototype",{writable:!1}),c}var a=7680,l=s(function c(h,u,A,f,d,g){(function(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")})(this,c),this.test=h,this.ref=u,this.mask=A,this.fail=f,this.depthFail=d,this.pass=g});l.disabled=new l({func:519,mask:0},0,0,a,a,a),r.exports=l},2578:function(r,s,a){function l(Z){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(Z)}function c(Z,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function");Z.prototype=Object.create(G&&G.prototype,{constructor:{value:Z,writable:!0,configurable:!0}}),Object.defineProperty(Z,"prototype",{writable:!1}),G&&h(Z,G)}function h(Z,G){return h=Object.setPrototypeOf||function($,X){return $.__proto__=X,$},h(Z,G)}function u(Z){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 $,X=f(Z);if(G){var K=f(this).constructor;$=Reflect.construct(X,arguments,K)}else $=X.apply(this,arguments);return A(this,$)}}function A(Z,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($){if($===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return $}(Z)}function f(Z){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(G){return G.__proto__||Object.getPrototypeOf(G)},f(Z)}function d(Z,G){if(!(Z instanceof G))throw new TypeError("Cannot call a class as a function")}function g(Z,G){for(var $=0;$<G.length;$++){var X=G[$];X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X&&(X.writable=!0),Object.defineProperty(Z,X.key,X)}}function v(Z,G,$){return G&&g(Z.prototype,G),Object.defineProperty(Z,"prototype",{writable:!1}),Z}var y=a(6016),m=a(8316),w=function(){function Z(G){d(this,Z),this.context=G,this.current=y.transparent}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.current;G.r===$.r&&G.g===$.g&&G.b===$.b&&G.a===$.a||(this.context.gl.clearColor(G.r,G.g,G.b,G.a),this.current=G)}}]),Z}(),_=function(){function Z(G){d(this,Z),this.context=G,this.current=1}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.clearDepth(G),this.current=G)}}]),Z}(),E=function(){function Z(G){d(this,Z),this.context=G,this.current=0}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.clearStencil(G),this.current=G)}}]),Z}(),T=function(){function Z(G){d(this,Z),this.context=G,this.current=[!0,!0,!0,!0]}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.current;G[0]===$[0]&&G[1]===$[1]&&G[2]===$[2]&&G[3]===$[3]||(this.context.gl.colorMask(G[0],G[1],G[2],G[3]),this.current=G)}}]),Z}(),P=function(){function Z(G){d(this,Z),this.context=G,this.current=!0}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.depthMask(G),this.current=G)}}]),Z}(),F=function(){function Z(G){d(this,Z),this.context=G,this.current=255}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.stencilMask(G),this.current=G)}}]),Z}(),D=function(){function Z(G){d(this,Z),this.context=G,this.current={func:G.gl.ALWAYS,ref:0,mask:255}}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.current;G.func===$.func&&G.ref===$.ref&&G.mask===$.mask||(this.context.gl.stencilFunc(G.func,G.ref,G.mask),this.current=G)}}]),Z}(),B=function(){function Z(G){d(this,Z),this.context=G;var $=this.context.gl;this.current=[$.KEEP,$.KEEP,$.KEEP]}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.current;G[0]===$[0]&&G[1]===$[1]&&G[2]===$[2]||(this.context.gl.stencilOp(G[0],G[1],G[2]),this.current=G)}}]),Z}(),S=function(){function Z(G){d(this,Z),this.context=G,this.current=!1}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var $=this.context.gl;G?$.enable($.STENCIL_TEST):$.disable($.STENCIL_TEST),this.current=G}}}]),Z}(),I=function(){function Z(G){d(this,Z),this.context=G,this.current=[0,1]}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.current;G[0]===$[0]&&G[1]===$[1]||(this.context.gl.depthRange(G[0],G[1]),this.current=G)}}]),Z}(),b=function(){function Z(G){d(this,Z),this.context=G,this.current=!1}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var $=this.context.gl;G?$.enable($.DEPTH_TEST):$.disable($.DEPTH_TEST),this.current=G}}}]),Z}(),x=function(){function Z(G){d(this,Z),this.context=G,this.current=G.gl.LESS}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.depthFunc(G),this.current=G)}}]),Z}(),U=function(){function Z(G){d(this,Z),this.context=G,this.current=!1}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var $=this.context.gl;G?$.enable($.BLEND):$.disable($.BLEND),this.current=G}}}]),Z}(),k=function(){function Z(G){d(this,Z),this.context=G;var $=this.context.gl;this.current=[$.ONE,$.ZERO]}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.current;G[0]===$[0]&&G[1]===$[1]||(this.context.gl.blendFunc(G[0],G[1]),this.current=G)}}]),Z}(),M=function(){function Z(G){d(this,Z),this.context=G,this.current=y.transparent}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.current;G.r===$.r&&G.g===$.g&&G.b===$.b&&G.a===$.a||(this.context.gl.blendColor(G.r,G.g,G.b,G.a),this.current=G)}}]),Z}(),R=function(){function Z(G){d(this,Z),this.context=G,this.current=null}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.useProgram(G),this.current=G)}}]),Z}(),O=function(){function Z(G){d(this,Z),this.context=G,this.current=1}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.context.lineWidthRange,X=m.clamp(G,$[0],$[1]);this.current!==X&&(this.context.gl.lineWidth(X),this.current=G)}}]),Z}(),z=function(){function Z(G){d(this,Z),this.context=G,this.current=G.gl.TEXTURE0}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.activeTexture(G),this.current=G)}}]),Z}(),V=function(){function Z(G){d(this,Z),this.context=G;var $=this.context.gl;this.current=[0,0,$.drawingBufferWidth,$.drawingBufferHeight]}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.current;G[0]===$[0]&&G[1]===$[1]&&G[2]===$[2]&&G[3]===$[3]||(this.context.gl.viewport(G[0],G[1],G[2],G[3]),this.current=G)}}]),Z}(),H=function(){function Z(G){d(this,Z),this.context=G,this.current=null}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var $=this.context.gl;$.bindFramebuffer($.FRAMEBUFFER,G),this.current=G}}}]),Z}(),q=function(){function Z(G){d(this,Z),this.context=G,this.current=null}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var $=this.context.gl;$.bindRenderbuffer($.RENDERBUFFER,G),this.current=G}}}]),Z}(),J=function(){function Z(G){d(this,Z),this.context=G,this.current=null}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var $=this.context.gl;$.bindTexture($.TEXTURE_2D,G),this.current=G}}}]),Z}(),j=function(){function Z(G){d(this,Z),this.context=G,this.current=null}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var $=this.context.gl;$.bindBuffer($.ARRAY_BUFFER,G),this.current=G}}}]),Z}(),re=function(){function Z(G){d(this,Z),this.context=G,this.current=null}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var $=this.context.gl;$.bindBuffer($.ELEMENT_ARRAY_BUFFER,G),this.current=G}}]),Z}(),oe=function(){function Z(G){d(this,Z),this.context=G,this.current=null}return v(Z,[{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)}}]),Z}(),ue=function(){function Z(G){d(this,Z),this.context=G,this.current=4}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var $=this.context.gl;$.pixelStorei($.UNPACK_ALIGNMENT,G),this.current=G}}}]),Z}(),ce=function(){function Z(G){d(this,Z),this.context=G,this.current=!1}return v(Z,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var $=this.context.gl;$.pixelStorei($.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G),this.current=G}}}]),Z}(),ne=function(){function Z(G,$){d(this,Z),this.context=G,this.current=null,this.parent=$}return v(Z,[{key:"get",value:function(){return this.current}}]),Z}(),he=function(Z){c($,Z);var G=u($);function $(X,K){var W;return d(this,$),(W=G.call(this,X,K)).dirty=!1,W}return v($,[{key:"set",value:function(X){if(this.dirty||this.current!==X){var K=this.context.gl;this.context.bindFramebuffer.set(this.parent),K.framebufferTexture2D(K.FRAMEBUFFER,K.COLOR_ATTACHMENT0,K.TEXTURE_2D,X,0),this.current=X,this.dirty=!1}}},{key:"setDirty",value:function(){this.dirty=!0}}]),$}(ne),Y=function(Z){c($,Z);var G=u($);function $(){return d(this,$),G.apply(this,arguments)}return v($,[{key:"set",value:function(X){if(this.current!==X){var K=this.context.gl;this.context.bindFramebuffer.set(this.parent),K.framebufferRenderbuffer(K.FRAMEBUFFER,K.DEPTH_ATTACHMENT,K.RENDERBUFFER,X),this.current=X}}}]),$}(ne);r.exports={ClearColor:w,ClearDepth:_,ClearStencil:E,ColorMask:T,DepthMask:P,StencilMask:F,StencilFunc:D,StencilOp:B,StencilTest:S,DepthRange:I,DepthTest:b,DepthFunc:x,Blend:U,BlendFunc:k,BlendColor:M,Program:R,LineWidth:O,ActiveTextureUnit:z,Viewport:V,BindFramebuffer:H,BindRenderbuffer:q,BindTexture:J,BindVertexBuffer:j,BindElementBuffer:re,BindVertexArrayOES:oe,PixelStoreUnpack:ue,PixelStoreUnpackPremultiplyAlpha:ce,ColorAttachment:he,DepthAttachment:Y}},3292:function(r,s,a){function l(A,f){for(var d=0;d<f.length;d++){var g=f[d];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(A,g.key,g)}}var c=a(8583),h={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},u=function(){function A(g,v,y,m){(function(_,E){if(!(_ instanceof E))throw new TypeError("Cannot call a class as a function")})(this,A),this.length=v.length,this.attributes=y,this.itemSize=v.bytesPerElement,this.dynamicDraw=m,this.context=g;var w=g.gl;this.buffer=w.createBuffer(),g.bindVertexBuffer.set(this.buffer),w.bufferData(w.ARRAY_BUFFER,v.arrayBuffer,this.dynamicDraw?w.DYNAMIC_DRAW:w.STATIC_DRAW),this.dynamicDraw||delete v.arrayBuffer}var f,d;return f=A,(d=[{key:"bind",value:function(){this.context.bindVertexBuffer.set(this.buffer)}},{key:"updateData",value:function(g){c(g.length===this.length);var v=this.context.gl;this.bind(),v.bufferSubData(v.ARRAY_BUFFER,0,g.arrayBuffer)}},{key:"enableAttributes",value:function(g,v){for(var y=0;y<this.attributes.length;y++){var m=this.attributes[y],w=v.attributes[m.name];w!==void 0&&g.enableVertexAttribArray(w)}}},{key:"setVertexAttribPointers",value:function(g,v,y){for(var m=0;m<this.attributes.length;m++){var w=this.attributes[m],_=v.attributes[w.name];_!==void 0&&g.vertexAttribPointer(_,w.components,g[h[w.type]],!1,this.itemSize,w.offset+this.itemSize*(y||0))}}},{key:"destroy",value:function(){var g=this.context.gl;this.buffer&&(g.deleteBuffer(this.buffer),delete this.buffer)}}])&&l(f.prototype,d),Object.defineProperty(f,"prototype",{writable:!1}),A}();r.exports=u},5579:function(r,s,a){var l=a(2235),c=a(3103),h=a(4147).i8,u=a(2062),A=a(3340),f=a(3600),d=a(5060),g=a(7316),v=a(8841),y=a(3316),m=a(650),w=a(56),_=a(9069),E=a(4899),T=a(5550),P=a(1495),F=a(6752),D=a(4781),B=a(1282);r.exports={version:h,supported:l,workerCount:Math.max(Math.floor(c.hardwareConcurrency/2),1),setRTLTextPlugin:D.setRTLTextPlugin,Map:u,NavigationControl:A,GeolocateControl:f,AttributionControl:d,ScaleControl:g,FullscreenControl:v,Popup:y,Marker:m,Style:w,LngLat:_,LngLatBounds:E,Point:T,Evented:P,config:F,BasicRenderer:B,get accessToken(){return F.ACCESS_TOKEN},set accessToken(S){F.ACCESS_TOKEN=S}}},5155:function(r,s,a){function l(A,f){(f==null||f>A.length)&&(f=A.length);for(var d=0,g=new Array(f);d<f;d++)g[d]=A[d];return g}var c=a(7650),h=a(2749),u=a(6937);r.exports=function(A,f,d){var g=d.paint.get("background-color"),v=d.paint.get("background-opacity");if(v!==0){var y,m=A.context,w=m.gl,_=A.transform,E=_.tileSize,T=d.paint.get("background-pattern"),P=T||g.a!==1||v!==1?"translucent":"opaque";if(A.renderPass===P){if(m.setStencilMode(h.disabled),m.setDepthMode(A.depthModeForSublayer(0,P==="opaque"?u.ReadWrite:u.ReadOnly)),m.setColorMode(A.colorModeForRenderPass()),T){if(c.isPatternMissing(T,A))return;y=A.useProgram("backgroundPattern"),c.prepare(T,A,y),A.tileExtentPatternVAO.bind(m,y,A.tileExtentBuffer,[])}else y=A.useProgram("background"),w.uniform4fv(y.uniforms.u_color,[g.r,g.g,g.b,g.a]),A.tileExtentVAO.bind(m,y,A.tileExtentBuffer,[]);w.uniform1f(y.uniforms.u_opacity,v);var F,D=function(S,I){var b=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!b){if(Array.isArray(S)||(b=function(O,z){if(O){if(typeof O=="string")return l(O,z);var V=Object.prototype.toString.call(O).slice(8,-1);return V==="Object"&&O.constructor&&(V=O.constructor.name),V==="Map"||V==="Set"?Array.from(O):V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V)?l(O,z):void 0}}(S))||I){b&&(S=b);var x=0,U=function(){};return{s:U,n:function(){return x>=S.length?{done:!0}:{done:!1,value:S[x++]}},e:function(O){throw O},f:U}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
@@ -2755,7 +2755,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
2755
2755
|
//material.diffuse = vec3(0.0, 0.0, 1.0);
|
|
2756
2756
|
//material.diffuse.g = -fsInput.attributes.positionEC.z / 1.0e4;
|
|
2757
2757
|
}
|
|
2758
|
-
`});this._customShader=o}update(){alert("暂未实现!")}get customShader(){return this._customShader}}const IU=(t,n)=>{if(!t)return;const e=6378137*Math.PI/180,[i,o,r]=t,a=1/(e*Math.cos(o*Math.PI/180));return[n[0]/a,n[1]/a,n[2]]},kU=(t,n)=>{const e=6378137*Math.PI/180,[i,o,r]=t,s=n,l=1/(e*Math.cos(o*Math.PI/180));return[i+l*s[0],o+l*s[1],r+s[2]]};function $A(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function FU(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,$A(t.rgba)];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,$A(t.rgba)];if(i)return[`\${${n}} >= ${t.minValue}`,$A(t.rgba)];if(o)return[`\${${n}} <= ${t.maxValue}`,$A(t.rgba)];if(!e&&!i&&!o)throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在!`)}catch(r){throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在! ${r}`)}}function BU(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,t.visable.toString()];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,t.visable.toString()];if(i)return[`\${${n}} >= ${t.minValue}`,t.visable.toString()];if(o)return[`\${${n}} <= ${t.maxValue}`,t.visable.toString()];if(!e&&!i&&!o)throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在!`)}catch(r){throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在! ${r}`)}}const uu=class uu extends Bn{constructor(e,i){super(e,i);L(this,"_czm3DTiles");L(this,"_clippingPlanes");L(this,"_flattenedPlane");L(this,"_styleColor",this.dv(p.react(void 0)));L(this,"_highlightStyleColor",this.dv(p.react(void 0)));L(this,"_styleVisable",this.dv(p.react(void 0)));this._flattenedPlane=this.dv(new Wr(i,e.id)),this._czm3DTiles=this.dv(new $e(i,this,e.id)),this._clippingPlanes=this.dv(new as(i,e.id));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._czm3DTiles;this.ad(e.setMaterialEvent.don(l=>{r.setMaterial(l)}));{const l=()=>{r.origin&&(e.offset||(e.offset=[0,0,0]),r.position=kU(r.origin,e.offset))};l(),this.d(e.offsetChanged.don(l)),this.d(r.originChanged.don(l))}{const l=()=>{if(!r.position)return;const h=r.position.map((u,A)=>{if(r.origin)return u-r.origin[A]});r.origin&&(e.offset=IU(r.origin,h))};l();const c=this.ad(p.createNextAnimateFrameEvent(r.positionChanged));this.d(c.don(l))}const s=this._clippingPlanes,a=this._flattenedPlane;this.d(e.setFeatureColorEvent.don((l,c)=>{const u=c.reverse().map(A=>FU(A,l));this.setFeatureColor(u)})),this.d(e.setFeatureVisableEvent.don((l,c)=>{const u=c.reverse().map(A=>BU(A,l));this.setFeatureVisable(u)})),this.d(e.resetFeatureStyleEvent.don(()=>{this.resetFeatureStyle()})),this.d(e.highlightFeatureEvent.don((l,c)=>{this.highlightFeature(l,c)})),this.d(e.highlightFeatureAndFlyToEvent.don((l,c,h,u)=>{h&&this.highlightFeature(l,h);const A=new C.Cartesian3(c[0],c[1],c[2]),f=new C.BoundingSphere(A,c[3]);o.camera.flyToBoundingSphere(f,{duration:u??1})})),this.d(r.czmTilesetReadyEvent.don(l=>{const c=h=>{if(l.style=void 0,h.length===0)return;const u=[...h],A=[],f=[];let d;u.forEach(g=>{Array.isArray(g.condition)?(A.push({condition:g.condition,color:g.color??[1,1,1,1]}),f.push({condition:g.condition,show:g.show??!0})):(A.push({condition:[g.condition],color:g.color??[1,1,1,1]}),f.push({condition:[g.condition],show:g.show??!0}))});{const g=(y,m)=>{try{let w;return A.forEach(_=>{if(w===void 0){const E=xU(_,y);E.length>0&&!E.includes(!1)&&(w=bU(_.color,m))}}),w||C.Color.clone(C.Color.WHITE,m)}catch{return C.Color.clone(C.Color.WHITE,m)}},v=y=>{try{let m;return f.forEach(w=>{if(m===void 0){const _=SU(w,y);_.length>0&&!_.includes(!1)&&(m=w.show)}}),m!==void 0?m:!0}catch{return!0}};d=new C.Cesium3DTileStyle({color:{evaluateColor:function(y,m){return g(y,m)}},show:{evaluate:function(y){return v(y)}}})}l.style=d};this.d(e.setFeatureStyleEvent.don(h=>{c(h)})),this.d(e.resetFeatureStyleEvent.don(()=>{l.style=void 0}));{const h=this,u=[],A=l.tileLoad.addEventListener(function(d){try{const v=d.content.getFeature(0),m=v.getPropertyIds().map(E=>{const T=v.getProperty(E);return{key:E,type:typeof T}}),w=u.map(E=>E.key),_=m.filter(E=>!w.includes(E.key));u.push(..._)}catch{}});this.d(()=>{A()});const f=async()=>{try{u.length>0?e._featureTableResultEvent.emit(u):e._featureTableResultEvent.emit(void 0)}catch(d){console.warn(`CzmES3DTileset GetFeatureTable: ${d}`),e._featureTableResultEvent.emit(void 0)}};h.d(e.getFeatureTableEvent.don(()=>{f()}))}{const h=u=>{r.tileset.featureIdLabel=`featureId_${u}`};this.ad(e.featureIdLabelChanged.don(u=>{h(u)}))}})),this.d(r.czmTilesetReadyEvent.don((l,c)=>{e.supportEdit=r.supportEdit,e.tilesetReady.emit(l)})),r.absoluteClippingPlanes=!0,r.czmFlattenedPlaneId=this.flattenedPlane.id,e.flattenedPlaneId=this.flattenedPlane.id,r.clippingPlanesId=this.clippingPlanes.id,this.d(p.track([a,"enabled"],[e,"flattenedPlaneEnabled"])),this.d(p.track([s,"enabled"],[e,"clippingPlaneEnabled"])),this.d(p.track([s,"planeIds"],[e,"clippingPlaneIds"])),this.d(p.track([s,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(p.track([s,"edgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(p.track([s,"edgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(e.clippingPlaneIdChanged.don(()=>{r.clippingPlanesId=e.clippingPlaneId})),this.d(e.excavateIdChanged.don(()=>{r.clippingPolygonsId=e.excavateId}));{const l=()=>{typeof e.url=="string"?e.url=Q.ESSceneObject.context.getStrFromEnv(e.url):e.url&&(e.url.url=Q.ESSceneObject.context.getStrFromEnv(e.url.url)),r.url=e.url};l(),this.d(e.urlChanged.don(l))}this.d(p.track([r,"show"],[e,"show"])),this.d(p.track([r,"colorBlendMode"],[e,"colorBlendMode"])),this.d(p.track([r,"cacheBytes"],[e,"cacheBytes"])),this.d(p.track([r,"maximumCacheOverflowBytes"],[e,"cacheBytes"])),this.d(p.track([r,"allowPicking"],[e,"allowPicking"])),this.d(p.bind([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(p.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"])),this.d(p.track([r,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(p.track([r,"maximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(p.track([r,"classificationType"],[e,"czmClassificationType"])),this.d(p.track([r,"styleJson"],[e,"czmStyleJson"])),this.d(p.bind([r,"rotation"],[e,"rotation"])),this.d(p.track([r,"backFaceCulling"],[e,"czmBackFaceCulling"])),this.d(p.track([r,"debugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(p.track([r,"debugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(p.track([r,"skipLevelOfDetail"],[e,"czmSkipLevelOfDetail"])),this.ad(p.bind([r,"splitDirection"],[e,"splitDirection"]));{const l=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};l(e.czmAtmosphereScatteringIntensity),l(e.czmLuminanceAtZenith),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>l(c))),this.ad(e.czmLuminanceAtZenithChanged.don(c=>l(c)))}{const l=()=>{var c,h;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=e.czmLuminanceAtZenith=(h=e.czmEnvironmentMapManager)==null?void 0:h.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const c=e.materialMode??Q.ES3DTileset.defaults.materialMode;J_=e.materialParams.baseColor??[1,1,1],c==="normal"?r.customShaderInstanceClass=void 0:c==="technology"&&(r.customShaderInstanceClass=void 0,r.customShaderInstanceClass=TU)};this.d(e.materialModeChanged.don(c=>{l()})),this.d(e.materialParamsChanged.don(()=>{l()})),l()}}get czm3DTiles(){return this._czm3DTiles}get clippingPlanes(){return this._clippingPlanes}get flattenedPlane(){return this._flattenedPlane}get styleColor(){return this._styleColor.value}set styleColor(e){this._styleColor.value=e}get highlightStyleColor(){return this._highlightStyleColor.value}set highlightStyleColor(e){this._highlightStyleColor.value=e}get styleVisable(){return this._styleVisable.value}set styleVisable(e){this._styleVisable.value=e}highlightFeature(e,i){const o=i??"rgba(255,0,0,1)",a=["${id} === "+(typeof e=="string"?`'${e}'`:e),o];let l={};const c=this.styleColor?[a,...this.styleColor]:[a];this.styleVisable?l={show:{conditions:[...this.styleVisable]},color:{conditions:[...c]}}:l={color:{conditions:[...c]}},console.log("style",l),this._czm3DTiles.styleJson=l,this.highlightStyleColor=[...a]}setFeatureColor(e){const i=this.highlightStyleColor,o=this.styleColor?[...e,...this.styleColor]:[...e];let r={};this.styleVisable?i?r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o,i]}}:r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o]}}:i?r={color:{conditions:[...o,i]}}:r={color:{conditions:[...o]}},console.log("style",r),this._czm3DTiles.styleJson=r,this.styleColor=[...o]}setFeatureVisable(e){let i={};const o=this.highlightStyleColor,r=this.styleVisable?[...e,...this.styleVisable]:[...e];this.styleColor?o?i={show:{conditions:[...r]},color:{conditions:[o,...this.styleColor]}}:i={show:{conditions:[...r]},color:{conditions:[...this.styleColor]}}:o?i={show:{conditions:[...r]},color:{conditions:[o]}}:i={show:{conditions:[...r]}},console.log("style",i),this._czm3DTiles.styleJson=i,this.styleVisable=[...r]}resetFeatureStyle(){this.czm3DTiles.styleJson=void 0,this.styleColor=void 0,this.highlightStyleColor=void 0,this.styleVisable=void 0}flyTo(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(uu,"type",uu.register("ESCesiumViewer",Q.ES3DTileset.type,uu));let ss=uu;const cu=class cu extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}const r=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_b.glb"),s=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_a.glb");this._czmModelPrimitive=this.dv(new Ht(this.czmViewer,this.sceneObject.id));const a=this._czmModelPrimitive;this.d(a.readyEvent.don(l=>{e.readyEvent.emit(l)})),this.ad(p.bind([a,"position"],[e,"position"])),this.ad(Dt([a,"rotation"],[e,"rotation"])),this.ad(p.track([a,"show"],[e,"show"])),a.activeAnimationsAnimateWhilePaused=!0,a.activeAnimationsJson=Q.ESAlarm.defaults.czmAnimations;{const l=this.dv(p.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?a.allowPicking=!0:a.allowPicking=!1};c(),this.d(l.don(c))}{const l=()=>{const c=e.mode;c==="circle"?a.url=r:(c==="cylinder"||c===void 0)&&(a.url=s)};l(),this.dispose(e.modeChanged.disposableOn(()=>{l()}))}{const l=()=>{const h=e.radius??Q.ESAlarm.defaults.radius;a.scale=[h*e.scale[0],h*e.scale[1],h*e.scale[2]]};l();const c=this.dv(p.createNextAnimateFrameEvent(e.radiusChanged,e.scaleChanged));this.dispose(c.disposableOn(()=>{l()}))}}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):(s&&dn(r,o,i,e,s,!0),!0)}};L(cu,"type",cu.register("ESCesiumViewer",Q.ESAlarm.type,cu));let gm=cu;const hu=class hu extends Ge{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new st(i,this.sceneObject.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"scale"],[e,"scale"])),r.indexTypedArray=new Uint16Array([0,1,2,0,2,3]),r.uniformMap={u_color:[0,.7,1,1]};{const a={scan:`
|
|
2758
|
+
`});this._customShader=o}update(){alert("暂未实现!")}get customShader(){return this._customShader}}class IU extends p.Destroyable{constructor(e){super();L(this,"strokeSilhouette",C.PostProcessStageLibrary.createEdgeDetectionStage());e.scene.postProcessStages.add(C.PostProcessStageLibrary.createSilhouetteStage([this.strokeSilhouette])),this.strokeSilhouette.uniforms.length=.01,this.strokeSilhouette.uniforms.color=C.Color.RED,this.strokeSilhouette.selected=[],this.ad(()=>{e.scene.postProcessStages.remove(this.strokeSilhouette)})}setStrokeLength(e){this.strokeSilhouette.uniforms.length=e??.01}setStrokeColor(e){this.strokeSilhouette.uniforms.color=C.Color.fromBytes(e[0]*255,e[1]*255,e[2]*255,e[3]*255)}setStrokeSelect(e,i=!1){if(e.length==0){this.strokeSilhouette.selected=[];return}if(i){this.strokeSilhouette.selected.push(...e);return}this.strokeSilhouette.selected=[...e]}}const kU=(t,n)=>{if(!t)return;const e=6378137*Math.PI/180,[i,o,r]=t,a=1/(e*Math.cos(o*Math.PI/180));return[n[0]/a,n[1]/a,n[2]]},FU=(t,n)=>{const e=6378137*Math.PI/180,[i,o,r]=t,s=n,l=1/(e*Math.cos(o*Math.PI/180));return[i+l*s[0],o+l*s[1],r+s[2]]};function $A(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function BU(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,$A(t.rgba)];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,$A(t.rgba)];if(i)return[`\${${n}} >= ${t.minValue}`,$A(t.rgba)];if(o)return[`\${${n}} <= ${t.maxValue}`,$A(t.rgba)];if(!e&&!i&&!o)throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在!`)}catch(r){throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在! ${r}`)}}function MU(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,t.visable.toString()];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,t.visable.toString()];if(i)return[`\${${n}} >= ${t.minValue}`,t.visable.toString()];if(o)return[`\${${n}} <= ${t.maxValue}`,t.visable.toString()];if(!e&&!i&&!o)throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在!`)}catch(r){throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在! ${r}`)}}const uu=class uu extends Bn{constructor(e,i){super(e,i);L(this,"_czm3DTiles");L(this,"_clippingPlanes");L(this,"_flattenedPlane");L(this,"_styleColor",this.dv(p.react(void 0)));L(this,"_highlightStyleColor",this.dv(p.react(void 0)));L(this,"_styleVisable",this.dv(p.react(void 0)));this._flattenedPlane=this.dv(new Wr(i,e.id)),this._czm3DTiles=this.dv(new $e(i,this,e.id)),this._clippingPlanes=this.dv(new as(i,e.id));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._czm3DTiles;this.ad(e.setMaterialEvent.don(l=>{r.setMaterial(l)}));{const l=()=>{r.origin&&(e.offset||(e.offset=[0,0,0]),r.position=FU(r.origin,e.offset))};l(),this.d(e.offsetChanged.don(l)),this.d(r.originChanged.don(l))}{const l=()=>{if(!r.position)return;const h=r.position.map((u,A)=>{if(r.origin)return u-r.origin[A]});r.origin&&(e.offset=kU(r.origin,h))};l();const c=this.ad(p.createNextAnimateFrameEvent(r.positionChanged));this.d(c.don(l))}const s=this._clippingPlanes,a=this._flattenedPlane;{this.d(e.setFeatureColorEvent.don((l,c)=>{const u=c.reverse().map(A=>BU(A,l));this.setFeatureColor(u)})),this.d(e.setFeatureVisableEvent.don((l,c)=>{const u=c.reverse().map(A=>MU(A,l));this.setFeatureVisable(u)})),this.d(e.resetFeatureStyleEvent.don(()=>{this.resetFeatureStyle()})),this.d(e.highlightFeatureEvent.don((l,c)=>{this.highlightFeature(l,c)})),this.d(e.highlightFeatureAndFlyToEvent.don((l,c,h,u)=>{h&&this.highlightFeature(l,h);const A=new C.Cartesian3(c[0],c[1],c[2]),f=new C.BoundingSphere(A,c[3]);o.camera.flyToBoundingSphere(f,{duration:u??1})}));{const l=this.ad(new IU(o));this.ad(e.strokeFeatureEvent.don((c,h)=>{h&&l.setStrokeColor(h),l.setStrokeSelect(c)}))}this.d(r.czmTilesetReadyEvent.don(l=>{const c=h=>{if(l.style=void 0,h.length===0)return;const u=[...h],A=[],f=[];let d;u.forEach(g=>{Array.isArray(g.condition)?(A.push({condition:g.condition,color:g.color??[1,1,1,1]}),f.push({condition:g.condition,show:g.show??!0})):(A.push({condition:[g.condition],color:g.color??[1,1,1,1]}),f.push({condition:[g.condition],show:g.show??!0}))});{const g=(y,m)=>{try{let w;return A.forEach(_=>{if(w===void 0){const E=xU(_,y);E.length>0&&!E.includes(!1)&&(w=bU(_.color,m))}}),w||C.Color.clone(C.Color.WHITE,m)}catch{return C.Color.clone(C.Color.WHITE,m)}},v=y=>{try{let m;return f.forEach(w=>{if(m===void 0){const _=SU(w,y);_.length>0&&!_.includes(!1)&&(m=w.show)}}),m!==void 0?m:!0}catch{return!0}};d=new C.Cesium3DTileStyle({color:{evaluateColor:function(y,m){return g(y,m)}},show:{evaluate:function(y){return v(y)}}})}l.style=d};this.d(e.setFeatureStyleEvent.don(h=>{c(h)})),this.d(e.resetFeatureStyleEvent.don(()=>{l.style=void 0}));{const h=this,u=[],A=l.tileLoad.addEventListener(function(d){try{const v=d.content.getFeature(0),m=v.getPropertyIds().map(E=>{const T=v.getProperty(E);return{key:E,type:typeof T}}),w=u.map(E=>E.key),_=m.filter(E=>!w.includes(E.key));u.push(..._)}catch{}});this.d(()=>{A()});const f=async()=>{try{u.length>0?e._featureTableResultEvent.emit(u):e._featureTableResultEvent.emit(void 0)}catch(d){console.warn(`CzmES3DTileset GetFeatureTable: ${d}`),e._featureTableResultEvent.emit(void 0)}};h.d(e.getFeatureTableEvent.don(()=>{f()}))}{const h=u=>{r.tileset.featureIdLabel=`featureId_${u}`};this.ad(e.featureIdLabelChanged.don(u=>{h(u)}))}}))}this.d(r.czmTilesetReadyEvent.don((l,c)=>{e.supportEdit=r.supportEdit,e.tilesetReady.emit(l)})),r.absoluteClippingPlanes=!0,r.czmFlattenedPlaneId=this.flattenedPlane.id,e.flattenedPlaneId=this.flattenedPlane.id,r.clippingPlanesId=this.clippingPlanes.id,this.d(p.track([a,"enabled"],[e,"flattenedPlaneEnabled"])),this.d(p.track([s,"enabled"],[e,"clippingPlaneEnabled"])),this.d(p.track([s,"planeIds"],[e,"clippingPlaneIds"])),this.d(p.track([s,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(p.track([s,"edgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(p.track([s,"edgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(e.clippingPlaneIdChanged.don(()=>{r.clippingPlanesId=e.clippingPlaneId})),this.d(e.excavateIdChanged.don(()=>{r.clippingPolygonsId=e.excavateId}));{const l=()=>{typeof e.url=="string"?e.url=Q.ESSceneObject.context.getStrFromEnv(e.url):e.url&&(e.url.url=Q.ESSceneObject.context.getStrFromEnv(e.url.url)),r.url=e.url};l(),this.d(e.urlChanged.don(l))}this.d(p.track([r,"show"],[e,"show"])),this.d(p.track([r,"colorBlendMode"],[e,"colorBlendMode"])),this.d(p.track([r,"cacheBytes"],[e,"cacheBytes"])),this.d(p.track([r,"maximumCacheOverflowBytes"],[e,"cacheBytes"])),this.d(p.track([r,"allowPicking"],[e,"allowPicking"])),this.d(p.bind([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(p.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"])),this.d(p.track([r,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(p.track([r,"maximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(p.track([r,"classificationType"],[e,"czmClassificationType"])),this.d(p.track([r,"styleJson"],[e,"czmStyleJson"])),this.d(p.bind([r,"rotation"],[e,"rotation"])),this.d(p.track([r,"backFaceCulling"],[e,"czmBackFaceCulling"])),this.d(p.track([r,"debugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(p.track([r,"debugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(p.track([r,"skipLevelOfDetail"],[e,"czmSkipLevelOfDetail"])),this.ad(p.bind([r,"splitDirection"],[e,"splitDirection"]));{const l=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};l(e.czmAtmosphereScatteringIntensity),l(e.czmLuminanceAtZenith),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>l(c))),this.ad(e.czmLuminanceAtZenithChanged.don(c=>l(c)))}{const l=()=>{var c,h;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=e.czmLuminanceAtZenith=(h=e.czmEnvironmentMapManager)==null?void 0:h.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const c=e.materialMode??Q.ES3DTileset.defaults.materialMode;J_=e.materialParams.baseColor??[1,1,1],c==="normal"?r.customShaderInstanceClass=void 0:c==="technology"&&(r.customShaderInstanceClass=void 0,r.customShaderInstanceClass=TU)};this.d(e.materialModeChanged.don(c=>{l()})),this.d(e.materialParamsChanged.don(()=>{l()})),l()}}get czm3DTiles(){return this._czm3DTiles}get clippingPlanes(){return this._clippingPlanes}get flattenedPlane(){return this._flattenedPlane}get styleColor(){return this._styleColor.value}set styleColor(e){this._styleColor.value=e}get highlightStyleColor(){return this._highlightStyleColor.value}set highlightStyleColor(e){this._highlightStyleColor.value=e}get styleVisable(){return this._styleVisable.value}set styleVisable(e){this._styleVisable.value=e}highlightFeature(e,i){const o=i??"rgba(255,0,0,1)",a=["${id} === "+(typeof e=="string"?`'${e}'`:e),o];let l={};const c=this.styleColor?[a,...this.styleColor]:[a];this.styleVisable?l={show:{conditions:[...this.styleVisable]},color:{conditions:[...c]}}:l={color:{conditions:[...c]}},console.log("style",l),this._czm3DTiles.styleJson=l,this.highlightStyleColor=[...a]}setFeatureColor(e){const i=this.highlightStyleColor,o=this.styleColor?[...e,...this.styleColor]:[...e];let r={};this.styleVisable?i?r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o,i]}}:r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o]}}:i?r={color:{conditions:[...o,i]}}:r={color:{conditions:[...o]}},console.log("style",r),this._czm3DTiles.styleJson=r,this.styleColor=[...o]}setFeatureVisable(e){let i={};const o=this.highlightStyleColor,r=this.styleVisable?[...e,...this.styleVisable]:[...e];this.styleColor?o?i={show:{conditions:[...r]},color:{conditions:[o,...this.styleColor]}}:i={show:{conditions:[...r]},color:{conditions:[...this.styleColor]}}:o?i={show:{conditions:[...r]},color:{conditions:[o]}}:i={show:{conditions:[...r]}},console.log("style",i),this._czm3DTiles.styleJson=i,this.styleVisable=[...r]}resetFeatureStyle(){this.czm3DTiles.styleJson=void 0,this.styleColor=void 0,this.highlightStyleColor=void 0,this.styleVisable=void 0}flyTo(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(uu,"type",uu.register("ESCesiumViewer",Q.ES3DTileset.type,uu));let ss=uu;const cu=class cu extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}const r=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_b.glb"),s=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_a.glb");this._czmModelPrimitive=this.dv(new Ht(this.czmViewer,this.sceneObject.id));const a=this._czmModelPrimitive;this.d(a.readyEvent.don(l=>{e.readyEvent.emit(l)})),this.ad(p.bind([a,"position"],[e,"position"])),this.ad(Dt([a,"rotation"],[e,"rotation"])),this.ad(p.track([a,"show"],[e,"show"])),a.activeAnimationsAnimateWhilePaused=!0,a.activeAnimationsJson=Q.ESAlarm.defaults.czmAnimations;{const l=this.dv(p.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?a.allowPicking=!0:a.allowPicking=!1};c(),this.d(l.don(c))}{const l=()=>{const c=e.mode;c==="circle"?a.url=r:(c==="cylinder"||c===void 0)&&(a.url=s)};l(),this.dispose(e.modeChanged.disposableOn(()=>{l()}))}{const l=()=>{const h=e.radius??Q.ESAlarm.defaults.radius;a.scale=[h*e.scale[0],h*e.scale[1],h*e.scale[2]]};l();const c=this.dv(p.createNextAnimateFrameEvent(e.radiusChanged,e.scaleChanged));this.dispose(c.disposableOn(()=>{l()}))}}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):(s&&dn(r,o,i,e,s,!0),!0)}};L(cu,"type",cu.register("ESCesiumViewer",Q.ESAlarm.type,cu));let gm=cu;const hu=class hu extends Ge{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new st(i,this.sceneObject.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"scale"],[e,"scale"])),r.indexTypedArray=new Uint16Array([0,1,2,0,2,3]),r.uniformMap={u_color:[0,.7,1,1]};{const a={scan:`
|
|
2759
2759
|
in vec2 v_st;
|
|
2760
2760
|
uniform vec4 u_color;
|
|
2761
2761
|
void main()
|
|
@@ -2782,12 +2782,12 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
2782
2782
|
alpha = smoothstep(0.0, 1.0, alpha);
|
|
2783
2783
|
alpha +=step(d,1.) * step(movingCircleD, d) * step(d, movingCircleD + .2) * smoothstep(movingCircleD, movingCircleD + .2, d) ;
|
|
2784
2784
|
out_FragColor = vec4(u_color.rgb, alpha);
|
|
2785
|
-
}`},l=()=>{r.fragmentShaderSource=a[e.mode]};l(),this.ad(e.modeChanged.don(l))}const s=()=>{const a=e.radius*2,l=e.radius*2;r.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[-a*.5,-l*.5,0],max:[a*.5,l*.5,0]}},r.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array([-.5*a,-.5*l,0,.5*a,-.5*l,0,.5*a,.5*l,0,-.5*a,.5*l,0])},normal:{componentsPerAttribute:3,typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([-1,-1,1,-1,1,1,-1,1])}}};s(),this.dispose(e.radiusChanged.don(()=>s()))}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:s}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(dn(r,o,i,e,s,!0),!0)}};L(hu,"type",hu.register("ESCesiumViewer",Q.ESApertureEffect.type,hu));let ym=hu;const
|
|
2785
|
+
}`},l=()=>{r.fragmentShaderSource=a[e.mode]};l(),this.ad(e.modeChanged.don(l))}const s=()=>{const a=e.radius*2,l=e.radius*2;r.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[-a*.5,-l*.5,0],max:[a*.5,l*.5,0]}},r.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array([-.5*a,-.5*l,0,.5*a,-.5*l,0,.5*a,.5*l,0,-.5*a,.5*l,0])},normal:{componentsPerAttribute:3,typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([-1,-1,1,-1,1,1,-1,1])}}};s(),this.dispose(e.radiusChanged.don(()=>s()))}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:s}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(dn(r,o,i,e,s,!0),!0)}};L(hu,"type",hu.register("ESCesiumViewer",Q.ESApertureEffect.type,hu));let ym=hu;const DU=t=>{const n=[];do{if(!t)break;const e=t.length;let i=0;for(let o=0;o<e;++o){const r=(o+1)%e,s=Q.geoDistance(t[o],t[r]),a=Math.abs(t[o][2]-t[r][2]),l=Math.sqrt(s*s+a*a);i+=l,n.push(i)}}while(!1);return n},j_=t=>{let n;return t?(t.length<3?n=0:n=Q.geoArea(t),n):0},eC=t=>{let n;return t?(t.length<3?n=void 0:n=Q.geoCenterOfMass(t),n):void 0};function RU(t,n,e){const i=[];for(const o of e)switch(o){case"SquareMeter":i.push(`面积:${t.toFixed(2)} m²`);break;case"SquareKilometer":i.push(`面积:${(t/1e6).toFixed(2)} km²`);break;case"MU":i.push(`面积:${(t*.0014999250037498124).toFixed(2)} 亩`);break;case"Hectare":i.push(`面积:${(t*1e-4).toFixed(2)} 公顷`);break;case"PerimeterMeter":i.push(`周长:${n.toFixed(2)} m`);break;case"PerimeterKilometer":i.push(`周长:${(n/1e3).toFixed(2)} km`);break}return i}class ls extends p.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.dv(new p.Event));L(this,"_flyToEvent",this.dv(new p.Event));L(this,"_area",this.dv(p.react(0)));L(this,"_centerOfMass",this.dv(p.reactArrayWithUndefined(void 0)));L(this,"_distances",this.dv(p.reactArray([])));L(this,"_geoPolyline");L(this,"_id",this.dv(p.react(p.createGuid())));i&&(this.id=i);{const o=()=>{this._distances.value=DU(this.positions),this._area.value=j_(this.positions),this._centerOfMass.value=eC(this.positions)};o();const r=this.dv(p.createNextAnimateFrameEvent(this.positionsChanged));this.dispose(r.disposableOn(o))}{const o=this._geoPolyline=this.dv(new Je(e,i));o.loop=!0,o.arcType="GEODESIC",this.dispose(p.bind([o,"color"],[this,"color"])),this.dispose(p.bind([o,"dashLength"],[this,"dashLength"])),this.dispose(p.bind([o,"dashPattern"],[this,"dashPattern"])),this.dispose(p.bind([o,"gapColor"],[this,"gapColor"])),this.dispose(p.bind([o,"hasArrow"],[this,"hasArrow"])),this.dispose(p.bind([o,"hasDash"],[this,"hasDash"])),this.dispose(p.bind([o,"positions"],[this,"positions"])),this.dispose(p.bind([o,"show"],[this,"show"])),this.dispose(p.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(p.bind([o,"width"],[this,"width"])),this.dispose(p.bind([o,"depthTest"],[this,"depthTest"])),this.dispose(p.bind([o,"ground"],[this,"strokeGround"]))}{const o=this.dv(new _i(e,i));o.outline=!1;const r=()=>{o.positions=this.positions};r(),this.dispose(this.positionsChanged.disposableOn(r));const s=()=>{const a=this.fillColor;o.color=[a[0],a[1],a[2],a[3]*.5]};s(),this.dispose(this.fillColorChanged.disposableOn(s)),this.dispose(p.track([o,"show"],[this,"show"])),this.dispose(p.track([o,"ground"],[this,"ground"])),this.dispose(p.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(p.bind([o,"depthTest"],[this,"depthTest"])),this.d(this.flyToEvent.don(a=>{o.flyTo(a)}))}{const o=this.dv(new wt(e,i)),r=this.dv(p.createNextAnimateFrameEvent(this.areaChanged,this.centerOfMassChanged,this.distancesChanged,this.unitsChanged)),s=()=>{if(this.distances.length===0){o.innerHTML="";return}const a=RU(this.area,this.distances[this.distances.length-1],this.units);o.innerHTML=bo([...a].join(`
|
|
2786
2786
|
`))};s(),this.dispose(r.disposableOn(s)),this.dispose(p.track([o,"show"],[this,"show"])),this.dispose(p.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(p.bind([o,"shadowDom"],[this,"shadowDom"])),this.dispose(p.bind([o,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(p.track([o,"position"],[this,"centerOfMass"])),this.ad(o.pickedEvent.don(a=>{Ui(a)===0&&this.pickedEvent.emit(a)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get area(){return this._area.value}get areaChanged(){return this._area.changed}get centerOfMass(){return this._centerOfMass.value}get centerOfMassChanged(){return this._centerOfMass.changed}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}get geoPolyline(){return this._geoPolyline}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(ls,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(void 0),width:2,color:p.reactArray([1,1,1,.5]),fillColor:p.reactArray([1,1,1,.5]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:void 0,depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!0,ground:!0,units:p.reactArray(["SquareKilometer","PerimeterKilometer"])})})(ls||(ls={})),p.extendClassProps(ls.prototype,ls.createDefaultProps);const Au=class Au extends Tn{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new ls(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}e.strokeGround=!1,e.fillGround=!1;const r=this._czmAreaMeasurement;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"units"],[e,"units"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.bind([r,"strokeGround"],[e,"strokeGround"])),this.d(p.bind([r,"ground"],[e,"fillGround"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.color=e.strokeColor;const c=e.strokeStyle;if(c.material==="hasDash"&&c.materialParams)try{const u=c.materialParams;Reflect.has(u,"gapColor")&&(r.gapColor=u.gapColor??[0,0,0,0]),Reflect.has(u,"dashLength")&&(r.dashLength=u.dashLength),Reflect.has(u,"dashPattern")&&(r.dashPattern=u.dashPattern)}catch(u){console.error(u)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0;const h=e.strokeMaterial??"normal";h==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):h==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1)};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}{const s=()=>{if(e.filled)r.fillColor=e.fillColor;else{r.fillColor=[1,1,1,0];return}};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Au,"type",Au.register("ESCesiumViewer",Q.ESAreaMeasurement.type,Au));let vm=Au;const fu=class fu extends Ge{constructor(e,i){super(e,i);L(this,"_czmBlastParticeSystem");if(this._czmBlastParticeSystem=this.dv(new hi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmBlastParticeSystem:r}=this;{r.updateCallback=`
|
|
2787
2787
|
function (particle, dt) {
|
|
2788
2788
|
particle.velocity = Cesium.Cartesian3.ZERO;
|
|
2789
2789
|
}
|
|
2790
|
-
`;const s={emitter:{type:"CircleEmitter",radius:.1},startColor:[1,0,0,1],endColor:[1,.5,0,.5],particleLife:1,emissionRate:2,lifetime:1,imageSize:[1,1],sizeInMeters:!0},a=Object.keys(s);for(const l of a)r[l]=s[l]}{const s=()=>{r.startScale=1*(e.scale[0]>0?e.scale[0]:1),r.endScale=10*(e.scale[0]>0?e.scale[0]:1)};s(),this.ad(e.scaleChanged.don(s))}this.d(p.track([r,"show"],[e,"show"])),this.d(p.bind([r,"position"],[e,"position"])),this.d(p.track([r,"translation"],[e,"translation"])),this.d(Dt([r,"rotation"],[e,"rotation"])),this.d(p.track([r,"image"],[e,"image"]))}get czmBlastParticeSystem(){return this._czmBlastParticeSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBlastParticeSystem:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,Dn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(fu,"type",fu.register("ESCesiumViewer",Q.ESBlastParticleSystem.type,fu));let wm=fu;function RU(t,n,e){const i=t,o=n,r=[[i[0],i[1],i[2]],[o[0],i[1],i[2]],[o[0],o[1],i[2]],[i[0],o[1],i[2]],[i[0],i[1],o[2]],[o[0],i[1],o[2]],[o[0],o[1],o[2]],[i[0],o[1],o[2]]],s=C.Math.toDegrees,a=r.map(c=>{const h=C.Matrix4.multiplyByPoint(e,C.Cartesian3.fromElements(...c),new C.Cartesian3),u=C.Cartographic.fromCartesian(h);return[s(u.longitude),s(u.latitude),u.height]});return[[a[0],a[1],a[2],a[3],a[0]],[a[4],a[5],a[6],a[7],a[4]],[a[0],a[4]],[a[1],a[5]],[a[2],a[6]],[a[3],a[7]]]}class us extends p.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(p.react(p.createGuid())));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_computedClippingPlanes",this.disposeVar(p.react(void 0)));L(this,"_polylines");i&&(this.id=i),this._polylines=this.disposeVar(new En(e,i)),this._polylines.arcType="NONE",this.ad(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Ye)||!e.actived)return;if(!this.position){console.warn("CzmBoxClippingPlanes warning: 没有位置,无法飞入!");return}const r=this.minSize,s=this.maxSize,a=[s[0]-r[0],s[1]-r[1],s[2]-r[2]],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);Be(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{e instanceof Ye&&(e.sceneGlobeClippingPlanesId=this.applyOnTerrain&&i||"")};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.applyOnTerrainChanged,this.computedClippingPlanesChanged));this.ad(r.disposableOn(o)),this.ad(()=>{e instanceof Ye&&e.sceneGlobeClippingPlanesId===i&&(e.sceneGlobeClippingPlanes=void 0)})}{const o=()=>{const s=this.minSize,a=this.maxSize,l=[a[0]-s[0],a[1]-s[1],a[2]-s[2]],c=this.reverse?-1:1,h=[...this.modelMatrix];let u=[];do{if(!this.position)break;const A=at({position:this.position,rotation:this.rotation});if(!A)break;const f=C.Matrix4.fromArray(this.modelMatrix),d=C.Matrix4.multiply(A,f,new C.Matrix4);C.Matrix4.toArray(d,h),u=RU(this.minSize,this.maxSize,d)}while(!1);this.polylines.positions=u,this._computedClippingPlanes.value={planes:[{normal:[-1*c,0,0],distance:(l[0]+s[0])*c},{normal:[1*c,0,0],distance:-s[0]*c},{normal:[0,-1*c,0],distance:(l[1]+s[1])*c},{normal:[0,1*c,0],distance:-s[1]*c},{normal:[0,0,-1*c],distance:(l[2]+s[2])*c},{normal:[0,0,1*c],distance:-s[2]*c}],enabled:this.enabled,modelMatrix:h,unionClippingRegions:!this.reverse,edgeColor:this.edgeColor,edgeWidth:this.edgeWidth}};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.reverseChanged,this.edgeColorChanged,this.edgeWidthChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}this.dispose(p.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(p.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(p.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}get polylines(){return this._polylines}}L(us,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,applyOnTerrain:!1,positionEditing:!1,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),modelMatrix:p.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,edgeColor:p.reactArray([1,1,1,1]),edgeWidth:2,minSize:p.reactArray([-100,-100,-100]),maxSize:p.reactArray([100,100,100])})})(us||(us={})),p.extendClassProps(us.prototype,us.createDefaultProps);let UU=class extends p.Destroyable{constructor(n,e){super(),this._czmESBoxClippingPlanes=n,this._eS3DTileset=e;const i=this._czmESBoxClippingPlanes.czmBoxClippingPlanes.id;this._eS3DTileset.clippingPlaneId=i,this.dispose(()=>{this._eS3DTileset.clippingPlaneId=""})}};const du=class du extends Ge{constructor(e,i){super(e,i);L(this,"_czmBoxClippingPlanes");L(this,"_tilesSceneObjectWithId");this._tilesSceneObjectWithId=this.disposeVar(new Q.ESSceneObjectWithId);const o=this.ad(p.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=Q.ESSceneObject.getSceneObject(e.targetID);o.value=a?a.getMainClass().id:o.value})),this._czmBoxClippingPlanes=this.ad(new us(i,e.id)),this.dispose(p.track([this._tilesSceneObjectWithId,"id"],o)),Q.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(p.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmBoxClippingPlanes.enabledChanged));this.disposeVar(new p.ObjResettingWithEvent(a,()=>{const{sceneObject:l}=this.tilesSceneObjectWithId;if(l&&l instanceof Q.ES3DTileset&&this.sceneObject.show)return new UU(this,l)}))}),!i.viewer){console.warn("viewer is undefined!");return}const{czmBoxClippingPlanes:s}=this;{const a=()=>{s.enabled=e.show,s.showHelper=e.show};a(),this.dispose(e.showChanged.don(a))}{const a=()=>{s.reverse=!e.reverse};a(),this.dispose(e.reverseChanged.don(a))}{const a=()=>{e.targetID?s.applyOnTerrain=!1:s.applyOnTerrain=!0};a(),this.dispose(e.targetIDChanged.don(a))}{const a=()=>{const[l,c,h]=e.size;s.minSize=[-.5*l,-.5*c,-.5*h],s.maxSize=[.5*l,.5*c,.5*h]};a(),this.dispose(e.sizeChanged.don(a))}this.dispose(p.bind([s,"position"],[e,"position"])),this.dispose(p.bind([s,"rotation"],[e,"rotation"])),this.dispose(p.track([s,"edgeColor"],[e,"edgeColor"])),this.dispose(p.track([s,"edgeWidth"],[e,"edgeWidth"]))}get czmBoxClippingPlanes(){return this._czmBoxClippingPlanes}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Rn(r,o,i,o.position,Math.max(...o.size),e,!0),!0):!1}};L(du,"type",du.register("ESCesiumViewer",Q.ESBoxClipping.type,du));let bm=du;const pu=class pu extends Ge{constructor(e,i){super(e,i);L(this,"_view");if(this._view=this.disposeVar(new pn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{view:r}=this;this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"thumbnail"],[e,"thumbnail"])),this.dispose(p.bind([r,"duration"],[e,"duration"])),r.show=!1,this.dispose(e.flyInEvent.disposableOn((s,a,l="default")=>{r.flyTo(e.duration??s??1)})),!r.position&&!r.rotation&&r.resetWithCurrentCamera(pn.ResetFlag.Position|pn.ResetFlag.Rotation|pn.ResetFlag.ViewDistance),this.dispose(e.resetWithCurrentCameraEvent.disposableOn(()=>{r.resetWithCurrentCamera(pn.ResetFlag.Position|pn.ResetFlag.Rotation|pn.ResetFlag.ViewDistance)})),this.dispose(e.captureEvent.disposableOn((s,a)=>{const{thumbnailWidth:l,thumbnailHeight:c}=Q.ESCameraView.defaults;r.capture(s??l,a??c)}))}get view(){return this._view}flyTo(e,i){const{sceneObject:o,czmViewer:r,view:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(pu,"type",pu.register("ESCesiumViewer",Q.ESCameraView.type,pu));let _m=pu;const mu=class mu extends Ge{constructor(e,i){super(e,i);L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmESCustomPrimitive=this.disposeVar(new st(i,e.id)),this._czmTexture=this.dv(new At(i,e.id));const r=this._czmESCustomPrimitive,s=this._czmTexture;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"position"],[e,"position"])),this.dispose(p.track([r,"scale"],[e,"scale"]));{const a=()=>{const c=e.far*Math.tan(Math.PI*(e.fov/360))*2,h=c/e.aspectRatio,u=e.far,A=e.near*Math.tan(Math.PI*(e.fov/360))*2,f=A/e.aspectRatio,d=e.near,g=[d,-A/2,-f/2],v=[d,-A/2,f/2],y=[d,A/2,f/2],m=[d,A/2,-f/2],w=[u,-c/2,-h/2],_=[u,-c/2,h/2],E=[u,c/2,h/2],T=[u,c/2,-h/2],P=[...g,...v,...y,...m,...w,..._,...E,...T],F=[0,4,5,0,5,1,1,5,6,1,6,2,2,6,7,2,7,3,3,7,4,3,4,0],D=[...F,...F.reverse()],B=[1,0],S=[1,1],I=[1,0],b=[1,1],x=[0,0],U=[0,1],k=[0,0],M=[0,1],R=[...B,...S,...I,...b,...x,...U,...k,...M];r.indexTypedArray=new Uint16Array(D),r.attributes={position:{typedArray:new Float32Array(P),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},s.uri=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/visible_img.png"),r.uniformMap={u_image:{type:"texture",id:s.id},u_color:[1,1,1,1]};const O=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!O)return;const{min:z,max:V}=O;r.setLocalAxisedBoundingBox(z,V)};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged,e.farChanged,e.nearChanged));this.dispose(l.disposableOn(()=>a()))}}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i),!0;{const s=Math.max(o.far,o.near)??Q.ESCameraVisibleRange.defaults.far;return o.position?(Rn(r,o,i,o.position,s,e),!0):!1}}};L(mu,"type",mu.register("ESCesiumViewer",Q.ESCameraVisibleRange.type,mu));let Cm=mu;const gu=class gu extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Ht(i,e.id));const r=this._czmModelPrimitive;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"scale"],[e,"scale"]));{const l=this.dv(p.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};c(),this.d(l.don(c))}const s=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/car/PoliceCar.glb"),a=()=>{switch(e.mode){case"policeCar":r.url=s;break;default:r.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>a())),a()}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(s&&dn(r,o,i,e,s,!0),!!s):!1}};L(gu,"type",gu.register("ESCesiumViewer",Q.ESCar.type,gu));let xm=gu;const Sm={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},yu=class yu extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_circleCustomPrimitive");L(this,"_cylinderCustomPrimitive");L(this,"_cylinderParticlesCustomPrimitive");this._circleCustomPrimitive=this.disposeVar(new st(e,i)),this._cylinderCustomPrimitive=this.disposeVar(new st(e,i)),this._cylinderParticlesCustomPrimitive=this.disposeVar(new st(e,i));const{circleCustomPrimitive:o}=this;w0(o,{width:120,height:120}),o.fragmentShaderSource=`
|
|
2790
|
+
`;const s={emitter:{type:"CircleEmitter",radius:.1},startColor:[1,0,0,1],endColor:[1,.5,0,.5],particleLife:1,emissionRate:2,lifetime:1,imageSize:[1,1],sizeInMeters:!0},a=Object.keys(s);for(const l of a)r[l]=s[l]}{const s=()=>{r.startScale=1*(e.scale[0]>0?e.scale[0]:1),r.endScale=10*(e.scale[0]>0?e.scale[0]:1)};s(),this.ad(e.scaleChanged.don(s))}this.d(p.track([r,"show"],[e,"show"])),this.d(p.bind([r,"position"],[e,"position"])),this.d(p.track([r,"translation"],[e,"translation"])),this.d(Dt([r,"rotation"],[e,"rotation"])),this.d(p.track([r,"image"],[e,"image"]))}get czmBlastParticeSystem(){return this._czmBlastParticeSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBlastParticeSystem:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,Dn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(fu,"type",fu.register("ESCesiumViewer",Q.ESBlastParticleSystem.type,fu));let wm=fu;function UU(t,n,e){const i=t,o=n,r=[[i[0],i[1],i[2]],[o[0],i[1],i[2]],[o[0],o[1],i[2]],[i[0],o[1],i[2]],[i[0],i[1],o[2]],[o[0],i[1],o[2]],[o[0],o[1],o[2]],[i[0],o[1],o[2]]],s=C.Math.toDegrees,a=r.map(c=>{const h=C.Matrix4.multiplyByPoint(e,C.Cartesian3.fromElements(...c),new C.Cartesian3),u=C.Cartographic.fromCartesian(h);return[s(u.longitude),s(u.latitude),u.height]});return[[a[0],a[1],a[2],a[3],a[0]],[a[4],a[5],a[6],a[7],a[4]],[a[0],a[4]],[a[1],a[5]],[a[2],a[6]],[a[3],a[7]]]}class us extends p.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(p.react(p.createGuid())));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_computedClippingPlanes",this.disposeVar(p.react(void 0)));L(this,"_polylines");i&&(this.id=i),this._polylines=this.disposeVar(new En(e,i)),this._polylines.arcType="NONE",this.ad(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Ye)||!e.actived)return;if(!this.position){console.warn("CzmBoxClippingPlanes warning: 没有位置,无法飞入!");return}const r=this.minSize,s=this.maxSize,a=[s[0]-r[0],s[1]-r[1],s[2]-r[2]],l=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]);Be(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{e instanceof Ye&&(e.sceneGlobeClippingPlanesId=this.applyOnTerrain&&i||"")};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.applyOnTerrainChanged,this.computedClippingPlanesChanged));this.ad(r.disposableOn(o)),this.ad(()=>{e instanceof Ye&&e.sceneGlobeClippingPlanesId===i&&(e.sceneGlobeClippingPlanes=void 0)})}{const o=()=>{const s=this.minSize,a=this.maxSize,l=[a[0]-s[0],a[1]-s[1],a[2]-s[2]],c=this.reverse?-1:1,h=[...this.modelMatrix];let u=[];do{if(!this.position)break;const A=at({position:this.position,rotation:this.rotation});if(!A)break;const f=C.Matrix4.fromArray(this.modelMatrix),d=C.Matrix4.multiply(A,f,new C.Matrix4);C.Matrix4.toArray(d,h),u=UU(this.minSize,this.maxSize,d)}while(!1);this.polylines.positions=u,this._computedClippingPlanes.value={planes:[{normal:[-1*c,0,0],distance:(l[0]+s[0])*c},{normal:[1*c,0,0],distance:-s[0]*c},{normal:[0,-1*c,0],distance:(l[1]+s[1])*c},{normal:[0,1*c,0],distance:-s[1]*c},{normal:[0,0,-1*c],distance:(l[2]+s[2])*c},{normal:[0,0,1*c],distance:-s[2]*c}],enabled:this.enabled,modelMatrix:h,unionClippingRegions:!this.reverse,edgeColor:this.edgeColor,edgeWidth:this.edgeWidth}};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.reverseChanged,this.edgeColorChanged,this.edgeWidthChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}this.dispose(p.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(p.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(p.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}get polylines(){return this._polylines}}L(us,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,applyOnTerrain:!1,positionEditing:!1,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),modelMatrix:p.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,edgeColor:p.reactArray([1,1,1,1]),edgeWidth:2,minSize:p.reactArray([-100,-100,-100]),maxSize:p.reactArray([100,100,100])})})(us||(us={})),p.extendClassProps(us.prototype,us.createDefaultProps);let OU=class extends p.Destroyable{constructor(n,e){super(),this._czmESBoxClippingPlanes=n,this._eS3DTileset=e;const i=this._czmESBoxClippingPlanes.czmBoxClippingPlanes.id;this._eS3DTileset.clippingPlaneId=i,this.dispose(()=>{this._eS3DTileset.clippingPlaneId=""})}};const du=class du extends Ge{constructor(e,i){super(e,i);L(this,"_czmBoxClippingPlanes");L(this,"_tilesSceneObjectWithId");this._tilesSceneObjectWithId=this.disposeVar(new Q.ESSceneObjectWithId);const o=this.ad(p.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=Q.ESSceneObject.getSceneObject(e.targetID);o.value=a?a.getMainClass().id:o.value})),this._czmBoxClippingPlanes=this.ad(new us(i,e.id)),this.dispose(p.track([this._tilesSceneObjectWithId,"id"],o)),Q.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(p.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmBoxClippingPlanes.enabledChanged));this.disposeVar(new p.ObjResettingWithEvent(a,()=>{const{sceneObject:l}=this.tilesSceneObjectWithId;if(l&&l instanceof Q.ES3DTileset&&this.sceneObject.show)return new OU(this,l)}))}),!i.viewer){console.warn("viewer is undefined!");return}const{czmBoxClippingPlanes:s}=this;{const a=()=>{s.enabled=e.show,s.showHelper=e.show};a(),this.dispose(e.showChanged.don(a))}{const a=()=>{s.reverse=!e.reverse};a(),this.dispose(e.reverseChanged.don(a))}{const a=()=>{e.targetID?s.applyOnTerrain=!1:s.applyOnTerrain=!0};a(),this.dispose(e.targetIDChanged.don(a))}{const a=()=>{const[l,c,h]=e.size;s.minSize=[-.5*l,-.5*c,-.5*h],s.maxSize=[.5*l,.5*c,.5*h]};a(),this.dispose(e.sizeChanged.don(a))}this.dispose(p.bind([s,"position"],[e,"position"])),this.dispose(p.bind([s,"rotation"],[e,"rotation"])),this.dispose(p.track([s,"edgeColor"],[e,"edgeColor"])),this.dispose(p.track([s,"edgeWidth"],[e,"edgeWidth"]))}get czmBoxClippingPlanes(){return this._czmBoxClippingPlanes}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Rn(r,o,i,o.position,Math.max(...o.size),e,!0),!0):!1}};L(du,"type",du.register("ESCesiumViewer",Q.ESBoxClipping.type,du));let bm=du;const pu=class pu extends Ge{constructor(e,i){super(e,i);L(this,"_view");if(this._view=this.disposeVar(new pn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{view:r}=this;this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"thumbnail"],[e,"thumbnail"])),this.dispose(p.bind([r,"duration"],[e,"duration"])),r.show=!1,this.dispose(e.flyInEvent.disposableOn((s,a,l="default")=>{r.flyTo(e.duration??s??1)})),!r.position&&!r.rotation&&r.resetWithCurrentCamera(pn.ResetFlag.Position|pn.ResetFlag.Rotation|pn.ResetFlag.ViewDistance),this.dispose(e.resetWithCurrentCameraEvent.disposableOn(()=>{r.resetWithCurrentCamera(pn.ResetFlag.Position|pn.ResetFlag.Rotation|pn.ResetFlag.ViewDistance)})),this.dispose(e.captureEvent.disposableOn((s,a)=>{const{thumbnailWidth:l,thumbnailHeight:c}=Q.ESCameraView.defaults;r.capture(s??l,a??c)}))}get view(){return this._view}flyTo(e,i){const{sceneObject:o,czmViewer:r,view:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(pu,"type",pu.register("ESCesiumViewer",Q.ESCameraView.type,pu));let _m=pu;const mu=class mu extends Ge{constructor(e,i){super(e,i);L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmESCustomPrimitive=this.disposeVar(new st(i,e.id)),this._czmTexture=this.dv(new At(i,e.id));const r=this._czmESCustomPrimitive,s=this._czmTexture;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"position"],[e,"position"])),this.dispose(p.track([r,"scale"],[e,"scale"]));{const a=()=>{const c=e.far*Math.tan(Math.PI*(e.fov/360))*2,h=c/e.aspectRatio,u=e.far,A=e.near*Math.tan(Math.PI*(e.fov/360))*2,f=A/e.aspectRatio,d=e.near,g=[d,-A/2,-f/2],v=[d,-A/2,f/2],y=[d,A/2,f/2],m=[d,A/2,-f/2],w=[u,-c/2,-h/2],_=[u,-c/2,h/2],E=[u,c/2,h/2],T=[u,c/2,-h/2],P=[...g,...v,...y,...m,...w,..._,...E,...T],F=[0,4,5,0,5,1,1,5,6,1,6,2,2,6,7,2,7,3,3,7,4,3,4,0],D=[...F,...F.reverse()],B=[1,0],S=[1,1],I=[1,0],b=[1,1],x=[0,0],U=[0,1],k=[0,0],M=[0,1],R=[...B,...S,...I,...b,...x,...U,...k,...M];r.indexTypedArray=new Uint16Array(D),r.attributes={position:{typedArray:new Float32Array(P),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},s.uri=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/visible_img.png"),r.uniformMap={u_image:{type:"texture",id:s.id},u_color:[1,1,1,1]};const O=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!O)return;const{min:z,max:V}=O;r.setLocalAxisedBoundingBox(z,V)};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged,e.farChanged,e.nearChanged));this.dispose(l.disposableOn(()=>a()))}}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i),!0;{const s=Math.max(o.far,o.near)??Q.ESCameraVisibleRange.defaults.far;return o.position?(Rn(r,o,i,o.position,s,e),!0):!1}}};L(mu,"type",mu.register("ESCesiumViewer",Q.ESCameraVisibleRange.type,mu));let Cm=mu;const gu=class gu extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Ht(i,e.id));const r=this._czmModelPrimitive;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"scale"],[e,"scale"]));{const l=this.dv(p.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};c(),this.d(l.don(c))}const s=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/car/PoliceCar.glb"),a=()=>{switch(e.mode){case"policeCar":r.url=s;break;default:r.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>a())),a()}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(s&&dn(r,o,i,e,s,!0),!!s):!1}};L(gu,"type",gu.register("ESCesiumViewer",Q.ESCar.type,gu));let xm=gu;const Sm={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},yu=class yu extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_circleCustomPrimitive");L(this,"_cylinderCustomPrimitive");L(this,"_cylinderParticlesCustomPrimitive");this._circleCustomPrimitive=this.disposeVar(new st(e,i)),this._cylinderCustomPrimitive=this.disposeVar(new st(e,i)),this._cylinderParticlesCustomPrimitive=this.disposeVar(new st(e,i));const{circleCustomPrimitive:o}=this;w0(o,{width:120,height:120}),o.fragmentShaderSource=`
|
|
2791
2791
|
in vec2 v_st;
|
|
2792
2792
|
uniform vec4 u_color;
|
|
2793
2793
|
void main()
|
|
@@ -2819,7 +2819,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
2819
2819
|
out_FragColor = imageColor * u_color;
|
|
2820
2820
|
out_FragColor.a *= smoothstep(1., 0.8, v_st.t);
|
|
2821
2821
|
}
|
|
2822
|
-
`,s.pass="TRANSLUCENT",s.renderState=Sm,s.allowPickingDepth=!1,this.dispose(p.track([o,"show"],[this,"show"])),this.dispose(p.track([r,"show"],[this,"show"])),this.dispose(p.track([s,"show"],[this,"show"])),this.dispose(p.track([o,"position"],[this,"position"])),this.dispose(p.track([r,"position"],[this,"position"])),this.dispose(p.track([s,"position"],[this,"position"])),this.dispose(p.track([o,"rotation"],[this,"rotation"])),this.dispose(p.track([r,"rotation"],[this,"rotation"])),this.dispose(p.track([s,"rotation"],[this,"rotation"])),this.dispose(p.track([o,"scale"],[this,"scale"])),this.dispose(p.track([r,"scale"],[this,"scale"])),this.dispose(p.track([s,"scale"],[this,"scale"]));{const a={type:"image",uri:yu.defaultParticlesImageUri},l=()=>{o.uniformMap={u_color:this.color??[1,1,0,2]},r.uniformMap={u_color:this.color??[1,1,0,2]},s.uniformMap={u_color:this.color??[1,1,0,2],u_image:a}};l(),this.dispose(this.colorChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(a=>{r.flyTo(a)})),this.dispose(p.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([s,"allowPicking"],[this,"allowPicking"]))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get circleCustomPrimitive(){return this._circleCustomPrimitive}get cylinderCustomPrimitive(){return this._cylinderCustomPrimitive}get cylinderParticlesCustomPrimitive(){return this._cylinderParticlesCustomPrimitive}};L(yu,"defaultParticlesImageUri","${earthsdk3-assets-script-dir}/assets/img/particles.png");let Vo=yu;(t=>{t.createDefaultProps=()=>({show:void 0,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),scale:p.reactArrayWithUndefined(void 0),color:p.reactArrayWithUndefined(void 0),allowPicking:void 0})})(Vo||(Vo={})),p.extendClassProps(Vo.prototype,Vo.createDefaultProps);const vu=class vu extends Ge{constructor(e,i){super(e,i);L(this,"_czmCityBasePoint");if(this._czmCityBasePoint=this.disposeVar(new Vo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCityBasePoint;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"scale"],[e,"scale"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"color"],[e,"color"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(Dt([r,"rotation"],[e,"rotation"]))}get czmCityBasePoint(){return this._czmCityBasePoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCityBasePoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s.cylinderCustomPrimitive,!0),!0):!1}};L(vu,"type",vu.register("ESCesiumViewer",Q.ESCityBasePoint.type,vu));let Em=vu;class Ho extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this.id=i);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(p.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.colorChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,this.classificationTypeChanged));this.disposeVar(new p.ObjResettingWithEvent(r,()=>{if(this.polygonHierarchy)return new OU(this,e)}));const s=new C.BoundingSphere;{const a=()=>{if(!this.polygonHierarchy)return;const l=Zt(this.polygonHierarchy.positions);if(l.length<3){s.radius=-1;return}C.BoundingSphere.fromPoints(l,s)};a(),this.polygonHierarchyChanged.disposableOn(a)}this.dispose(this.flyToEvent.disposableOn(a=>{if(e.actived&&s.radius>0){const l=Ue(s.center);l&&Be(o,l,s.radius*4,void 0,a)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(Ho,"defaults",{color:[1,1,1,.5]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,color:p.reactArrayWithUndefined(void 0),stRotation:void 0,polygonHierarchy:p.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0,classificationType:"BOTH"})})(Ho||(Ho={})),p.extendClassProps(Ho.prototype,Ho.createDefaultProps);class OU extends p.HasOwner{constructor(n,e){if(super(n),!e)throw new Error("!czmViewer");const i=this.owner;if(!i.polygonHierarchy)throw new Error("polygonHierarchy is required");const o=[],r=new C.GeometryInstance({geometry:new C.PolygonGeometry({vertexFormat:C.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ri(i.polygonHierarchy),stRotation:i.stRotation&&C.Math.toRadians(i.stRotation),arcType:i.arcType&&C.ArcType[i.arcType],height:i.height,extrudedHeight:i.extrudedHeight,perPositionHeight:i.perPositionHeight,closeTop:i.closeTop,closeBottom:i.closeBottom,ellipsoid:i.ellipsoid&&Ke(i.ellipsoid),granularity:i.granularity!==void 0?C.Math.toRadians(i.granularity):void 0}),attributes:{color:C.ColorGeometryInstanceAttribute.fromColor(new C.Color(...i.color??Ho.defaults.color)),show:new C.ShowGeometryInstanceAttribute(!0)},id:this});o.push(r);const s=new C.ClassificationPrimitive({geometryInstances:o,asynchronous:!1,allowPicking:i.allowPicking,compressVertices:!1,classificationType:Xt.classificationTypeMap[i.classificationType]});C.ClassificationPrimitive.prototype&&(s.ESSceneObjectID=n.id);{if(!e)throw new Error("!this.owner.czmViewer");const{viewer:a}=e;if(!a)throw new Error("!czmViewer.viewer");a.scene.primitives.add(s),this.dispose(()=>a.scene.primitives.remove(s))}{const a=()=>{s.show=i.show??!0};a(),this.dispose(i.showChanged.disposableOn(a))}}}class LU extends p.Destroyable{constructor(e,i){super();L(this,"_czmClassificationPolygonPrimitive");this._czmClassificationPolygonPrimitive=this.disposeVar(new Ho(i,e.id));const o=this._czmClassificationPolygonPrimitive;{const r=()=>{const a=e.show,l=e.fill;if(o.show=a&&l,e.positions&&e.positions.length>0?o.height=e.positions[0][2]:o.height=void 0,o.polygonHierarchy=o.show?{positions:e.positions||[]}:{positions:[]},o.color=e.color,e.depth===void 0)throw new Error("sceneObject.depth === undefined");o.extrudedHeight=(o.height??0)+e.depth,o.classificationType=e.classificationType};r();const s=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.classificationTypeChanged));this.dispose(s.disposableOn(r))}this.dispose(e.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(p.track([o,"allowPicking"],[e,"allowPicking"]))}}class cs extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_helperPolygon");L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this.id=i);{const o=this.disposeVar(new Br(e,i));this._helperPolygon=o,this.dispose(p.track([o,"show"],[this,"showHelper"],r=>r));{const r=()=>{o.show=this.showHelper};r(),this.dispose(this.showHelperChanged.disposableOn(r))}this.dispose(p.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([o,"outline"],[this,"outline"])),this.dispose(p.track([o,"outlineColor"],[this,"outlineColor"])),this.dispose(p.track([o,"outlineWidth"],[this,"outlineWidth"])),o.fill=!1,o.color=[0,0,0,0],this.dispose(p.track([o,"positions"],[this,"positions"])),this.dispose(p.track([o,"depth"],[this,"depth"])),this.dispose(p.track([o,"zIndex"],[this,"zIndex"]))}this.disposeVar(new p.ObjResettingWithEvent(this.depthChanged,()=>{if(!(this.depth===void 0||this.depth<0))return new LU(this,e)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get helperPolygon(){return this._helperPolygon}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(cs,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,showHelper:!1,allowPicking:!1,classificationType:"BOTH",outline:!0,outlineColor:p.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:p.reactArray([1,1,1,.5]),positions:p.reactPositions(void 0),depth:0,zIndex:0})})(cs||(cs={})),p.extendClassProps(cs.prototype,cs.createDefaultProps);const wu=class wu extends an{constructor(e,i){super(e,i);L(this,"_polygon");if(this._polygon=this.disposeVar(new cs(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._polygon;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"depth"],[e,"height"])),this.dispose(p.track([r,"showHelper"],[e,"stroked"])),this.dispose(p.track([r,"outline"],[e,"stroked"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(p.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"fill"],[e,"filled"])),this.dispose(p.track([r,"color"],[e,"fillColor"]))}get polygon(){return this._polygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,polygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,polygon:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(wu,"type",wu.register("ESCesiumViewer",Q.ESClassification.type,wu));let Pm=wu;const zU=[{id:"document",version:"1.0"},{id:"Vehicle",availability:"2012-08-04T16:00:00Z/2012-08-04T16:14:15.251Z",billboard:{eyeOffset:{cartesian:[0,0,0]},horizontalOrigin:"CENTER",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEISURBVEhLvVXBDYQwDOuojHKj8LhBbpTbpBCEkZsmIVTXq1RVQGrHiWlLmTTqPiZBlyLgy/KSZQ5JSHDQ/mCYCsC8106kDU0AdwRnvYZArWRcAl0dcYJq1hWCb3hBrumbDAVMwAC82WoRvgMnVMDBnB0nYZFTbE6BBvdUGqVqCbjBIk3PyFFR/NU7EKzru+qZsau3ryPwwCRLKYOzutZuCL6fUmWeJGzNzL/RxAMrUmASSCkkAayk2IxPlwhAAYGpsiHQjbLccfdOY5gKkCXAMi7SscAwbQpAnKyctWyUZ6z8ja3OGMepwD8asz+9FnSvbhU8uVOHFIwQsI3/p0CfhuqCSQuxLqsN6mu8SS+N42MAAAAASUVORK5CYII=",pixelOffset:{cartesian2:[0,0]},scale:.8333333333333334,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],verticalOrigin:"BOTTOM"},label:{fillColor:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}],font:"bold 10pt Segoe UI Semibold",horizontalOrigin:"LEFT",outlineColor:{rgba:[0,0,0,255]},pixelOffset:{cartesian2:[10,0]},scale:1,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],style:"FILL",text:"Vehicle",verticalOrigin:"CENTER"},path:{material:{solidColor:{color:{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}}},width:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",number:5}],show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}]},position:{interpolationAlgorithm:"LAGRANGE",interpolationDegree:1,epoch:"2012-08-04T16:00:00Z",cartesian:[0,-23797546637012e-7,-466533288013588e-8,362813368924173e-8,100,-237951008905552e-8,-466541964840452e-8,362818220006795e-8,200,-23795684769522e-7,-46655553441867e-7,362797083323261e-8,300,-237963893786855e-8,-466569163561896e-8,362775082085873e-8,400,-237970929834665e-8,-46658279679646e-7,362753080187124e-8,500,-237983728064915e-8,-46658477494347e-7,362742212874017e-8,600,-237962498289073e-8,-466590750853722e-8,36274841191848e-7,700,-237938612743523e-8,-466602954174431e-8,362748383297459e-8,800,-237914726777171e-8,-466615156669944e-8,36274835403492e-7,900,-237890840390057e-8,-466627358340244e-8,362748324130864e-8,1e3]}}],QU=`第一个packet代表了cesium场景(cesium时间轴的范围,当前时刻,倍速等信息)之外,其他的packet都可以理解为描述某一时间范围内的entity的行为。
|
|
2822
|
+
`,s.pass="TRANSLUCENT",s.renderState=Sm,s.allowPickingDepth=!1,this.dispose(p.track([o,"show"],[this,"show"])),this.dispose(p.track([r,"show"],[this,"show"])),this.dispose(p.track([s,"show"],[this,"show"])),this.dispose(p.track([o,"position"],[this,"position"])),this.dispose(p.track([r,"position"],[this,"position"])),this.dispose(p.track([s,"position"],[this,"position"])),this.dispose(p.track([o,"rotation"],[this,"rotation"])),this.dispose(p.track([r,"rotation"],[this,"rotation"])),this.dispose(p.track([s,"rotation"],[this,"rotation"])),this.dispose(p.track([o,"scale"],[this,"scale"])),this.dispose(p.track([r,"scale"],[this,"scale"])),this.dispose(p.track([s,"scale"],[this,"scale"]));{const a={type:"image",uri:yu.defaultParticlesImageUri},l=()=>{o.uniformMap={u_color:this.color??[1,1,0,2]},r.uniformMap={u_color:this.color??[1,1,0,2]},s.uniformMap={u_color:this.color??[1,1,0,2],u_image:a}};l(),this.dispose(this.colorChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(a=>{r.flyTo(a)})),this.dispose(p.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([s,"allowPicking"],[this,"allowPicking"]))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get circleCustomPrimitive(){return this._circleCustomPrimitive}get cylinderCustomPrimitive(){return this._cylinderCustomPrimitive}get cylinderParticlesCustomPrimitive(){return this._cylinderParticlesCustomPrimitive}};L(yu,"defaultParticlesImageUri","${earthsdk3-assets-script-dir}/assets/img/particles.png");let Vo=yu;(t=>{t.createDefaultProps=()=>({show:void 0,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),scale:p.reactArrayWithUndefined(void 0),color:p.reactArrayWithUndefined(void 0),allowPicking:void 0})})(Vo||(Vo={})),p.extendClassProps(Vo.prototype,Vo.createDefaultProps);const vu=class vu extends Ge{constructor(e,i){super(e,i);L(this,"_czmCityBasePoint");if(this._czmCityBasePoint=this.disposeVar(new Vo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCityBasePoint;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"scale"],[e,"scale"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"color"],[e,"color"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(Dt([r,"rotation"],[e,"rotation"]))}get czmCityBasePoint(){return this._czmCityBasePoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCityBasePoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s.cylinderCustomPrimitive,!0),!0):!1}};L(vu,"type",vu.register("ESCesiumViewer",Q.ESCityBasePoint.type,vu));let Em=vu;class Ho extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this.id=i);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(p.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.colorChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,this.classificationTypeChanged));this.disposeVar(new p.ObjResettingWithEvent(r,()=>{if(this.polygonHierarchy)return new LU(this,e)}));const s=new C.BoundingSphere;{const a=()=>{if(!this.polygonHierarchy)return;const l=Zt(this.polygonHierarchy.positions);if(l.length<3){s.radius=-1;return}C.BoundingSphere.fromPoints(l,s)};a(),this.polygonHierarchyChanged.disposableOn(a)}this.dispose(this.flyToEvent.disposableOn(a=>{if(e.actived&&s.radius>0){const l=Ue(s.center);l&&Be(o,l,s.radius*4,void 0,a)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(Ho,"defaults",{color:[1,1,1,.5]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,color:p.reactArrayWithUndefined(void 0),stRotation:void 0,polygonHierarchy:p.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0,classificationType:"BOTH"})})(Ho||(Ho={})),p.extendClassProps(Ho.prototype,Ho.createDefaultProps);class LU extends p.HasOwner{constructor(n,e){if(super(n),!e)throw new Error("!czmViewer");const i=this.owner;if(!i.polygonHierarchy)throw new Error("polygonHierarchy is required");const o=[],r=new C.GeometryInstance({geometry:new C.PolygonGeometry({vertexFormat:C.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ri(i.polygonHierarchy),stRotation:i.stRotation&&C.Math.toRadians(i.stRotation),arcType:i.arcType&&C.ArcType[i.arcType],height:i.height,extrudedHeight:i.extrudedHeight,perPositionHeight:i.perPositionHeight,closeTop:i.closeTop,closeBottom:i.closeBottom,ellipsoid:i.ellipsoid&&Ke(i.ellipsoid),granularity:i.granularity!==void 0?C.Math.toRadians(i.granularity):void 0}),attributes:{color:C.ColorGeometryInstanceAttribute.fromColor(new C.Color(...i.color??Ho.defaults.color)),show:new C.ShowGeometryInstanceAttribute(!0)},id:this});o.push(r);const s=new C.ClassificationPrimitive({geometryInstances:o,asynchronous:!1,allowPicking:i.allowPicking,compressVertices:!1,classificationType:Xt.classificationTypeMap[i.classificationType]});C.ClassificationPrimitive.prototype&&(s.ESSceneObjectID=n.id);{if(!e)throw new Error("!this.owner.czmViewer");const{viewer:a}=e;if(!a)throw new Error("!czmViewer.viewer");a.scene.primitives.add(s),this.dispose(()=>a.scene.primitives.remove(s))}{const a=()=>{s.show=i.show??!0};a(),this.dispose(i.showChanged.disposableOn(a))}}}class zU extends p.Destroyable{constructor(e,i){super();L(this,"_czmClassificationPolygonPrimitive");this._czmClassificationPolygonPrimitive=this.disposeVar(new Ho(i,e.id));const o=this._czmClassificationPolygonPrimitive;{const r=()=>{const a=e.show,l=e.fill;if(o.show=a&&l,e.positions&&e.positions.length>0?o.height=e.positions[0][2]:o.height=void 0,o.polygonHierarchy=o.show?{positions:e.positions||[]}:{positions:[]},o.color=e.color,e.depth===void 0)throw new Error("sceneObject.depth === undefined");o.extrudedHeight=(o.height??0)+e.depth,o.classificationType=e.classificationType};r();const s=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.classificationTypeChanged));this.dispose(s.disposableOn(r))}this.dispose(e.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(p.track([o,"allowPicking"],[e,"allowPicking"]))}}class cs extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_helperPolygon");L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this.id=i);{const o=this.disposeVar(new Br(e,i));this._helperPolygon=o,this.dispose(p.track([o,"show"],[this,"showHelper"],r=>r));{const r=()=>{o.show=this.showHelper};r(),this.dispose(this.showHelperChanged.disposableOn(r))}this.dispose(p.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([o,"outline"],[this,"outline"])),this.dispose(p.track([o,"outlineColor"],[this,"outlineColor"])),this.dispose(p.track([o,"outlineWidth"],[this,"outlineWidth"])),o.fill=!1,o.color=[0,0,0,0],this.dispose(p.track([o,"positions"],[this,"positions"])),this.dispose(p.track([o,"depth"],[this,"depth"])),this.dispose(p.track([o,"zIndex"],[this,"zIndex"]))}this.disposeVar(new p.ObjResettingWithEvent(this.depthChanged,()=>{if(!(this.depth===void 0||this.depth<0))return new zU(this,e)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get helperPolygon(){return this._helperPolygon}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(cs,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,showHelper:!1,allowPicking:!1,classificationType:"BOTH",outline:!0,outlineColor:p.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:p.reactArray([1,1,1,.5]),positions:p.reactPositions(void 0),depth:0,zIndex:0})})(cs||(cs={})),p.extendClassProps(cs.prototype,cs.createDefaultProps);const wu=class wu extends an{constructor(e,i){super(e,i);L(this,"_polygon");if(this._polygon=this.disposeVar(new cs(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._polygon;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"depth"],[e,"height"])),this.dispose(p.track([r,"showHelper"],[e,"stroked"])),this.dispose(p.track([r,"outline"],[e,"stroked"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(p.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"fill"],[e,"filled"])),this.dispose(p.track([r,"color"],[e,"fillColor"]))}get polygon(){return this._polygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,polygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,polygon:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(wu,"type",wu.register("ESCesiumViewer",Q.ESClassification.type,wu));let Pm=wu;const QU=[{id:"document",version:"1.0"},{id:"Vehicle",availability:"2012-08-04T16:00:00Z/2012-08-04T16:14:15.251Z",billboard:{eyeOffset:{cartesian:[0,0,0]},horizontalOrigin:"CENTER",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEISURBVEhLvVXBDYQwDOuojHKj8LhBbpTbpBCEkZsmIVTXq1RVQGrHiWlLmTTqPiZBlyLgy/KSZQ5JSHDQ/mCYCsC8106kDU0AdwRnvYZArWRcAl0dcYJq1hWCb3hBrumbDAVMwAC82WoRvgMnVMDBnB0nYZFTbE6BBvdUGqVqCbjBIk3PyFFR/NU7EKzru+qZsau3ryPwwCRLKYOzutZuCL6fUmWeJGzNzL/RxAMrUmASSCkkAayk2IxPlwhAAYGpsiHQjbLccfdOY5gKkCXAMi7SscAwbQpAnKyctWyUZ6z8ja3OGMepwD8asz+9FnSvbhU8uVOHFIwQsI3/p0CfhuqCSQuxLqsN6mu8SS+N42MAAAAASUVORK5CYII=",pixelOffset:{cartesian2:[0,0]},scale:.8333333333333334,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],verticalOrigin:"BOTTOM"},label:{fillColor:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}],font:"bold 10pt Segoe UI Semibold",horizontalOrigin:"LEFT",outlineColor:{rgba:[0,0,0,255]},pixelOffset:{cartesian2:[10,0]},scale:1,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],style:"FILL",text:"Vehicle",verticalOrigin:"CENTER"},path:{material:{solidColor:{color:{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}}},width:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",number:5}],show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}]},position:{interpolationAlgorithm:"LAGRANGE",interpolationDegree:1,epoch:"2012-08-04T16:00:00Z",cartesian:[0,-23797546637012e-7,-466533288013588e-8,362813368924173e-8,100,-237951008905552e-8,-466541964840452e-8,362818220006795e-8,200,-23795684769522e-7,-46655553441867e-7,362797083323261e-8,300,-237963893786855e-8,-466569163561896e-8,362775082085873e-8,400,-237970929834665e-8,-46658279679646e-7,362753080187124e-8,500,-237983728064915e-8,-46658477494347e-7,362742212874017e-8,600,-237962498289073e-8,-466590750853722e-8,36274841191848e-7,700,-237938612743523e-8,-466602954174431e-8,362748383297459e-8,800,-237914726777171e-8,-466615156669944e-8,36274835403492e-7,900,-237890840390057e-8,-466627358340244e-8,362748324130864e-8,1e3]}}],VU=`第一个packet代表了cesium场景(cesium时间轴的范围,当前时刻,倍速等信息)之外,其他的packet都可以理解为描述某一时间范围内的entity的行为。
|
|
2823
2823
|
\`\`\`
|
|
2824
2824
|
[{
|
|
2825
2825
|
"id": "document",
|
|
@@ -2889,12 +2889,12 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
2889
2889
|
}
|
|
2890
2890
|
}
|
|
2891
2891
|
}
|
|
2892
|
-
`,
|
|
2892
|
+
`,HU=`data 路径都可以使用下面回调函数
|
|
2893
2893
|
\`\`\`
|
|
2894
2894
|
${tC}
|
|
2895
2895
|
\`\`\`
|
|
2896
2896
|
|
|
2897
|
-
`,nC=Date.now();new Date(nC).toISOString(),new Date(nC+864e5).toISOString();const bu=class bu extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_loadFuncReact",this.disposeVar(p.react(void 0)));L(this,"_clock");L(this,"_resetClockEvent",this.disposeVar(new p.Event));L(this,"_dataSource",this.disposeVar(p.react(void 0)));this._clock=this.disposeVar(new ze(e)),this.dispose(p.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(p.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(p.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(p.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(p.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(p.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(p.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&this.dataSource&&(c!==void 0?o.flyTo(this.dataSource,{duration:c/1e3}):o.flyTo(this.dataSource))}));const r=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource,!0),this._dataSource.value=void 0)};this.dispose(r);const s=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:c}=this;this.startTime=C.JulianDate.toDate(c.clock.startTime).getTime(),this.stopTime=C.JulianDate.toDate(c.clock.stopTime).getTime(),this.currentTime=C.JulianDate.toDate(c.clock.currentTime).getTime(),this.multiplier=c.clock.multiplier,this.clockStep=ze.getClockStep(c.clock.clockStep),this.clockRange=ze.getClockRange(c.clock.clockRange)};this.dispose(this.resetClockEvent.disposableOn(s));const a=()=>{this.dataSource&&(this.dataSource.show=this.show??bu.defaults.show)};a(),this.dispose(this.showChanged.disposableOn(a));const l=this.disposeVar(p.react(void 0));{const c=()=>{const u=()=>{var A;if(this.uri)if(this.uri&&typeof this.uri!="string")(A=C.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||A.then(f=>f);else return Q.ESSceneObject.context.getStrFromEnv(this.uri)};l.value=this.data??u()};c();const h=this.disposeVar(p.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.dispose(h.disposableOn(c))}{const c=this.disposeVar(p.createProcessingFromAsyncFunc(async A=>{if(r(),!l.value)return;let f;try{f=await C.CzmlDataSource.load(l.value)}catch(d){console.error(`加载czml错误:${d}`),console.error(d)}if(f&&(A.check(),f.entities.values.forEach(d=>{C.Entity.prototype&&(f.ESSceneObjectID=i)}),o.dataSources.add(f),this._dataSource.value=f,a(),(this.autoResetClock??bu.defaults.autoResetClock)&&s(),!!this.loadFun))try{this.loadFun(f)}catch(d){console.error(d)}})),h=()=>{c.isRunning&&c.cancel(),c.restart()};h();const u=this.disposeVar(p.createNextAnimateFrameEvent(l.changed,this.loadFunChanged));this.dispose(u.disposableOn(h))}{const c=()=>{if(this.loadFuncStr)try{const h=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=h}catch(h){console.error(h),this.loadFun=void 0}else this.loadFun=void 0};c(),this.dispose(this.loadFuncStrChanged.disposableOn(c))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};L(bu,"defaults",{show:!0,allowPicking:!0,data:
|
|
2897
|
+
`,nC=Date.now();new Date(nC).toISOString(),new Date(nC+864e5).toISOString();const bu=class bu extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_loadFuncReact",this.disposeVar(p.react(void 0)));L(this,"_clock");L(this,"_resetClockEvent",this.disposeVar(new p.Event));L(this,"_dataSource",this.disposeVar(p.react(void 0)));this._clock=this.disposeVar(new ze(e)),this.dispose(p.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(p.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(p.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(p.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(p.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(p.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(p.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&this.dataSource&&(c!==void 0?o.flyTo(this.dataSource,{duration:c/1e3}):o.flyTo(this.dataSource))}));const r=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource,!0),this._dataSource.value=void 0)};this.dispose(r);const s=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:c}=this;this.startTime=C.JulianDate.toDate(c.clock.startTime).getTime(),this.stopTime=C.JulianDate.toDate(c.clock.stopTime).getTime(),this.currentTime=C.JulianDate.toDate(c.clock.currentTime).getTime(),this.multiplier=c.clock.multiplier,this.clockStep=ze.getClockStep(c.clock.clockStep),this.clockRange=ze.getClockRange(c.clock.clockRange)};this.dispose(this.resetClockEvent.disposableOn(s));const a=()=>{this.dataSource&&(this.dataSource.show=this.show??bu.defaults.show)};a(),this.dispose(this.showChanged.disposableOn(a));const l=this.disposeVar(p.react(void 0));{const c=()=>{const u=()=>{var A;if(this.uri)if(this.uri&&typeof this.uri!="string")(A=C.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||A.then(f=>f);else return Q.ESSceneObject.context.getStrFromEnv(this.uri)};l.value=this.data??u()};c();const h=this.disposeVar(p.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.dispose(h.disposableOn(c))}{const c=this.disposeVar(p.createProcessingFromAsyncFunc(async A=>{if(r(),!l.value)return;let f;try{f=await C.CzmlDataSource.load(l.value)}catch(d){console.error(`加载czml错误:${d}`),console.error(d)}if(f&&(A.check(),f.entities.values.forEach(d=>{C.Entity.prototype&&(f.ESSceneObjectID=i)}),o.dataSources.add(f),this._dataSource.value=f,a(),(this.autoResetClock??bu.defaults.autoResetClock)&&s(),!!this.loadFun))try{this.loadFun(f)}catch(d){console.error(d)}})),h=()=>{c.isRunning&&c.cancel(),c.restart()};h();const u=this.disposeVar(p.createNextAnimateFrameEvent(l.changed,this.loadFunChanged));this.dispose(u.disposableOn(h))}{const c=()=>{if(this.loadFuncStr)try{const h=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=h}catch(h){console.error(h),this.loadFun=void 0}else this.loadFun=void 0};c(),this.dispose(this.loadFuncStrChanged.disposableOn(c))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};L(bu,"defaults",{show:!0,allowPicking:!0,data:QU,dataMd:VU,autoResetClock:!0,clockEnabled:!1,startTime:ze.defaults.startTime,stopTime:ze.defaults.stopTime,currentTime:ze.defaults.currentTime,multiplier:ze.defaults.multiplier,clockStep:ze.defaults.clockStep,clockRange:ze.defaults.clockRange,shouldAnimate:ze.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:tC,defaultLoadFuncDocStr:HU});let No=bu;(t=>{t.createDefaultProps=()=>({show:void 0,uri:void 0,allowPicking:void 0,data:p.reactJsonWithUndefined(void 0),autoResetClock:void 0,clockEnabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0,loadFuncStr:void 0})})(No||(No={})),p.extendClassProps(No.prototype,No.createDefaultProps);const _u=class _u extends Q.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new No(e,n.id));this.dispose(p.track([o,"show"],[n,"show"])),this.dispose(p.track([o,"allowPicking"],[n,"allowPicking"])),this.dispose(p.bind([o,"data"],[n,"data"])),this.dispose(p.bind([o,"uri"],[n,"uri"])),this.dispose(p.bind([o,"loadFuncStr"],[n,"loadFuncStr"])),this.dispose(p.bind([o,"autoResetClock"],[n,"autoResetClock"])),this.dispose(p.bind([o,"clockEnabled"],[n,"clockEnabled"])),this.dispose(p.bind([o,"startTime"],[n,"startTime"])),this.dispose(p.bind([o,"stopTime"],[n,"stopTime"])),this.dispose(p.bind([o,"currentTime"],[n,"currentTime"])),this.dispose(p.bind([o,"multiplier"],[n,"multiplier"])),this.dispose(p.bind([o,"clockStep"],[n,"clockStep"])),this.dispose(p.bind([o,"clockRange"],[n,"clockRange"])),this.dispose(p.bind([o,"shouldAnimate"],[n,"shouldAnimate"])),this.dispose(n.flyToEvent.disposableOn(r=>{e.actived&&o.flyTo(r)}))}};L(_u,"type",_u.register("ESCesiumViewer",Q.ESCzml.type,_u));let Tm=_u;async function NU(t,n){const e=p.fetchArrayBuffer(t+"index.bin"),i=p.fetchArrayBuffer(t+"vertex.bin"),o=[...new Array(n).keys()].map(u=>u.toString().padStart(6,"0")).map(u=>`${t}bins/R2DC${u}.bin`).map(u=>p.fetchArrayBuffer(u)),r=await Promise.all([e,i,...o]);if(r.some(u=>u===void 0)){console.warn("有数据未能解析!");return}const[s,...a]=r,l=new Uint16Array(s),[c,...h]=a.map(u=>new Float32Array(u));return{indexBuffer:l,vertexBuffer:c,propBuffers:h}}function*GU(t){const e=t.length/3|0;for(let i=0;i<e;++i)yield[t[i*3+0],t[i*3+1],t[i*3+2]]}const Cu=class Cu extends Ge{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");L(this,"_czmTexture");if(this._czmCustomPrimitive=this.disposeVar(new st(i,e.id)),this._czmTexture=this.ad(new At(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this,{czmTexture:s}=this;{s.uri="",s.size=[1024,1],s.enabled=!0;const l=new p.ColorStops,c=()=>{l.value=e.colorStops??Q.ESDataMesh.defaults.colorStops;const h=l.getColorsInUint8(new Uint8Array(1024*4));s.copyTexture({source:{width:1024,height:1,arrayBufferView:h}})};c(),this.dispose(e.colorStopsChanged.disposableOn(c))}this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),r.cull=!1,r.vertexShaderSource=`
|
|
2898
2898
|
precision highp float;
|
|
2899
2899
|
in vec3 a_position;
|
|
2900
2900
|
in vec3 a_prop;
|
|
@@ -2924,7 +2924,7 @@ ${tC}
|
|
|
2924
2924
|
// out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, (a + .1)*4.);
|
|
2925
2925
|
out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, a);
|
|
2926
2926
|
}
|
|
2927
|
-
`,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let a=this.disposeVar(p.react(void 0));{const l=this.disposeVar(p.createProcessingFromAsyncFunc(async h=>{a.value=void 0;const u=e.url??Q.ESDataMesh.defaults.url;if(!u)return;await h.promise(p.sleep(200));const A=(e.maxTime??Q.ESDataMesh.defaults.maxTime)|0;a.value=await h.promise(HU(Q.ESSceneObject.context.getStrFromEnv(typeof u=="string"?u:u.url),A+1))}));l.start();const c=this.disposeVar(p.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(c.disposableOn(()=>l.restart()))}{class l{constructor(u){this._buffer=u}[Symbol.iterator](){return NU(this._buffer)}}const c=()=>{if(!a.value)return;const{vertexBuffer:h,propBuffers:u,indexBuffer:A}=a.value,{minPos:f,maxPos:d}=Q.getMinMaxCorner(new l(h));r.setLocalAxisedBoundingBox(f,d);const g=(e.maxTime??Q.ESDataMesh.defaults.maxTime)|0;let v=(e.currentTime??Q.ESDataMesh.defaults.currentTime)/g;v=v<0?0:v>1?1:v;const y=v*g;let m=v*g|0,w=y-m;if(m>=g&&(m=g-1,w=1),!Number.isFinite(w)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=A,!u[m]||!u[m+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:h,componentsPerAttribute:3},a_prop:{typedArray:u[m],componentsPerAttribute:3},a_prop2:{typedArray:u[m+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${s.id}`},u_stripMinMaxValue:[e.minPropValue??Q.ESDataMesh.defaults.minPropValue,e.maxPropValue??Q.ESDataMesh.defaults.maxPropValue],u_ratio:w}};c(),this.dispose(e.maxTimeChanged.disposableOn(c)),this.dispose(e.currentTimeChanged.disposableOn(c)),this.dispose(e.minPropValueChanged.disposableOn(c)),this.dispose(e.maxPropValueChanged.disposableOn(c)),this.dispose(a.changed.disposableOn(c))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s,!0),!0):!1}};L(Cu,"type",Cu.register("ESCesiumViewer",Q.ESDataMesh.type,Cu));let Im=Cu;const na=class na extends p.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new p.Event));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_heading",this.disposeVar(p.react(0)));L(this,"_textFunc",this.disposeVar(p.react(void 0)));const o=this;{const a=()=>{if(this.positions&&this.positions.length>=2){let c=0;this.arcType===void 0||this.arcType==="GEODESIC"?c=Q.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?c=Q.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?c=Q.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?Q.clampN180_180(c):Q.clamp0_360(c)}};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(a))}const r=this.disposeVar(new Je(e,i));r.loop=!1,this.dispose(p.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(p.bind([r,"arcType"],[o,"arcType"])),this.dispose(p.bind([r,"color"],[o,"color"])),this.dispose(p.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(p.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(p.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(p.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(p.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(p.bind([r,"positions"],[o,"positions"])),this.dispose(p.bind([r,"show"],[o,"show"])),this.dispose(p.bind([r,"width"],[o,"width"])),this.dispose(p.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(p.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(a=>{e.actived&&r.flyTo(a)}));const s=this.disposeVar(new wt(e,i));this.dispose(p.bind([s,"shadowDom"],[o,"shadowDom"])),this.dispose(p.bind([s,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(p.bind([s,"show"],[o,"show"]));{const a=()=>{o.positions&&o.positions.length>=2?s.position=o.positions[1]:s.position=void 0};a(),this.dispose(o.positionsChanged.disposableOn(a))}{const a=()=>{const{heading:c}=o,h=(o.textFunc??na.defaultTextFunc_度格式)(c);s.innerHTML=bo(`方向: ${h}`,24)};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(a))}this.ad(s.pickedEvent.don(a=>{Ui(a)===0&&this.pickedEvent.emit(a)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};L(na,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(na,"defaultTextFunc_度分格式",e=>`${qs(e,!0)}`),L(na,"defaultTextFunc_度分秒格式",e=>`${qs(e,!1)}`),L(na,"defaults",{positions:[]});let Go=na;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(void 0),width:8,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(Go||(Go={})),p.extendClassProps(Go.prototype,Go.createDefaultProps);const xu=class xu extends an{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new Go(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.bind([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const c=e.strokeMaterial??"normal";c==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):c==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):c==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const u=h.materialParams;Reflect.has(u,"gapColor")&&(r.gapColor=u.gapColor??[0,0,0,0]),Reflect.has(u,"dashLength")&&(r.dashLength=u.dashLength),Reflect.has(u,"dashPattern")&&(r.dashPattern=u.dashPattern)}catch(u){console.error(u)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{Ui(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(xu,"type",xu.register("ESCesiumViewer",Q.ESDirectionMeasurement.type,xu));let km=xu;class hs extends p.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new p.Event));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_distances",this.disposeVar(p.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await x0(e.viewer,this.positions??[]):this._distances.value=Q.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const s=this.disposeVar(new Je(e,i));s.loop=!1,this.dispose(p.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(p.bind([s,"arcType"],[this,"arcType"])),this.dispose(p.bind([s,"color"],[this,"color"])),this.dispose(p.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(p.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(p.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(p.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(p.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(p.bind([s,"positions"],[this,"positions"])),this.dispose(p.bind([s,"show"],[this,"show"])),this.dispose(p.bind([s,"width"],[this,"width"])),this.dispose(p.bind([s,"depthTest"],[this,"depthTest"])),this.dispose(p.bind([s,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&s.flyTo(a)}));{const a=[],l=()=>{for(let h of a)h.destroy();a.length=0};this.dispose(l);const c=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const u=Yf("起点",this.positions[0],e,i);u.dispose(p.track([u,"show"],[this,"show"])),u.dispose(p.track([u,"shadowDom"],[this,"shadowDom"])),u.dispose(p.track([u,"cssAllInitial"],[this,"cssAllInitial"])),a.push(u)}const h=this.distances.length;for(let u=0;u<h;++u){const A=this.distances[u],f=this.positions[u+1],d=Yf(`长度: ${oh(A)}`,f,e,i);d.dispose(p.track([d,"show"],[this,"show"])),d.dispose(p.track([d,"shadowDom"],[this,"shadowDom"])),d.dispose(p.track([d,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(d.pickedEvent.don(g=>{Ui(g)===0&&this.pickedEvent.emit(g)})),a.push(d)}};c(),this.dispose(this.distancesChanged.disposableOn(()=>Q.inOrderRunning(c)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}L(hs,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(void 0),width:1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(hs||(hs={})),p.extendClassProps(hs.prototype,hs.createDefaultProps);const Su=class Su extends an{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Je(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"width"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"strokeColor"])),this.dispose(p.track([r,"ground"],[e,"strokeGround"]));{const s=()=>{r.show=e.show&&e.stroked};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:s}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Su,"type",Su.register("ESCesiumViewer",Q.ESGeoLineString.type,Su));let As=Su;const Eu=class Eu extends As{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new hs(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.bind([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const c=e.strokeMaterial??"normal";c==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):c==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const u=h.materialParams;Reflect.has(u,"gapColor")&&(r.gapColor=u.gapColor??[0,0,0,0]),Reflect.has(u,"dashLength")&&(r.dashLength=u.dashLength),Reflect.has(u,"dashPattern")&&(r.dashPattern=u.dashPattern)}catch(u){console.error(u)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{Ui(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Eu,"type",Eu.register("ESCesiumViewer",Q.ESDistanceMeasurement.type,Eu));let Fm=Eu;class fs extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this.id=i)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:p.reactPositions(void 0),reverse:!1,edgeColor:p.reactArray([1,1,1,1]),edgeWidth:2})})(fs||(fs={})),p.extendClassProps(fs.prototype,fs.createDefaultProps);class GU extends p.Destroyable{constructor(n,e){super(),this._czmESExcavate=n,this._eS3DTileset=e;for(let i=0;i<this._eS3DTileset.excavateId.length;i++){const o=this._eS3DTileset.excavateId[i];Q.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(i,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(i=>i!==this._czmESExcavate.czmPolygonClipping.id)]})}}class WU extends p.Destroyable{constructor(n){if(super(),this._czmESExcavate=n,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const i=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];Q.ESSceneObject.getSceneObjById(i)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const Pu=class Pu extends Tn{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new fs(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new Q.ESSceneObjectWithId);const o=this.ad(p.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=Q.ESSceneObject.getSceneObject(e.targetID);o.value=a?a.getMainClass().id:o.value})),this.dispose(p.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(p.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const s=this._czmPolygonClipping;s.showHelper=!1,this.dispose(p.bind([s,"positions"],[e,"points"])),this.dispose(p.track([s,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.reverse=e.mode!=="in"};a(),this.dispose(e.modeChanged.disposableOn(a))}Q.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(p.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new p.ObjResettingWithEvent(a,()=>{const{sceneObject:l,id:c}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return c===""?new WU(this):!l||!(l instanceof Q.ES3DTileset)?void 0:new GU(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Pu,"type",Pu.register("ESCesiumViewer",Q.ESExcavate.type,Pu));let Bm=Pu;const Tu=class Tu extends Ge{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new hi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmFireParticleSystem;r.endColor=[1,1,0,.4],r.startColor=[1,0,0,.5],r.particleLife=1,r.emissionRate=30,r.lifetime=1,r.imageSize=[1,1],r.emitter={type:"CircleEmitter",radius:.1},r.sizeInMeters=!0;{const s=()=>{r.startScale=10*(e.scale[0]>0?e.scale[0]:1),r.endScale=5*(e.scale[0]>0?e.scale[0]:1),r.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),r.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};s(),this.ad(e.scaleChanged.don(s))}this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"translation"],[e,"translation"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,Dn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Tu,"type",Tu.register("ESCesiumViewer",Q.ESFireParticleSystem.type,Tu));let Mm=Tu;class ds extends p.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_currentDistance",this.disposeVar(p.react(0)));L(this,"_ratio",this.disposeVar(Q.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new Q.ESPathImpl),this._geoPolyline=this.disposeVar(new Je(e,i)),this._geoCanvasPointPoi=this.disposeVar(new wr(e,i)),this._player=this.disposeVar(new Q.Player),this.dispose(p.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(p.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(p.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(p.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(p.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(p.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(p.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(p.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(p.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(p.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(p.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(p.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(p.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(p.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(p.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(p.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(p.track([this._geoPath,"show"],[this,"show"])),this.dispose(p.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(p.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const s=this.granularity*Math.PI/180,a=Lf(this.positions,this.arcType??"GEODESIC",s);if(a){this._geoPath.timePosRots=a.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(r.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const r=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(r-this.currentDistance)>.01&&(this.currentDistance=r)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const r=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(r-(this._player.currentTime??0))>.01&&(this._player.currentTime=r)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(p.bind([this._player,"loop"],[this,"loop"])),this.dispose(p.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this._player,"duration"],[this,"duration"])),this.dispose(p.bind([this._player,"playing"],[this,"playing"])),this.dispose(p.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,i){const o=this._geoPath.subPath(e,i);if(o)return o.map(r=>r[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:p.reactPositions(void 0),width:1,ground:!1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(ds||(ds={})),p.extendClassProps(ds.prototype,ds.createDefaultProps);class zl extends p.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_currentDistance",this.disposeVar(p.react(0)));this._geoPolylinePath=this.disposeVar(new ds(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(p.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(p.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(p.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(p.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(p.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(p.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(p.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(p.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(p.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(p.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(p.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(p.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(p.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(p.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(p.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(p.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(p.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(p.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(p.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(p.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(p.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const s=Jf(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=s}else this._geoPolylinePath.positions=void 0}catch(s){console.error(s),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(s=>{this._geoPolylinePath.flyTo(s)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:p.reactPositions(void 0),width:1,ground:!1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(zl||(zl={})),p.extendClassProps(zl.prototype,zl.createDefaultProps);const ct=class ct extends Q.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new p.Event));this.ad(p.bind([this,"splitDirection"],[this,"czmSplitDirection"]))}get typeName(){return"ESMVTLayer"}get defaultProps(){return ct.createDefaultProps()}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Q.StringProperty("令牌","影像服务访问令牌",!1,!1,[this,"accessToken"],ct.defaults.accessToken),new Q.Number4Property("矩形范围","西南东北",!0,!1,[this,"rectangle"],ct.defaults.rectangle),new Q.JsonProperty("服务地址","mapbox样式对象或url资源",!1,!1,[this,"url"],ct.defaults.url),new Q.JsonProperty("样式配置","样式配置,用于自定义或替换样式",!1,!1,[this,"style"],ct.defaults.style),new Q.NumberProperty("层级序号","层级序号",!1,!1,[this,"zIndex"],ct.defaults.zIndex),new Q.EnumProperty("瓦片大小","瓦片大小",!1,!1,[this,"tileSize"],ct.defaults.tileSizes),new Q.NumberSliderProperty("最大层级","最大层级",!1,!1,[this,"maximumLevel"],1,[1,24],ct.defaults.maximumLevel),new Q.NumberSliderProperty("最小层级","最小层级",!1,!1,[this,"minimumLevel"],1,[0,24],ct.defaults.minimumLevel),new Q.EnumProperty("影像类型","影像类型",!1,!1,[this,"scheme"],[["tms","tms"],["xyz","xyz"]],ct.defaults.scheme)]}}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.Number4Property("矩形范围","西南东北",!0,!1,[this,"rectangle"],ct.defaults.rectangle),new Q.JsonProperty("服务地址","mapbox样式对象或url资源",!1,!1,[this,"url"],ct.defaults.url),new Q.JsonProperty("样式配置","样式配置,用于自定义或替换样式",!1,!1,[this,"style"],ct.defaults.style),new Q.NumberProperty("层级","影像显示层级",!1,!1,[this,"zIndex"],ct.defaults.zIndex),new Q.StringProperty("令牌","影像服务访问令牌",!1,!1,[this,"accessToken"],ct.defaults.accessToken),new Q.EnumProperty("瓦片大小","瓦片大小",!1,!1,[this,"tileSize"],ct.defaults.tileSizes),new Q.NumberSliderProperty("最大层级","最大层级",!1,!1,[this,"maximumLevel"],1,[1,24],ct.defaults.maximumLevel),new Q.NumberSliderProperty("最小层级","最小层级",!1,!1,[this,"minimumLevel"],1,[0,24],ct.defaults.minimumLevel),new Q.EnumProperty("影像类型","影像类型",!1,!1,[this,"scheme"],[["tms","tms"],["xyz","xyz"]],ct.defaults.scheme),new Q.EnumProperty("splitDirection","The ImagerySplitDirection split to apply to this layer.",!1,!1,[this,"splitDirection"],ct.defaults.splitDirectionEnum)]),new Q.GroupProperty("czm","czm",[new Q.NumberProperty("透明度","透明度,The alpha blending value of this layer, from 0.0 to 1.0.",!1,!1,[this,"czmAlpha"]),new Q.NumberProperty("亮度","亮度,The brightness of this layer. 1.0 uses the unmodified imagery color.",!1,!1,[this,"czmBrightness"]),new Q.NumberProperty("对比度","对比度,The contrast of this layer. 1.0 uses the unmodified imagery color.",!1,!1,[this,"czmContrast"]),new Q.NumberProperty("色相","色相,The hue of this layer. 0.0 uses the unmodified imagery color. ",!1,!1,[this,"czmHue"]),new Q.NumberProperty("饱和度","饱和度,The saturation of this layer. 1.0 uses the unmodified imagery color. ",!1,!1,[this,"czmSaturation"]),new Q.NumberProperty("伽马值","伽马,The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.",!1,!1,[this,"czmGamma"])])]}};L(ct,"type",ct.register("ESMVTLayer",ct,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"})),L(ct,"defaults",{...Q.ESVisualObject.defaults,url:"",zIndex:0,accessToken:"",tileSizes:[["256",256],["512",512],["1024",1024]],tileSize:256,maximumLevel:18,minimumLevel:0,rectangle:[-180,-90,180,90],style:[],scheme:"tms",splitDirectionEnum:[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]]});let qr=ct;(t=>{t.createDefaultProps=()=>({...Q.ESVisualObject.createDefaultProps(),rectangle:p.reactJsonWithUndefined(void 0),url:p.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:p.reactArrayWithUndefined(void 0),scheme:p.react(void 0),opacity:1,splitDirection:"NONE",czmSplitDirection:"NONE",czmAlpha:1,czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})})(qr||(qr={})),p.extendClassProps(qr.prototype,qr.createDefaultProps);const qU=t=>{const n=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:i}of n)if(t>=e)return i;return 20},KU=async(t,n,e)=>(await fetch(`https://tileser.giiiis.com/xyzinfo/${e}/${t}/${n}`)).json(),ZU=async t=>{var c;const n=(c=t.getCurrentCameraInfo())==null?void 0:c.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=qU(o);let s=Math.floor((e+180)/360*Math.pow(2,r+1)),a=Math.floor((90-i)/180*Math.pow(2,r));return await KU(s,a,r)};class XU extends p.Destroyable{constructor(n,e,i){super();const o=async()=>{const s=await ZU(n);e.datesEvent.emit(s,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const s=()=>{const a=e.currentDate?e.currentDate:0;i.url=`https://tileser.giiiis.com/timetile/tms/${a}/tilemapresource.xml`};s(),this.d(e.currentDateChanged.don(s))}}}const ia=class ia extends Q.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new Q.ESImageryLayer));L(this,"_datesEvent",this.dv(new p.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(p.track([i,"show"],[this,"show"])),this.d(p.track([i,"zIndex"],[this,"zIndex"])),this.d(p.track([i,"rectangle"],[this,"rectangle"])),this.d(p.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(p.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new XU(o,this,i)),this.d(this.flyInEvent.don(o=>{i.flyIn(o)})),this.d(this.flyToEvent.don(o=>{i.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}get typeName(){return"ESGeHistoryImagery"}get defaultProps(){return ia.createDefaultProps()}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Q.StringProperty("时间","currentDate",!1,!1,[this,"currentDate"],"0"),new Q.NumberProperty("层级","层级",!1,!1,[this,"zIndex"],0),new Q.Number4Property("矩形范围","西南东北",!1,!1,[this,"rectangle"],[-180,-90,180,90])]}}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.StringProperty("currentDate","currentDate",!1,!1,[this,"currentDate"]),new Q.NumberProperty("zIndex","层级",!1,!1,[this,"zIndex"]),new Q.Number4Property("矩形范围","西南东北",!1,!1,[this,"rectangle"])])]}};L(ia,"type",ia.register("ESGeHistoryImagery",ia,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"})),L(ia,"defaults",{...Q.ESVisualObject.defaults});let Kr=ia;(t=>{t.createDefaultProps=()=>({...Q.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:p.reactArray([-180,-90,180,90])})})(Kr||(Kr={})),p.extendClassProps(Kr.prototype,Kr.createDefaultProps);const $U=`<?xml version="1.0" encoding="utf-8" ?>
|
|
2927
|
+
`,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let a=this.disposeVar(p.react(void 0));{const l=this.disposeVar(p.createProcessingFromAsyncFunc(async h=>{a.value=void 0;const u=e.url??Q.ESDataMesh.defaults.url;if(!u)return;await h.promise(p.sleep(200));const A=(e.maxTime??Q.ESDataMesh.defaults.maxTime)|0;a.value=await h.promise(NU(Q.ESSceneObject.context.getStrFromEnv(typeof u=="string"?u:u.url),A+1))}));l.start();const c=this.disposeVar(p.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(c.disposableOn(()=>l.restart()))}{class l{constructor(u){this._buffer=u}[Symbol.iterator](){return GU(this._buffer)}}const c=()=>{if(!a.value)return;const{vertexBuffer:h,propBuffers:u,indexBuffer:A}=a.value,{minPos:f,maxPos:d}=Q.getMinMaxCorner(new l(h));r.setLocalAxisedBoundingBox(f,d);const g=(e.maxTime??Q.ESDataMesh.defaults.maxTime)|0;let v=(e.currentTime??Q.ESDataMesh.defaults.currentTime)/g;v=v<0?0:v>1?1:v;const y=v*g;let m=v*g|0,w=y-m;if(m>=g&&(m=g-1,w=1),!Number.isFinite(w)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=A,!u[m]||!u[m+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:h,componentsPerAttribute:3},a_prop:{typedArray:u[m],componentsPerAttribute:3},a_prop2:{typedArray:u[m+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${s.id}`},u_stripMinMaxValue:[e.minPropValue??Q.ESDataMesh.defaults.minPropValue,e.maxPropValue??Q.ESDataMesh.defaults.maxPropValue],u_ratio:w}};c(),this.dispose(e.maxTimeChanged.disposableOn(c)),this.dispose(e.currentTimeChanged.disposableOn(c)),this.dispose(e.minPropValueChanged.disposableOn(c)),this.dispose(e.maxPropValueChanged.disposableOn(c)),this.dispose(a.changed.disposableOn(c))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s,!0),!0):!1}};L(Cu,"type",Cu.register("ESCesiumViewer",Q.ESDataMesh.type,Cu));let Im=Cu;const na=class na extends p.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new p.Event));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_heading",this.disposeVar(p.react(0)));L(this,"_textFunc",this.disposeVar(p.react(void 0)));const o=this;{const a=()=>{if(this.positions&&this.positions.length>=2){let c=0;this.arcType===void 0||this.arcType==="GEODESIC"?c=Q.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?c=Q.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?c=Q.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?Q.clampN180_180(c):Q.clamp0_360(c)}};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(a))}const r=this.disposeVar(new Je(e,i));r.loop=!1,this.dispose(p.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(p.bind([r,"arcType"],[o,"arcType"])),this.dispose(p.bind([r,"color"],[o,"color"])),this.dispose(p.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(p.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(p.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(p.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(p.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(p.bind([r,"positions"],[o,"positions"])),this.dispose(p.bind([r,"show"],[o,"show"])),this.dispose(p.bind([r,"width"],[o,"width"])),this.dispose(p.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(p.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(a=>{e.actived&&r.flyTo(a)}));const s=this.disposeVar(new wt(e,i));this.dispose(p.bind([s,"shadowDom"],[o,"shadowDom"])),this.dispose(p.bind([s,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(p.bind([s,"show"],[o,"show"]));{const a=()=>{o.positions&&o.positions.length>=2?s.position=o.positions[1]:s.position=void 0};a(),this.dispose(o.positionsChanged.disposableOn(a))}{const a=()=>{const{heading:c}=o,h=(o.textFunc??na.defaultTextFunc_度格式)(c);s.innerHTML=bo(`方向: ${h}`,24)};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(a))}this.ad(s.pickedEvent.don(a=>{Ui(a)===0&&this.pickedEvent.emit(a)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};L(na,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(na,"defaultTextFunc_度分格式",e=>`${qs(e,!0)}`),L(na,"defaultTextFunc_度分秒格式",e=>`${qs(e,!1)}`),L(na,"defaults",{positions:[]});let Go=na;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(void 0),width:8,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(Go||(Go={})),p.extendClassProps(Go.prototype,Go.createDefaultProps);const xu=class xu extends an{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new Go(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.bind([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const c=e.strokeMaterial??"normal";c==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):c==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):c==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const u=h.materialParams;Reflect.has(u,"gapColor")&&(r.gapColor=u.gapColor??[0,0,0,0]),Reflect.has(u,"dashLength")&&(r.dashLength=u.dashLength),Reflect.has(u,"dashPattern")&&(r.dashPattern=u.dashPattern)}catch(u){console.error(u)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{Ui(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(xu,"type",xu.register("ESCesiumViewer",Q.ESDirectionMeasurement.type,xu));let km=xu;class hs extends p.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new p.Event));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_distances",this.disposeVar(p.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await x0(e.viewer,this.positions??[]):this._distances.value=Q.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const s=this.disposeVar(new Je(e,i));s.loop=!1,this.dispose(p.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(p.bind([s,"arcType"],[this,"arcType"])),this.dispose(p.bind([s,"color"],[this,"color"])),this.dispose(p.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(p.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(p.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(p.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(p.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(p.bind([s,"positions"],[this,"positions"])),this.dispose(p.bind([s,"show"],[this,"show"])),this.dispose(p.bind([s,"width"],[this,"width"])),this.dispose(p.bind([s,"depthTest"],[this,"depthTest"])),this.dispose(p.bind([s,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&s.flyTo(a)}));{const a=[],l=()=>{for(let h of a)h.destroy();a.length=0};this.dispose(l);const c=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const u=Yf("起点",this.positions[0],e,i);u.dispose(p.track([u,"show"],[this,"show"])),u.dispose(p.track([u,"shadowDom"],[this,"shadowDom"])),u.dispose(p.track([u,"cssAllInitial"],[this,"cssAllInitial"])),a.push(u)}const h=this.distances.length;for(let u=0;u<h;++u){const A=this.distances[u],f=this.positions[u+1],d=Yf(`长度: ${oh(A)}`,f,e,i);d.dispose(p.track([d,"show"],[this,"show"])),d.dispose(p.track([d,"shadowDom"],[this,"shadowDom"])),d.dispose(p.track([d,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(d.pickedEvent.don(g=>{Ui(g)===0&&this.pickedEvent.emit(g)})),a.push(d)}};c(),this.dispose(this.distancesChanged.disposableOn(()=>Q.inOrderRunning(c)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}L(hs,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(void 0),width:1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(hs||(hs={})),p.extendClassProps(hs.prototype,hs.createDefaultProps);const Su=class Su extends an{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Je(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"width"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"strokeColor"])),this.dispose(p.track([r,"ground"],[e,"strokeGround"]));{const s=()=>{r.show=e.show&&e.stroked};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:s}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Su,"type",Su.register("ESCesiumViewer",Q.ESGeoLineString.type,Su));let As=Su;const Eu=class Eu extends As{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new hs(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.bind([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const c=e.strokeMaterial??"normal";c==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):c==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const u=h.materialParams;Reflect.has(u,"gapColor")&&(r.gapColor=u.gapColor??[0,0,0,0]),Reflect.has(u,"dashLength")&&(r.dashLength=u.dashLength),Reflect.has(u,"dashPattern")&&(r.dashPattern=u.dashPattern)}catch(u){console.error(u)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{Ui(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Eu,"type",Eu.register("ESCesiumViewer",Q.ESDistanceMeasurement.type,Eu));let Fm=Eu;class fs extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this.id=i)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:p.reactPositions(void 0),reverse:!1,edgeColor:p.reactArray([1,1,1,1]),edgeWidth:2})})(fs||(fs={})),p.extendClassProps(fs.prototype,fs.createDefaultProps);class WU extends p.Destroyable{constructor(n,e){super(),this._czmESExcavate=n,this._eS3DTileset=e;for(let i=0;i<this._eS3DTileset.excavateId.length;i++){const o=this._eS3DTileset.excavateId[i];Q.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(i,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(i=>i!==this._czmESExcavate.czmPolygonClipping.id)]})}}class qU extends p.Destroyable{constructor(n){if(super(),this._czmESExcavate=n,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const i=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];Q.ESSceneObject.getSceneObjById(i)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const Pu=class Pu extends Tn{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new fs(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new Q.ESSceneObjectWithId);const o=this.ad(p.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const a=Q.ESSceneObject.getSceneObject(e.targetID);o.value=a?a.getMainClass().id:o.value})),this.dispose(p.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(p.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const s=this._czmPolygonClipping;s.showHelper=!1,this.dispose(p.bind([s,"positions"],[e,"points"])),this.dispose(p.track([s,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.reverse=e.mode!=="in"};a(),this.dispose(e.modeChanged.disposableOn(a))}Q.registerCreatedEventUpdate(this,e,()=>{const a=this.disposeVar(p.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new p.ObjResettingWithEvent(a,()=>{const{sceneObject:l,id:c}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return c===""?new qU(this):!l||!(l instanceof Q.ES3DTileset)?void 0:new WU(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Pu,"type",Pu.register("ESCesiumViewer",Q.ESExcavate.type,Pu));let Bm=Pu;const Tu=class Tu extends Ge{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new hi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmFireParticleSystem;r.endColor=[1,1,0,.4],r.startColor=[1,0,0,.5],r.particleLife=1,r.emissionRate=30,r.lifetime=1,r.imageSize=[1,1],r.emitter={type:"CircleEmitter",radius:.1},r.sizeInMeters=!0;{const s=()=>{r.startScale=10*(e.scale[0]>0?e.scale[0]:1),r.endScale=5*(e.scale[0]>0?e.scale[0]:1),r.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),r.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};s(),this.ad(e.scaleChanged.don(s))}this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"translation"],[e,"translation"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,Dn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Tu,"type",Tu.register("ESCesiumViewer",Q.ESFireParticleSystem.type,Tu));let Mm=Tu;class ds extends p.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_currentDistance",this.disposeVar(p.react(0)));L(this,"_ratio",this.disposeVar(Q.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new Q.ESPathImpl),this._geoPolyline=this.disposeVar(new Je(e,i)),this._geoCanvasPointPoi=this.disposeVar(new wr(e,i)),this._player=this.disposeVar(new Q.Player),this.dispose(p.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(p.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(p.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(p.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(p.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(p.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(p.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(p.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(p.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(p.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(p.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(p.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(p.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(p.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(p.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(p.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(p.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(p.track([this._geoPath,"show"],[this,"show"])),this.dispose(p.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(p.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const s=this.granularity*Math.PI/180,a=Lf(this.positions,this.arcType??"GEODESIC",s);if(a){this._geoPath.timePosRots=a.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(r.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const r=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(r-this.currentDistance)>.01&&(this.currentDistance=r)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const r=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(r-(this._player.currentTime??0))>.01&&(this._player.currentTime=r)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(p.bind([this._player,"loop"],[this,"loop"])),this.dispose(p.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this._player,"duration"],[this,"duration"])),this.dispose(p.bind([this._player,"playing"],[this,"playing"])),this.dispose(p.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,i){const o=this._geoPath.subPath(e,i);if(o)return o.map(r=>r[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:p.reactPositions(void 0),width:1,ground:!1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(ds||(ds={})),p.extendClassProps(ds.prototype,ds.createDefaultProps);class zl extends p.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_currentDistance",this.disposeVar(p.react(0)));this._geoPolylinePath=this.disposeVar(new ds(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(p.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(p.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(p.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(p.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(p.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(p.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(p.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(p.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(p.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(p.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(p.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(p.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(p.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(p.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(p.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(p.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(p.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(p.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(p.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(p.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(p.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const s=Jf(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=s}else this._geoPolylinePath.positions=void 0}catch(s){console.error(s),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(s=>{this._geoPolylinePath.flyTo(s)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:p.reactPositions(void 0),width:1,ground:!1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(zl||(zl={})),p.extendClassProps(zl.prototype,zl.createDefaultProps);const ct=class ct extends Q.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new p.Event));this.ad(p.bind([this,"splitDirection"],[this,"czmSplitDirection"]))}get typeName(){return"ESMVTLayer"}get defaultProps(){return ct.createDefaultProps()}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Q.StringProperty("令牌","影像服务访问令牌",!1,!1,[this,"accessToken"],ct.defaults.accessToken),new Q.Number4Property("矩形范围","西南东北",!0,!1,[this,"rectangle"],ct.defaults.rectangle),new Q.JsonProperty("服务地址","mapbox样式对象或url资源",!1,!1,[this,"url"],ct.defaults.url),new Q.JsonProperty("样式配置","样式配置,用于自定义或替换样式",!1,!1,[this,"style"],ct.defaults.style),new Q.NumberProperty("层级序号","层级序号",!1,!1,[this,"zIndex"],ct.defaults.zIndex),new Q.EnumProperty("瓦片大小","瓦片大小",!1,!1,[this,"tileSize"],ct.defaults.tileSizes),new Q.NumberSliderProperty("最大层级","最大层级",!1,!1,[this,"maximumLevel"],1,[1,24],ct.defaults.maximumLevel),new Q.NumberSliderProperty("最小层级","最小层级",!1,!1,[this,"minimumLevel"],1,[0,24],ct.defaults.minimumLevel),new Q.EnumProperty("影像类型","影像类型",!1,!1,[this,"scheme"],[["tms","tms"],["xyz","xyz"]],ct.defaults.scheme)]}}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.Number4Property("矩形范围","西南东北",!0,!1,[this,"rectangle"],ct.defaults.rectangle),new Q.JsonProperty("服务地址","mapbox样式对象或url资源",!1,!1,[this,"url"],ct.defaults.url),new Q.JsonProperty("样式配置","样式配置,用于自定义或替换样式",!1,!1,[this,"style"],ct.defaults.style),new Q.NumberProperty("层级","影像显示层级",!1,!1,[this,"zIndex"],ct.defaults.zIndex),new Q.StringProperty("令牌","影像服务访问令牌",!1,!1,[this,"accessToken"],ct.defaults.accessToken),new Q.EnumProperty("瓦片大小","瓦片大小",!1,!1,[this,"tileSize"],ct.defaults.tileSizes),new Q.NumberSliderProperty("最大层级","最大层级",!1,!1,[this,"maximumLevel"],1,[1,24],ct.defaults.maximumLevel),new Q.NumberSliderProperty("最小层级","最小层级",!1,!1,[this,"minimumLevel"],1,[0,24],ct.defaults.minimumLevel),new Q.EnumProperty("影像类型","影像类型",!1,!1,[this,"scheme"],[["tms","tms"],["xyz","xyz"]],ct.defaults.scheme),new Q.EnumProperty("splitDirection","The ImagerySplitDirection split to apply to this layer.",!1,!1,[this,"splitDirection"],ct.defaults.splitDirectionEnum)]),new Q.GroupProperty("czm","czm",[new Q.NumberProperty("透明度","透明度,The alpha blending value of this layer, from 0.0 to 1.0.",!1,!1,[this,"czmAlpha"]),new Q.NumberProperty("亮度","亮度,The brightness of this layer. 1.0 uses the unmodified imagery color.",!1,!1,[this,"czmBrightness"]),new Q.NumberProperty("对比度","对比度,The contrast of this layer. 1.0 uses the unmodified imagery color.",!1,!1,[this,"czmContrast"]),new Q.NumberProperty("色相","色相,The hue of this layer. 0.0 uses the unmodified imagery color. ",!1,!1,[this,"czmHue"]),new Q.NumberProperty("饱和度","饱和度,The saturation of this layer. 1.0 uses the unmodified imagery color. ",!1,!1,[this,"czmSaturation"]),new Q.NumberProperty("伽马值","伽马,The gamma correction to apply to this layer. 1.0 uses the unmodified imagery color.",!1,!1,[this,"czmGamma"])])]}};L(ct,"type",ct.register("ESMVTLayer",ct,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"})),L(ct,"defaults",{...Q.ESVisualObject.defaults,url:"",zIndex:0,accessToken:"",tileSizes:[["256",256],["512",512],["1024",1024]],tileSize:256,maximumLevel:18,minimumLevel:0,rectangle:[-180,-90,180,90],style:[],scheme:"tms",splitDirectionEnum:[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]]});let qr=ct;(t=>{t.createDefaultProps=()=>({...Q.ESVisualObject.createDefaultProps(),rectangle:p.reactJsonWithUndefined(void 0),url:p.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:p.reactArrayWithUndefined(void 0),scheme:p.react(void 0),opacity:1,splitDirection:"NONE",czmSplitDirection:"NONE",czmAlpha:1,czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})})(qr||(qr={})),p.extendClassProps(qr.prototype,qr.createDefaultProps);const KU=t=>{const n=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:i}of n)if(t>=e)return i;return 20},ZU=async(t,n,e)=>(await fetch(`https://tileser.giiiis.com/xyzinfo/${e}/${t}/${n}`)).json(),XU=async t=>{var c;const n=(c=t.getCurrentCameraInfo())==null?void 0:c.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=KU(o);let s=Math.floor((e+180)/360*Math.pow(2,r+1)),a=Math.floor((90-i)/180*Math.pow(2,r));return await ZU(s,a,r)};class $U extends p.Destroyable{constructor(n,e,i){super();const o=async()=>{const s=await XU(n);e.datesEvent.emit(s,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const s=()=>{const a=e.currentDate?e.currentDate:0;i.url=`https://tileser.giiiis.com/timetile/tms/${a}/tilemapresource.xml`};s(),this.d(e.currentDateChanged.don(s))}}}const ia=class ia extends Q.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new Q.ESImageryLayer));L(this,"_datesEvent",this.dv(new p.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(p.track([i,"show"],[this,"show"])),this.d(p.track([i,"zIndex"],[this,"zIndex"])),this.d(p.track([i,"rectangle"],[this,"rectangle"])),this.d(p.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(p.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new $U(o,this,i)),this.d(this.flyInEvent.don(o=>{i.flyIn(o)})),this.d(this.flyToEvent.don(o=>{i.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}get typeName(){return"ESGeHistoryImagery"}get defaultProps(){return ia.createDefaultProps()}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new Q.StringProperty("时间","currentDate",!1,!1,[this,"currentDate"],"0"),new Q.NumberProperty("层级","层级",!1,!1,[this,"zIndex"],0),new Q.Number4Property("矩形范围","西南东北",!1,!1,[this,"rectangle"],[-180,-90,180,90])]}}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.StringProperty("currentDate","currentDate",!1,!1,[this,"currentDate"]),new Q.NumberProperty("zIndex","层级",!1,!1,[this,"zIndex"]),new Q.Number4Property("矩形范围","西南东北",!1,!1,[this,"rectangle"])])]}};L(ia,"type",ia.register("ESGeHistoryImagery",ia,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"})),L(ia,"defaults",{...Q.ESVisualObject.defaults});let Kr=ia;(t=>{t.createDefaultProps=()=>({...Q.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:p.reactArray([-180,-90,180,90])})})(Kr||(Kr={})),p.extendClassProps(Kr.prototype,Kr.createDefaultProps);const YU=`<?xml version="1.0" encoding="utf-8" ?>
|
|
2928
2928
|
<kml xmlns="http://www.opengis.net/kml/2.2">
|
|
2929
2929
|
<Document id="root_doc">
|
|
2930
2930
|
<Folder><name>高速公路</name>
|
|
@@ -2949,7 +2949,7 @@ ${tC}
|
|
|
2949
2949
|
<Point><coordinates>118.49952,31.69933</coordinates></Point>
|
|
2950
2950
|
</Placemark>
|
|
2951
2951
|
</Folder>
|
|
2952
|
-
`,
|
|
2952
|
+
`,JU=`KML文件本质上是一个XML文件,完全遵循XML文件格式。但是,KML文件定义了几个特殊的元素标签,常用标签为:Placemark:标记或路径 Linestring:路劲的坐标点 Point:标记位置的坐标 Coordinates:经纬度坐标
|
|
2953
2953
|
\`\`\`
|
|
2954
2954
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
2955
2955
|
<kml xmlns="http://www.opengis.net/kml/2.2">
|
|
@@ -2987,7 +2987,7 @@ ${tC}
|
|
|
2987
2987
|
viewer.clock.multiplier = 30;
|
|
2988
2988
|
viewer.clock.shouldAnimate = true;
|
|
2989
2989
|
}
|
|
2990
|
-
`,
|
|
2990
|
+
`,jU=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
|
|
2991
2991
|
|
|
2992
2992
|
该路径可以使用下面回调函数
|
|
2993
2993
|
\`\`\`
|
|
@@ -3037,7 +3037,7 @@ ${iC}
|
|
|
3037
3037
|
}
|
|
3038
3038
|
|
|
3039
3039
|
\`\`\`
|
|
3040
|
-
`,_t=class _t extends Q.ESSceneObject{constructor(e){super(e);L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_resetClockEvent",this.disposeVar(new p.Event))}get typeName(){return"ESKml"}get defaultProps(){return _t.createDefaultProps()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Q.LongStringProperty("数据","数据",!0,!1,[this,"data"]),new Q.JsonProperty("路径","路径",!0,!1,[this,"uri"]),new Q.BooleanProperty("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"],_t.defaults.autoResetClock),new Q.BooleanProperty("启用","启用",!1,!1,[this,"clockEnabled"],_t.defaults.clockEnabled),new Q.BooleanProperty("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"],_t.defaults.shouldAnimate),new Q.DateProperty("开始时间","开始时间",!0,!1,[this,"startTime"],_t.defaults.startTime),new Q.DateProperty("结束时间","结束时间",!0,!1,[this,"stopTime"],_t.defaults.stopTime),new Q.DateProperty("当前时间","当前时间",!0,!1,[this,"currentTime"],_t.defaults.currentTime),new Q.NumberProperty("倍速","倍速.",!1,!1,[this,"multiplier"],_t.defaults.multiplier),new Q.EnumProperty("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],_t.defaults.clockStep),new Q.EnumProperty("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],_t.defaults.clockRange)],general:[...e.general,new Q.StringProperty("唯一标识","id",!1,!0,[this,"id"]),new Q.StringProperty("名称","name",!0,!1,[this,"name"]),new Q.BooleanProperty("是否显示","show",!1,!1,[this,"show"],!0),new Q.BooleanProperty("开启碰撞","collision",!1,!1,[this,"collision"],!1),new Q.BooleanProperty("允许拾取","allowPicking",!1,!1,[this,"allowPicking"],!1)]}}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.BooleanProperty("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new Q.BooleanProperty("允许拾取","是否允许拾取",!1,!1,[this,"allowPicking"]),new Q.FunctionProperty("飞入","飞入",["number"],i=>this.flyTo(i),[1e3]),new Q.LongStringProperty("数据","数据",!0,!1,[this,"data"]),new Q.JsonProperty("路径","路径",!0,!1,[this,"uri"],_t.defaults.uri),new Q.EvalStringProperty("loadFnStr","loadFnStr",!0,!1,[this,"loadFuncStr"],_t.defaults.defaultLoadFuncStr,_t.defaults.defaultLoadFuncDocStr),new Q.BooleanProperty("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"]),new Q.FunctionProperty("重设时钟","根据当前加载的数据重设始终",[],()=>this.resetClock(),[])]),new Q.GroupProperty("时钟","时钟",[new Q.BooleanProperty("启用","启用",!1,!1,[this,"clockEnabled"]),new Q.DateProperty("开始时间","开始时间",!0,!1,[this,"startTime"],_t.defaults.startTime),new Q.DateProperty("结束时间","结束时间",!0,!1,[this,"stopTime"],_t.defaults.stopTime),new Q.DateProperty("当前时间","当前时间",!0,!1,[this,"currentTime"],_t.defaults.currentTime),new Q.NumberProperty("倍速","倍速.",!1,!1,[this,"multiplier"]),new Q.EnumProperty("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]]),new Q.EnumProperty("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]]),new Q.BooleanProperty("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"])])]}};L(_t,"type",_t.register("ESKml",_t,{chsName:"ESKml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Kml数据加载"})),L(_t,"defaults",{...Q.ESSceneObject.defaults,show:!0,allowPicking:!1,defaultLoadFuncStr:iC,defaultLoadFuncDocStr:
|
|
3040
|
+
`,_t=class _t extends Q.ESSceneObject{constructor(e){super(e);L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_resetClockEvent",this.disposeVar(new p.Event))}get typeName(){return"ESKml"}get defaultProps(){return _t.createDefaultProps()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Q.LongStringProperty("数据","数据",!0,!1,[this,"data"]),new Q.JsonProperty("路径","路径",!0,!1,[this,"uri"]),new Q.BooleanProperty("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"],_t.defaults.autoResetClock),new Q.BooleanProperty("启用","启用",!1,!1,[this,"clockEnabled"],_t.defaults.clockEnabled),new Q.BooleanProperty("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"],_t.defaults.shouldAnimate),new Q.DateProperty("开始时间","开始时间",!0,!1,[this,"startTime"],_t.defaults.startTime),new Q.DateProperty("结束时间","结束时间",!0,!1,[this,"stopTime"],_t.defaults.stopTime),new Q.DateProperty("当前时间","当前时间",!0,!1,[this,"currentTime"],_t.defaults.currentTime),new Q.NumberProperty("倍速","倍速.",!1,!1,[this,"multiplier"],_t.defaults.multiplier),new Q.EnumProperty("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],_t.defaults.clockStep),new Q.EnumProperty("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],_t.defaults.clockRange)],general:[...e.general,new Q.StringProperty("唯一标识","id",!1,!0,[this,"id"]),new Q.StringProperty("名称","name",!0,!1,[this,"name"]),new Q.BooleanProperty("是否显示","show",!1,!1,[this,"show"],!0),new Q.BooleanProperty("开启碰撞","collision",!1,!1,[this,"collision"],!1),new Q.BooleanProperty("允许拾取","allowPicking",!1,!1,[this,"allowPicking"],!1)]}}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.BooleanProperty("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new Q.BooleanProperty("允许拾取","是否允许拾取",!1,!1,[this,"allowPicking"]),new Q.FunctionProperty("飞入","飞入",["number"],i=>this.flyTo(i),[1e3]),new Q.LongStringProperty("数据","数据",!0,!1,[this,"data"]),new Q.JsonProperty("路径","路径",!0,!1,[this,"uri"],_t.defaults.uri),new Q.EvalStringProperty("loadFnStr","loadFnStr",!0,!1,[this,"loadFuncStr"],_t.defaults.defaultLoadFuncStr,_t.defaults.defaultLoadFuncDocStr),new Q.BooleanProperty("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"]),new Q.FunctionProperty("重设时钟","根据当前加载的数据重设始终",[],()=>this.resetClock(),[])]),new Q.GroupProperty("时钟","时钟",[new Q.BooleanProperty("启用","启用",!1,!1,[this,"clockEnabled"]),new Q.DateProperty("开始时间","开始时间",!0,!1,[this,"startTime"],_t.defaults.startTime),new Q.DateProperty("结束时间","结束时间",!0,!1,[this,"stopTime"],_t.defaults.stopTime),new Q.DateProperty("当前时间","当前时间",!0,!1,[this,"currentTime"],_t.defaults.currentTime),new Q.NumberProperty("倍速","倍速.",!1,!1,[this,"multiplier"]),new Q.EnumProperty("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]]),new Q.EnumProperty("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]]),new Q.BooleanProperty("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"])])]}};L(_t,"type",_t.register("ESKml",_t,{chsName:"ESKml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Kml数据加载"})),L(_t,"defaults",{...Q.ESSceneObject.defaults,show:!0,allowPicking:!1,defaultLoadFuncStr:iC,defaultLoadFuncDocStr:jU,data:YU,dataMd:JU,autoResetClock:!0,clockEnabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+864e5,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,uri:"${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml"});let Zr=_t;(t=>{t.createDefaultProps=()=>({show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,clampToGround:!1,...Q.ESSceneObject.createDefaultProps()})})(Zr||(Zr={})),p.extendClassProps(Zr.prototype,Zr.createDefaultProps);const Rs=class Rs extends Q.ESLocalVector2D{get typeName(){return"ESLocalLineString"}get defaultProps(){return{...Rs.createDefaultProps()}}constructor(n){super(n)}getProperties(n){return[...super.getProperties(n),new Q.GroupProperty("折线","折线",[new Q.GroupProperty("ESLocalLineString","ESLocalLineString",[new Q.Number2sProperty("本地位置数组","本地位置数组",!0,!1,[this,"points"])])]),new Q.GroupProperty("czm","czm",[new Q.BooleanProperty("首尾相连","首尾相连",!1,!1,[this,"loop"]),new Q.BooleanProperty("是否为虚线","是否为虚线.",!1,!1,[this,"hasDash"]),new Q.ColorProperty("间隔颜色","A Property specifying the color.",!1,!1,[this,"gapColor"]),new Q.NumberProperty("虚线长度","虚线长度",!1,!1,[this,"dashLength"]),new Q.DashPatternProperty("虚线图案","虚线图案",!1,!1,[this,"dashPattern"]),new Q.BooleanProperty("是否带箭头","是否带箭头.",!1,!1,[this,"hasArrow"]),new Q.BooleanProperty("是否开启深度检测","A boolean Property specifying the visibility.",!1,!1,[this,"depthTest"])])]}};L(Rs,"type",Rs.register("ESLocalLineString",Rs,{chsName:"局部2D坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineString"}));let Xr=Rs;(t=>{t.createDefaultProps=()=>({...Q.ESLocalVector2D.createDefaultProps(),points:Q.reactPosition2Ds(void 0),loop:!0,hasDash:!0,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})})(Xr||(Xr={})),p.extendClassProps(Xr.prototype,Xr.createDefaultProps);const Us=class Us extends Q.ESLocalVector{get typeName(){return"ESLocalLineStringZ"}get defaultProps(){return{...Us.createDefaultProps()}}constructor(n){super(n)}getProperties(n){return[...super.getProperties(n),new Q.GroupProperty("通用","通用",[new Q.Number3sProperty("本地位置数组","本地位置数组",!0,!1,[this,"points"])]),new Q.GroupProperty("czm","czm",[new Q.BooleanProperty("首尾相连","首尾相连",!1,!1,[this,"loop"]),new Q.BooleanProperty("是否为虚线","是否为虚线.",!1,!1,[this,"hasDash"]),new Q.ColorProperty("间隔颜色","A Property specifying the color.",!1,!1,[this,"gapColor"]),new Q.NumberProperty("虚线长度","虚线长度",!1,!1,[this,"dashLength"]),new Q.DashPatternProperty("虚线图案","虚线图案",!1,!1,[this,"dashPattern"]),new Q.BooleanProperty("是否带箭头","是否带箭头.",!1,!1,[this,"hasArrow"]),new Q.BooleanProperty("是否开启深度检测","A boolean Property specifying the visibility.",!1,!1,[this,"depthTest"])])]}};L(Us,"type",Us.register("ESLocalLineStringZ",Us,{chsName:"局部坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineStringZ"}));let Yi=Us;(t=>{t.createDefaultProps=()=>({...Q.ESLocalVector.createDefaultProps(),points:p.reactPositions(void 0),loop:!0,width:void 0,color:p.reactArrayWithUndefined(void 0),hasDash:!0,gapColor:p.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})})(Yi||(Yi={})),p.extendClassProps(Yi.prototype,Yi.createDefaultProps);const rC=`in vec3 position;
|
|
3041
3041
|
in vec3 normal;
|
|
3042
3042
|
in vec2 st;
|
|
3043
3043
|
out vec3 v_normalEC;
|
|
@@ -3057,7 +3057,7 @@ void main()
|
|
|
3057
3057
|
vec4 imageColor = texture(u_image, v_st);
|
|
3058
3058
|
out_FragColor = imageColor * u_color;
|
|
3059
3059
|
}
|
|
3060
|
-
`,aC={type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},sC={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},lC={u_image:{type:"image",uri:""},u_color:[1,1,0,1]},uC={position:{typedArray:new Float32Array([0,0,0,0,-1,0,1,-1,0,0,0,0,1,-1,0,1,0,0]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,0,1,1,0,1,1]),componentsPerAttribute:2}},cC=new Uint16Array([0,1,2,3,4,5]);function hC(t){const n={};for(let e of Object.keys(t)){const{typedArray:i,componentsPerAttribute:o,usage:r,normalize:s}=t[e];n[e]={typedArray:{type:i.constructor.name,array:[...i.values()]},componentsPerAttribute:o,usage:r,normalize:s}}return n}function
|
|
3060
|
+
`,aC={type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},sC={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},lC={u_image:{type:"image",uri:""},u_color:[1,1,0,1]},uC={position:{typedArray:new Float32Array([0,0,0,0,-1,0,1,-1,0,0,0,0,1,-1,0,1,0,0]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,0,1,1,0,1,1]),componentsPerAttribute:2}},cC=new Uint16Array([0,1,2,3,4,5]);function hC(t){const n={};for(let e of Object.keys(t)){const{typedArray:i,componentsPerAttribute:o,usage:r,normalize:s}=t[e];n[e]={typedArray:{type:i.constructor.name,array:[...i.values()]},componentsPerAttribute:o,usage:r,normalize:s}}return n}function eO(t){const n={};for(let e of Object.keys(t)){const{typedArray:{type:i,array:o},componentsPerAttribute:r,usage:s,normalize:a}=t[e];n[e]={typedArray:new global[i](o),componentsPerAttribute:r,usage:s,normalize:a}}return n}function AC(t){return{type:t.constructor.name,array:[...t.values()]}}function tO(t){const{type:n,array:e}=t;return new global[n](e)}const nO=[["POINTS","POINTS"],["LINES","LINES"],["LINE_LOOP","LINE_LOOP"],["LINE_STRIP","LINE_STRIP"],["TRIANGLES","TRIANGLES"],["TRIANGLE_STRIP","TRIANGLE_STRIP"],["TRIANGLE_FAN","TRIANGLE_FAN"]],iO=[["ENVIRONMENT","ENVIRONMENT"],["COMPUTE","COMPUTE"],["GLOBE","GLOBE"],["TERRAIN_CLASSIFICATION","TERRAIN_CLASSIFICATION"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["CESIUM_3D_TILE_CLASSIFICATION","CESIUM_3D_TILE_CLASSIFICATION"],["CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW","CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW"],["OPAQUE","OPAQUE"],["TRANSLUCENT","TRANSLUCENT"],["OVERLAY","OVERLAY"],["NUMBER_OF_PASSES","NUMBER_OF_PASSES"]],rO=`### 默认使用的渲染状态
|
|
3061
3061
|
\`\`\`
|
|
3062
3062
|
{
|
|
3063
3063
|
depthTest: {
|
|
@@ -3184,7 +3184,7 @@ interface RenderStateOptions {
|
|
|
3184
3184
|
}
|
|
3185
3185
|
}
|
|
3186
3186
|
\`\`\`
|
|
3187
|
-
`,
|
|
3187
|
+
`,oO=`### 默认的BoundingVolume
|
|
3188
3188
|
\`\`\`
|
|
3189
3189
|
type: 'LocalAxisedBoundingBox',
|
|
3190
3190
|
data: {
|
|
@@ -3212,7 +3212,7 @@ export type BoundingVolumeJsonType = {
|
|
|
3212
3212
|
};
|
|
3213
3213
|
};
|
|
3214
3214
|
\`\`\`
|
|
3215
|
-
`,
|
|
3215
|
+
`,aO=`### 默认顶点Shader示例
|
|
3216
3216
|
\`\`\`
|
|
3217
3217
|
in vec3 position;
|
|
3218
3218
|
in vec3 normal;
|
|
@@ -3254,7 +3254,7 @@ void main()
|
|
|
3254
3254
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
3255
3255
|
}
|
|
3256
3256
|
\`\`\`
|
|
3257
|
-
`,
|
|
3257
|
+
`,sO=`### 默认片元Shader示例
|
|
3258
3258
|
\`\`\`
|
|
3259
3259
|
in vec2 v_st;
|
|
3260
3260
|
uniform sampler2D u_image;
|
|
@@ -3309,7 +3309,7 @@ void main()
|
|
|
3309
3309
|
// #endif
|
|
3310
3310
|
}
|
|
3311
3311
|
\`\`\`
|
|
3312
|
-
`,
|
|
3312
|
+
`,lO=`### 默认使用的UniformMap
|
|
3313
3313
|
\`\`\`
|
|
3314
3314
|
{
|
|
3315
3315
|
"myImage": {
|
|
@@ -3354,7 +3354,7 @@ void main()
|
|
|
3354
3354
|
export type CzmCustomPrimitiveUniformType = number | [number, number] | [number, number, number] | [number, number, number, number] | { type: 'image', uri: string };
|
|
3355
3355
|
export type CzmCustomPrimitiveUniformMapType = { [k: string]: CzmCustomPrimitiveUniformType };
|
|
3356
3356
|
\`\`\`
|
|
3357
|
-
`,
|
|
3357
|
+
`,uO=`### 默认的顶点属性
|
|
3358
3358
|
\`\`\`
|
|
3359
3359
|
{
|
|
3360
3360
|
position: {
|
|
@@ -3388,7 +3388,7 @@ export type AttributesJsonType = {
|
|
|
3388
3388
|
[k: string]: AttributeJsonType;
|
|
3389
3389
|
}
|
|
3390
3390
|
\`\`\`
|
|
3391
|
-
`,
|
|
3391
|
+
`,cO=`### 默认的索引数组
|
|
3392
3392
|
\`\`\`
|
|
3393
3393
|
{
|
|
3394
3394
|
"type": "Uint16Array",
|
|
@@ -3403,7 +3403,7 @@ export type IndexJsonType = {
|
|
|
3403
3403
|
array: number[];
|
|
3404
3404
|
}
|
|
3405
3405
|
\`\`\`
|
|
3406
|
-
`,Vt=class Vt extends Q.ESObjectWithLocation{constructor(e){super(e);L(this,"_attributes",this.disposeVar(p.react(void 0)));L(this,"_indexTypedArray",this.disposeVar(p.react(void 0)))}get typeName(){return"ESCustomPrimitive"}get defaultProps(){return Vt.createDefaultProps()}get attributesJson(){return this.attributes&&hC(this.attributes)}set attributesJson(e){const i=JSON.stringify(this.attributesJson),o=JSON.stringify(e);i!==o&&(this.attributes=e&&jU(e))}get attributesJsonChanged(){return this.attributesChanged}get indexTypedArrayJson(){return this.indexTypedArray&&AC(this.indexTypedArray)}set indexTypedArrayJson(e){const i=JSON.stringify(this.indexTypedArrayJson),o=JSON.stringify(e);i!==o&&(this.indexTypedArray=e&&eO(e))}get indexTypedArrayJsonChanged(){return this.indexTypedArrayChanged}get attributes(){return this._attributes.value}set attributes(e){this._attributes.value=e}get attributesChanged(){return this._attributes.changed}get indexTypedArray(){return this._indexTypedArray.value}set indexTypedArray(e){this._indexTypedArray.value=e}get indexTypedArrayChanged(){return this._indexTypedArray.changed}setUniformMap(e){if(Object.entries(e).some(([o,r])=>(console.warn(`setUniformMap error: key: ${o} value: ${r}`),r===null)))return;const i={...this.uniformMap??{},...e};this.uniformMap=i}setLocalBoundingSphere(e,i=[0,0,0]){if(!Number.isFinite(e)||e<=0){console.warn(`!Number.isFinite(radius) || radius <= 0 radius: ${e}`);return}this.boundingVolume={type:"LocalBoundingSphere",data:{center:i,radius:e}}}setLocalAxisedBoundingBox(e,i){if(e.some(o=>!Number.isFinite(o))||i.some(o=>!Number.isFinite(o))){console.warn(`setLocalAxisedBoundingBox error, min: ${e.toString()}, max: ${i.toString()}`);return}this.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:e,max:i}}}computeLocalAxisedBoundingBoxFromAttribute(e="a_position"){if(!this.attributes||!this.attributes[e]){console.warn(`attributes[${e}]不存在!无法获取!`);return}const i=this.attributes[e];if(!("typedArray"in i)||!(i.typedArray instanceof Float32Array)){console.warn(`!('typedArray' in posAttribute) || !(posAttribute.typedArray instanceof Float32Array) attributeName: ${e}`);return}if(!("componentsPerAttribute"in i)||i.componentsPerAttribute!==3){console.warn(`!('componentsPerAttribute' in posAttribute) || posAttribute.componentsPerAttribute !== 3 attributeName: ${e}`);return}const{min:o,max:r}=Vt.getMinMaxPosition(i.typedArray);if(!o.some(s=>!Number.isFinite(s)||r.some(a=>!Number.isFinite(a))))return{min:o,max:r}}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.Number4Property("可视范围控制","可视范围控制[near0, near1, far1, far0]",!0,!1,[this,"viewDistanceRange"],Vt.defaults.viewDistanceRange),new Q.BooleanProperty("可视距离调试","可视距离调试",!1,!1,[this,"viewDistanceDebug"])]),new Q.GroupProperty("屏幕像素","屏幕像素",[new Q.NumberProperty("最大缩放值","最大缩放值,需要和屏幕像素(pixelSize)配合适用!",!0,!1,[this,"maximumScale"],3),new Q.NumberProperty("最小缩放值","最小缩放值,需要和屏幕像素(pixelSize)配合适用!",!0,!1,[this,"minimumScale"],1),new Q.NumberProperty("屏幕像素","注意物体的实际屏幕像素=pixelSize*物体的物理尺寸(m),例如:一个20米长的房子,pixelSize设置为5,那么它在屏幕上的实际像素尺寸就是5*20=100px。根据物体在屏幕上的像素大小来决定缩放值,缩放值受maximumScale、minimumScale属性限制",!0,!1,[this,"pixelSize"],5),new Q.BooleanProperty("显示缩放值","每个视口都显示各自的缩放值",!0,!1,[this,"showSceneScale"],!1)]),new Q.GroupProperty("图元属性","图元属性",[new Q.JsonProperty("模型矩阵","模型矩阵",!0,!1,[this,"modelMatrix"],Vt.defaults.modelMatrix),new Q.BooleanProperty("是否拣选","是否拣选",!0,!1,[this,"cull"]),new Q.JsonProperty("包围体","用来进行拣选,以剔除不再视野范围内的模型",!0,!1,[this,"boundingVolume"],aC,rO),new Q.EnumProperty("渲染顺序","渲染顺序",!0,!1,[this,"pass"],nO,"TRANSLUCENT"),new Q.EnumProperty("图元类型","图元类型",!0,!1,[this,"primitiveType"],tO,"TRIANGLES"),new Q.JsonProperty("渲染状态","渲染状态",!0,!1,[this,"renderState"],sC,iO),new Q.EvalStringProperty("顶点着色器","顶点着色器",!0,!1,[this,"vertexShaderSource"],rC,oO),new Q.EvalStringProperty("片元着色器","片元着色器",!0,!1,[this,"fragmentShaderSource"],oC,aO),new Q.JsonProperty("一致性变量(uniform)","一致性变量(uniform)",!0,!1,[this,"uniformMap"],lC,sO),new Q.JsonProperty("顶点属性(attributes)","顶点属性(attributes)",!0,!1,[this,"attributesJson"],hC(uC),lO),new Q.JsonProperty("索引(index)","索引(index)",!0,!1,[this,"indexTypedArrayJson"],AC(cC),uO),new Q.NumberProperty("count","count",!0,!1,[this,"count"],0),new Q.NumberProperty("offset","offset",!0,!1,[this,"offset"],0),new Q.NumberProperty("instanceCount","instanceCount",!0,!1,[this,"instanceCount"],0),new Q.FunctionProperty("自动计算包围盒","根据顶点位置属性,自动计算包围盒",["string"],i=>{const o=this.computeLocalAxisedBoundingBoxFromAttribute(i);if(!o)return;const{min:r,max:s}=o;this.setLocalAxisedBoundingBox(r,s)},["position"])]),new Q.GroupProperty("本地变换","本地变换",[new Q.PositionProperty("本地偏移","本地偏移,不是经纬度!",!0,!1,[this,"localPosition"]),new Q.RotationProperty("本地姿态","本地姿态",!0,!1,[this,"localRotation"]),new Q.Number3Property("本地缩放","本地缩放",!0,!1,[this,"localScale"],[1,1,1]),new Q.JsonProperty("本地模型矩阵","本地模型矩阵,如果该属性有值,那么localPosition、localRotation、localScale等属性将不起作用。",!0,!1,[this,"localModelMatrix"])]),new Q.GroupProperty("调试","调试",[new Q.BooleanProperty("debugShowBoundingVolume","debugShowBoundingVolume",!0,!1,[this,"debugShowBoundingVolume"],!1),new Q.NumberProperty("debugOverlappingFrustums","debugOverlappingFrustums",!0,!1,[this,"debugOverlappingFrustums"],0)]),new Q.GroupProperty("Czm特有","Czm特有",[new Q.BooleanProperty("occlude","occlude",!0,!1,[this,"occlude"],!0),new Q.BooleanProperty("castShadows","castShadows",!0,!1,[this,"castShadows"],!1),new Q.BooleanProperty("receiveShadows","receiveShadows",!0,!1,[this,"receiveShadows"],!1),new Q.BooleanProperty("executeInClosestFrustum","executeInClosestFrustum",!0,!1,[this,"executeInClosestFrustum"],!1),new Q.BooleanProperty("pickOnly","pickOnly",!0,!1,[this,"pickOnly"],!1),new Q.BooleanProperty("depthForTranslucentClassification","depthForTranslucentClassification",!0,!1,[this,"depthForTranslucentClassification"],!1)])]}};L(Vt,"type",Vt.register("ESCustomPrimitive",Vt,{chsName:"ES自定义图元",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES自定义图元"})),L(Vt,"defaultRenderState",sC),L(Vt,"defaultVertexShaderSource",rC),L(Vt,"defaultFragmentShaderSource",oC),L(Vt,"defaultUniformMap",lC),L(Vt,"defaultBoundingVolume",aC),L(Vt,"defaultAttribute",uC),L(Vt,"defaultIndexTypedArray",cC),L(Vt,"defaults",{...Q.ESObjectWithLocation.defaults,allowPicking:!1,position:[116.39,39.9,0],rotation:[0,0,0],scale:[1,1,1],modelMatrix:[-.8957893500750183,-.4444788412198901,0,0,.28511078894078473,-.5746037485691958,.7671651518152995,0,-.3409886777031455,.68721837274483,.6414496315691579,0,-2.1778739967047274e6,4389222053178148e-9,4.0694736755001387e6,1],viewDistanceRange:[1e3,1e4,3e4,6e4]}),L(Vt,"getMinMaxPosition",p.getMinMaxPosition);let $r=Vt;(t=>{t.createDefaultProps=()=>({maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,modelMatrix:p.reactArrayWithUndefined(void 0),cull:p.react(void 0),boundingVolume:p.reactJson(void 0),renderState:p.reactJson(void 0),primitiveType:void 0,pass:void 0,vertexShaderSource:void 0,fragmentShaderSource:void 0,uniformMap:p.reactJson(void 0),localPosition:p.reactArrayWithUndefined(void 0),localRotation:p.reactArrayWithUndefined(void 0),localScale:p.reactArrayWithUndefined(void 0),localModelMatrix:p.reactArrayWithUndefined(void 0),occlude:void 0,count:void 0,offset:void 0,instanceCount:void 0,castShadows:void 0,receiveShadows:void 0,executeInClosestFrustum:void 0,debugShowBoundingVolume:void 0,debugOverlappingFrustums:void 0,pickOnly:void 0,depthForTranslucentClassification:void 0,viewDistanceRange:p.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,...Q.ESObjectWithLocation.createDefaultProps()})})($r||($r={})),p.extendClassProps($r.prototype,$r.createDefaultProps);const Bi=class Bi extends Q.ESGeoVector{constructor(e){super(e);L(this,"editingBindMode","lineString");L(this,"_player");this._player=this.disposeVar(new Q.Player);{const i=Bi.defaults;this.dispose(p.bind([this._player,"loop"],[this,"loop"],o=>o??i.loop,o=>o??i.loop)),this.dispose(p.bind([this._player,"currentTime"],[this,"currentTime"],o=>o??i.currentTime,o=>o??i.currentTime)),this.dispose(p.bind([this._player,"duration"],[this,"duration"],o=>o??i.duration,o=>o??i.duration)),this.dispose(p.bind([this._player,"playing"],[this,"playing"],o=>o??i.playing,o=>o??i.playing)),this.dispose(p.bind([this._player,"speed"],[this,"speed"],o=>o??i.speed,o=>o??i.speed))}}get typeName(){return"ESSignalTransmission"}get defaultProps(){return Bi.createDefaultProps()}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.NumberProperty("起始时间","信号起始传输时间",!1,!1,[this,"startTime"]),new Q.NumberProperty("传输时间","信号实际传输时间",!1,!1,[this,"transmissionTime"]),new Q.NumberProperty("高度比率","当只有两个位置点时才有效,此时信号线会自动变成有高度的曲线",!1,!1,[this,"heightRatio"]),new Q.EnumProperty("弧线类型","弧线类型",!1,!1,[this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]]),new Q.BooleanProperty("变亮","变亮",!1,!1,[this,"brightening"]),new Q.BooleanProperty("深度监测","深度监测",!1,!1,[this,"depthTest"]),new Q.UriProperty("图片路径","图片路径,若无图片,则显示内部的OD线样式",!0,!1,[this,"imageUrl"],Bi.defaults.imageUrl),new Q.NumberProperty("图像重复次数","图像重复次数,有图像时才有效",!1,!1,[this,"repeat"]),new Q.EnumProperty("运动方向","运动方向,注意对图片来说只有正反向。",!1,!1,[this,"bidirectional"],[["正向",0],["反向",1],["双向",2],["无",3]])]),new Q.GroupProperty("播放器","播放器",[new Q.PlayerProperty("播放器","播放器",[this,"playing"],[this,"ratio"],[this,"loop"]),new Q.BooleanProperty("是否循环","是否循环.",!1,!1,[this,"loop"]),new Q.NumberProperty("当前时间","当前时间",!1,!1,[this.player,"currentTime"]),new Q.NumberProperty("过渡时间","过渡时间",!1,!1,[this,"duration"]),new Q.BooleanProperty("是否播放","是否播放.",!1,!1,[this,"playing"]),new Q.NumberProperty("播放速度","播放速度.",!1,!1,[this,"speed"])])]}};L(Bi,"type",Bi.register("ESSignalTransmission",Bi,{chsName:"信号传输器",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"})),L(Bi,"supportEditingModes",[...Q.ESGeoVector.supportEditingModes,Q.ESJEditingMode.LineStringAppend,Q.ESJEditingMode.LineStringInsert]),L(Bi,"defaults",{...Q.ESGeoVector.defaults,loop:!0,currentTime:0,playerCurrentTime:0,duration:3e3,speed:1,playing:!0,startTime:0,transmissionTime:3e3,color:[0,1,0,1],width:3,heightRatio:1,arcType:"GEODESIC",brightening:!1,depthTest:!0,imageUrl:"${esobjs-xe2-plugin-assets-script-dir}/xe2-assets/esobjs-xe2-plugin/images/signal.png",repeat:5,bidirectional:0});let Yr=Bi;(t=>{t.createDefaultProps=()=>({imageUrl:void 0,repeat:5,bidirectional:0,startTime:0,transmissionTime:3e3,arcType:"GEODESIC",brightening:!1,depthTest:!0,heightRatio:1,loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,...Q.ESGeoVector.createDefaultProps()})})(Yr||(Yr={})),p.extendClassProps(Yr.prototype,Yr.createDefaultProps);const ao=class ao extends Q.ESGeoVector{constructor(e){super(e);L(this,"editingBindMode","lineString")}get typeName(){return"ESRoad"}get defaultProps(){return ao.createDefaultProps()}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.NumberProperty("线宽","道路宽度,单位是米!",!1,!1,[this,"width"]),new Q.EnumProperty("弧线类型","弧线类型",!1,!1,[this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]]),new Q.StringProperty("道路图片","道路图片",!1,!1,[this,"imageUrl"]),new Q.Number2Property("重复次数","重复次数,该参数以后会取消!",!1,!1,[this,"repeat"])])]}};L(ao,"type",ao.register("ESRoad",ao,{chsName:"贴地道路",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"最大宽度到1000米"})),L(ao,"supportEditingModes",[...Q.ESGeoVector.supportEditingModes,Q.ESJEditingMode.LineStringAppend,Q.ESJEditingMode.LineStringInsert]),L(ao,"defaults",{...Q.ESGeoVector.defaults,width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1]});let Jr=ao;(t=>{t.createDefaultProps=()=>({...Q.ESGeoVector.createDefaultProps(),width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],stroked:!0})})(Jr||(Jr={})),p.extendClassProps(Jr.prototype,Jr.createDefaultProps);const so=class so extends Q.ESGeoVector{constructor(e){super(e);L(this,"_deprecated",["ground"]);L(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());L(this,"editingBindMode","circular");this.stroked=!0,this.filled=!0,this.strokeColor=[1,1,1,1],this.fillColor=[1,1,1,.5]}get typeName(){return"ESGeoSmoothPolygon"}get defaultProps(){return so.createDefaultProps()}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.GroupProperty("czm","czm",[new Q.BooleanProperty("是否贴地","A boolean Property specifying the visibility.",!0,!1,[this,"ground"],!1),new Q.NumberProperty("厚度","厚度",!0,!1,[this,"depth"],16)])])]}};L(so,"type",so.register("ESGeoSmoothPolygon",so,{chsName:"平滑多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平滑多边形"})),L(so,"supportEditingModes",[...Q.ESGeoVector.supportEditingModes,Q.ESJEditingMode.CircularAppend,Q.ESJEditingMode.CircularInsert]),L(so,"defaults",{...Q.ESGeoVector.defaults,fillStyle:{color:[1,1,1,.5],material:"",materialParams:{}}});let Ji=so;(t=>{t.createDefaultProps=()=>({...Q.ESGeoVector.createDefaultProps(),ground:!1,depth:0})})(Ji||(Ji={})),p.extendClassProps(Ji.prototype,Ji.createDefaultProps);const ar=class ar extends Q.ESGeoVector{constructor(e){super(e);L(this,"_deprecated",["ground"]);L(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());L(this,"_geoPolylinePath");L(this,"_currentDistance",this.disposeVar(p.react(0)));this.stroked=!0}get typeName(){return"ESGeoBezierPath"}get defaultProps(){return ar.createDefaultProps()}updateEditing(){var e;(e=this.viewer)==null||e.startEditing(this,[Q.ESJEditingMode.LineStringAppend,Q.ESJEditingMode.LineStringInsert],{callSource:"inner"})}get geoPolylinePath(){return this._geoPolylinePath}set geoPolylinePath(e){this._geoPolylinePath=e}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.BooleanProperty("是否显示当前","是否显示当前.",!1,!1,[this,"currentPoiShow"]),new Q.NumberProperty("当前距离","当前距离",!1,!1,[this,"currentDistance"]),new Q.NumberProperty("分辨率","分辨率",!1,!1,[this,"resolution"]),new Q.NumberProperty("锐化程度","锐化程度",!1,!1,[this,"sharpness"])]),new Q.GroupProperty("GeoPath","GeoPath",[new Q.JsonProperty("timePosRots","类型为[timeStamp: number, position: [longitude: number, latitude: number, height: number], rotation: [heading: number, pitch: number, roll: number] | undefined];",!1,!0,[this,"timePosRots"],ar.defaults.timePosRots),new Q.NumberProperty("折线超前显示时长","折线超前显示时长",!1,!1,[this,"leadTime"]),new Q.NumberProperty("折线滞后显示时长","折线滞后显示时长",!1,!1,[this,"trailTime"])]),new Q.GroupProperty("播放器","播放器",[new Q.PlayerProperty("播放器","播放器",[this,"playing"],[this._geoPolylinePath,"ratio"],[this,"loop"]),new Q.BooleanProperty("是否循环","是否循环.",!1,!1,[this,"loop"]),new Q.NumberProperty("当前时间","当前时间",!1,!1,[this,"currentTime"]),new Q.NumberProperty("过渡时间","过渡时间",!1,!1,[this,"duration"]),new Q.BooleanProperty("是否播放","是否播放.",!1,!1,[this,"playing"]),new Q.NumberProperty("播放速度","播放速度.",!1,!1,[this,"speed"])]),new Q.GroupProperty("折线","折线",[new Q.BooleanProperty("是否贴地","是否贴地.",!1,!1,[this,"ground"]),new Q.BooleanProperty("是否开启深度检测","A boolean Property specifying the visibility.",!1,!1,[this,"depthTest"]),new Q.EnumProperty("弧线类型","弧线类型",!1,!1,[this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]])])]}};L(ar,"type",ar.register("ESGeoBezierPath",ar,{chsName:"贝塞尔曲线路径",tags:["GeoObjects"],description:"贝塞尔曲线路径"})),L(ar,"supportEditingModes",[...Q.ESGeoVector.supportEditingModes,Q.ESJEditingMode.LineStringAppend,Q.ESJEditingMode.LineStringInsert]),L(ar,"defaults",{...Q.ESGeoVector.defaults,currentPoiShow:!0,currentDistance:0,resolution:1e3,sharpness:.85,timePosRots:[],leadTime:0,trailTime:0,loop:!1,currentTime:0,duration:3e3,playing:!1,speed:1,ground:!1,depthTest:!1,arcType:"GEODESIC"});let jr=ar;(t=>{t.createDefaultProps=()=>({currentPoiShow:!0,ground:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0,...Q.ESGeoVector.createDefaultProps()})})(jr||(jr={})),p.extendClassProps(jr.prototype,jr.createDefaultProps);const Iu=class Iu extends Bn{constructor(e,i){super(e,i);L(this,"_czmBezierPath");if(this._czmBezierPath=this.disposeVar(new zl(i,e.id)),e.geoPolylinePath=this._czmBezierPath.geoPolylinePath,!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmBezierPath;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"currentPoiShow"],[e,"currentPoiShow"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.bind([r,"currentDistance"],[e,"currentDistance"])),this.dispose(p.track([r,"resolution"],[e,"resolution"])),this.dispose(p.track([r,"sharpness"],[e,"sharpness"])),this.dispose(p.track([r.geoPath,"timePosRots"],[e.geoPath,"timePosRots"])),this.dispose(p.track([r,"leadTime"],[e,"leadTime"])),this.dispose(p.track([r,"trailTime"],[e,"trailTime"])),this.dispose(p.track([r.geoPolylinePath,"ratio"],[e.geoPolylinePath,"ratio"])),this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"currentTime"],[e,"currentTime"])),this.dispose(p.track([r,"duration"],[e,"duration"])),this.dispose(p.track([r,"playing"],[e,"playing"])),this.dispose(p.track([r,"speed"],[e,"speed"])),this.dispose(p.track([r,"depthTest"],[e,"depthTest"])),this.dispose(p.track([r,"arcType"],[e,"arcType"])),this.dispose(p.track([r,"polylineShow"],[e,"stroked"])),this.dispose(p.track([r,"width"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"strokeColor"]));{const s=()=>{r.ground=e.ground||e.strokeGround};s();const a=this.dv(p.createNextAnimateFrameEvent(e.groundChanged,e.strokeGroundChanged));this.d(a.don(s))}{const s=()=>{if(!e.stroked){r.hasDash=!1,r.hasArrow=!1;return}const c=e.strokeStyle;if(c.material==="hasDash"&&c.materialParams)try{const u=c.materialParams;Reflect.has(u,"gapColor")&&(r.gapColor=u.gapColor??[0,0,0,0]),Reflect.has(u,"dashLength")&&(r.dashLength=u.dashLength),Reflect.has(u,"dashPattern")&&(r.dashPattern=u.dashPattern)}catch(u){console.error(u)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashLength=0;const h=e.strokeMaterial??"normal";h==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):h==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1)};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}}get czmBezierPath(){return this._czmBezierPath}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBezierPath:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmBezierPath:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Iu,"type",Iu.register("ESCesiumViewer",jr.type,Iu));let Dm=Iu;const ku=class ku extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoCustomDivPoi");L(this,"_divContainer");L(this,"_hasClassDivAndPos",{});if(this._czmGeoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoCustomDivPoi;r.cssAllInitial=!0,this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"opacity"],[e,"opacity"])),this.d(p.track([r,"zOrder"],[e,"zOrder"]));{const s=()=>{r.originRatioAndOffset=[...e.anchor,0,0],this._divContainer&&this._divContainer.children[0]&&(this._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};s(),this.dispose(e.anchorChanged.don(s))}{const s=()=>{const l=this;return class extends p.Destroyable{constructor(h,u,A){if(super(),this._subContainer=h,!A||!(A instanceof Ye))return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");l._divContainer=this.disposeVar(new e.instanceClass(h,e,A))._container;{const g=()=>{l._divContainer.style.pointerEvents=l.sceneObject.editing?"none":"all"};g(),this.d(l.sceneObject.editingChanged.don(g))}{const g=()=>{l._divContainer.children[0]&&(l._divContainer.children[0].style.transform=`scale(${e.scale[1]},${e.scale[2]})`,l._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};g(),this.d(e.scaleChanged.don(g))}let f=l._divContainer?l._divContainer.querySelectorAll("*[class]"):[];for(let g=0;g<f.length;g++){const v=f[g];var d=v.getBoundingClientRect();l._hasClassDivAndPos[v.className]=[v.offsetLeft,v.offsetTop,v.offsetLeft+d.width,v.offsetTop+d.height]}}}},a=()=>{try{e.instanceClass?r.instanceClass=s():r.instanceClass=void 0}catch(l){console.error(l)}};a(),this.dispose(e.instanceClassChanged.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(s=>{var c;s.assign({sceneObject:e});const a=(c=_o(s,"pickResult"))==null?void 0:c.pointerEvent;if(!a)return;const l={type:a.buttons!=0&&a.button==0?"leftClick":a.button==2?"rightClick":void 0,add:{mousePos:[a.offsetX,a.offsetY]}};if(l.type==null&&(l.type=a.type),l.type==="leftClick"){const h=Object.keys(this._hasClassDivAndPos);for(let u=0;u<h.length;u++){const A=h[u];let f=this._hasClassDivAndPos[A],d=this._divContainer.getBoundingClientRect();const g=a.clientX-d.left,v=a.clientY-d.top;if(g>=f[0]&&g<=f[2]&&v>=f[1]&&v<=f[3]){l.add.className=A;break}}}e.widgetEvent.emit(l),l.type==="leftClick"&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoCustomDivPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.position&&Be(r.viewer,s.position,1e3,Dn,e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ku,"type",ku.register("ESCesiumViewer",Q.ESGeoDiv.type,ku));let Rm=ku;const Fu=class Fu extends Ge{constructor(e,i){super(e,i);L(this,"_czmDivTextPoi");if(this._czmDivTextPoi=this.disposeVar(new ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDivTextPoi;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(p.bind([r,"textEditing"],[e,"textEditing"])),this.dispose(p.bind([r,"width"],[e,"width"])),this.dispose(p.bind([r,"text"],[e,"text"])),this.dispose(p.track([r,"originRatioAndOffset"],[e,"originRatioAndOffset"])),this.dispose(p.track([r,"opacity"],[e,"opacity"])),this.dispose(p.bind([r,"fontSize"],[e,"fontSize"])),this.dispose(p.track([r,"color"],[e,"color"])),this.dispose(p.track([r,"backgroundColor"],[e,"backgroundColor"])),this.dispose(p.track([r,"borderRadius"],[e,"borderRadius"])),this.dispose(p.track([r,"borderColor"],[e,"borderColor"])),this.dispose(p.track([r,"borderWidth"],[e,"borderWidth"])),this.dispose(p.track([r,"textAlign"],[e,"textAlign"])),this.dispose(p.track([r,"borderStyle"],[e,"borderStyle"]))}get czmDivTextPoi(){return this._czmDivTextPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDivTextPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Fu,"type",Fu.register("ESCesiumViewer",Q.ESGeoDivTextPoi.type,Fu));let Um=Fu;const cO={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[116.2,39.56]},properties:{title:"swimming","marker-symbol":"swimming","marker-color":"#8F1312"}},{type:"Feature",geometry:{type:"Point",coordinates:[115.2,38.56]},properties:{title:"8","marker-symbol":"8","marker-color":"#46117E"}},{type:"Feature",geometry:{type:"Point",coordinates:[114.2,37.56]},properties:{title:"6","marker-symbol":"6","marker-color":"#713291"}}]},hO=`properties是一个包含三个属性的对象,title表示标题,marker-symbol表示点位的文字内容,marker-color表示点位颜色,properties可以删除,然后使用场景对象属性设置。
|
|
3406
|
+
`,Vt=class Vt extends Q.ESObjectWithLocation{constructor(e){super(e);L(this,"_attributes",this.disposeVar(p.react(void 0)));L(this,"_indexTypedArray",this.disposeVar(p.react(void 0)))}get typeName(){return"ESCustomPrimitive"}get defaultProps(){return Vt.createDefaultProps()}get attributesJson(){return this.attributes&&hC(this.attributes)}set attributesJson(e){const i=JSON.stringify(this.attributesJson),o=JSON.stringify(e);i!==o&&(this.attributes=e&&eO(e))}get attributesJsonChanged(){return this.attributesChanged}get indexTypedArrayJson(){return this.indexTypedArray&&AC(this.indexTypedArray)}set indexTypedArrayJson(e){const i=JSON.stringify(this.indexTypedArrayJson),o=JSON.stringify(e);i!==o&&(this.indexTypedArray=e&&tO(e))}get indexTypedArrayJsonChanged(){return this.indexTypedArrayChanged}get attributes(){return this._attributes.value}set attributes(e){this._attributes.value=e}get attributesChanged(){return this._attributes.changed}get indexTypedArray(){return this._indexTypedArray.value}set indexTypedArray(e){this._indexTypedArray.value=e}get indexTypedArrayChanged(){return this._indexTypedArray.changed}setUniformMap(e){if(Object.entries(e).some(([o,r])=>(console.warn(`setUniformMap error: key: ${o} value: ${r}`),r===null)))return;const i={...this.uniformMap??{},...e};this.uniformMap=i}setLocalBoundingSphere(e,i=[0,0,0]){if(!Number.isFinite(e)||e<=0){console.warn(`!Number.isFinite(radius) || radius <= 0 radius: ${e}`);return}this.boundingVolume={type:"LocalBoundingSphere",data:{center:i,radius:e}}}setLocalAxisedBoundingBox(e,i){if(e.some(o=>!Number.isFinite(o))||i.some(o=>!Number.isFinite(o))){console.warn(`setLocalAxisedBoundingBox error, min: ${e.toString()}, max: ${i.toString()}`);return}this.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:e,max:i}}}computeLocalAxisedBoundingBoxFromAttribute(e="a_position"){if(!this.attributes||!this.attributes[e]){console.warn(`attributes[${e}]不存在!无法获取!`);return}const i=this.attributes[e];if(!("typedArray"in i)||!(i.typedArray instanceof Float32Array)){console.warn(`!('typedArray' in posAttribute) || !(posAttribute.typedArray instanceof Float32Array) attributeName: ${e}`);return}if(!("componentsPerAttribute"in i)||i.componentsPerAttribute!==3){console.warn(`!('componentsPerAttribute' in posAttribute) || posAttribute.componentsPerAttribute !== 3 attributeName: ${e}`);return}const{min:o,max:r}=Vt.getMinMaxPosition(i.typedArray);if(!o.some(s=>!Number.isFinite(s)||r.some(a=>!Number.isFinite(a))))return{min:o,max:r}}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.Number4Property("可视范围控制","可视范围控制[near0, near1, far1, far0]",!0,!1,[this,"viewDistanceRange"],Vt.defaults.viewDistanceRange),new Q.BooleanProperty("可视距离调试","可视距离调试",!1,!1,[this,"viewDistanceDebug"])]),new Q.GroupProperty("屏幕像素","屏幕像素",[new Q.NumberProperty("最大缩放值","最大缩放值,需要和屏幕像素(pixelSize)配合适用!",!0,!1,[this,"maximumScale"],3),new Q.NumberProperty("最小缩放值","最小缩放值,需要和屏幕像素(pixelSize)配合适用!",!0,!1,[this,"minimumScale"],1),new Q.NumberProperty("屏幕像素","注意物体的实际屏幕像素=pixelSize*物体的物理尺寸(m),例如:一个20米长的房子,pixelSize设置为5,那么它在屏幕上的实际像素尺寸就是5*20=100px。根据物体在屏幕上的像素大小来决定缩放值,缩放值受maximumScale、minimumScale属性限制",!0,!1,[this,"pixelSize"],5),new Q.BooleanProperty("显示缩放值","每个视口都显示各自的缩放值",!0,!1,[this,"showSceneScale"],!1)]),new Q.GroupProperty("图元属性","图元属性",[new Q.JsonProperty("模型矩阵","模型矩阵",!0,!1,[this,"modelMatrix"],Vt.defaults.modelMatrix),new Q.BooleanProperty("是否拣选","是否拣选",!0,!1,[this,"cull"]),new Q.JsonProperty("包围体","用来进行拣选,以剔除不再视野范围内的模型",!0,!1,[this,"boundingVolume"],aC,oO),new Q.EnumProperty("渲染顺序","渲染顺序",!0,!1,[this,"pass"],iO,"TRANSLUCENT"),new Q.EnumProperty("图元类型","图元类型",!0,!1,[this,"primitiveType"],nO,"TRIANGLES"),new Q.JsonProperty("渲染状态","渲染状态",!0,!1,[this,"renderState"],sC,rO),new Q.EvalStringProperty("顶点着色器","顶点着色器",!0,!1,[this,"vertexShaderSource"],rC,aO),new Q.EvalStringProperty("片元着色器","片元着色器",!0,!1,[this,"fragmentShaderSource"],oC,sO),new Q.JsonProperty("一致性变量(uniform)","一致性变量(uniform)",!0,!1,[this,"uniformMap"],lC,lO),new Q.JsonProperty("顶点属性(attributes)","顶点属性(attributes)",!0,!1,[this,"attributesJson"],hC(uC),uO),new Q.JsonProperty("索引(index)","索引(index)",!0,!1,[this,"indexTypedArrayJson"],AC(cC),cO),new Q.NumberProperty("count","count",!0,!1,[this,"count"],0),new Q.NumberProperty("offset","offset",!0,!1,[this,"offset"],0),new Q.NumberProperty("instanceCount","instanceCount",!0,!1,[this,"instanceCount"],0),new Q.FunctionProperty("自动计算包围盒","根据顶点位置属性,自动计算包围盒",["string"],i=>{const o=this.computeLocalAxisedBoundingBoxFromAttribute(i);if(!o)return;const{min:r,max:s}=o;this.setLocalAxisedBoundingBox(r,s)},["position"])]),new Q.GroupProperty("本地变换","本地变换",[new Q.PositionProperty("本地偏移","本地偏移,不是经纬度!",!0,!1,[this,"localPosition"]),new Q.RotationProperty("本地姿态","本地姿态",!0,!1,[this,"localRotation"]),new Q.Number3Property("本地缩放","本地缩放",!0,!1,[this,"localScale"],[1,1,1]),new Q.JsonProperty("本地模型矩阵","本地模型矩阵,如果该属性有值,那么localPosition、localRotation、localScale等属性将不起作用。",!0,!1,[this,"localModelMatrix"])]),new Q.GroupProperty("调试","调试",[new Q.BooleanProperty("debugShowBoundingVolume","debugShowBoundingVolume",!0,!1,[this,"debugShowBoundingVolume"],!1),new Q.NumberProperty("debugOverlappingFrustums","debugOverlappingFrustums",!0,!1,[this,"debugOverlappingFrustums"],0)]),new Q.GroupProperty("Czm特有","Czm特有",[new Q.BooleanProperty("occlude","occlude",!0,!1,[this,"occlude"],!0),new Q.BooleanProperty("castShadows","castShadows",!0,!1,[this,"castShadows"],!1),new Q.BooleanProperty("receiveShadows","receiveShadows",!0,!1,[this,"receiveShadows"],!1),new Q.BooleanProperty("executeInClosestFrustum","executeInClosestFrustum",!0,!1,[this,"executeInClosestFrustum"],!1),new Q.BooleanProperty("pickOnly","pickOnly",!0,!1,[this,"pickOnly"],!1),new Q.BooleanProperty("depthForTranslucentClassification","depthForTranslucentClassification",!0,!1,[this,"depthForTranslucentClassification"],!1)])]}};L(Vt,"type",Vt.register("ESCustomPrimitive",Vt,{chsName:"ES自定义图元",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES自定义图元"})),L(Vt,"defaultRenderState",sC),L(Vt,"defaultVertexShaderSource",rC),L(Vt,"defaultFragmentShaderSource",oC),L(Vt,"defaultUniformMap",lC),L(Vt,"defaultBoundingVolume",aC),L(Vt,"defaultAttribute",uC),L(Vt,"defaultIndexTypedArray",cC),L(Vt,"defaults",{...Q.ESObjectWithLocation.defaults,allowPicking:!1,position:[116.39,39.9,0],rotation:[0,0,0],scale:[1,1,1],modelMatrix:[-.8957893500750183,-.4444788412198901,0,0,.28511078894078473,-.5746037485691958,.7671651518152995,0,-.3409886777031455,.68721837274483,.6414496315691579,0,-2.1778739967047274e6,4389222053178148e-9,4.0694736755001387e6,1],viewDistanceRange:[1e3,1e4,3e4,6e4]}),L(Vt,"getMinMaxPosition",p.getMinMaxPosition);let $r=Vt;(t=>{t.createDefaultProps=()=>({maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,modelMatrix:p.reactArrayWithUndefined(void 0),cull:p.react(void 0),boundingVolume:p.reactJson(void 0),renderState:p.reactJson(void 0),primitiveType:void 0,pass:void 0,vertexShaderSource:void 0,fragmentShaderSource:void 0,uniformMap:p.reactJson(void 0),localPosition:p.reactArrayWithUndefined(void 0),localRotation:p.reactArrayWithUndefined(void 0),localScale:p.reactArrayWithUndefined(void 0),localModelMatrix:p.reactArrayWithUndefined(void 0),occlude:void 0,count:void 0,offset:void 0,instanceCount:void 0,castShadows:void 0,receiveShadows:void 0,executeInClosestFrustum:void 0,debugShowBoundingVolume:void 0,debugOverlappingFrustums:void 0,pickOnly:void 0,depthForTranslucentClassification:void 0,viewDistanceRange:p.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,...Q.ESObjectWithLocation.createDefaultProps()})})($r||($r={})),p.extendClassProps($r.prototype,$r.createDefaultProps);const Bi=class Bi extends Q.ESGeoVector{constructor(e){super(e);L(this,"editingBindMode","lineString");L(this,"_player");this._player=this.disposeVar(new Q.Player);{const i=Bi.defaults;this.dispose(p.bind([this._player,"loop"],[this,"loop"],o=>o??i.loop,o=>o??i.loop)),this.dispose(p.bind([this._player,"currentTime"],[this,"currentTime"],o=>o??i.currentTime,o=>o??i.currentTime)),this.dispose(p.bind([this._player,"duration"],[this,"duration"],o=>o??i.duration,o=>o??i.duration)),this.dispose(p.bind([this._player,"playing"],[this,"playing"],o=>o??i.playing,o=>o??i.playing)),this.dispose(p.bind([this._player,"speed"],[this,"speed"],o=>o??i.speed,o=>o??i.speed))}}get typeName(){return"ESSignalTransmission"}get defaultProps(){return Bi.createDefaultProps()}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.NumberProperty("起始时间","信号起始传输时间",!1,!1,[this,"startTime"]),new Q.NumberProperty("传输时间","信号实际传输时间",!1,!1,[this,"transmissionTime"]),new Q.NumberProperty("高度比率","当只有两个位置点时才有效,此时信号线会自动变成有高度的曲线",!1,!1,[this,"heightRatio"]),new Q.EnumProperty("弧线类型","弧线类型",!1,!1,[this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]]),new Q.BooleanProperty("变亮","变亮",!1,!1,[this,"brightening"]),new Q.BooleanProperty("深度监测","深度监测",!1,!1,[this,"depthTest"]),new Q.UriProperty("图片路径","图片路径,若无图片,则显示内部的OD线样式",!0,!1,[this,"imageUrl"],Bi.defaults.imageUrl),new Q.NumberProperty("图像重复次数","图像重复次数,有图像时才有效",!1,!1,[this,"repeat"]),new Q.EnumProperty("运动方向","运动方向,注意对图片来说只有正反向。",!1,!1,[this,"bidirectional"],[["正向",0],["反向",1],["双向",2],["无",3]])]),new Q.GroupProperty("播放器","播放器",[new Q.PlayerProperty("播放器","播放器",[this,"playing"],[this,"ratio"],[this,"loop"]),new Q.BooleanProperty("是否循环","是否循环.",!1,!1,[this,"loop"]),new Q.NumberProperty("当前时间","当前时间",!1,!1,[this.player,"currentTime"]),new Q.NumberProperty("过渡时间","过渡时间",!1,!1,[this,"duration"]),new Q.BooleanProperty("是否播放","是否播放.",!1,!1,[this,"playing"]),new Q.NumberProperty("播放速度","播放速度.",!1,!1,[this,"speed"])])]}};L(Bi,"type",Bi.register("ESSignalTransmission",Bi,{chsName:"信号传输器",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"})),L(Bi,"supportEditingModes",[...Q.ESGeoVector.supportEditingModes,Q.ESJEditingMode.LineStringAppend,Q.ESJEditingMode.LineStringInsert]),L(Bi,"defaults",{...Q.ESGeoVector.defaults,loop:!0,currentTime:0,playerCurrentTime:0,duration:3e3,speed:1,playing:!0,startTime:0,transmissionTime:3e3,color:[0,1,0,1],width:3,heightRatio:1,arcType:"GEODESIC",brightening:!1,depthTest:!0,imageUrl:"${esobjs-xe2-plugin-assets-script-dir}/xe2-assets/esobjs-xe2-plugin/images/signal.png",repeat:5,bidirectional:0});let Yr=Bi;(t=>{t.createDefaultProps=()=>({imageUrl:void 0,repeat:5,bidirectional:0,startTime:0,transmissionTime:3e3,arcType:"GEODESIC",brightening:!1,depthTest:!0,heightRatio:1,loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,...Q.ESGeoVector.createDefaultProps()})})(Yr||(Yr={})),p.extendClassProps(Yr.prototype,Yr.createDefaultProps);const ao=class ao extends Q.ESGeoVector{constructor(e){super(e);L(this,"editingBindMode","lineString")}get typeName(){return"ESRoad"}get defaultProps(){return ao.createDefaultProps()}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.NumberProperty("线宽","道路宽度,单位是米!",!1,!1,[this,"width"]),new Q.EnumProperty("弧线类型","弧线类型",!1,!1,[this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]]),new Q.StringProperty("道路图片","道路图片",!1,!1,[this,"imageUrl"]),new Q.Number2Property("重复次数","重复次数,该参数以后会取消!",!1,!1,[this,"repeat"])])]}};L(ao,"type",ao.register("ESRoad",ao,{chsName:"贴地道路",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"最大宽度到1000米"})),L(ao,"supportEditingModes",[...Q.ESGeoVector.supportEditingModes,Q.ESJEditingMode.LineStringAppend,Q.ESJEditingMode.LineStringInsert]),L(ao,"defaults",{...Q.ESGeoVector.defaults,width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1]});let Jr=ao;(t=>{t.createDefaultProps=()=>({...Q.ESGeoVector.createDefaultProps(),width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],stroked:!0})})(Jr||(Jr={})),p.extendClassProps(Jr.prototype,Jr.createDefaultProps);const so=class so extends Q.ESGeoVector{constructor(e){super(e);L(this,"_deprecated",["ground"]);L(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());L(this,"editingBindMode","circular");this.stroked=!0,this.filled=!0,this.strokeColor=[1,1,1,1],this.fillColor=[1,1,1,.5]}get typeName(){return"ESGeoSmoothPolygon"}get defaultProps(){return so.createDefaultProps()}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.GroupProperty("czm","czm",[new Q.BooleanProperty("是否贴地","A boolean Property specifying the visibility.",!0,!1,[this,"ground"],!1),new Q.NumberProperty("厚度","厚度",!0,!1,[this,"depth"],16)])])]}};L(so,"type",so.register("ESGeoSmoothPolygon",so,{chsName:"平滑多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平滑多边形"})),L(so,"supportEditingModes",[...Q.ESGeoVector.supportEditingModes,Q.ESJEditingMode.CircularAppend,Q.ESJEditingMode.CircularInsert]),L(so,"defaults",{...Q.ESGeoVector.defaults,fillStyle:{color:[1,1,1,.5],material:"",materialParams:{}}});let Ji=so;(t=>{t.createDefaultProps=()=>({...Q.ESGeoVector.createDefaultProps(),ground:!1,depth:0})})(Ji||(Ji={})),p.extendClassProps(Ji.prototype,Ji.createDefaultProps);const ar=class ar extends Q.ESGeoVector{constructor(e){super(e);L(this,"_deprecated",["ground"]);L(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());L(this,"_geoPolylinePath");L(this,"_currentDistance",this.disposeVar(p.react(0)));this.stroked=!0}get typeName(){return"ESGeoBezierPath"}get defaultProps(){return ar.createDefaultProps()}updateEditing(){var e;(e=this.viewer)==null||e.startEditing(this,[Q.ESJEditingMode.LineStringAppend,Q.ESJEditingMode.LineStringInsert],{callSource:"inner"})}get geoPolylinePath(){return this._geoPolylinePath}set geoPolylinePath(e){this._geoPolylinePath=e}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}getProperties(e){return[...super.getProperties(e),new Q.GroupProperty("通用","通用",[new Q.BooleanProperty("是否显示当前","是否显示当前.",!1,!1,[this,"currentPoiShow"]),new Q.NumberProperty("当前距离","当前距离",!1,!1,[this,"currentDistance"]),new Q.NumberProperty("分辨率","分辨率",!1,!1,[this,"resolution"]),new Q.NumberProperty("锐化程度","锐化程度",!1,!1,[this,"sharpness"])]),new Q.GroupProperty("GeoPath","GeoPath",[new Q.JsonProperty("timePosRots","类型为[timeStamp: number, position: [longitude: number, latitude: number, height: number], rotation: [heading: number, pitch: number, roll: number] | undefined];",!1,!0,[this,"timePosRots"],ar.defaults.timePosRots),new Q.NumberProperty("折线超前显示时长","折线超前显示时长",!1,!1,[this,"leadTime"]),new Q.NumberProperty("折线滞后显示时长","折线滞后显示时长",!1,!1,[this,"trailTime"])]),new Q.GroupProperty("播放器","播放器",[new Q.PlayerProperty("播放器","播放器",[this,"playing"],[this._geoPolylinePath,"ratio"],[this,"loop"]),new Q.BooleanProperty("是否循环","是否循环.",!1,!1,[this,"loop"]),new Q.NumberProperty("当前时间","当前时间",!1,!1,[this,"currentTime"]),new Q.NumberProperty("过渡时间","过渡时间",!1,!1,[this,"duration"]),new Q.BooleanProperty("是否播放","是否播放.",!1,!1,[this,"playing"]),new Q.NumberProperty("播放速度","播放速度.",!1,!1,[this,"speed"])]),new Q.GroupProperty("折线","折线",[new Q.BooleanProperty("是否贴地","是否贴地.",!1,!1,[this,"ground"]),new Q.BooleanProperty("是否开启深度检测","A boolean Property specifying the visibility.",!1,!1,[this,"depthTest"]),new Q.EnumProperty("弧线类型","弧线类型",!1,!1,[this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]])])]}};L(ar,"type",ar.register("ESGeoBezierPath",ar,{chsName:"贝塞尔曲线路径",tags:["GeoObjects"],description:"贝塞尔曲线路径"})),L(ar,"supportEditingModes",[...Q.ESGeoVector.supportEditingModes,Q.ESJEditingMode.LineStringAppend,Q.ESJEditingMode.LineStringInsert]),L(ar,"defaults",{...Q.ESGeoVector.defaults,currentPoiShow:!0,currentDistance:0,resolution:1e3,sharpness:.85,timePosRots:[],leadTime:0,trailTime:0,loop:!1,currentTime:0,duration:3e3,playing:!1,speed:1,ground:!1,depthTest:!1,arcType:"GEODESIC"});let jr=ar;(t=>{t.createDefaultProps=()=>({currentPoiShow:!0,ground:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0,...Q.ESGeoVector.createDefaultProps()})})(jr||(jr={})),p.extendClassProps(jr.prototype,jr.createDefaultProps);const Iu=class Iu extends Bn{constructor(e,i){super(e,i);L(this,"_czmBezierPath");if(this._czmBezierPath=this.disposeVar(new zl(i,e.id)),e.geoPolylinePath=this._czmBezierPath.geoPolylinePath,!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmBezierPath;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"currentPoiShow"],[e,"currentPoiShow"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.bind([r,"currentDistance"],[e,"currentDistance"])),this.dispose(p.track([r,"resolution"],[e,"resolution"])),this.dispose(p.track([r,"sharpness"],[e,"sharpness"])),this.dispose(p.track([r.geoPath,"timePosRots"],[e.geoPath,"timePosRots"])),this.dispose(p.track([r,"leadTime"],[e,"leadTime"])),this.dispose(p.track([r,"trailTime"],[e,"trailTime"])),this.dispose(p.track([r.geoPolylinePath,"ratio"],[e.geoPolylinePath,"ratio"])),this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"currentTime"],[e,"currentTime"])),this.dispose(p.track([r,"duration"],[e,"duration"])),this.dispose(p.track([r,"playing"],[e,"playing"])),this.dispose(p.track([r,"speed"],[e,"speed"])),this.dispose(p.track([r,"depthTest"],[e,"depthTest"])),this.dispose(p.track([r,"arcType"],[e,"arcType"])),this.dispose(p.track([r,"polylineShow"],[e,"stroked"])),this.dispose(p.track([r,"width"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"strokeColor"]));{const s=()=>{r.ground=e.ground||e.strokeGround};s();const a=this.dv(p.createNextAnimateFrameEvent(e.groundChanged,e.strokeGroundChanged));this.d(a.don(s))}{const s=()=>{if(!e.stroked){r.hasDash=!1,r.hasArrow=!1;return}const c=e.strokeStyle;if(c.material==="hasDash"&&c.materialParams)try{const u=c.materialParams;Reflect.has(u,"gapColor")&&(r.gapColor=u.gapColor??[0,0,0,0]),Reflect.has(u,"dashLength")&&(r.dashLength=u.dashLength),Reflect.has(u,"dashPattern")&&(r.dashPattern=u.dashPattern)}catch(u){console.error(u)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashLength=0;const h=e.strokeMaterial??"normal";h==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):h==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1)};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}}get czmBezierPath(){return this._czmBezierPath}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBezierPath:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmBezierPath:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Iu,"type",Iu.register("ESCesiumViewer",jr.type,Iu));let Dm=Iu;const ku=class ku extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoCustomDivPoi");L(this,"_divContainer");L(this,"_hasClassDivAndPos",{});if(this._czmGeoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoCustomDivPoi;r.cssAllInitial=!0,this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"opacity"],[e,"opacity"])),this.d(p.track([r,"zOrder"],[e,"zOrder"]));{const s=()=>{r.originRatioAndOffset=[...e.anchor,0,0],this._divContainer&&this._divContainer.children[0]&&(this._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};s(),this.dispose(e.anchorChanged.don(s))}{const s=()=>{const l=this;return class extends p.Destroyable{constructor(h,u,A){if(super(),this._subContainer=h,!A||!(A instanceof Ye))return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");l._divContainer=this.disposeVar(new e.instanceClass(h,e,A))._container;{const g=()=>{l._divContainer.style.pointerEvents=l.sceneObject.editing?"none":"all"};g(),this.d(l.sceneObject.editingChanged.don(g))}{const g=()=>{l._divContainer.children[0]&&(l._divContainer.children[0].style.transform=`scale(${e.scale[1]},${e.scale[2]})`,l._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};g(),this.d(e.scaleChanged.don(g))}let f=l._divContainer?l._divContainer.querySelectorAll("*[class]"):[];for(let g=0;g<f.length;g++){const v=f[g];var d=v.getBoundingClientRect();l._hasClassDivAndPos[v.className]=[v.offsetLeft,v.offsetTop,v.offsetLeft+d.width,v.offsetTop+d.height]}}}},a=()=>{try{e.instanceClass?r.instanceClass=s():r.instanceClass=void 0}catch(l){console.error(l)}};a(),this.dispose(e.instanceClassChanged.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(s=>{var c;s.assign({sceneObject:e});const a=(c=_o(s,"pickResult"))==null?void 0:c.pointerEvent;if(!a)return;const l={type:a.buttons!=0&&a.button==0?"leftClick":a.button==2?"rightClick":void 0,add:{mousePos:[a.offsetX,a.offsetY]}};if(l.type==null&&(l.type=a.type),l.type==="leftClick"){const h=Object.keys(this._hasClassDivAndPos);for(let u=0;u<h.length;u++){const A=h[u];let f=this._hasClassDivAndPos[A],d=this._divContainer.getBoundingClientRect();const g=a.clientX-d.left,v=a.clientY-d.top;if(g>=f[0]&&g<=f[2]&&v>=f[1]&&v<=f[3]){l.add.className=A;break}}}e.widgetEvent.emit(l),l.type==="leftClick"&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoCustomDivPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.position&&Be(r.viewer,s.position,1e3,Dn,e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ku,"type",ku.register("ESCesiumViewer",Q.ESGeoDiv.type,ku));let Rm=ku;const Fu=class Fu extends Ge{constructor(e,i){super(e,i);L(this,"_czmDivTextPoi");if(this._czmDivTextPoi=this.disposeVar(new ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDivTextPoi;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(p.bind([r,"textEditing"],[e,"textEditing"])),this.dispose(p.bind([r,"width"],[e,"width"])),this.dispose(p.bind([r,"text"],[e,"text"])),this.dispose(p.track([r,"originRatioAndOffset"],[e,"originRatioAndOffset"])),this.dispose(p.track([r,"opacity"],[e,"opacity"])),this.dispose(p.bind([r,"fontSize"],[e,"fontSize"])),this.dispose(p.track([r,"color"],[e,"color"])),this.dispose(p.track([r,"backgroundColor"],[e,"backgroundColor"])),this.dispose(p.track([r,"borderRadius"],[e,"borderRadius"])),this.dispose(p.track([r,"borderColor"],[e,"borderColor"])),this.dispose(p.track([r,"borderWidth"],[e,"borderWidth"])),this.dispose(p.track([r,"textAlign"],[e,"textAlign"])),this.dispose(p.track([r,"borderStyle"],[e,"borderStyle"]))}get czmDivTextPoi(){return this._czmDivTextPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDivTextPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Fu,"type",Fu.register("ESCesiumViewer",Q.ESGeoDivTextPoi.type,Fu));let Um=Fu;const hO={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[116.2,39.56]},properties:{title:"swimming","marker-symbol":"swimming","marker-color":"#8F1312"}},{type:"Feature",geometry:{type:"Point",coordinates:[115.2,38.56]},properties:{title:"8","marker-symbol":"8","marker-color":"#46117E"}},{type:"Feature",geometry:{type:"Point",coordinates:[114.2,37.56]},properties:{title:"6","marker-symbol":"6","marker-color":"#713291"}}]},AO=`properties是一个包含三个属性的对象,title表示标题,marker-symbol表示点位的文字内容,marker-color表示点位颜色,properties可以删除,然后使用场景对象属性设置。
|
|
3407
3407
|
\`\`\`
|
|
3408
3408
|
{
|
|
3409
3409
|
"type": "FeatureCollection",
|
|
@@ -3482,19 +3482,19 @@ export type IndexJsonType = {
|
|
|
3482
3482
|
}
|
|
3483
3483
|
}
|
|
3484
3484
|
}
|
|
3485
|
-
`,dC="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",
|
|
3485
|
+
`,dC="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",fO=`${dC}
|
|
3486
3486
|
|
|
3487
3487
|
该路径可以使用下面回调函数
|
|
3488
3488
|
\`\`\`
|
|
3489
3489
|
${fC}
|
|
3490
3490
|
\`\`\`
|
|
3491
|
-
`,Ct=class Ct extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_loadFuncReact",this.disposeVar(p.react(void 0)));L(this,"_dataSource",this.disposeVar(p.react(void 0)));L(this,"_data");L(this,"_defaultHeight",{});L(this,"_defaultBoundingSphere",new C.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{r()});{const s=this.dv(p.createProcessingFromAsyncFunc(async c=>{if(this.dataSource&&r(),!!this.url){do{if(typeof this.url=="object"){this._data=this.url;break}if(this._isJSONString(this.url)){this._data=JSON.parse(this.url);break}await fetch(Q.ESSceneObject.context.getStrFromEnv(this.url)).then(h=>h.json()).then(h=>{this._data=h}).catch(h=>{console.warn("ESGeoJson数据加载失败",h)})}while(!1);this.dataSource=await C.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(h=>{var A,f;const u=[];for(const d of h.entities.values)if(C.Entity.prototype&&(d.ESSceneObjectID=i),this._isEntityShow(d,e),d.polygon&&u.push(...(A=d.polygon.hierarchy)==null?void 0:A.getValue(C.JulianDate.now()).positions),d.polyline&&u.push(...(f=d.polyline.positions)==null?void 0:f.getValue(C.JulianDate.now())),d.position){const g=d.position.getValue(C.JulianDate.now());g&&u.push(g)}this._defaultBoundingSphere=C.BoundingSphere.fromPoints(u)})}})),a=()=>{s.isRunning&&s.cancel(),s.restart()};a();const l=this.dv(p.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(a))}{const s=()=>{var l,c;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(h){console.error(h)}else{const h=this.dataSource.entities.values;for(let u=0;u<h.length;u++){const A=h[u];if(A.polygon){this._defaultHeight[A.id]||(this._defaultHeight[A.id]=(l=A.polygon.height)==null?void 0:l.getValue(C.JulianDate.now())),A.polygon.height=this.fillGround?void 0:new C.ConstantProperty(this._defaultHeight[A.id]),A.polygon.perPositionHeight=new C.ConstantProperty(!this.fillGround),A.polygon.heightReference=new C.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?C.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?C.HeightReference.CLAMP_TO_GROUND:C.HeightReference.RELATIVE_TO_GROUND),A.polygon.show=new C.ConstantProperty(this.filled??Ct.defaults.filled),A.polygon.material=new C.ColorMaterialProperty(new C.Color(...this.fillColor??Ct.defaults.fillColor)),A.polygon.outline=new C.ConstantProperty(!1),A.polyline=new C.PolylineGraphics;const f=JSON.parse(JSON.stringify((c=A.polygon.hierarchy)==null?void 0:c.getValue(C.JulianDate.now()).positions));C.Cartesian3.equals(f[0],f[f.length-1])||f.push(f[0]),A.polyline.positions=f}if(A.polyline&&(A.polyline.show=new C.ConstantProperty(this.stroked??Ct.defaults.stroked),A.polyline.width=new C.ConstantProperty(this.strokeWidth??Ct.defaults.strokeWidth),A.polyline.material=new C.ColorMaterialProperty(new C.Color(...this.strokeColor??Ct.defaults.strokeColor)),A.polyline.clampToGround=new C.ConstantProperty(this.strokeGround)),A.billboard){A.billboard.show=new C.ConstantProperty(this.imageShow??Ct.defaults.imageShow),A.billboard.width=new C.ConstantProperty(this.imageSize?this.imageSize[0]:Ct.defaults.imageSize[0]),A.billboard.height=new C.ConstantProperty(this.imageSize?this.imageSize[1]:Ct.defaults.imageSize[1]);const f=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:Ct.defaults.imageUrl;A.billboard.image=new C.ConstantProperty(Q.ESSceneObject.context.getStrFromEnv(f)),A.billboard.horizontalOrigin=new C.ConstantProperty(C.HorizontalOrigin.LEFT),A.billboard.verticalOrigin=new C.ConstantProperty(C.VerticalOrigin.TOP),A.billboard.heightReference=new C.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?C.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?C.HeightReference.CLAMP_TO_GROUND:C.HeightReference.RELATIVE_TO_GROUND);const d=this.imageAnchor??Ct.defaults.imageAnchor,g=this.imageOffset??Ct.defaults.imageOffset;if(A.billboard.pixelOffset=new C.ConstantProperty(C.Cartesian2.fromArray([-d[0]*A.billboard.width.getValue(C.JulianDate.now())+g[0],-d[1]*A.billboard.height.getValue(C.JulianDate.now())+g[1]])),A.label=new C.LabelGraphics,!A.label)return;A.label.show=new C.ConstantProperty(this.textShow??Ct.defaults.textShow),A.label.heightReference=new C.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?C.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?C.HeightReference.CLAMP_TO_GROUND:C.HeightReference.RELATIVE_TO_GROUND),A.label.text=new C.ConstantProperty(this.textProperty&&this.textProperty!==""&&A.properties&&A.properties[this.textProperty]?A.properties[this.textProperty].getValue():this.textDefaultText??Ct.defaults.textDefaultText),A.label.fillColor=new C.ConstantProperty(new C.Color(...this.textColor??Ct.defaults.textColor)),A.label.showBackground=new C.ConstantProperty(this.textBackgroundColor!=null);const v=this.textFontSize&&this.textFontSize!=0?this.textFontSize:Ct.defaults.textFontSize,y=this.textOffset??Ct.defaults.textOffset;A.label.backgroundColor=new C.ConstantProperty(new C.Color(...this.textBackgroundColor??Ct.defaults.textBackgroundColor)),A.label.font=new C.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${v}px ${this.textFontFamily??Ct.defaults.textFontFamily}`),A.label.horizontalOrigin=new C.ConstantProperty(C.HorizontalOrigin.LEFT),A.label.verticalOrigin=new C.ConstantProperty(C.VerticalOrigin.TOP),A.label.eyeOffset=new C.ConstantProperty(C.Cartesian3.fromArray([0,0,-1]));const m=this.textAnchor??Ct.defaults.textAnchor;A.label.pixelOffset=new C.ConstantProperty(C.Cartesian2.fromArray([-m[0]*((this.textBackgroundColor?-14:-v*2)+this._countBytes(A.label.text.getValue(C.JulianDate.now()))/2*v)+y[0],-m[1]*((this.textBackgroundColor?10:0)+v)+y[1]]))}}}};s();const a=this.dv(p.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged));this.dispose(a.don(s))}{const s=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let c=0;c<l.length;c++){const h=l[c];this._isEntityShow(h,e)}};s();const a=this.ad(p.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(a.don(s))}{const s=()=>{if(this.loadFuncStr)try{const a=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=a}catch(a){console.error(a),this.loadFun=void 0}else this.loadFun=void 0};s(),this.dispose(this.loadFuncStrChanged.disposableOn(s))}this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&this.dataSource&&(s!==void 0?o.flyTo(this.dataSource,{duration:s/1e3}).then(a=>{a||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:s/1e3})}):o.flyTo(this.dataSource).then(a=>{a||o.camera.flyToBoundingSphere(this._defaultBoundingSphere)}))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_isJSONString(e){try{return JSON.parse(e),!0}catch{return!1}}_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}_isEntityShow(e,i){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=i.viewer)!=null&&o.camera&&this.show){let r;do{if(e.polygon&&e.polygon.hierarchy){r=Q.getMinMaxCorner(e.polygon.hierarchy.getValue(C.JulianDate.now()).positions.map(l=>Ue(l))).center;break}if(e.polyline&&e.polyline.positions&&(r=Q.getMinMaxCorner(e.polyline.positions.getValue(C.JulianDate.now()).map(l=>Ue(l))).center),e.position){const l=e.position.getValue(C.JulianDate.now());l&&(r=Ue(l))}}while(!1);if(!r||isNaN(r[0]))return;const s=Q.getDistancesFromPositions([r,_n(i.viewer.camera)],"NONE")[0];let a=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?a=this.minFeatureVisibleDistance<s&&s<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?a=s>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(a=s<this.maxFeatureVisibleDistance),e.show=this.show&&a}}};L(Ct,"defaults",{show:!0,allowPicking:!0,url:dC,defaultLoadFuncStr:fC,defaultLoadFuncDocStr:AO,data:cO,dataMd:hO,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 Wo=Ct;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:p.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:p.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:p.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:p.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:p.reactArrayWithUndefined(void 0),imageAnchor:p.reactArrayWithUndefined(void 0),imageOffset:p.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:p.reactArrayWithUndefined(void 0),textBackgroundColor:p.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:p.reactArrayWithUndefined(void 0),textOffset:p.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE"})})(Wo||(Wo={})),p.extendClassProps(Wo.prototype,Wo.createDefaultProps);const Bu=class Bu extends Bn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Wo(e,n.id));this.dispose(p.track([o,"show"],[n,"show"])),this.dispose(p.track([o,"allowPicking"],[n,"allowPicking"])),this.dispose(p.track([o,"loadFuncStr"],[n,"loadFuncStr"])),this.dispose(p.track([o,"url"],[n,"features"])),this.dispose(p.track([o,"stroked"],[n,"stroked"])),this.dispose(p.track([o,"strokeWidth"],[n,"strokeWidth"])),this.dispose(p.track([o,"strokeWidthType"],[n,"strokeWidthType"])),this.dispose(p.track([o,"strokeColor"],[n,"strokeColor"])),this.dispose(p.track([o,"strokeMaterial"],[n,"strokeMaterial"])),this.dispose(p.track([o,"strokeMaterialParams"],[n,"strokeMaterialParams"])),this.dispose(p.track([o,"strokeGround"],[n,"strokeGround"])),this.dispose(p.track([o,"filled"],[n,"filled"])),this.dispose(p.track([o,"fillColor"],[n,"fillColor"])),this.dispose(p.track([o,"fillMaterial"],[n,"fillMaterial"])),this.dispose(p.track([o,"fillMaterialParams"],[n,"fillMaterialParams"])),this.dispose(p.track([o,"fillGround"],[n,"fillGround"])),this.dispose(p.track([o,"imageShow"],[n,"imageShow"])),this.dispose(p.track([o,"imageUrl"],[n,"imageUrl"])),this.dispose(p.track([o,"imageSize"],[n,"imageSize"])),this.dispose(p.track([o,"imageAnchor"],[n,"imageAnchor"])),this.dispose(p.track([o,"imageOffset"],[n,"imageOffset"])),this.dispose(p.track([o,"textShow"],[n,"textShow"])),this.dispose(p.track([o,"textProperty"],[n,"textProperty"])),this.dispose(p.track([o,"textDefaultText"],[n,"textDefaultText"])),this.dispose(p.track([o,"textColor"],[n,"textColor"])),this.dispose(p.track([o,"textBackgroundColor"],[n,"textBackgroundColor"])),this.dispose(p.track([o,"textFontFamily"],[n,"textFontFamily"])),this.dispose(p.track([o,"textFontSize"],[n,"textFontSize"])),this.dispose(p.track([o,"textFontStyle"],[n,"textFontStyle"])),this.dispose(p.track([o,"textFontWeight"],[n,"textFontWeight"])),this.dispose(p.track([o,"textAnchor"],[n,"textAnchor"])),this.dispose(p.track([o,"textOffset"],[n,"textOffset"])),this.dispose(p.track([o,"minFeatureVisibleDistance"],[n,"minFeatureVisibleDistance"])),this.dispose(p.track([o,"maxFeatureVisibleDistance"],[n,"maxFeatureVisibleDistance"])),this.dispose(p.track([o,"heightReference"],[n,"heightReference"])),this.dispose(n.flyToEvent.disposableOn(r=>{if(e.actived){if(n.flyInParam){const{position:s,rotation:a,flyDuration:l}=n.flyInParam;return Be(e.viewer,s,void 0,a,l),!0}o.flyTo(r&&r*1e3)}}));{const r=(s,a,l)=>{if(!e.actived)return;const c=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(s,a)));if(!(!c||!(c!=null&&c.positions)))if(c.type=="Point"||c.type=="MultiPoint")Rn(e,n,this.id,this._calculateFeatureHeight(c.type=="MultiPoint"?c.positions.flat():c.positions,n.heightReference,e),1e3,l);else{const h=c.type=="Polygon"||c.type=="MultiPolygon"||c.type=="MultiLineString";let u=[];h?u=c.positions.flat(c.type=="MultiPolygon"?2:1).map(g=>this._calculateFeatureHeight(g,n.fillGround?"CLAMP_TO_GROUND":"NONE",e)):u=c.positions.map(g=>this._calculateFeatureHeight(g,n.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:A,maxPos:f,center:d}=Q.getMinMaxCorner(u);Rn(e,n,this.id,d,Q.getDistancesFromPositions([A,f],"NONE")[0],l)}};this.d(n.flyToFeatureEvent.don((s,a,l)=>r(s,a,l))),this.d(n.flyToFeatureIndexEvent.don((s,a)=>r(s,void 0,a)))}}_getFeatureByIndexOrProperties(n,e){var s,a,l,c,h,u,A,f;const{sceneObject:i}=this,o=i.features;if(!o)return;const r=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(r){if(e){let d=r.find(g=>(g==null?void 0:g.properties[n])==e);return{type:d!=null&&d.coordinates?d.type:(s=d==null?void 0:d.geometry)==null?void 0:s.type,positions:(d==null?void 0:d.coordinates)||((a=d==null?void 0:d.geometry)==null?void 0:a.coordinates)}}else if(typeof n=="number")return{type:(l=r[n])!=null&&l.coordinates?r[n].type:(h=(c=r[n])==null?void 0:c.geometry)==null?void 0:h.type,positions:((u=r[n])==null?void 0:u.coordinates)||((f=(A=r[n])==null?void 0:A.geometry)==null?void 0:f.coordinates)}}}_calculateFeatureHeight(n,e,i){const{sceneObject:o}=this,r=[...n];do{if(e=="NONE"){r[2]=r[2]??0;break}if(e=="CLAMP_TO_GROUND"||!r[2]){r[2]=i.getTerrainHeight(r)??0;break}r[2]+=i.getTerrainHeight(r)??0}while(!1);return r}};L(Bu,"type",Bu.register("ESCesiumViewer",Q.ESGeoJson.type,Bu));let Om=Bu;const Mu=class Mu extends an{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 pi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,s=this._geoPolyline;s.arcType="RHUMB",this.dispose(p.track([s,"color"],[e,"strokeColor"])),this.dispose(p.track([s,"width"],[e,"strokeWidth"])),this.dispose(p.track([s,"ground"],[e,"strokeGround"])),this.dispose(p.track([r,"ground"],[e,"fillGround"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.show=e.show&&e.stroked,r.show=e.show&&e.filled};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:h}=Q.getMinMaxCorner(l);r.rectangle=[c[0],c[1],h[0],h[1]],r.height=l[0][2],r.extrudedHeight=l[0][2];const u=l.map(g=>(l&&(g[2]=l[0][2]),g)),A=u[0],f=u[1],d=[A,[A[0],f[1],A[2]],f,[f[0],A[1],f[2]]];s.positions=[...d,A]}else r.rectangle=void 0,s.positions=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,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:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(Mu,"type",Mu.register("ESCesiumViewer",Q.ESGeoRectangle.type,Mu));let Lm=Mu;class Ql extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Br(e,i));const{geoPolygon:o}=this;this.dispose(p.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(s=>{o.flyTo(s)})),this.dispose(p.bind([o,"show"],[this,"show"])),this.dispose(p.bind([o,"fill"],[this,"filled"])),this.dispose(p.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(p.bind([o,"ground"],[this,"ground"])),this.dispose(p.bind([o,"outline"],[this,"outline"])),this.dispose(p.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(p.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(p.bind([o,"color"],[this,"color"])),this.dispose(p.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const s=Jf([...this.positions,this.positions[0]]);o.positions=s}else o.positions=void 0};r(),this.dispose(this.positionsChanged.disposableOn(r))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:p.reactArray([1,1,1,1]),outlineWidth:1,color:p.reactArrayWithUndefined([1,1,1,.5]),positions:p.reactPositions(void 0),depth:0})})(Ql||(Ql={})),p.extendClassProps(Ql.prototype,Ql.createDefaultProps);const Du=class Du extends an{constructor(e,i){super(e,i);L(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Ql(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"outline"],[e,"stroked"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(p.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"filled"],[e,"filled"])),this.dispose(p.track([r,"color"],[e,"fillColor"])),this.dispose(p.track([r,"ground"],[e,"ground"]));{const s=()=>{r.ground=e.ground||e.fillGround};s();const a=this.dv(p.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(a.don(s))}{const s=()=>{r.color=e.filled?e.fillColor:Ji.defaults.fillStyle.color};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(s))}this.dispose(p.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Du,"type",Du.register("ESCesiumViewer",Ji.type,Du));let zm=Du;const Ru=class Ru extends Ge{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 Ht(i,e.id));const r=this._czmModel;this.d(r.readyEvent.don(a=>{r.gltf.animations&&(r.activeAnimationsJson=r.gltf.animations.map((l,c)=>({index:c,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),r.activeAnimationsAnimateWhilePaused=!0),e.czmModelReadyEvent.emit(a)})),this.ad(new Wf(o,this._czmModel)),this.d(p.track([r,"show"],[e,"show"])),this.d(p.track([r,"color"],[e,"czmColor"])),this.d(p.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(p.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(p.bind([r,"position"],[e,"position"])),this.d(p.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(p.track([r,"scale"],[e,"scale"])),this.ad(p.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(p.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const a=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};a(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>a(l)))}{const a=()=>{var l,c;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(c=e.czmEnvironmentMapManager)==null?void 0:c.atmosphereScatteringIntensity)};a(),this.ad(e.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances?0:90,r.rotation=l};a(),this.d(e.rotationChanged.don(a));{const l=()=>{if(a(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(c=>{const h=JSON.parse(JSON.stringify(c));return!h.rotation&&(h.rotation=[0,0,0]),h.rotation[0]+=90,h})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(a=>{r.setMaterial(a)}));{const a=()=>{const l=[...r.rotation];l[0]-=e.instances?0:90,e.rotation=l};a(),this.d(r.rotationChanged.don(a))}{const a=this.dv(p.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};l(),this.d(a.don(l))}const s=()=>{r.url=Q.ESSceneObject.context.getStrFromEnv(rh(typeof e.url=="string"?e.url:e.url.url))};s(),this.d(e.urlChanged.don(s)),this.d(e.setNodePositionEvent.don((a,l)=>{r.setNodeTranslation(a,l)})),this.d(e.setNodeRotationEvent.don((a,l)=>{r.setNodeRotation(a,l)})),this.d(e.setNodeScaleEvent.don((a,l)=>{r.setNodeScale(a,l)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,i){const{sceneObject:o,czmViewer:r,model:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(s&&dn(r,o,i,e,s,!0),!!s):!1}};L(Ru,"type",Ru.register("ESCesiumViewer",Q.ESGltfModel.type,Ru));let Qm=Ru;function pC(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 Vl extends p.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new p.Event));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_distance",this.disposeVar(p.react(0)));L(this,"_surfaceDistance",this.disposeVar(p.react(0)));L(this,"_height",this.disposeVar(p.react(0)));L(this,"_middlePosition",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_heightPosition",this.disposeVar(p.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const s=this._surfaceDistance.value=Q.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="RHUMB"){const s=this._surfaceDistance.value=Q.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="NONE"){const s=Q.lbhToXyz(this.positions[0]),a=Q.lbhToXyz(this.positions[1]);this._distance.value=pC(s,a),this._surfaceDistance.value=pC(Q.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const s=this.disposeVar(new Je(e,i));s.ground=!1,s.loop=!1,this.dispose(p.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(p.bind([s,"arcType"],[this,"arcType"])),this.dispose(p.bind([s,"color"],[this,"color"])),this.dispose(p.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(p.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(p.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(p.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(p.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(p.bind([s,"show"],[this,"show"])),this.dispose(p.bind([s,"width"],[this,"width"])),this.dispose(p.bind([s,"depthTest"],[this,"depthTest"]));{s.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[c,h]=this.positions;s.positions=[c,h,[c[0],c[1],h[2]]]}else s.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const a=this.disposeVar(new wt(e,i));this.dispose(p.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(p.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(p.track([a,"show"],[this,"show"]));{const l=()=>{a.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{a.innerHTML=bo(`高度: ${oh(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(a.pickedEvent.don(l=>{Ui(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:p.reactPositions(void 0),width:1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Vl||(Vl={})),p.extendClassProps(Vl.prototype,Vl.createDefaultProps);const Uu=class Uu extends an{constructor(e,i){super(e,i);L(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Vl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const c=e.strokeMaterial??"normal";c==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):c==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const u=h.materialParams;Reflect.has(u,"gapColor")&&(r.gapColor=u.gapColor??[0,0,0,0]),Reflect.has(u,"dashLength")&&(r.dashLength=u.dashLength),Reflect.has(u,"dashPattern")&&(r.dashPattern=u.dashPattern)}catch(u){console.error(u)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{Ui(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Uu,"type",Uu.register("ESCesiumViewer",Q.ESHeightMeasurement.type,Uu));let Vm=Uu;const Ou=class Ou extends Ge{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 Ht(i,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"scale"],[e,"scale"]));{const g=this.dv(p.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),v=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};v(),this.d(g.don(v))}const s=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),a=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),c=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),h=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),u=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),A=()=>{switch(e.mode){case"worker":r.url=s;break;case"police":r.url=a;break;case"pedestrian":r.url=l;break;case"stranger":r.url=c;break;case"suitMan":r.url=h;break;case"suitWoman":r.url=u;break;default:r.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>{A()})),A();const f=()=>{const g=e.animation??Q.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}g==="walking"?r.activeAnimationsJson=Q.ESHuman.defaults.czmAnimationsWalk:g==="standing"?r.activeAnimationsJson=Q.ESHuman.defaults.czmAnimationsStand:g==="running"&&(r.activeAnimationsJson=Q.ESHuman.defaults.czmAnimationsRun)};f();const d=this.ad(p.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(d.disposableOn(()=>f())),this.ad(new Wf(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(s&&dn(r,o,i,e,s,!0),!!s)}};L(Ou,"type",Ou.register("ESCesiumViewer",Q.ESHuman.type,Ou));let Hm=Ou;class mC extends p.Destroyable{constructor(e,i){super();L(this,"_czmGeoCanvasImagePoi");L(this,"flyTo",(e,i)=>{if(this.czmGeoCanvasImagePoi.position){Be(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Dn,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoCanvasImagePoi=this.disposeVar(new ui(i));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=h=>{let u=h;return h.includes("inner://")&&(u="${earthsdk3-assets-script-dir}/assets/img/points/"+h.split("inner://")[1]),Q.ESSceneObject.context.getStrFromEnv(rh(u))},s=()=>{const h=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=h,e.sizeByContent){const A=new Image;A.src=h,A.onload=()=>{o.size=[A.width,A.height]}}else{const A=e.size;o.size=[...A]}},a=this.disposeVar(p.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(a.disposableOn(()=>s())),s(),this.d(p.track([o,"zOrder"],[e,"zOrder"])),this.dispose(p.track([o,"show"],[e,"show"])),this.dispose(p.bind([o,"position"],[e,"position"])),this.ad(p.bind([o,"isHoverZoom"],[e,"isHoverZoom"]));{const h=()=>{o.scale=[e.scale[1],e.scale[2]]};h(),this.dispose(e.scaleChanged.don(h))}const l=()=>{const h=e.anchor,u=e.offset;h?o.originRatioAndOffset=[...h,-u[0],-u[1]]:o.originRatioAndOffset=[0,0,0,0]},c=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(c.disposableOn(()=>l())),l(),this.dispose(o.clickEvent.disposableOn(h=>{const{offsetX:u,offsetY:A}=h,d={type:h.button===0?"leftClick":h.button===2?"rightClick":void 0,add:{mousePos:[u,A]}};e.widgetEvent.emit(d)})),this.dispose(o.hoveredChanged.disposableOn(h=>{if(h===void 0)return;const u={type:h?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(u)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class gC extends p.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 Wi(i,e.id));const r=this._czmGeoImageModel;this.ad(i.clickEvent.don(A=>{const f=A==null?void 0:A.pointerEvent;f&&(this._isPointEvent=!0,this._eventInfo={type:f.button==0?"leftClick":f.button==2?"rightClick":"leftClick",add:{mousePos:[f.offsetX,f.offsetY]}})})),this.d(e.pickedEvent.don(A=>{var f,d,g;A.screenPosition&&this._isPointEvent&&A.attachedInfo!="innerHoverEvent"&&((f=this._eventInfo.add)!=null&&f.mousePos)&&Math.abs(A.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(A.screenPosition[1]-((g=this._eventInfo.add)==null?void 0:g.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),Q.registerCreatedEventUpdate(this,e,()=>{const A=i.getEngineObject(e);this.ad(A.lastHoverResultChanged.don((f,d)=>{(f==null?void 0:f.sceneObject)==(d==null?void 0:d.sceneObject)||(f==null?void 0:f.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(f!=null&&f.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:f==null?void 0:f.screenPosition}},f.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&f.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:f==null?void 0:f.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 s=e.sizeByContent,l=(A=>{let f=A;return A.includes("inner://")&&(f="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),Q.ESSceneObject.context.getStrFromEnv(rh(f))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),c=new Image;c.src=l,c.onload=()=>{if(s)r.size=[c.width/100,c.height/100];else{const A=e.size;r.size=[A[0]/100,A[1]/100]}},r.uri=l,this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),r.pixelSize=void 0,r.useAxis="XZ";{const A=()=>{r.scale=[e.scale[1],e.scale[2]]};A(),this.d(e.scaleChanged.don(A))}{const A=()=>{e.rotationType===0&&(r.rotationMode="WithProp",this.d(Dt([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};A(),this.dispose(e.rotationTypeChanged.disposableOn(A))}const h=()=>{const A=e.anchor,f=e.offset;A?r.originRatioAndOffset=[...A,-f[0]/100,-f[1]/100]:r.originRatioAndOffset=[0,0,0,0]},u=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>h())),h()}get czmGeoImageModel(){return this._czmGeoImageModel}}const Lu=class Lu extends Ol{constructor(e,i){super(e,i);L(this,"_resetting");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(p.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new p.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new mC(this.sceneObject,this.czmViewer):new gC(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s&&s.obj&&s.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Lu,"type",Lu.register("ESCesiumViewer",Q.ESImageLabel.type,Lu));let Nm=Lu;function fO(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const zu=class zu extends Bn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Nr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const s=this.ad(p.reactJson(""));{const c=()=>{if(typeof e.url=="string")s.value=Q.ESSceneObject.context.getStrFromEnv(e.url);else{const h=e.url;h.url=Q.ESSceneObject.context.getStrFromEnv(h.url),s.value=h}};c(),this.ad(e.urlChanged.don(c))}const a=()=>{var d;if(!s.value)return;const c=(((d=e.options)==null?void 0:d.type)??"auto").toLowerCase(),h=e.options??{};let u={type:"UrlTemplateImageryProvider",url:s.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...h},A=s.value,f=typeof A=="string"?A:A.url;if(c==="auto"){const g=f.toLowerCase();if(g.startsWith("ion://")){const y=+g.substring(6);u={...h,assetId:y,type:"IonImageryProvider"}}else if(g.includes("{x}")||g.includes("{y}")||g.includes("{z}"))u.type="UrlTemplateImageryProvider";else if(g.includes("wmts"))u.type="WebMapTileServiceImageryProvider";else if(g.includes("wms"))u.type="WebMapServiceImageryProvider";else{if(f.includes("/tilemapresource.xml")){const v=f.split("/tilemapresource.xml").join("");typeof A=="string"?A=v:A.url=v,u.url=A}u.type="TileMapServiceImageryProvider"}}else{if(c==="tms"&&f.includes("/tilemapresource.xml")){const g=f.split("/tilemapresource.xml").join("");typeof A=="string"?A=g:A.url=g,u.url=A}else if(c==="ion"&&f.startsWith("ion://")){const v=+f.substring(6);u={...h,assetId:v,type:"IonImageryProvider"}}u.type=fO(c)}console.log("imageryProvider",u),r.imageryProvider=u};a();const l=this.dv(p.createNextAnimateFrameEvent(s.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(a))}this.d(p.track([r,"show"],[e,"show"])),this.d(p.bind([r,"alpha"],[e,"opacity"])),this.d(p.bind([r,"alpha"],[e,"czmAlpha"])),this.d(p.track([r,"splitDirection"],[e,"splitDirection"])),this.d(p.track([r,"brightness"],[e,"czmBrightness"])),this.d(p.track([r,"contrast"],[e,"czmContrast"])),this.d(p.track([r,"hue"],[e,"czmHue"])),this.d(p.track([r,"saturation"],[e,"czmSaturation"])),this.d(p.track([r,"gamma"],[e,"czmGamma"])),this.d(p.track([r,"rectangle"],[e,"rectangle"])),this.d(p.track([r,"zIndex"],[e,"zIndex"]))}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(zu,"type",zu.register("ESCesiumViewer",Q.ESImageryLayer.type,zu));let Gm=zu;class dO extends p.Destroyable{constructor(e,i,o,r){super();L(this,"_show");L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(p.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new st(i,this._sceneObject.id)),this._czmTexture=this.dv(new At(i));const s=e,a=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(p.track([a,"show"],[this,"show"])),this.dispose(p.track([a,"show"],[s,"show"])),this.dispose(p.track([a,"allowPicking"],[s,"allowPicking"])),this.dispose(p.track([a,"rotation"],[s,"rotation"])),this.dispose(p.track([a,"position"],[s,"position"])),this.dispose(p.track([a,"scale"],[s,"scale"])),this.ad(s.allowPickingChanged.don(()=>{a.allowPicking=s.allowPicking,a.pass=s.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const c=()=>{const u=s.size/2,A=r[0].map(S=>S*u),f=r[1].map(S=>S*u),d=r[2].map(S=>S*u),g=r[3].map(S=>S*u),v=[...A,...f,...d,...g];let y=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(y=y.reverse());const m=[0,0],w=[1,0],_=[1,1],E=[0,1];let T=[];o=="east"||o=="south"?T=[...w,...m,...E,..._]:o=="west"?T=[...w,..._,...E,...m]:o=="top"?T=[...E,..._,...w,...m]:T=[...m,...w,..._,...E],a.indexTypedArray=new Uint16Array(y),a.attributes={position:{typedArray:new Float32Array(v),componentsPerAttribute:3},st:{typedArray:new Float32Array(T),componentsPerAttribute:2}},l.uri=Q.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${s.mode}/${o}.${s.mode!="blueSky"?"png":"jpg"}`);const P=i.getCameraInfo();if(P!=null){const I=Q.getDistancesFromPositions([s.position,P.position],"NONE")[0]/(s.size/2*s.autoOpacityFactor);this.changeOpacity(s.autoFollow?1:I)}const F=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!F)return;const{min:D,max:B}=F;a.setLocalAxisedBoundingBox(D,B)};c();const h=this.disposeVar(p.createNextAnimateFrameEvent(s.sizeChanged,s.modeChanged));this.dispose(h.disposableOn(c))}}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 pO extends p.Destroyable{constructor(n,e,i){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{s()}));function s(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const a=e.getCameraInfo();if(a!=null&&(r==null||r.position[0]!=a.position[0]||r.position[1]!=a.position[1]||r.position[2]!=a.position[2]||r.rotation[0]!=a.rotation[0]||r.rotation[1]!=a.rotation[1]||r.rotation[2]!=a.rotation[2])){r=a;const h=Q.getDistancesFromPositions([n.position,r.position],"NONE")[0]/(n.size/2*n.autoOpacityFactor);n.autoFollow?(n.position=r.position,o&&(o=!1,i.forEach(u=>{u.changeOpacity(1)}))):i.forEach(u=>{u.changeOpacity(h)})}}s()}}const Tt=class Tt extends Ge{constructor(e,i){super(e,i);L(this,"_czmSkyBoxComponents",[]);if(!i.viewer){console.warn("viewer is undefined!");return}!Tt._defaultLocalBox&&Tt._firstLoad&&(Tt._firstLoad=!1,Tt._defaultLocalBox=i.xbsjLocalBoxSources),Tt._eSLocalSkyBoxArr.push(e),this.d(()=>{Tt._eSLocalSkyBoxArr.includes(e)&&Tt._eSLocalSkyBoxArr.splice(Tt._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const r={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const s in r)if(Object.prototype.hasOwnProperty.call(r,s)){const a=r[s];this._czmSkyBoxComponents.push(this.dv(new dO(e,i,s,a)))}{const s=this.disposeVar(p.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new p.ObjResettingWithEvent(s,()=>(this.ChangeAutoFollow(),new pO(e,i,this._czmSkyBoxComponents))))}{const s=()=>{this.ChangeAutoFollow()},a=this.disposeVar(p.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(a.disposableOn(s))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let i=Tt._eSLocalSkyBoxArr.length-1;i>=0;i--){const o=Tt._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=Tt._defaultLocalBox)}Tt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Tt._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 s=o.size??Q.ESLocalSkyBox.defaults.size;return o.position?(Rn(r,o,i,o.position,s,e,!0),!0):!1}}};L(Tt,"type",Tt.register("ESCesiumViewer",Q.ESLocalSkyBox.type,Tt)),L(Tt,"_defaultLocalBox"),L(Tt,"_firstLoad",!0),L(Tt,"_eSLocalSkyBoxArr",[]);let Wm=Tt;const qn=class qn extends Ge{constructor(e,i){super(e,i);L(this,"_geoCustomDivPoi");L(this,"_textFunc",this.disposeVar(p.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(s=>{(e.allowPicking??Q.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(s)})),this.dispose(r.innerHtmlMounted.disposableOn(s=>{const a=s.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=l=>r.pickFromDiv(a,{type:"viewerPicking",pointerEvent:l}))}));{const s=()=>{if(!e.position)return;const l=(this.textFunc??qn.defaultTextFunc_度格式)(e.position);r.innerHTML=bo(l)};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(s))}{const s=()=>{i.lonLatFormat??(i.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=i.lonLatFormat=="DECIMAL_DEGREE"?qn.defaultTextFunc_度格式:i.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?qn.defaultTextFunc_度分格式:qn.defaultTextFunc_度分秒格式};s(),this.d(i.lonLatFormatChanged.don(()=>{s()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(qn,"type",qn.register("ESCesiumViewer",Q.ESLocationMeasurement.type,qn)),L(qn,"defaultTextFunc_度格式",e=>{if(!e)return"";const[i=0,o=0,r=0]=e;return`经度: ${i.toFixed(5)}°
|
|
3491
|
+
`,Ct=class Ct extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_loadFuncReact",this.disposeVar(p.react(void 0)));L(this,"_dataSource",this.disposeVar(p.react(void 0)));L(this,"_data");L(this,"_defaultHeight",{});L(this,"_defaultBoundingSphere",new C.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{r()});{const s=this.dv(p.createProcessingFromAsyncFunc(async c=>{if(this.dataSource&&r(),!!this.url){do{if(typeof this.url=="object"){this._data=this.url;break}if(this._isJSONString(this.url)){this._data=JSON.parse(this.url);break}await fetch(Q.ESSceneObject.context.getStrFromEnv(this.url)).then(h=>h.json()).then(h=>{this._data=h}).catch(h=>{console.warn("ESGeoJson数据加载失败",h)})}while(!1);this.dataSource=await C.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(h=>{var A,f;const u=[];for(const d of h.entities.values)if(C.Entity.prototype&&(d.ESSceneObjectID=i),this._isEntityShow(d,e),d.polygon&&u.push(...(A=d.polygon.hierarchy)==null?void 0:A.getValue(C.JulianDate.now()).positions),d.polyline&&u.push(...(f=d.polyline.positions)==null?void 0:f.getValue(C.JulianDate.now())),d.position){const g=d.position.getValue(C.JulianDate.now());g&&u.push(g)}this._defaultBoundingSphere=C.BoundingSphere.fromPoints(u)})}})),a=()=>{s.isRunning&&s.cancel(),s.restart()};a();const l=this.dv(p.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(a))}{const s=()=>{var l,c;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(h){console.error(h)}else{const h=this.dataSource.entities.values;for(let u=0;u<h.length;u++){const A=h[u];if(A.polygon){this._defaultHeight[A.id]||(this._defaultHeight[A.id]=(l=A.polygon.height)==null?void 0:l.getValue(C.JulianDate.now())),A.polygon.height=this.fillGround?void 0:new C.ConstantProperty(this._defaultHeight[A.id]),A.polygon.perPositionHeight=new C.ConstantProperty(!this.fillGround),A.polygon.heightReference=new C.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?C.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?C.HeightReference.CLAMP_TO_GROUND:C.HeightReference.RELATIVE_TO_GROUND),A.polygon.show=new C.ConstantProperty(this.filled??Ct.defaults.filled),A.polygon.material=new C.ColorMaterialProperty(new C.Color(...this.fillColor??Ct.defaults.fillColor)),A.polygon.outline=new C.ConstantProperty(!1),A.polyline=new C.PolylineGraphics;const f=JSON.parse(JSON.stringify((c=A.polygon.hierarchy)==null?void 0:c.getValue(C.JulianDate.now()).positions));C.Cartesian3.equals(f[0],f[f.length-1])||f.push(f[0]),A.polyline.positions=f}if(A.polyline&&(A.polyline.show=new C.ConstantProperty(this.stroked??Ct.defaults.stroked),A.polyline.width=new C.ConstantProperty(this.strokeWidth??Ct.defaults.strokeWidth),A.polyline.material=new C.ColorMaterialProperty(new C.Color(...this.strokeColor??Ct.defaults.strokeColor)),A.polyline.clampToGround=new C.ConstantProperty(this.strokeGround)),A.billboard){A.billboard.show=new C.ConstantProperty(this.imageShow??Ct.defaults.imageShow),A.billboard.width=new C.ConstantProperty(this.imageSize?this.imageSize[0]:Ct.defaults.imageSize[0]),A.billboard.height=new C.ConstantProperty(this.imageSize?this.imageSize[1]:Ct.defaults.imageSize[1]);const f=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:Ct.defaults.imageUrl;A.billboard.image=new C.ConstantProperty(Q.ESSceneObject.context.getStrFromEnv(f)),A.billboard.horizontalOrigin=new C.ConstantProperty(C.HorizontalOrigin.LEFT),A.billboard.verticalOrigin=new C.ConstantProperty(C.VerticalOrigin.TOP),A.billboard.heightReference=new C.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?C.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?C.HeightReference.CLAMP_TO_GROUND:C.HeightReference.RELATIVE_TO_GROUND);const d=this.imageAnchor??Ct.defaults.imageAnchor,g=this.imageOffset??Ct.defaults.imageOffset;if(A.billboard.pixelOffset=new C.ConstantProperty(C.Cartesian2.fromArray([-d[0]*A.billboard.width.getValue(C.JulianDate.now())+g[0],-d[1]*A.billboard.height.getValue(C.JulianDate.now())+g[1]])),A.label=new C.LabelGraphics,!A.label)return;A.label.show=new C.ConstantProperty(this.textShow??Ct.defaults.textShow),A.label.heightReference=new C.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?C.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?C.HeightReference.CLAMP_TO_GROUND:C.HeightReference.RELATIVE_TO_GROUND),A.label.text=new C.ConstantProperty(this.textProperty&&this.textProperty!==""&&A.properties&&A.properties[this.textProperty]?A.properties[this.textProperty].getValue():this.textDefaultText??Ct.defaults.textDefaultText),A.label.fillColor=new C.ConstantProperty(new C.Color(...this.textColor??Ct.defaults.textColor)),A.label.showBackground=new C.ConstantProperty(this.textBackgroundColor!=null);const v=this.textFontSize&&this.textFontSize!=0?this.textFontSize:Ct.defaults.textFontSize,y=this.textOffset??Ct.defaults.textOffset;A.label.backgroundColor=new C.ConstantProperty(new C.Color(...this.textBackgroundColor??Ct.defaults.textBackgroundColor)),A.label.font=new C.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${v}px ${this.textFontFamily??Ct.defaults.textFontFamily}`),A.label.horizontalOrigin=new C.ConstantProperty(C.HorizontalOrigin.LEFT),A.label.verticalOrigin=new C.ConstantProperty(C.VerticalOrigin.TOP),A.label.eyeOffset=new C.ConstantProperty(C.Cartesian3.fromArray([0,0,-1]));const m=this.textAnchor??Ct.defaults.textAnchor;A.label.pixelOffset=new C.ConstantProperty(C.Cartesian2.fromArray([-m[0]*((this.textBackgroundColor?-14:-v*2)+this._countBytes(A.label.text.getValue(C.JulianDate.now()))/2*v)+y[0],-m[1]*((this.textBackgroundColor?10:0)+v)+y[1]]))}}}};s();const a=this.dv(p.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged));this.dispose(a.don(s))}{const s=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let c=0;c<l.length;c++){const h=l[c];this._isEntityShow(h,e)}};s();const a=this.ad(p.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(a.don(s))}{const s=()=>{if(this.loadFuncStr)try{const a=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=a}catch(a){console.error(a),this.loadFun=void 0}else this.loadFun=void 0};s(),this.dispose(this.loadFuncStrChanged.disposableOn(s))}this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&this.dataSource&&(s!==void 0?o.flyTo(this.dataSource,{duration:s/1e3}).then(a=>{a||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:s/1e3})}):o.flyTo(this.dataSource).then(a=>{a||o.camera.flyToBoundingSphere(this._defaultBoundingSphere)}))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_isJSONString(e){try{return JSON.parse(e),!0}catch{return!1}}_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}_isEntityShow(e,i){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=i.viewer)!=null&&o.camera&&this.show){let r;do{if(e.polygon&&e.polygon.hierarchy){r=Q.getMinMaxCorner(e.polygon.hierarchy.getValue(C.JulianDate.now()).positions.map(l=>Ue(l))).center;break}if(e.polyline&&e.polyline.positions&&(r=Q.getMinMaxCorner(e.polyline.positions.getValue(C.JulianDate.now()).map(l=>Ue(l))).center),e.position){const l=e.position.getValue(C.JulianDate.now());l&&(r=Ue(l))}}while(!1);if(!r||isNaN(r[0]))return;const s=Q.getDistancesFromPositions([r,_n(i.viewer.camera)],"NONE")[0];let a=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?a=this.minFeatureVisibleDistance<s&&s<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?a=s>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(a=s<this.maxFeatureVisibleDistance),e.show=this.show&&a}}};L(Ct,"defaults",{show:!0,allowPicking:!0,url:dC,defaultLoadFuncStr:fC,defaultLoadFuncDocStr:fO,data:hO,dataMd:AO,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 Wo=Ct;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:p.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:p.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:p.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:p.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:p.reactArrayWithUndefined(void 0),imageAnchor:p.reactArrayWithUndefined(void 0),imageOffset:p.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:p.reactArrayWithUndefined(void 0),textBackgroundColor:p.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:p.reactArrayWithUndefined(void 0),textOffset:p.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE"})})(Wo||(Wo={})),p.extendClassProps(Wo.prototype,Wo.createDefaultProps);const Bu=class Bu extends Bn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Wo(e,n.id));this.dispose(p.track([o,"show"],[n,"show"])),this.dispose(p.track([o,"allowPicking"],[n,"allowPicking"])),this.dispose(p.track([o,"loadFuncStr"],[n,"loadFuncStr"])),this.dispose(p.track([o,"url"],[n,"features"])),this.dispose(p.track([o,"stroked"],[n,"stroked"])),this.dispose(p.track([o,"strokeWidth"],[n,"strokeWidth"])),this.dispose(p.track([o,"strokeWidthType"],[n,"strokeWidthType"])),this.dispose(p.track([o,"strokeColor"],[n,"strokeColor"])),this.dispose(p.track([o,"strokeMaterial"],[n,"strokeMaterial"])),this.dispose(p.track([o,"strokeMaterialParams"],[n,"strokeMaterialParams"])),this.dispose(p.track([o,"strokeGround"],[n,"strokeGround"])),this.dispose(p.track([o,"filled"],[n,"filled"])),this.dispose(p.track([o,"fillColor"],[n,"fillColor"])),this.dispose(p.track([o,"fillMaterial"],[n,"fillMaterial"])),this.dispose(p.track([o,"fillMaterialParams"],[n,"fillMaterialParams"])),this.dispose(p.track([o,"fillGround"],[n,"fillGround"])),this.dispose(p.track([o,"imageShow"],[n,"imageShow"])),this.dispose(p.track([o,"imageUrl"],[n,"imageUrl"])),this.dispose(p.track([o,"imageSize"],[n,"imageSize"])),this.dispose(p.track([o,"imageAnchor"],[n,"imageAnchor"])),this.dispose(p.track([o,"imageOffset"],[n,"imageOffset"])),this.dispose(p.track([o,"textShow"],[n,"textShow"])),this.dispose(p.track([o,"textProperty"],[n,"textProperty"])),this.dispose(p.track([o,"textDefaultText"],[n,"textDefaultText"])),this.dispose(p.track([o,"textColor"],[n,"textColor"])),this.dispose(p.track([o,"textBackgroundColor"],[n,"textBackgroundColor"])),this.dispose(p.track([o,"textFontFamily"],[n,"textFontFamily"])),this.dispose(p.track([o,"textFontSize"],[n,"textFontSize"])),this.dispose(p.track([o,"textFontStyle"],[n,"textFontStyle"])),this.dispose(p.track([o,"textFontWeight"],[n,"textFontWeight"])),this.dispose(p.track([o,"textAnchor"],[n,"textAnchor"])),this.dispose(p.track([o,"textOffset"],[n,"textOffset"])),this.dispose(p.track([o,"minFeatureVisibleDistance"],[n,"minFeatureVisibleDistance"])),this.dispose(p.track([o,"maxFeatureVisibleDistance"],[n,"maxFeatureVisibleDistance"])),this.dispose(p.track([o,"heightReference"],[n,"heightReference"])),this.dispose(n.flyToEvent.disposableOn(r=>{if(e.actived){if(n.flyInParam){const{position:s,rotation:a,flyDuration:l}=n.flyInParam;return Be(e.viewer,s,void 0,a,l),!0}o.flyTo(r&&r*1e3)}}));{const r=(s,a,l)=>{if(!e.actived)return;const c=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(s,a)));if(!(!c||!(c!=null&&c.positions)))if(c.type=="Point"||c.type=="MultiPoint")Rn(e,n,this.id,this._calculateFeatureHeight(c.type=="MultiPoint"?c.positions.flat():c.positions,n.heightReference,e),1e3,l);else{const h=c.type=="Polygon"||c.type=="MultiPolygon"||c.type=="MultiLineString";let u=[];h?u=c.positions.flat(c.type=="MultiPolygon"?2:1).map(g=>this._calculateFeatureHeight(g,n.fillGround?"CLAMP_TO_GROUND":"NONE",e)):u=c.positions.map(g=>this._calculateFeatureHeight(g,n.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:A,maxPos:f,center:d}=Q.getMinMaxCorner(u);Rn(e,n,this.id,d,Q.getDistancesFromPositions([A,f],"NONE")[0],l)}};this.d(n.flyToFeatureEvent.don((s,a,l)=>r(s,a,l))),this.d(n.flyToFeatureIndexEvent.don((s,a)=>r(s,void 0,a)))}}_getFeatureByIndexOrProperties(n,e){var s,a,l,c,h,u,A,f;const{sceneObject:i}=this,o=i.features;if(!o)return;const r=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(r){if(e){let d=r.find(g=>(g==null?void 0:g.properties[n])==e);return{type:d!=null&&d.coordinates?d.type:(s=d==null?void 0:d.geometry)==null?void 0:s.type,positions:(d==null?void 0:d.coordinates)||((a=d==null?void 0:d.geometry)==null?void 0:a.coordinates)}}else if(typeof n=="number")return{type:(l=r[n])!=null&&l.coordinates?r[n].type:(h=(c=r[n])==null?void 0:c.geometry)==null?void 0:h.type,positions:((u=r[n])==null?void 0:u.coordinates)||((f=(A=r[n])==null?void 0:A.geometry)==null?void 0:f.coordinates)}}}_calculateFeatureHeight(n,e,i){const{sceneObject:o}=this,r=[...n];do{if(e=="NONE"){r[2]=r[2]??0;break}if(e=="CLAMP_TO_GROUND"||!r[2]){r[2]=i.getTerrainHeight(r)??0;break}r[2]+=i.getTerrainHeight(r)??0}while(!1);return r}};L(Bu,"type",Bu.register("ESCesiumViewer",Q.ESGeoJson.type,Bu));let Om=Bu;const Mu=class Mu extends an{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 pi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,s=this._geoPolyline;s.arcType="RHUMB",this.dispose(p.track([s,"color"],[e,"strokeColor"])),this.dispose(p.track([s,"width"],[e,"strokeWidth"])),this.dispose(p.track([s,"ground"],[e,"strokeGround"])),this.dispose(p.track([r,"ground"],[e,"fillGround"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"]));{const a=()=>{s.show=e.show&&e.stroked,r.show=e.show&&e.filled};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(a))}{const a=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:h}=Q.getMinMaxCorner(l);r.rectangle=[c[0],c[1],h[0],h[1]],r.height=l[0][2],r.extrudedHeight=l[0][2];const u=l.map(g=>(l&&(g[2]=l[0][2]),g)),A=u[0],f=u[1],d=[A,[A[0],f[1],A[2]],f,[f[0],A[1],f[2]]];s.positions=[...d,A]}else r.rectangle=void 0,s.positions=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,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:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(Mu,"type",Mu.register("ESCesiumViewer",Q.ESGeoRectangle.type,Mu));let Lm=Mu;class Ql extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Br(e,i));const{geoPolygon:o}=this;this.dispose(p.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(s=>{o.flyTo(s)})),this.dispose(p.bind([o,"show"],[this,"show"])),this.dispose(p.bind([o,"fill"],[this,"filled"])),this.dispose(p.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(p.bind([o,"ground"],[this,"ground"])),this.dispose(p.bind([o,"outline"],[this,"outline"])),this.dispose(p.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(p.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(p.bind([o,"color"],[this,"color"])),this.dispose(p.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const s=Jf([...this.positions,this.positions[0]]);o.positions=s}else o.positions=void 0};r(),this.dispose(this.positionsChanged.disposableOn(r))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:p.reactArray([1,1,1,1]),outlineWidth:1,color:p.reactArrayWithUndefined([1,1,1,.5]),positions:p.reactPositions(void 0),depth:0})})(Ql||(Ql={})),p.extendClassProps(Ql.prototype,Ql.createDefaultProps);const Du=class Du extends an{constructor(e,i){super(e,i);L(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Ql(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"outline"],[e,"stroked"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(p.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"filled"],[e,"filled"])),this.dispose(p.track([r,"color"],[e,"fillColor"])),this.dispose(p.track([r,"ground"],[e,"ground"]));{const s=()=>{r.ground=e.ground||e.fillGround};s();const a=this.dv(p.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(a.don(s))}{const s=()=>{r.color=e.filled?e.fillColor:Ji.defaults.fillStyle.color};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(s))}this.dispose(p.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Du,"type",Du.register("ESCesiumViewer",Ji.type,Du));let zm=Du;const Ru=class Ru extends Ge{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 Ht(i,e.id));const r=this._czmModel;this.d(r.readyEvent.don(a=>{r.gltf.animations&&(r.activeAnimationsJson=r.gltf.animations.map((l,c)=>({index:c,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),r.activeAnimationsAnimateWhilePaused=!0),e.czmModelReadyEvent.emit(a)})),this.ad(new Wf(o,this._czmModel)),this.d(p.track([r,"show"],[e,"show"])),this.d(p.track([r,"color"],[e,"czmColor"])),this.d(p.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(p.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(p.bind([r,"position"],[e,"position"])),this.d(p.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(p.track([r,"scale"],[e,"scale"])),this.ad(p.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(p.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const a=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};a(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>a(l)))}{const a=()=>{var l,c;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(c=e.czmEnvironmentMapManager)==null?void 0:c.atmosphereScatteringIntensity)};a(),this.ad(e.czmEnvironmentMapManagerChanged.don(a))}{const a=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances?0:90,r.rotation=l};a(),this.d(e.rotationChanged.don(a));{const l=()=>{if(a(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(c=>{const h=JSON.parse(JSON.stringify(c));return!h.rotation&&(h.rotation=[0,0,0]),h.rotation[0]+=90,h})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(a=>{r.setMaterial(a)}));{const a=()=>{const l=[...r.rotation];l[0]-=e.instances?0:90,e.rotation=l};a(),this.d(r.rotationChanged.don(a))}{const a=this.dv(p.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};l(),this.d(a.don(l))}const s=()=>{r.url=Q.ESSceneObject.context.getStrFromEnv(rh(typeof e.url=="string"?e.url:e.url.url))};s(),this.d(e.urlChanged.don(s)),this.d(e.setNodePositionEvent.don((a,l)=>{r.setNodeTranslation(a,l)})),this.d(e.setNodeRotationEvent.don((a,l)=>{r.setNodeRotation(a,l)})),this.d(e.setNodeScaleEvent.don((a,l)=>{r.setNodeScale(a,l)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,i){const{sceneObject:o,czmViewer:r,model:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(s&&dn(r,o,i,e,s,!0),!!s):!1}};L(Ru,"type",Ru.register("ESCesiumViewer",Q.ESGltfModel.type,Ru));let Qm=Ru;function pC(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 Vl extends p.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new p.Event));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_distance",this.disposeVar(p.react(0)));L(this,"_surfaceDistance",this.disposeVar(p.react(0)));L(this,"_height",this.disposeVar(p.react(0)));L(this,"_middlePosition",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_heightPosition",this.disposeVar(p.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const s=this._surfaceDistance.value=Q.geoDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="RHUMB"){const s=this._surfaceDistance.value=Q.geoRhumbDistance(this.positions[0],this.positions[1]),a=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(s*s+a*a)}else if(this.arcType==="NONE"){const s=Q.lbhToXyz(this.positions[0]),a=Q.lbhToXyz(this.positions[1]);this._distance.value=pC(s,a),this._surfaceDistance.value=pC(Q.lbhToXyz(this._middlePosition.value),a),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const s=this.disposeVar(new Je(e,i));s.ground=!1,s.loop=!1,this.dispose(p.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(p.bind([s,"arcType"],[this,"arcType"])),this.dispose(p.bind([s,"color"],[this,"color"])),this.dispose(p.bind([s,"dashLength"],[this,"dashLength"])),this.dispose(p.bind([s,"dashPattern"],[this,"dashPattern"])),this.dispose(p.bind([s,"gapColor"],[this,"gapColor"])),this.dispose(p.bind([s,"hasArrow"],[this,"hasArrow"])),this.dispose(p.bind([s,"hasDash"],[this,"hasDash"])),this.dispose(p.bind([s,"show"],[this,"show"])),this.dispose(p.bind([s,"width"],[this,"width"])),this.dispose(p.bind([s,"depthTest"],[this,"depthTest"]));{s.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[c,h]=this.positions;s.positions=[c,h,[c[0],c[1],h[2]]]}else s.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const a=this.disposeVar(new wt(e,i));this.dispose(p.track([a,"shadowDom"],[this,"shadowDom"])),this.dispose(p.track([a,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(p.track([a,"show"],[this,"show"]));{const l=()=>{a.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{a.innerHTML=bo(`高度: ${oh(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(a.pickedEvent.don(l=>{Ui(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:p.reactPositions(void 0),width:1,color:p.reactArray([1,1,1,1]),hasDash:!1,gapColor:p.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Vl||(Vl={})),p.extendClassProps(Vl.prototype,Vl.createDefaultProps);const Uu=class Uu extends an{constructor(e,i){super(e,i);L(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Vl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"]));{const s=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const c=e.strokeMaterial??"normal";c==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):c==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const h=e.strokeStyle;if(h.material==="hasDash"&&h.materialParams)try{const u=h.materialParams;Reflect.has(u,"gapColor")&&(r.gapColor=u.gapColor??[0,0,0,0]),Reflect.has(u,"dashLength")&&(r.dashLength=u.dashLength),Reflect.has(u,"dashPattern")&&(r.dashPattern=u.dashPattern)}catch(u){console.error(u)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(s=>{Ui(s)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(s)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Uu,"type",Uu.register("ESCesiumViewer",Q.ESHeightMeasurement.type,Uu));let Vm=Uu;const Ou=class Ou extends Ge{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 Ht(i,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"scale"],[e,"scale"]));{const g=this.dv(p.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),v=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};v(),this.d(g.don(v))}const s=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),a=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),c=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),h=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),u=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),A=()=>{switch(e.mode){case"worker":r.url=s;break;case"police":r.url=a;break;case"pedestrian":r.url=l;break;case"stranger":r.url=c;break;case"suitMan":r.url=h;break;case"suitWoman":r.url=u;break;default:r.url=s;break}};this.dispose(e.modeChanged.disposableOn(()=>{A()})),A();const f=()=>{const g=e.animation??Q.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}g==="walking"?r.activeAnimationsJson=Q.ESHuman.defaults.czmAnimationsWalk:g==="standing"?r.activeAnimationsJson=Q.ESHuman.defaults.czmAnimationsStand:g==="running"&&(r.activeAnimationsJson=Q.ESHuman.defaults.czmAnimationsRun)};f();const d=this.ad(p.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(d.disposableOn(()=>f())),this.ad(new Wf(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:s}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(s&&dn(r,o,i,e,s,!0),!!s)}};L(Ou,"type",Ou.register("ESCesiumViewer",Q.ESHuman.type,Ou));let Hm=Ou;class mC extends p.Destroyable{constructor(e,i){super();L(this,"_czmGeoCanvasImagePoi");L(this,"flyTo",(e,i)=>{if(this.czmGeoCanvasImagePoi.position){Be(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Dn,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoCanvasImagePoi=this.disposeVar(new ui(i));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=h=>{let u=h;return h.includes("inner://")&&(u="${earthsdk3-assets-script-dir}/assets/img/points/"+h.split("inner://")[1]),Q.ESSceneObject.context.getStrFromEnv(rh(u))},s=()=>{const h=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=h,e.sizeByContent){const A=new Image;A.src=h,A.onload=()=>{o.size=[A.width,A.height]}}else{const A=e.size;o.size=[...A]}},a=this.disposeVar(p.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(a.disposableOn(()=>s())),s(),this.d(p.track([o,"zOrder"],[e,"zOrder"])),this.dispose(p.track([o,"show"],[e,"show"])),this.dispose(p.bind([o,"position"],[e,"position"])),this.ad(p.bind([o,"isHoverZoom"],[e,"isHoverZoom"]));{const h=()=>{o.scale=[e.scale[1],e.scale[2]]};h(),this.dispose(e.scaleChanged.don(h))}const l=()=>{const h=e.anchor,u=e.offset;h?o.originRatioAndOffset=[...h,-u[0],-u[1]]:o.originRatioAndOffset=[0,0,0,0]},c=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(c.disposableOn(()=>l())),l(),this.dispose(o.clickEvent.disposableOn(h=>{const{offsetX:u,offsetY:A}=h,d={type:h.button===0?"leftClick":h.button===2?"rightClick":void 0,add:{mousePos:[u,A]}};e.widgetEvent.emit(d)})),this.dispose(o.hoveredChanged.disposableOn(h=>{if(h===void 0)return;const u={type:h?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(u)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class gC extends p.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 Wi(i,e.id));const r=this._czmGeoImageModel;this.ad(i.clickEvent.don(A=>{const f=A==null?void 0:A.pointerEvent;f&&(this._isPointEvent=!0,this._eventInfo={type:f.button==0?"leftClick":f.button==2?"rightClick":"leftClick",add:{mousePos:[f.offsetX,f.offsetY]}})})),this.d(e.pickedEvent.don(A=>{var f,d,g;A.screenPosition&&this._isPointEvent&&A.attachedInfo!="innerHoverEvent"&&((f=this._eventInfo.add)!=null&&f.mousePos)&&Math.abs(A.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(A.screenPosition[1]-((g=this._eventInfo.add)==null?void 0:g.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),Q.registerCreatedEventUpdate(this,e,()=>{const A=i.getEngineObject(e);this.ad(A.lastHoverResultChanged.don((f,d)=>{(f==null?void 0:f.sceneObject)==(d==null?void 0:d.sceneObject)||(f==null?void 0:f.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(f!=null&&f.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:f==null?void 0:f.screenPosition}},f.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&f.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:f==null?void 0:f.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 s=e.sizeByContent,l=(A=>{let f=A;return A.includes("inner://")&&(f="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),Q.ESSceneObject.context.getStrFromEnv(rh(f))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),c=new Image;c.src=l,c.onload=()=>{if(s)r.size=[c.width/100,c.height/100];else{const A=e.size;r.size=[A[0]/100,A[1]/100]}},r.uri=l,this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),r.pixelSize=void 0,r.useAxis="XZ";{const A=()=>{r.scale=[e.scale[1],e.scale[2]]};A(),this.d(e.scaleChanged.don(A))}{const A=()=>{e.rotationType===0&&(r.rotationMode="WithProp",this.d(Dt([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};A(),this.dispose(e.rotationTypeChanged.disposableOn(A))}const h=()=>{const A=e.anchor,f=e.offset;A?r.originRatioAndOffset=[...A,-f[0]/100,-f[1]/100]:r.originRatioAndOffset=[0,0,0,0]},u=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>h())),h()}get czmGeoImageModel(){return this._czmGeoImageModel}}const Lu=class Lu extends Ol{constructor(e,i){super(e,i);L(this,"_resetting");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(p.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new p.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new mC(this.sceneObject,this.czmViewer):new gC(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s&&s.obj&&s.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Lu,"type",Lu.register("ESCesiumViewer",Q.ESImageLabel.type,Lu));let Nm=Lu;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 zu=class zu extends Bn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Nr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const s=this.ad(p.reactJson(""));{const c=()=>{if(typeof e.url=="string")s.value=Q.ESSceneObject.context.getStrFromEnv(e.url);else{const h=e.url;h.url=Q.ESSceneObject.context.getStrFromEnv(h.url),s.value=h}};c(),this.ad(e.urlChanged.don(c))}const a=()=>{var d;if(!s.value)return;const c=(((d=e.options)==null?void 0:d.type)??"auto").toLowerCase(),h=e.options??{};let u={type:"UrlTemplateImageryProvider",url:s.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...h},A=s.value,f=typeof A=="string"?A:A.url;if(c==="auto"){const g=f.toLowerCase();if(g.startsWith("ion://")){const y=+g.substring(6);u={...h,assetId:y,type:"IonImageryProvider"}}else if(g.includes("{x}")||g.includes("{y}")||g.includes("{z}"))u.type="UrlTemplateImageryProvider";else if(g.includes("wmts"))u.type="WebMapTileServiceImageryProvider";else if(g.includes("wms"))u.type="WebMapServiceImageryProvider";else{if(f.includes("/tilemapresource.xml")){const v=f.split("/tilemapresource.xml").join("");typeof A=="string"?A=v:A.url=v,u.url=A}u.type="TileMapServiceImageryProvider"}}else{if(c==="tms"&&f.includes("/tilemapresource.xml")){const g=f.split("/tilemapresource.xml").join("");typeof A=="string"?A=g:A.url=g,u.url=A}else if(c==="ion"&&f.startsWith("ion://")){const v=+f.substring(6);u={...h,assetId:v,type:"IonImageryProvider"}}u.type=dO(c)}console.log("imageryProvider",u),r.imageryProvider=u};a();const l=this.dv(p.createNextAnimateFrameEvent(s.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(a))}this.d(p.track([r,"show"],[e,"show"])),this.d(p.bind([r,"alpha"],[e,"opacity"])),this.d(p.bind([r,"alpha"],[e,"czmAlpha"])),this.d(p.track([r,"splitDirection"],[e,"splitDirection"])),this.d(p.track([r,"brightness"],[e,"czmBrightness"])),this.d(p.track([r,"contrast"],[e,"czmContrast"])),this.d(p.track([r,"hue"],[e,"czmHue"])),this.d(p.track([r,"saturation"],[e,"czmSaturation"])),this.d(p.track([r,"gamma"],[e,"czmGamma"])),this.d(p.track([r,"rectangle"],[e,"rectangle"])),this.d(p.track([r,"zIndex"],[e,"zIndex"]))}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(zu,"type",zu.register("ESCesiumViewer",Q.ESImageryLayer.type,zu));let Gm=zu;class pO extends p.Destroyable{constructor(e,i,o,r){super();L(this,"_show");L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(p.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new st(i,this._sceneObject.id)),this._czmTexture=this.dv(new At(i));const s=e,a=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(p.track([a,"show"],[this,"show"])),this.dispose(p.track([a,"show"],[s,"show"])),this.dispose(p.track([a,"allowPicking"],[s,"allowPicking"])),this.dispose(p.track([a,"rotation"],[s,"rotation"])),this.dispose(p.track([a,"position"],[s,"position"])),this.dispose(p.track([a,"scale"],[s,"scale"])),this.ad(s.allowPickingChanged.don(()=>{a.allowPicking=s.allowPicking,a.pass=s.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const c=()=>{const u=s.size/2,A=r[0].map(S=>S*u),f=r[1].map(S=>S*u),d=r[2].map(S=>S*u),g=r[3].map(S=>S*u),v=[...A,...f,...d,...g];let y=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(y=y.reverse());const m=[0,0],w=[1,0],_=[1,1],E=[0,1];let T=[];o=="east"||o=="south"?T=[...w,...m,...E,..._]:o=="west"?T=[...w,..._,...E,...m]:o=="top"?T=[...E,..._,...w,...m]:T=[...m,...w,..._,...E],a.indexTypedArray=new Uint16Array(y),a.attributes={position:{typedArray:new Float32Array(v),componentsPerAttribute:3},st:{typedArray:new Float32Array(T),componentsPerAttribute:2}},l.uri=Q.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${s.mode}/${o}.${s.mode!="blueSky"?"png":"jpg"}`);const P=i.getCameraInfo();if(P!=null){const I=Q.getDistancesFromPositions([s.position,P.position],"NONE")[0]/(s.size/2*s.autoOpacityFactor);this.changeOpacity(s.autoFollow?1:I)}const F=a.computeLocalAxisedBoundingBoxFromAttribute("position");if(!F)return;const{min:D,max:B}=F;a.setLocalAxisedBoundingBox(D,B)};c();const h=this.disposeVar(p.createNextAnimateFrameEvent(s.sizeChanged,s.modeChanged));this.dispose(h.disposableOn(c))}}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 mO extends p.Destroyable{constructor(n,e,i){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{s()}));function s(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const a=e.getCameraInfo();if(a!=null&&(r==null||r.position[0]!=a.position[0]||r.position[1]!=a.position[1]||r.position[2]!=a.position[2]||r.rotation[0]!=a.rotation[0]||r.rotation[1]!=a.rotation[1]||r.rotation[2]!=a.rotation[2])){r=a;const h=Q.getDistancesFromPositions([n.position,r.position],"NONE")[0]/(n.size/2*n.autoOpacityFactor);n.autoFollow?(n.position=r.position,o&&(o=!1,i.forEach(u=>{u.changeOpacity(1)}))):i.forEach(u=>{u.changeOpacity(h)})}}s()}}const Tt=class Tt extends Ge{constructor(e,i){super(e,i);L(this,"_czmSkyBoxComponents",[]);if(!i.viewer){console.warn("viewer is undefined!");return}!Tt._defaultLocalBox&&Tt._firstLoad&&(Tt._firstLoad=!1,Tt._defaultLocalBox=i.xbsjLocalBoxSources),Tt._eSLocalSkyBoxArr.push(e),this.d(()=>{Tt._eSLocalSkyBoxArr.includes(e)&&Tt._eSLocalSkyBoxArr.splice(Tt._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const r={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const s in r)if(Object.prototype.hasOwnProperty.call(r,s)){const a=r[s];this._czmSkyBoxComponents.push(this.dv(new pO(e,i,s,a)))}{const s=this.disposeVar(p.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new p.ObjResettingWithEvent(s,()=>(this.ChangeAutoFollow(),new mO(e,i,this._czmSkyBoxComponents))))}{const s=()=>{this.ChangeAutoFollow()},a=this.disposeVar(p.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(a.disposableOn(s))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let i=Tt._eSLocalSkyBoxArr.length-1;i>=0;i--){const o=Tt._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=Tt._defaultLocalBox)}Tt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Tt._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 s=o.size??Q.ESLocalSkyBox.defaults.size;return o.position?(Rn(r,o,i,o.position,s,e,!0),!0):!1}}};L(Tt,"type",Tt.register("ESCesiumViewer",Q.ESLocalSkyBox.type,Tt)),L(Tt,"_defaultLocalBox"),L(Tt,"_firstLoad",!0),L(Tt,"_eSLocalSkyBoxArr",[]);let Wm=Tt;const qn=class qn extends Ge{constructor(e,i){super(e,i);L(this,"_geoCustomDivPoi");L(this,"_textFunc",this.disposeVar(p.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(s=>{(e.allowPicking??Q.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(s)})),this.dispose(r.innerHtmlMounted.disposableOn(s=>{const a=s.firstElementChild;a&&(a.style.pointerEvents="auto",a.style.cursor="default",a.onclick=l=>r.pickFromDiv(a,{type:"viewerPicking",pointerEvent:l}))}));{const s=()=>{if(!e.position)return;const l=(this.textFunc??qn.defaultTextFunc_度格式)(e.position);r.innerHTML=bo(l)};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(a.disposableOn(s))}{const s=()=>{i.lonLatFormat??(i.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=i.lonLatFormat=="DECIMAL_DEGREE"?qn.defaultTextFunc_度格式:i.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?qn.defaultTextFunc_度分格式:qn.defaultTextFunc_度分秒格式};s(),this.d(i.lonLatFormatChanged.don(()=>{s()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(qn,"type",qn.register("ESCesiumViewer",Q.ESLocationMeasurement.type,qn)),L(qn,"defaultTextFunc_度格式",e=>{if(!e)return"";const[i=0,o=0,r=0]=e;return`经度: ${i.toFixed(5)}°
|
|
3492
3492
|
纬度: ${o.toFixed(5)}°
|
|
3493
3493
|
高度: ${r.toFixed(2)}m`}),L(qn,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[i,o,r]=Xf(e,!0);return`经度: ${i}
|
|
3494
3494
|
纬度: ${o}
|
|
3495
3495
|
高度: ${r}`}),L(qn,"defaultTextFunc_度分秒格式",e=>{if(!e)return"";const[i,o,r]=Xf(e);return`经度: ${i}
|
|
3496
3496
|
纬度: ${o}
|
|
3497
|
-
高度: ${r}`});let qm=qn;const Qu=class Qu extends Ge{constructor(e,i){super(e,i);L(this,"_czmESParticleSystemPrimitive");if(this._czmESParticleSystemPrimitive=this.disposeVar(new hi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESParticleSystemPrimitive;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"updateCallback"],[e,"updateCallback"])),this.dispose(p.track([r,"emissionRate"],[e,"emissionRate"])),this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"scale"],[e,"particleScale"])),this.dispose(p.track([r,"startScale"],[e,"startScale"])),this.dispose(p.track([r,"endScale"],[e,"endScale"])),this.dispose(p.track([r,"color"],[e,"color"])),this.dispose(p.track([r,"startColor"],[e,"startColor"])),this.dispose(p.track([r,"endColor"],[e,"endColor"])),this.dispose(p.track([r,"sizeInMeters"],[e,"sizeInMeters"])),this.dispose(p.track([r,"speed"],[e,"speed"])),this.dispose(p.track([r,"minimumSpeed"],[e,"minimumSpeed"])),this.dispose(p.track([r,"maximumSpeed"],[e,"maximumSpeed"])),this.dispose(p.track([r,"lifetime"],[e,"lifetime"])),this.dispose(p.track([r,"particleLife"],[e,"particleLife"])),this.dispose(p.track([r,"minimumParticleLife"],[e,"minimumParticleLife"])),this.dispose(p.track([r,"maximumParticleLife"],[e,"maximumParticleLife"])),this.dispose(p.track([r,"mass"],[e,"mass"])),this.dispose(p.track([r,"minimumMass"],[e,"minimumMass"])),this.dispose(p.track([r,"maximumMass"],[e,"maximumMass"])),this.dispose(p.track([r,"imageSize"],[e,"imageSize"])),this.dispose(p.track([r,"minimumImageSize"],[e,"minimumImageSize"])),this.dispose(p.track([r,"maximumImageSize"],[e,"maximumImageSize"])),this.dispose(p.track([r,"image"],[e,"image"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"translation"],[e,"translation"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"bursts"],[e,"bursts"])),this.dispose(p.track([r,"emitter"],[e,"emitter"])),this.dispose(p.track([r,"ratio"],[e,"ratio"])),this.dispose(p.track([r,"playingLoop"],[e,"playingLoop"])),this.dispose(p.track([r,"currentTime"],[e,"currentTime"])),this.dispose(p.track([r,"duration"],[e,"duration"])),this.dispose(p.track([r,"playing"],[e,"playing"])),this.dispose(p.track([r,"playingSpeed"],[e,"playingSpeed"]))}get czmESParticleSystemPrimitive(){return this._czmESParticleSystemPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESParticleSystemPrimitive:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,Dn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Qu,"type",Qu.register("ESCesiumViewer",Q.ESParticleSystemPrimitive.type,Qu));let Km=Qu;async function
|
|
3497
|
+
高度: ${r}`});let qm=qn;const Qu=class Qu extends Ge{constructor(e,i){super(e,i);L(this,"_czmESParticleSystemPrimitive");if(this._czmESParticleSystemPrimitive=this.disposeVar(new hi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESParticleSystemPrimitive;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"updateCallback"],[e,"updateCallback"])),this.dispose(p.track([r,"emissionRate"],[e,"emissionRate"])),this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"scale"],[e,"particleScale"])),this.dispose(p.track([r,"startScale"],[e,"startScale"])),this.dispose(p.track([r,"endScale"],[e,"endScale"])),this.dispose(p.track([r,"color"],[e,"color"])),this.dispose(p.track([r,"startColor"],[e,"startColor"])),this.dispose(p.track([r,"endColor"],[e,"endColor"])),this.dispose(p.track([r,"sizeInMeters"],[e,"sizeInMeters"])),this.dispose(p.track([r,"speed"],[e,"speed"])),this.dispose(p.track([r,"minimumSpeed"],[e,"minimumSpeed"])),this.dispose(p.track([r,"maximumSpeed"],[e,"maximumSpeed"])),this.dispose(p.track([r,"lifetime"],[e,"lifetime"])),this.dispose(p.track([r,"particleLife"],[e,"particleLife"])),this.dispose(p.track([r,"minimumParticleLife"],[e,"minimumParticleLife"])),this.dispose(p.track([r,"maximumParticleLife"],[e,"maximumParticleLife"])),this.dispose(p.track([r,"mass"],[e,"mass"])),this.dispose(p.track([r,"minimumMass"],[e,"minimumMass"])),this.dispose(p.track([r,"maximumMass"],[e,"maximumMass"])),this.dispose(p.track([r,"imageSize"],[e,"imageSize"])),this.dispose(p.track([r,"minimumImageSize"],[e,"minimumImageSize"])),this.dispose(p.track([r,"maximumImageSize"],[e,"maximumImageSize"])),this.dispose(p.track([r,"image"],[e,"image"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"translation"],[e,"translation"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"bursts"],[e,"bursts"])),this.dispose(p.track([r,"emitter"],[e,"emitter"])),this.dispose(p.track([r,"ratio"],[e,"ratio"])),this.dispose(p.track([r,"playingLoop"],[e,"playingLoop"])),this.dispose(p.track([r,"currentTime"],[e,"currentTime"])),this.dispose(p.track([r,"duration"],[e,"duration"])),this.dispose(p.track([r,"playing"],[e,"playing"])),this.dispose(p.track([r,"playingSpeed"],[e,"playingSpeed"]))}get czmESParticleSystemPrimitive(){return this._czmESParticleSystemPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESParticleSystemPrimitive:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=s.position;return Be(r.viewer,a,100,Dn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Qu,"type",Qu.register("ESCesiumViewer",Q.ESParticleSystemPrimitive.type,Qu));let Km=Qu;async function gO(t){const n=["Flag01","Flag02","Linear02","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"],e=["CircularV05","Diamond01"],i=["Flag01","Flag02","Linear02","Linear03","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"];let o=[];const r="${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/",s=n.includes(t)?void 0:await Co(Q.ESSceneObject.context.getStrFromEnv(r+`/${t}/icon.png`)),a=e.includes(t)?void 0:await Co(Q.ESSceneObject.context.getStrFromEnv(r+`/${t}/anchor.png`));for(let h=1;h<=(SO[t]??3);h++)o.push(await Co(Q.ESSceneObject.context.getStrFromEnv(r+`/${t}/textBox_0${h}.png`)));const l=i.includes(t)?void 0:await Co(Q.ESSceneObject.context.getStrFromEnv(r+`/${t}/iconBox.png`)),c=o.filter(h=>h!=null);return{icon:s,anchor:a,iconBox:l,textBox:c}}function yO(t,n,e,i,o,r){var d,g,v;const s={iconBox:i,icon:o,anchor:r},a=document.createElement("div");a.classList.add("czmPoi2dDiv"),["SquareH","CircularH","Flag","Linear01"].some(y=>t.includes(y))?a.innerHTML=bO(t,s,n):a.innerHTML=_O(t,s,n);const{textDiv:c,height:h}=CO(e);let u;t=="Linear03"&&o&&(u=document.createElement("img"),u.classList.add(`${t}-icon`),u.src=o.url,u.style.width=`${o.width}px`,u.style.height=`${o.height}px`,u.style.position="absolute",u.style.top="2px");const A=a.querySelector(".textDiv");if(A&&A.nextElementSibling)do{const y=(d=A.nextElementSibling.lastElementChild)==null?void 0:d.getAttribute("style");if(u){A.nextElementSibling.insertAdjacentElement("afterbegin",u),(g=A.nextElementSibling.lastElementChild)==null||g.setAttribute("style",y+`;margin-left: ${o==null?void 0:o.width}px;`);break}if(["Stranger","Man","Woman"].some(m=>t.includes(m))){(v=A.nextElementSibling.lastElementChild)==null||v.setAttribute("style",y+";margin-left: 50px;");break}}while(!1);A&&(A.innerHTML=c);const{poi2DCssObj:f}=vO(t,r,i,h);return{div:a,styleObj:f}}function vO(t,n,e,i){const o=wO(t,n,e),r={img:"display:inline-block !important;",icon:`top: ${((e==null?void 0:e.height)??0)*(t=="CircularV05"?.4:.5)}px !important;`,anchor:`top:${e!=null&&e.height?e.height+(["Diamond02","Linear01"].includes(t)?0:(n==null?void 0:n.height)??0):0}px !important;
|
|
3498
3498
|
left: calc(50% - ${((n==null?void 0:n.width)??0)/2}px)!important;`,textBoxTransverseParent:`height:${o}px !important;`,textBoxTransverse:`
|
|
3499
3499
|
margin-left:${n&&!["Flag02","Linear01","CircularH02","CircularH01"].includes(t)?t.includes("Flag01")?-n.width/2+2:n.height:t=="CircularH01"?15:t=="CircularH02"?-2:2}px !important;
|
|
3500
3500
|
line-height: ${t=="CircularH01"?i+5:t=="Linear01"?e==null?void 0:e.height:i}px !important;
|
|
@@ -3508,7 +3508,7 @@ ${fC}
|
|
|
3508
3508
|
.czmPoi2dDiv .${t}-textBoxTransverse {${r.textBoxTransverse}}
|
|
3509
3509
|
.czmPoi2dDiv .${t}-textBoxVertical {${r.textBoxVertical}}
|
|
3510
3510
|
.czmPoi2dDiv .${t}-textBoxVertical+div {${r.textBoxVerticalBrother}}
|
|
3511
|
-
`,poi2DCssObj:r}}function
|
|
3511
|
+
`,poi2DCssObj:r}}function wO(t,n,e){return e==null?n==null?void 0:n.height:n==null?e.height:e.height+n.height*(["Diamond02","Linear01","Linear02","Linear03"].includes(t)?1:2)}function bO(t,n,e){const{iconBox:i,icon:o,anchor:r}=n;let s="";return i&&o&&(s+=`<img src="${i.url}" class="${t}-iconBox" style="text-align:center !important"/>
|
|
3512
3512
|
<img src="${o.url}" class="${t}-icon"
|
|
3513
3513
|
style="{{icon}} position:absolute !important;
|
|
3514
3514
|
top: ${i.height*.5}px !important;
|
|
@@ -3538,7 +3538,7 @@ ${fC}
|
|
|
3538
3538
|
</span>
|
|
3539
3539
|
</div>
|
|
3540
3540
|
</div>
|
|
3541
|
-
</div>`}function
|
|
3541
|
+
</div>`}function _O(t,n,e){const{iconBox:i,icon:o,anchor:r}=n;let s="";return i!=null&&o!=null&&(s+=`<img src="${i.url}" class="${t}-iconBox" style="width:${i.width}px !important;height:${i.height}px !important;text-align:center !important"/>
|
|
3542
3542
|
<img class="${t}-icon" src="${o.url}"
|
|
3543
3543
|
style="{{icon}} width:${o.width}px !important;
|
|
3544
3544
|
height:${o.height}px !important;
|
|
@@ -3568,11 +3568,11 @@ ${fC}
|
|
|
3568
3568
|
<div style="{{textBoxVerticalBrother}} position: relative !important;">
|
|
3569
3569
|
${s}
|
|
3570
3570
|
</div>
|
|
3571
|
-
</div>`}function
|
|
3571
|
+
</div>`}function CO(t){let n="",e=0,i=0;for(let o=0;o<t.length;o+=2)i+=t[o].width;for(let o=0;o<t.length;o++)t.length==1?n+=`<img src="${t[o].url}" style="{{img}} width: 100% !important;height: ${t[o].height}px !important;vertical-align: top !important"/>`:o%2==1?n+=`<img src="${t[o].url}" style="{{img}}
|
|
3572
3572
|
width: calc(${100/Math.floor(t.length/2)}% - ${i/Math.floor(t.length/2)}px) !important;
|
|
3573
3573
|
height: ${t[o].height}px !important;
|
|
3574
3574
|
vertical-align: top !important"
|
|
3575
|
-
/>`:n+=`<img src="${t[o].url}" style="{{img}} width: ${t[o].width}px !important;height: ${t[o].height}px !important;vertical-align: top !important"/>`,e=e>t[o].height?e:t[o].height;return{textDiv:n,height:e}}function
|
|
3575
|
+
/>`:n+=`<img src="${t[o].url}" style="{{img}} width: ${t[o].width}px !important;height: ${t[o].height}px !important;vertical-align: top !important"/>`,e=e>t[o].height?e:t[o].height;return{textDiv:n,height:e}}function xO(t,n){for(let e in n){const i=new RegExp("\\{\\{"+e+"\\}\\}","g");t=t.replace(i,n[e])}return t}const SO={SquareH01:1,SquareH02:3,SquareV01:5,SquareV02:5,SquareV03:5,SquareV04:3,Flag01:3,Flag02:3,Linear01:0,Linear02:3,Linear03:3,CircularH01:3,CircularH02:3,CircularV01:1,CircularV02:3,CircularV03:3,CircularV04:3,CircularV05:2,P3D01:3,P3D02:3,P3D03:1,P3D04:3,P3D05:1,P3D06:1,P3D07:1,Diamond01:3,Diamond02:3},EO=`
|
|
3576
3576
|
<div class="{{CustomContainer}}" style="position: relative !important;">
|
|
3577
3577
|
<div style="position:relative !important; width: {{IMAGE_WIDTH}}; height: {{IMAGE_HEIGHT}};">
|
|
3578
3578
|
<img src="{{IMAGE_SRC}}" alt="图片icon" class="{{CustomImage}} Custom-anchor" style="position: absolute !important; width: {{IMAGE_WIDTH}}; height: {{IMAGE_HEIGHT}};">
|
|
@@ -3584,7 +3584,7 @@ ${fC}
|
|
|
3584
3584
|
</div>
|
|
3585
3585
|
</div>
|
|
3586
3586
|
</div>
|
|
3587
|
-
`,EO=async(t,n)=>{const e=(n==null?void 0:n.fontSize)??Q.ESPoi2D.defaults.style.fontSize,i=(n==null?void 0:n.image)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/anchor.png",o=(n==null?void 0:n.imageSize)??Q.ESPoi2D.defaults.style.imageSize,r=(n==null?void 0:n.text)??Q.ESPoi2D.defaults.style.text,s=(n==null?void 0:n.textBackground)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/textBox_01.png",a=(n==null?void 0:n.textBackgroundColor)??Q.ESPoi2D.defaults.style.textBackgroundColor,l=(n==null?void 0:n.textBackgroundSize)??Q.ESPoi2D.defaults.style.textBackgroundSize,c=(n==null?void 0:n.textColor)??Q.ESPoi2D.defaults.style.textColor,h=(n==null?void 0:n.textOffset)??Q.ESPoi2D.defaults.style.textOffset;let u=SO;u=u.replace(/{{CustomContainer}}/g,`ESPoi2DCustomContainer${t}`),u=u.replace(/{{CustomImage}}/g,`ESPoi2DCustomImage${t}`),u=u.replace(/{{CustomTextContainer}}/g,`ESPoi2DCustomTextContainer${t}`),u=u.replace(/{{FONT_SIZE}}/g,e+"px"),u=u.replace(/{{IMAGE_SRC}}/g,Q.ESSceneObject.context.getStrFromEnv(i)),u=u.replace(/{{IMAGE_WIDTH}}/g,o[0]+"px"),u=u.replace(/{{IMAGE_HEIGHT}}/g,o[1]+"px"),u=u.replace(/{{TEXT}}/g,r),u=u.replace(/{{TEXT_BACKGROUND}}/g,Q.ESSceneObject.context.getStrFromEnv(s)),u=u.replace(/{{TEXT_BACKGROUND_COLOR}}/g,`rgb(${a.map(f=>f*255).join(",")})`),u=u.replace(/{{TEXT_BACKGROUND_WIDTH}}/g,l[0]+"px"),u=u.replace(/{{TEXT_BACKGROUND_HEIGHT}}/g,l[1]+"px"),u=u.replace(/{{TEXT_COLOR}}/g,`rgb(${c.map(f=>f*255).join(",")})`),u=u.replace(/{{TEXT_OFFSET_X}}/g,h[0]+"px"),u=u.replace(/{{TEXT_OFFSET_Y}}/g,h[1]+"px");const A=document.createElement("div");return A.innerHTML=u,[A.children[0].children[0],A.children[0].children[1]]},xt=class xt extends Ol{constructor(e,i){super(e,i);L(this,"_widgetComponent");L(this,"_customWidgetComponent");L(this,"_textBox",[]);L(this,"_iconBox");L(this,"_icon");L(this,"_anchor");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.ad(new p.Event),s=this.ad(new p.Event);{let l;const c=this.ad(p.createNextAnimateFrameEvent(e.screenRenderChanged,s));this.customWidgetComponent=this.disposeVar(new p.ObjResettingWithEvent(c,()=>{if(!(!l||e.mode!="Custom"))return e.screenRender?new br(e,i,l[1],!0,!1):new cA(e,i,l[1],!0,!1)},!1)),this.widgetComponent=this.disposeVar(new p.ObjResettingWithEvent(c,()=>{if(l)return e.screenRender?new br(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1):new cA(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1)},!1)),this.widgetComponent.objChanged.don(()=>{e.minVisibleDistanceChanged.emit()});const h=this.dv(p.createNextAnimateFrameEvent(e.nameChanged,e.styleChanged,r));this.ad(h.don(async()=>{var u;if(e.mode!="Custom"){if(this._textBox.length==0&&e.mode!="Linear01")return;const A=e.style[Object.keys(e.style).filter(g=>g.toUpperCase()=="TEXT")[0]]??e.name,{div:f,styleObj:d}=gO(e.mode,A,this._textBox,this._iconBox,this._icon,this._anchor);l=f,l.innerHTML=CO(l.innerHTML,d)}else{const A=await EO(e.id,{...e.style,text:((u=e.style)==null?void 0:u.text)??e.name});l=[A[0],A[1]]}s.emit()}))}{const l=this.ad(p.createProcessingFromAsyncFunc(async A=>{const f=e.mode;xt.modeCache.value={...xt.modeCache.value,[f]:void 0},await A.promise(mO(f)).then(d=>{xt.modeCache.value={...xt.modeCache.value,[f]:d},this._icon=d.icon,this._anchor=d.anchor,this._iconBox=d.iconBox,this._textBox=d.textBox,r.emit()})}));let c=null,h=null;const u=()=>{var A,f,d,g;if(e.mode=="Custom"){r.emit();return}if(Reflect.has(xt.modeCache.value,e.mode))if(xt.modeCache.value[e.mode])this._icon=(A=xt.modeCache.value[e.mode])==null?void 0:A.icon,this._anchor=(f=xt.modeCache.value[e.mode])==null?void 0:f.anchor,this._iconBox=(d=xt.modeCache.value[e.mode])==null?void 0:d.iconBox,this._textBox=((g=xt.modeCache.value[e.mode])==null?void 0:g.textBox)??[],r.emit();else{if(c)return;c=xt.modeCache.changed.don(()=>{var v,y,m,w;xt.modeCache.value[e.mode]&&(this._icon=(v=xt.modeCache.value[e.mode])==null?void 0:v.icon,this._anchor=(y=xt.modeCache.value[e.mode])==null?void 0:y.anchor,this._iconBox=(m=xt.modeCache.value[e.mode])==null?void 0:m.iconBox,this._textBox=((w=xt.modeCache.value[e.mode])==null?void 0:w.textBox)??[],r.emit(),c&&c(),c=null)})}else if(!l.isRunning)l.restart();else{if(h)return;h=l.completeEvent.donce(()=>{h&&h(),h=null,l.restart()})}};u(),this.d(e.modeChanged.don(u))}const a=this.ad(new p.Event);{const l=this.dv(p.createNextAnimateFrameEvent(e.anchorChanged,e.autoAnchorChanged,e.offsetChanged)),c=()=>{const h=this.widgetComponent.obj,u=e.autoAnchor?h.defaultAnchor:e.anchor,A=e.offset;if(h instanceof br)u?(h.czmGeoCustomDivPoi.originRatioAndOffset=[...u,-A[0],-A[1]],h.widgetInfo.style.transformOrigin=`${u[0]*100}% ${u[1]*100}%`):h.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let f=100,d=100;e.sizeByContent&&h.domSize?(f=h.domSize.width/100,d=h.domSize.height/100):(f=e.size[0]/100,d=e.size[1]/100),u?h.czmCustomPrimitive.localPosition=[u[0]*f-A[0]/100,0,u[1]*d-A[1]/100]:h.czmCustomPrimitive.localPosition=[0,0,0]}e.mode=="Custom"&&a.emit()};this.d(l.don(c)),this.ad(new p.ObjResettingWithEvent(this.widgetComponent.objChanged,()=>{if(this.widgetComponent.obj==null)return;const h=new p.Destroyable;return c(),h.d(this.widgetComponent.obj.defaultAnchorChanged.don(c)),h}))}{const l=this.dv(p.createNextAnimateFrameEvent(e.styleChanged,e.showChanged,a)),c=()=>{var y,m,w;if(e.mode!="Custom")return;const h=this.customWidgetComponent.obj;if(!h)return;const u=((y=e.style)==null?void 0:y.imageSize)??Q.ESPoi2D.defaults.style.imageSize,A=e.autoAnchor?this.widgetComponent.obj.defaultAnchor:e.anchor,f=((m=e.style)==null?void 0:m.textBoxAlign)??Q.ESPoi2D.defaults.style.textBoxAlign,d=f=="start"?0:f=="center"?.5:1,g=((w=e.style)==null?void 0:w.textBoxOffset)??Q.ESPoi2D.defaults.style.textBoxOffset,v=e.offset;if(h instanceof br)A?(h.czmGeoCustomDivPoi.originRatioAndOffset=[d,.5,-v[0]-g[0]+u[0]*(A[0]-.5),-v[1]-g[1]+u[1]*(A[1]-.5)],h.widgetInfo.style.transformOrigin=`${d*100}% ${.5*100}%`):h.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let _=100,E=100;e.sizeByContent&&h.domSize?(_=h.domSize.width/100,E=h.domSize.height/100):(_=e.size[0]/100,E=e.size[1]/100),A?h.czmCustomPrimitive.localPosition=[d*_+(-v[0]-g[0]+u[0]*(A[0]-.5))/100,0,.5*E+(-v[1]-g[1]+u[1]*(A[1]-.5))/100]:h.czmCustomPrimitive.localPosition=[0,0,0]}};this.ad(l.don(c));{const h=this.ad(p.createNextAnimateFrameEvent(this.customWidgetComponent.objChanged,this.widgetComponent.objChanged));this.ad(new p.ObjResettingWithEvent(h,()=>{if(this.customWidgetComponent.obj==null||this.widgetComponent.obj==null)return;const u=new p.Destroyable,A=this.customWidgetComponent.obj,f=()=>{var d,g,v,y;A&&(A instanceof br?(((d=e.style)==null?void 0:d.textBoxMode)??Q.ESPoi2D.defaults.style.textBoxMode)=="hover"?(A.czmGeoCustomDivPoi.show=!1,this.d(this.widgetComponent.obj.czmGeoCustomDivPoi.pickedEvent.don(m=>{var _,E;const w=(_=_o(m,"pickResult"))==null?void 0:_.pointerEvent;w&&(A.czmGeoCustomDivPoi.show=e.show&&(((E=e.style)==null?void 0:E.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow)&&w.type=="mouseenter")}))):A.czmGeoCustomDivPoi.show=e.show&&(((g=e.style)==null?void 0:g.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow):(((v=e.style)==null?void 0:v.textBoxMode)??Q.ESPoi2D.defaults.style.textBoxMode)=="hover"?(A.czmCustomPrimitive.show=!1,this.d(e.widgetEvent.don(m=>{var w;m&&(A.czmCustomPrimitive.show=e.show&&(((w=e.style)==null?void 0:w.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow)&&m.type=="mouseEnter")}))):A.czmCustomPrimitive.show=e.show&&(((y=e.style)==null?void 0:y.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow))};return f(),u.ad(e.styleChanged.don(f)),u}))}}}get widgetComponent(){return this._widgetComponent}set widgetComponent(e){this._widgetComponent=e}get customWidgetComponent(){return this._customWidgetComponent}set customWidgetComponent(e){this._customWidgetComponent=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,widgetComponent:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(s.obj)s.obj.flyTo(e,i);else{const a=setTimeout(()=>{clearTimeout(a),this.flyTo(e,i)},200)}return o.flyOverEvent.emit(i,"over",r),!0}visibleDistance(e,i){var o,r,s,a,l;if((o=i.viewer)!=null&&o.camera&&e.show){const c=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let h=!1;e.minVisibleDistance<e.maxVisibleDistance?h=e.minVisibleDistance<c&&c<e.maxVisibleDistance:e.maxVisibleDistance==0&&(h=c>e.minVisibleDistance);const u=this.widgetComponent.obj,A=this.customWidgetComponent.obj;if(!u)return;u instanceof br?(u.czmGeoCustomDivPoi.show=e.show&&h,(((r=e.style)==null?void 0:r.textBoxMode)??Q.ESPoi2D.defaults.style.textBoxMode)=="default"&&A&&(A.czmGeoCustomDivPoi.show=e.show&&h&&(((s=e.style)==null?void 0:s.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow))):(u.czmCustomPrimitive.show=e.show&&h,(((a=e.style)==null?void 0:a.textBoxMode)??Q.ESPoi2D.defaults.style.textBoxMode)=="default"&&A&&(A.czmCustomPrimitive.show=e.show&&h&&(((l=e.style)==null?void 0:l.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow)))}}};L(xt,"type",xt.register("ESCesiumViewer",Q.ESPoi2D.type,xt)),L(xt,"modeCache",p.react({}));let Zm=xt;const Vu=class Vu extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPoi3D");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(p.createNextAnimateFrameEvent(e.modeChanged));this.dv(new p.ObjResettingWithEvent(r,()=>{let{mode:s}=e;const a=Q.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/glb/poi3d/${s}/SM_POI_${s.charAt(0).toUpperCase()+s.slice(1)}.gltf`);return this._czmModelPoi3D=new PO(e,i,a)}))}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;if(e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),!this._czmModelPoi3D)return;this._czmModelPoi3D.czmModel&&(this._czmModelPoi3D.czmModel.show=e.show&&s)}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this._czmModelPoi3D?(this._czmModelPoi3D.flyTo(e,i),!0):!1:!1}};L(Vu,"type",Vu.register("ESCesiumViewer",Q.ESPoi3D.type,Vu));let Xm=Vu;class PO extends p.Destroyable{constructor(e,i,o){super();L(this,"czmModel");this._sceneObject=e,this._czmViewer=i,this._modelUrl=o,this.czmModel=this.ad(new Ht(this._czmViewer,this._sceneObject.id));const r=this._sceneObject,s=this.czmModel;s.show=!1,s.url=this._modelUrl,s.basePath=this._modelUrl.split("/").slice(0,-1).join("/")+"/",s.activeAnimationsAnimateWhilePaused=!0,this.d(p.bind([s,"position"],[r,"position"])),this.d(Dt([s,"rotation"],[r,"rotation"])),this.d(p.track([s,"scale"],[r,"scale"])),this.d(p.track([s,"show"],[r,"show"]));{const a=this.dv(p.createNextAnimateFrameEvent(r.allowPickingChanged,r.editingChanged)),l=()=>{r.allowPicking&&!r.editing?s.allowPicking=!0:s.allowPicking=!1};l(),this.d(a.don(l))}{const a=()=>{const c=document.createElement("div");c.style.position="absolute",c.style.zIndex="-1",c.style.bottom="108px",c.style.right="0px",c.innerHTML=`<div style="width: 512px; height: 128px;color: #fff;text-align: center;line-height: 128px;font-size: 50px;margin: 0 auto;">
|
|
3587
|
+
`,PO=async(t,n)=>{const e=(n==null?void 0:n.fontSize)??Q.ESPoi2D.defaults.style.fontSize,i=(n==null?void 0:n.image)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/anchor.png",o=(n==null?void 0:n.imageSize)??Q.ESPoi2D.defaults.style.imageSize,r=(n==null?void 0:n.text)??Q.ESPoi2D.defaults.style.text,s=(n==null?void 0:n.textBackground)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/textBox_01.png",a=(n==null?void 0:n.textBackgroundColor)??Q.ESPoi2D.defaults.style.textBackgroundColor,l=(n==null?void 0:n.textBackgroundSize)??Q.ESPoi2D.defaults.style.textBackgroundSize,c=(n==null?void 0:n.textColor)??Q.ESPoi2D.defaults.style.textColor,h=(n==null?void 0:n.textOffset)??Q.ESPoi2D.defaults.style.textOffset;let u=EO;u=u.replace(/{{CustomContainer}}/g,`ESPoi2DCustomContainer${t}`),u=u.replace(/{{CustomImage}}/g,`ESPoi2DCustomImage${t}`),u=u.replace(/{{CustomTextContainer}}/g,`ESPoi2DCustomTextContainer${t}`),u=u.replace(/{{FONT_SIZE}}/g,e+"px"),u=u.replace(/{{IMAGE_SRC}}/g,Q.ESSceneObject.context.getStrFromEnv(i)),u=u.replace(/{{IMAGE_WIDTH}}/g,o[0]+"px"),u=u.replace(/{{IMAGE_HEIGHT}}/g,o[1]+"px"),u=u.replace(/{{TEXT}}/g,r),u=u.replace(/{{TEXT_BACKGROUND}}/g,Q.ESSceneObject.context.getStrFromEnv(s)),u=u.replace(/{{TEXT_BACKGROUND_COLOR}}/g,`rgb(${a.map(f=>f*255).join(",")})`),u=u.replace(/{{TEXT_BACKGROUND_WIDTH}}/g,l[0]+"px"),u=u.replace(/{{TEXT_BACKGROUND_HEIGHT}}/g,l[1]+"px"),u=u.replace(/{{TEXT_COLOR}}/g,`rgb(${c.map(f=>f*255).join(",")})`),u=u.replace(/{{TEXT_OFFSET_X}}/g,h[0]+"px"),u=u.replace(/{{TEXT_OFFSET_Y}}/g,h[1]+"px");const A=document.createElement("div");return A.innerHTML=u,[A.children[0].children[0],A.children[0].children[1]]},xt=class xt extends Ol{constructor(e,i){super(e,i);L(this,"_widgetComponent");L(this,"_customWidgetComponent");L(this,"_textBox",[]);L(this,"_iconBox");L(this,"_icon");L(this,"_anchor");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.ad(new p.Event),s=this.ad(new p.Event);{let l;const c=this.ad(p.createNextAnimateFrameEvent(e.screenRenderChanged,s));this.customWidgetComponent=this.disposeVar(new p.ObjResettingWithEvent(c,()=>{if(!(!l||e.mode!="Custom"))return e.screenRender?new br(e,i,l[1],!0,!1):new cA(e,i,l[1],!0,!1)},!1)),this.widgetComponent=this.disposeVar(new p.ObjResettingWithEvent(c,()=>{if(l)return e.screenRender?new br(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1):new cA(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1)},!1)),this.widgetComponent.objChanged.don(()=>{e.minVisibleDistanceChanged.emit()});const h=this.dv(p.createNextAnimateFrameEvent(e.nameChanged,e.styleChanged,r));this.ad(h.don(async()=>{var u;if(e.mode!="Custom"){if(this._textBox.length==0&&e.mode!="Linear01")return;const A=e.style[Object.keys(e.style).filter(g=>g.toUpperCase()=="TEXT")[0]]??e.name,{div:f,styleObj:d}=yO(e.mode,A,this._textBox,this._iconBox,this._icon,this._anchor);l=f,l.innerHTML=xO(l.innerHTML,d)}else{const A=await PO(e.id,{...e.style,text:((u=e.style)==null?void 0:u.text)??e.name});l=[A[0],A[1]]}s.emit()}))}{const l=this.ad(p.createProcessingFromAsyncFunc(async A=>{const f=e.mode;xt.modeCache.value={...xt.modeCache.value,[f]:void 0},await A.promise(gO(f)).then(d=>{xt.modeCache.value={...xt.modeCache.value,[f]:d},this._icon=d.icon,this._anchor=d.anchor,this._iconBox=d.iconBox,this._textBox=d.textBox,r.emit()})}));let c=null,h=null;const u=()=>{var A,f,d,g;if(e.mode=="Custom"){r.emit();return}if(Reflect.has(xt.modeCache.value,e.mode))if(xt.modeCache.value[e.mode])this._icon=(A=xt.modeCache.value[e.mode])==null?void 0:A.icon,this._anchor=(f=xt.modeCache.value[e.mode])==null?void 0:f.anchor,this._iconBox=(d=xt.modeCache.value[e.mode])==null?void 0:d.iconBox,this._textBox=((g=xt.modeCache.value[e.mode])==null?void 0:g.textBox)??[],r.emit();else{if(c)return;c=xt.modeCache.changed.don(()=>{var v,y,m,w;xt.modeCache.value[e.mode]&&(this._icon=(v=xt.modeCache.value[e.mode])==null?void 0:v.icon,this._anchor=(y=xt.modeCache.value[e.mode])==null?void 0:y.anchor,this._iconBox=(m=xt.modeCache.value[e.mode])==null?void 0:m.iconBox,this._textBox=((w=xt.modeCache.value[e.mode])==null?void 0:w.textBox)??[],r.emit(),c&&c(),c=null)})}else if(!l.isRunning)l.restart();else{if(h)return;h=l.completeEvent.donce(()=>{h&&h(),h=null,l.restart()})}};u(),this.d(e.modeChanged.don(u))}const a=this.ad(new p.Event);{const l=this.dv(p.createNextAnimateFrameEvent(e.anchorChanged,e.autoAnchorChanged,e.offsetChanged)),c=()=>{const h=this.widgetComponent.obj,u=e.autoAnchor?h.defaultAnchor:e.anchor,A=e.offset;if(h instanceof br)u?(h.czmGeoCustomDivPoi.originRatioAndOffset=[...u,-A[0],-A[1]],h.widgetInfo.style.transformOrigin=`${u[0]*100}% ${u[1]*100}%`):h.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let f=100,d=100;e.sizeByContent&&h.domSize?(f=h.domSize.width/100,d=h.domSize.height/100):(f=e.size[0]/100,d=e.size[1]/100),u?h.czmCustomPrimitive.localPosition=[u[0]*f-A[0]/100,0,u[1]*d-A[1]/100]:h.czmCustomPrimitive.localPosition=[0,0,0]}e.mode=="Custom"&&a.emit()};this.d(l.don(c)),this.ad(new p.ObjResettingWithEvent(this.widgetComponent.objChanged,()=>{if(this.widgetComponent.obj==null)return;const h=new p.Destroyable;return c(),h.d(this.widgetComponent.obj.defaultAnchorChanged.don(c)),h}))}{const l=this.dv(p.createNextAnimateFrameEvent(e.styleChanged,e.showChanged,a)),c=()=>{var y,m,w;if(e.mode!="Custom")return;const h=this.customWidgetComponent.obj;if(!h)return;const u=((y=e.style)==null?void 0:y.imageSize)??Q.ESPoi2D.defaults.style.imageSize,A=e.autoAnchor?this.widgetComponent.obj.defaultAnchor:e.anchor,f=((m=e.style)==null?void 0:m.textBoxAlign)??Q.ESPoi2D.defaults.style.textBoxAlign,d=f=="start"?0:f=="center"?.5:1,g=((w=e.style)==null?void 0:w.textBoxOffset)??Q.ESPoi2D.defaults.style.textBoxOffset,v=e.offset;if(h instanceof br)A?(h.czmGeoCustomDivPoi.originRatioAndOffset=[d,.5,-v[0]-g[0]+u[0]*(A[0]-.5),-v[1]-g[1]+u[1]*(A[1]-.5)],h.widgetInfo.style.transformOrigin=`${d*100}% ${.5*100}%`):h.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let _=100,E=100;e.sizeByContent&&h.domSize?(_=h.domSize.width/100,E=h.domSize.height/100):(_=e.size[0]/100,E=e.size[1]/100),A?h.czmCustomPrimitive.localPosition=[d*_+(-v[0]-g[0]+u[0]*(A[0]-.5))/100,0,.5*E+(-v[1]-g[1]+u[1]*(A[1]-.5))/100]:h.czmCustomPrimitive.localPosition=[0,0,0]}};this.ad(l.don(c));{const h=this.ad(p.createNextAnimateFrameEvent(this.customWidgetComponent.objChanged,this.widgetComponent.objChanged));this.ad(new p.ObjResettingWithEvent(h,()=>{if(this.customWidgetComponent.obj==null||this.widgetComponent.obj==null)return;const u=new p.Destroyable,A=this.customWidgetComponent.obj,f=()=>{var d,g,v,y;A&&(A instanceof br?(((d=e.style)==null?void 0:d.textBoxMode)??Q.ESPoi2D.defaults.style.textBoxMode)=="hover"?(A.czmGeoCustomDivPoi.show=!1,this.d(this.widgetComponent.obj.czmGeoCustomDivPoi.pickedEvent.don(m=>{var _,E;const w=(_=_o(m,"pickResult"))==null?void 0:_.pointerEvent;w&&(A.czmGeoCustomDivPoi.show=e.show&&(((E=e.style)==null?void 0:E.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow)&&w.type=="mouseenter")}))):A.czmGeoCustomDivPoi.show=e.show&&(((g=e.style)==null?void 0:g.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow):(((v=e.style)==null?void 0:v.textBoxMode)??Q.ESPoi2D.defaults.style.textBoxMode)=="hover"?(A.czmCustomPrimitive.show=!1,this.d(e.widgetEvent.don(m=>{var w;m&&(A.czmCustomPrimitive.show=e.show&&(((w=e.style)==null?void 0:w.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow)&&m.type=="mouseEnter")}))):A.czmCustomPrimitive.show=e.show&&(((y=e.style)==null?void 0:y.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow))};return f(),u.ad(e.styleChanged.don(f)),u}))}}}get widgetComponent(){return this._widgetComponent}set widgetComponent(e){this._widgetComponent=e}get customWidgetComponent(){return this._customWidgetComponent}set customWidgetComponent(e){this._customWidgetComponent=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,widgetComponent:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(s.obj)s.obj.flyTo(e,i);else{const a=setTimeout(()=>{clearTimeout(a),this.flyTo(e,i)},200)}return o.flyOverEvent.emit(i,"over",r),!0}visibleDistance(e,i){var o,r,s,a,l;if((o=i.viewer)!=null&&o.camera&&e.show){const c=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let h=!1;e.minVisibleDistance<e.maxVisibleDistance?h=e.minVisibleDistance<c&&c<e.maxVisibleDistance:e.maxVisibleDistance==0&&(h=c>e.minVisibleDistance);const u=this.widgetComponent.obj,A=this.customWidgetComponent.obj;if(!u)return;u instanceof br?(u.czmGeoCustomDivPoi.show=e.show&&h,(((r=e.style)==null?void 0:r.textBoxMode)??Q.ESPoi2D.defaults.style.textBoxMode)=="default"&&A&&(A.czmGeoCustomDivPoi.show=e.show&&h&&(((s=e.style)==null?void 0:s.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow))):(u.czmCustomPrimitive.show=e.show&&h,(((a=e.style)==null?void 0:a.textBoxMode)??Q.ESPoi2D.defaults.style.textBoxMode)=="default"&&A&&(A.czmCustomPrimitive.show=e.show&&h&&(((l=e.style)==null?void 0:l.textBoxShow)??Q.ESPoi2D.defaults.style.textBoxShow)))}}};L(xt,"type",xt.register("ESCesiumViewer",Q.ESPoi2D.type,xt)),L(xt,"modeCache",p.react({}));let Zm=xt;const Vu=class Vu extends Ge{constructor(e,i){super(e,i);L(this,"_czmModelPoi3D");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(p.createNextAnimateFrameEvent(e.modeChanged));this.dv(new p.ObjResettingWithEvent(r,()=>{let{mode:s}=e;const a=Q.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/glb/poi3d/${s}/SM_POI_${s.charAt(0).toUpperCase()+s.slice(1)}.gltf`);return this._czmModelPoi3D=new TO(e,i,a)}))}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;if(e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),!this._czmModelPoi3D)return;this._czmModelPoi3D.czmModel&&(this._czmModelPoi3D.czmModel.show=e.show&&s)}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this._czmModelPoi3D?(this._czmModelPoi3D.flyTo(e,i),!0):!1:!1}};L(Vu,"type",Vu.register("ESCesiumViewer",Q.ESPoi3D.type,Vu));let Xm=Vu;class TO extends p.Destroyable{constructor(e,i,o){super();L(this,"czmModel");this._sceneObject=e,this._czmViewer=i,this._modelUrl=o,this.czmModel=this.ad(new Ht(this._czmViewer,this._sceneObject.id));const r=this._sceneObject,s=this.czmModel;s.show=!1,s.url=this._modelUrl,s.basePath=this._modelUrl.split("/").slice(0,-1).join("/")+"/",s.activeAnimationsAnimateWhilePaused=!0,this.d(p.bind([s,"position"],[r,"position"])),this.d(Dt([s,"rotation"],[r,"rotation"])),this.d(p.track([s,"scale"],[r,"scale"])),this.d(p.track([s,"show"],[r,"show"]));{const a=this.dv(p.createNextAnimateFrameEvent(r.allowPickingChanged,r.editingChanged)),l=()=>{r.allowPicking&&!r.editing?s.allowPicking=!0:s.allowPicking=!1};l(),this.d(a.don(l))}{const a=()=>{const c=document.createElement("div");c.style.position="absolute",c.style.zIndex="-1",c.style.bottom="108px",c.style.right="0px",c.innerHTML=`<div style="width: 512px; height: 128px;color: #fff;text-align: center;line-height: 128px;font-size: 50px;margin: 0 auto;">
|
|
3588
3588
|
<span style="display: inline-block;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;width: 512px;">${r.style[Object.keys(r.style).filter(h=>h.toUpperCase()=="TEXT")[0]]??r.name}</span>
|
|
3589
3589
|
</div>`,document.body.contains(c)||document.body.appendChild(c),dp(c,{backgroundColor:null,allowTaint:!1,useCORS:!0}).then(h=>{var u,A;document.body.contains(c)&&document.body.removeChild(c);for(let f=0;f<s.gltf.images.length;f++){const d=s.gltf.images[f];d.name.toUpperCase().includes("TEXT")&&(d.uri=h.toDataURL("image/png",1))}for(let f=0;f<s.gltf.materials.length;f++){const d=s.gltf.materials[f];d.name.toUpperCase().includes("UI")||d.name.toUpperCase().includes("LAMBERT5")?(d.pbrMetallicRoughness.baseColorFactor=((u=r.style)==null?void 0:u.UI_Color)??[1,1,1,1],d.alphaMode&&delete d.alphaMode):d.name.toUpperCase().includes("TEXT")||(d.pbrMetallicRoughness.baseColorFactor=((A=r.style)==null?void 0:A.FX_Color)??[1,1,1,1])}s.gltfJson=s.gltf,s.activeAnimationsJson=s.gltf.animations.map((f,d)=>({index:d,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))}).catch(()=>{document.body.contains(c)&&document.body.removeChild(c)})};a();const l=this.dv(p.createNextAnimateFrameEvent(r.nameChanged,r.styleChanged));this.d(l.don(a))}}flyTo(e,i){const{_czmViewer:o,_sceneObject:r,czmModel:s}=this;dn(o,r,i,e,s,!0)}}const Hu=class Hu extends Ge{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");L(this,"_causticsTexture");L(this,"_foamTexture");L(this,"_heightMapTexture");L(this,"_normalMapTexture");L(this,"isTimestamp",e=>{if(e.toString().length!==13||isNaN(e))return console.log("时间戳格式错误"),!1;const o=new Date(e);return isNaN(o.getTime())?(console.log("时间戳格式错误"),!1):!0});L(this,"getClosestTimestampIndex",(e,i)=>{for(var o=0,r=1/0,s=0;s<i.length;s++){var a=Math.abs(e-i[s]);a<r&&(r=a,o=s)}return o});if(this._czmCustomPrimitive=this.dv(new st(i,e.id)),this._causticsTexture=this.dv(new At(i)),this._foamTexture=this.dv(new At(i)),this._heightMapTexture=this.dv(new At(i)),this._normalMapTexture=this.dv(new At(i)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.czmCustomPrimitive,s=this.causticsTexture,a=this.foamTexture,l=this.heightMapTexture,c=this.normalMapTexture;s.uri=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/caustics.jpg"),a.uri=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/foam.jpg"),l.uri=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/heightmap.jpg"),c.uri=Q.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/water_normalmap.png"),this.d(p.track([r,"show"],[e,"show"])),this.d(p.track([r,"allowPicking"],[e,"allowPicking"])),this.d(p.bind([r,"position"],[e,"position"])),this.d(p.bind([r,"rotation"],[e,"rotation"])),this.d(p.bind([r,"scale"],[e,"scale"])),r.pass="TRANSLUCENT",r.primitiveType="TRIANGLES",r.renderState={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},depthMask:!0,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},r.vertexShaderSource=`
|
|
3590
3590
|
in vec3 position;
|
|
@@ -3657,7 +3657,7 @@ ${fC}
|
|
|
3657
3657
|
out_FragColor.rgb *= vec3(clamp((distance - realDistance)*.5, 0.5, 1.0));
|
|
3658
3658
|
out_FragColor.a = 0.9;
|
|
3659
3659
|
}
|
|
3660
|
-
`;{const h=this.dv(p.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??Q.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??Q.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??Q.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??Q.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??Q.ESSubmergingAnalysis.defaults.flowSpeed});else{const A=Object.assign({},td[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=10),this.updateWater(A)}};u(),this.d(h.don(u))}{const h=A=>{if(A==0||!this.isTimestamp(A))return;const f=e.getAllMoments(),d=e.getSubmergingData;if(f.length==0||!d)return;const g=this.getClosestTimestampIndex(A,f);r.attributes={position:{typedArray:d[g].posBuffer,componentsPerAttribute:3}},r.indexTypedArray=d[g].indicesBuffer;const v=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!v)return;const{min:y,max:m}=v;r.setLocalAxisedBoundingBox(y,m)},u=this.dv(p.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(u.don(()=>{h(e.currentTime)}))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get causticsTexture(){return this._causticsTexture}get foamTexture(){return this._foamTexture}get heightMapTexture(){return this._heightMapTexture}get normalMapTexture(){return this._normalMapTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:i,sceneObject:o,heightMapTexture:r,normalMapTexture:s,foamTexture:a,causticsTexture:l}=this,c=o.materialParams[Object.keys(o.materialParams).filter(h=>h.toUpperCase().includes("BASECOLOR"))[0]];i.uniformMap={u_image:{type:"texture",id:r.id},u_heightmap_image:{type:"texture",id:r.id},u_normalmap_image:{type:"texture",id:s.id},u_foam_image:{type:"texture",id:a.id},u_caustics_image:{type:"texture",id:l.id},u_color:e.waterColor??c??Q.ESSubmergingAnalysis.defaults.waterColor}}};L(Hu,"type",Hu.register("ESCesiumViewer",Q.ESSubmergingAnalysis.type,Hu));let $m=Hu;const{getStrFromEnv:yC}=Q.ESSceneObject.context;function TO(t){let n;if(t.startsWith("ion://")){const i=+t.substring(6);Number.isFinite(i)&&(n=C.IonResource.fromAssetId(i))}else n=yC(t);return n}async function IO(t,n){if(t.type==="EllipsoidTerrainProvider")return new C.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),tilingScheme:t.tilingScheme&&ai(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=TO(typeof t.url=="string"?t.url:t.url.url);return e?await C.CesiumTerrainProvider.fromUrl(typeof e=="string"?xn(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await C.GoogleEarthEnterpriseMetadata.fromUrl(yC(t.url));return await C.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await C.ArcGISTiledElevationTerrainProvider.fromUrl(xn(t.url),{token:t.token,ellipsoid:t.ellipsoid&&Ke(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new C.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&ai(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await C.VRTheWorldTerrainProvider.fromUrl(xn(t.url),{ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),credit:t.credit})}}const Nu=class Nu extends Bn{constructor(e,i){super(e,i);L(this,"_provider",this.disposeVar(p.react(void 0)));L(this,"_czmProvider",this.dv(p.react(void 0)));const o=i.viewer;if(!o)return;const r=Sn(o);if(!r)return;const{terrainManager:s}=r,a=()=>{s.delete(this),this.provider=void 0};this.dispose(a);let l=!1;const c=this.disposeVar(p.createProcessingFromAsyncFunc(async(u,A)=>{if(A){if(l=!0,a(),!this.czmProvider)return;this.provider=await u.promise(IO(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),s.add(this),l=!1}}));c.restart(void 0,!0);const h=this.disposeVar(new p.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{h.emit()})),this.dispose(Q.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{h.emit()})),this.dispose(h.disposableOn(()=>{c.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{l||c.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((u,A)=>this.flyTo(u,A)));{const u=this.ad(p.reactJson(""));{const f=()=>{if(typeof e.url=="string")u.value=Q.ESSceneObject.context.getStrFromEnv(e.url??Q.ESTerrainLayer.defaults.url);else{const d=e.url;d.url=Q.ESSceneObject.context.getStrFromEnv(d.url??Q.ESTerrainLayer.defaults.url),u.value=d}};f(),this.ad(e.urlChanged.don(f))}const A=()=>{if(!u.value)return;let f=u.value,d=typeof f=="string"?f:f.url;if(d.includes(Q.ESTerrainLayer.defaults.url)){const g=kO(d);if(g&&g.h){const v=Number(g.h),y={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[y.x+v,y.y+v,y.z+v]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else d.includes("/layer.json")&&(typeof f=="string"?f=d.split("/layer.json").join(""):f.url=d.split("/layer.json").join("")),this._czmProvider.value={type:"CesiumTerrainProvider",url:f,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};A(),this.dispose(u.changed.disposableOn(A))}}get provider(){return this._provider.value}set provider(e){this._provider.value=e}get providerChanged(){return this._provider.changed}get czmProvider(){return this._czmProvider.value}get czmProviderChanged(){return this._czmProvider.changed}flyTo(e,i){const{czmViewer:o,sceneObject:r}=this;if(!o.actived)return!1;const{viewer:s}=o;return s?(s.camera.flyTo({destination:r.rectangle&&!qf(r.rectangle)?mt(r.rectangle):C.Camera.DEFAULT_VIEW_RECTANGLE,duration:e}),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?super.flyIn(e,i):this.flyTo(e,i):!1}};L(Nu,"type",Nu.register("ESCesiumViewer",Q.ESTerrainLayer.type,Nu));let Ym=Nu;function kO(t){const n=t.indexOf("?"),i=t.slice(n+1).split("&"),o={};for(var r=0;r<i.length;r++){var s=i[r].split("=");o[s[0]]=s[1]}return o}class vC extends p.Destroyable{constructor(e,i){super();L(this,"_czmTextLabel");L(this,"flyTo",(e,i)=>{if(this.czmTextLabel.position){Be(this.czmViewer.viewer,this.czmTextLabel.position,1e3,Dn,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=i,this._czmTextLabel=this.disposeVar(new ci(i,e.id));const o=this._czmTextLabel,r=()=>{const a=e.anchor,l=e.offset;a?o.originRatioAndOffset=[...a,-l[0],-l[1]]:o.originRatioAndOffset=[0,0,0,0]},s=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(s.disposableOn(()=>r())),r(),this.dispose(p.track([o,"zOrder"],[e,"zOrder"])),this.dispose(p.track([o,"show"],[e,"show"])),this.dispose(p.bind([o,"text"],[e,"text"])),this.dispose(p.track([o,"color"],[e,"color"])),this.dispose(p.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(p.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(p.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(p.bind([o,"position"],[e,"position"])),this.dispose(p.track([o,"width"],[e,"width"])),this.dispose(p.track([o,"opacity"],[e,"opacity"])),this.dispose(p.track([o,"padding"],[e,"padding"])),this.dispose(p.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(p.track([o,"borderColor"],[e,"borderColor"])),this.dispose(p.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(p.track([o,"textAlign"],[e,"textAlign"])),this.dispose(p.track([o,"fontSize"],[e,"fontSize"])),this.dispose(p.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(p.track([o,"pickOnClick"],[e,"allowPicking"]));{const a=()=>{o.scale=[e.scale[1],e.scale[2]]};a(),this.dispose(e.scaleChanged.don(a))}{const a=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};a(),this.dispose(e.sizeByContentChanged.don(a)),this.dispose(e.sizeChanged.don(a))}this.d(o.pickedEvent.don(a=>{var h;const l=(h=_o(a,"pickResult"))==null?void 0:h.pointerEvent;if(!l)return;const c={type:l.buttons!=0&&l.button==0?"leftClick":l.button==2?"rightClick":void 0,add:{mousePos:[l.offsetX,l.offsetY]}};c.type==null&&(c.type=l.type),e.widgetEvent.emit(c),l.buttons!=0&&l.button==0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}));{let a;const l=c=>{c&&(a=c),a&&(a.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>l(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(c=>l(c)))}}get czmTextLabel(){return this._czmTextLabel}}class wC extends p.Destroyable{constructor(e,i){super();L(this,"_czmTextLabel");L(this,"_czmImageModel");L(this,"_url",this.disposeVar(p.react("")));L(this,"_defaultSize",this.disposeVar(p.react([1,1])));L(this,"_size",this.disposeVar(p.react([1,1])));L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmImageModel.position)return Rn(this._czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=i,this._czmTextLabel=this.disposeVar(new ci(i,e.id)),this._czmImageModel=this.disposeVar(new Wi(i,e.id));const o=this._czmViewer,r=this._czmTextLabel;r.originRatioAndOffset=[1e3,0,0,0],this.dispose(r.divCreatedEvent.disposableOn(l=>{const c=setTimeout(()=>{dp(l,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:l.offsetWidth,height:l.offsetHeight,scale:1}).then(h=>{if(clearTimeout(c),this.isDestroyed())return;const u=new Image;u.onload=()=>{e.sizeByContent?this._size.value=[u.width/100,u.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},u.src=h.toDataURL("image/png"),this._url.value=h.toDataURL("image/png")}).catch(h=>{clearTimeout(c),console.error(h)})},50);this.dispose(()=>clearTimeout(c))})),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"text"],[e,"text"])),this.dispose(p.track([r,"color"],[e,"color"])),this.dispose(p.track([r,"fontSize"],[e,"fontSize"]));const s=()=>{const l=e.anchor,c=e.offset;l?this.czmImageModel.originRatioAndOffset=[...l,-c[0]/100,-c[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},a=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(a.disposableOn(()=>s())),s();{const l=()=>{this._czmTextLabel.show=!1;const c=this._czmImageModel;c.uri=this._url.value,c.pixelSize=void 0,c.useAxis="XZ",this.dispose(this.sizeChanged.disposableOn(()=>{c.size=this._size.value})),this.dispose(p.track([c,"show"],[e,"show"])),this.dispose(p.bind([c,"position"],[e,"position"])),this.dispose(p.track([c,"allowPicking"],[e,"allowPicking"]));{const h=()=>{c.scale=[e.scale[1],e.scale[2]]};h(),this.d(e.scaleChanged.don(h))}{const h=()=>{e.rotationType===0&&(c.rotationMode="WithProp",this.d(Dt([c,"rotation"],[e,"rotation"]))),e.rotationType===1&&(c.rotationMode="WithCamera"),e.rotationType===2&&(c.rotationMode="WithCameraOnlyZ")};h(),this.dispose(e.rotationTypeChanged.disposableOn(h))}};this.dispose(this._url.changed.disposableOn(l))}this.ad(o.clickEvent.don(l=>{const c=l==null?void 0:l.pointerEvent;c&&(this._isPointEvent=!0,this._eventInfo={type:c.button==0?"leftClick":c.button==2?"rightClick":"leftClick",add:{mousePos:[c.offsetX,c.offsetY]}})})),this.d(e.pickedEvent.don(l=>{var c,h,u;l.screenPosition&&this._isPointEvent&&l.attachedInfo!="innerHoverEvent"&&((c=this._eventInfo.add)!=null&&c.mousePos)&&Math.abs(l.screenPosition[0]-((h=this._eventInfo.add)==null?void 0:h.mousePos[0]))<1&&Math.abs(l.screenPosition[1]-((u=this._eventInfo.add)==null?void 0:u.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),Q.registerCreatedEventUpdate(this,e,()=>{const l=o.getEngineObject(e);this.ad(l.lastHoverResultChanged.don((c,h)=>{(c==null?void 0:c.sceneObject)==(h==null?void 0:h.sceneObject)||(c==null?void 0:c.sceneObject)!=e&&(h==null?void 0:h.sceneObject)!=e||(c!=null&&c.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:c==null?void 0:c.screenPosition}},c.sceneObject.widgetEvent.emit(this._eventInfo)),h!=null&&h.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:c==null?void 0:c.screenPosition}},h.sceneObject.widgetEvent.emit(this._eventInfo)))}))})}get czmTextLabel(){return this._czmTextLabel}get czmImageModel(){return this._czmImageModel}get url(){return this._url.value}get defaultSize(){return this._defaultSize.value}get defaultSizeChanged(){return this._defaultSize.changed}get size(){return this._size.value}get sizeChanged(){return this._size.changed}}const Gu=class Gu extends Ol{constructor(e,i){super(e,i);L(this,"_event",this.disposeVar(p.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));L(this,"_resetting",this.disposeVar(new p.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new vC(this.sceneObject,this.czmViewer):new wC(this.sceneObject,this.czmViewer))));if(!i.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s&&s.obj&&s.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Gu,"type",Gu.register("ESCesiumViewer",Q.ESTextLabel.type,Gu));let Jm=Gu;const Wu=class Wu extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new So(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoDivSwitchPoi;r.showIcon=!1,this.d(p.track([r,"zOrder"],[e,"zOrder"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"text"],[e,"info"],l=>Object.values(l??{title:"请输入内容"}).join())),this.dispose(p.bind([r,"position"],[e,"position"]));const s=()=>{const l=e.anchor,c=e.offset;l?r.originRatioAndOffset=[...l,-c[0],-c[1]]:r.originRatioAndOffset=[0,0,0,0]},a=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(a.disposableOn(()=>s())),s()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoDivSwitchPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.position?(Be(this.czmViewer.viewer,s.position,1e3,Dn,e),!0):(s.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Wu,"type",Wu.register("ESCesiumViewer",Q.ESUEWidget.type,Wu));let jm=Wu;const qu=class qu extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new On(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(qu,"type",qu.register("ESCesiumViewer",Q.ESUnrealActor.type,qu));let eg=qu;var FO=C.Primitive._modifyShaderPosition;C.Primitive._modifyShaderPosition=function(t,i,e){var i=FO(t,i,e);return t.isCameraVideo&&i.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(i=i.replace("void main()",`
|
|
3660
|
+
`;{const h=this.dv(p.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??Q.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??Q.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??Q.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??Q.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??Q.ESSubmergingAnalysis.defaults.flowSpeed});else{const A=Object.assign({},td[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=10),this.updateWater(A)}};u(),this.d(h.don(u))}{const h=A=>{if(A==0||!this.isTimestamp(A))return;const f=e.getAllMoments(),d=e.getSubmergingData;if(f.length==0||!d)return;const g=this.getClosestTimestampIndex(A,f);r.attributes={position:{typedArray:d[g].posBuffer,componentsPerAttribute:3}},r.indexTypedArray=d[g].indicesBuffer;const v=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!v)return;const{min:y,max:m}=v;r.setLocalAxisedBoundingBox(y,m)},u=this.dv(p.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(u.don(()=>{h(e.currentTime)}))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get causticsTexture(){return this._causticsTexture}get foamTexture(){return this._foamTexture}get heightMapTexture(){return this._heightMapTexture}get normalMapTexture(){return this._normalMapTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:i,sceneObject:o,heightMapTexture:r,normalMapTexture:s,foamTexture:a,causticsTexture:l}=this,c=o.materialParams[Object.keys(o.materialParams).filter(h=>h.toUpperCase().includes("BASECOLOR"))[0]];i.uniformMap={u_image:{type:"texture",id:r.id},u_heightmap_image:{type:"texture",id:r.id},u_normalmap_image:{type:"texture",id:s.id},u_foam_image:{type:"texture",id:a.id},u_caustics_image:{type:"texture",id:l.id},u_color:e.waterColor??c??Q.ESSubmergingAnalysis.defaults.waterColor}}};L(Hu,"type",Hu.register("ESCesiumViewer",Q.ESSubmergingAnalysis.type,Hu));let $m=Hu;const{getStrFromEnv:yC}=Q.ESSceneObject.context;function IO(t){let n;if(t.startsWith("ion://")){const i=+t.substring(6);Number.isFinite(i)&&(n=C.IonResource.fromAssetId(i))}else n=yC(t);return n}async function kO(t,n){if(t.type==="EllipsoidTerrainProvider")return new C.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),tilingScheme:t.tilingScheme&&ai(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=IO(typeof t.url=="string"?t.url:t.url.url);return e?await C.CesiumTerrainProvider.fromUrl(typeof e=="string"?xn(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await C.GoogleEarthEnterpriseMetadata.fromUrl(yC(t.url));return await C.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await C.ArcGISTiledElevationTerrainProvider.fromUrl(xn(t.url),{token:t.token,ellipsoid:t.ellipsoid&&Ke(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new C.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&ai(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await C.VRTheWorldTerrainProvider.fromUrl(xn(t.url),{ellipsoid:t.ellipsoid&&Ke(t.ellipsoid),credit:t.credit})}}const Nu=class Nu extends Bn{constructor(e,i){super(e,i);L(this,"_provider",this.disposeVar(p.react(void 0)));L(this,"_czmProvider",this.dv(p.react(void 0)));const o=i.viewer;if(!o)return;const r=Sn(o);if(!r)return;const{terrainManager:s}=r,a=()=>{s.delete(this),this.provider=void 0};this.dispose(a);let l=!1;const c=this.disposeVar(p.createProcessingFromAsyncFunc(async(u,A)=>{if(A){if(l=!0,a(),!this.czmProvider)return;this.provider=await u.promise(kO(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),s.add(this),l=!1}}));c.restart(void 0,!0);const h=this.disposeVar(new p.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{h.emit()})),this.dispose(Q.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{h.emit()})),this.dispose(h.disposableOn(()=>{c.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{l||c.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((u,A)=>this.flyTo(u,A)));{const u=this.ad(p.reactJson(""));{const f=()=>{if(typeof e.url=="string")u.value=Q.ESSceneObject.context.getStrFromEnv(e.url??Q.ESTerrainLayer.defaults.url);else{const d=e.url;d.url=Q.ESSceneObject.context.getStrFromEnv(d.url??Q.ESTerrainLayer.defaults.url),u.value=d}};f(),this.ad(e.urlChanged.don(f))}const A=()=>{if(!u.value)return;let f=u.value,d=typeof f=="string"?f:f.url;if(d.includes(Q.ESTerrainLayer.defaults.url)){const g=FO(d);if(g&&g.h){const v=Number(g.h),y={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[y.x+v,y.y+v,y.z+v]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else d.includes("/layer.json")&&(typeof f=="string"?f=d.split("/layer.json").join(""):f.url=d.split("/layer.json").join("")),this._czmProvider.value={type:"CesiumTerrainProvider",url:f,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};A(),this.dispose(u.changed.disposableOn(A))}}get provider(){return this._provider.value}set provider(e){this._provider.value=e}get providerChanged(){return this._provider.changed}get czmProvider(){return this._czmProvider.value}get czmProviderChanged(){return this._czmProvider.changed}flyTo(e,i){const{czmViewer:o,sceneObject:r}=this;if(!o.actived)return!1;const{viewer:s}=o;return s?(s.camera.flyTo({destination:r.rectangle&&!qf(r.rectangle)?mt(r.rectangle):C.Camera.DEFAULT_VIEW_RECTANGLE,duration:e}),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?super.flyIn(e,i):this.flyTo(e,i):!1}};L(Nu,"type",Nu.register("ESCesiumViewer",Q.ESTerrainLayer.type,Nu));let Ym=Nu;function FO(t){const n=t.indexOf("?"),i=t.slice(n+1).split("&"),o={};for(var r=0;r<i.length;r++){var s=i[r].split("=");o[s[0]]=s[1]}return o}class vC extends p.Destroyable{constructor(e,i){super();L(this,"_czmTextLabel");L(this,"flyTo",(e,i)=>{if(this.czmTextLabel.position){Be(this.czmViewer.viewer,this.czmTextLabel.position,1e3,Dn,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=i,this._czmTextLabel=this.disposeVar(new ci(i,e.id));const o=this._czmTextLabel,r=()=>{const a=e.anchor,l=e.offset;a?o.originRatioAndOffset=[...a,-l[0],-l[1]]:o.originRatioAndOffset=[0,0,0,0]},s=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(s.disposableOn(()=>r())),r(),this.dispose(p.track([o,"zOrder"],[e,"zOrder"])),this.dispose(p.track([o,"show"],[e,"show"])),this.dispose(p.bind([o,"text"],[e,"text"])),this.dispose(p.track([o,"color"],[e,"color"])),this.dispose(p.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(p.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(p.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(p.bind([o,"position"],[e,"position"])),this.dispose(p.track([o,"width"],[e,"width"])),this.dispose(p.track([o,"opacity"],[e,"opacity"])),this.dispose(p.track([o,"padding"],[e,"padding"])),this.dispose(p.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(p.track([o,"borderColor"],[e,"borderColor"])),this.dispose(p.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(p.track([o,"textAlign"],[e,"textAlign"])),this.dispose(p.track([o,"fontSize"],[e,"fontSize"])),this.dispose(p.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(p.track([o,"pickOnClick"],[e,"allowPicking"]));{const a=()=>{o.scale=[e.scale[1],e.scale[2]]};a(),this.dispose(e.scaleChanged.don(a))}{const a=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};a(),this.dispose(e.sizeByContentChanged.don(a)),this.dispose(e.sizeChanged.don(a))}this.d(o.pickedEvent.don(a=>{var h;const l=(h=_o(a,"pickResult"))==null?void 0:h.pointerEvent;if(!l)return;const c={type:l.buttons!=0&&l.button==0?"leftClick":l.button==2?"rightClick":void 0,add:{mousePos:[l.offsetX,l.offsetY]}};c.type==null&&(c.type=l.type),e.widgetEvent.emit(c),l.buttons!=0&&l.button==0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}));{let a;const l=c=>{c&&(a=c),a&&(a.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>l(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(c=>l(c)))}}get czmTextLabel(){return this._czmTextLabel}}class wC extends p.Destroyable{constructor(e,i){super();L(this,"_czmTextLabel");L(this,"_czmImageModel");L(this,"_url",this.disposeVar(p.react("")));L(this,"_defaultSize",this.disposeVar(p.react([1,1])));L(this,"_size",this.disposeVar(p.react([1,1])));L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmImageModel.position)return Rn(this._czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=i,this._czmTextLabel=this.disposeVar(new ci(i,e.id)),this._czmImageModel=this.disposeVar(new Wi(i,e.id));const o=this._czmViewer,r=this._czmTextLabel;r.originRatioAndOffset=[1e3,0,0,0],this.dispose(r.divCreatedEvent.disposableOn(l=>{const c=setTimeout(()=>{dp(l,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:l.offsetWidth,height:l.offsetHeight,scale:1}).then(h=>{if(clearTimeout(c),this.isDestroyed())return;const u=new Image;u.onload=()=>{e.sizeByContent?this._size.value=[u.width/100,u.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},u.src=h.toDataURL("image/png"),this._url.value=h.toDataURL("image/png")}).catch(h=>{clearTimeout(c),console.error(h)})},50);this.dispose(()=>clearTimeout(c))})),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"text"],[e,"text"])),this.dispose(p.track([r,"color"],[e,"color"])),this.dispose(p.track([r,"fontSize"],[e,"fontSize"]));const s=()=>{const l=e.anchor,c=e.offset;l?this.czmImageModel.originRatioAndOffset=[...l,-c[0]/100,-c[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},a=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(a.disposableOn(()=>s())),s();{const l=()=>{this._czmTextLabel.show=!1;const c=this._czmImageModel;c.uri=this._url.value,c.pixelSize=void 0,c.useAxis="XZ",this.dispose(this.sizeChanged.disposableOn(()=>{c.size=this._size.value})),this.dispose(p.track([c,"show"],[e,"show"])),this.dispose(p.bind([c,"position"],[e,"position"])),this.dispose(p.track([c,"allowPicking"],[e,"allowPicking"]));{const h=()=>{c.scale=[e.scale[1],e.scale[2]]};h(),this.d(e.scaleChanged.don(h))}{const h=()=>{e.rotationType===0&&(c.rotationMode="WithProp",this.d(Dt([c,"rotation"],[e,"rotation"]))),e.rotationType===1&&(c.rotationMode="WithCamera"),e.rotationType===2&&(c.rotationMode="WithCameraOnlyZ")};h(),this.dispose(e.rotationTypeChanged.disposableOn(h))}};this.dispose(this._url.changed.disposableOn(l))}this.ad(o.clickEvent.don(l=>{const c=l==null?void 0:l.pointerEvent;c&&(this._isPointEvent=!0,this._eventInfo={type:c.button==0?"leftClick":c.button==2?"rightClick":"leftClick",add:{mousePos:[c.offsetX,c.offsetY]}})})),this.d(e.pickedEvent.don(l=>{var c,h,u;l.screenPosition&&this._isPointEvent&&l.attachedInfo!="innerHoverEvent"&&((c=this._eventInfo.add)!=null&&c.mousePos)&&Math.abs(l.screenPosition[0]-((h=this._eventInfo.add)==null?void 0:h.mousePos[0]))<1&&Math.abs(l.screenPosition[1]-((u=this._eventInfo.add)==null?void 0:u.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),Q.registerCreatedEventUpdate(this,e,()=>{const l=o.getEngineObject(e);this.ad(l.lastHoverResultChanged.don((c,h)=>{(c==null?void 0:c.sceneObject)==(h==null?void 0:h.sceneObject)||(c==null?void 0:c.sceneObject)!=e&&(h==null?void 0:h.sceneObject)!=e||(c!=null&&c.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:c==null?void 0:c.screenPosition}},c.sceneObject.widgetEvent.emit(this._eventInfo)),h!=null&&h.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:c==null?void 0:c.screenPosition}},h.sceneObject.widgetEvent.emit(this._eventInfo)))}))})}get czmTextLabel(){return this._czmTextLabel}get czmImageModel(){return this._czmImageModel}get url(){return this._url.value}get defaultSize(){return this._defaultSize.value}get defaultSizeChanged(){return this._defaultSize.changed}get size(){return this._size.value}get sizeChanged(){return this._size.changed}}const Gu=class Gu extends Ol{constructor(e,i){super(e,i);L(this,"_event",this.disposeVar(p.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));L(this,"_resetting",this.disposeVar(new p.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new vC(this.sceneObject,this.czmViewer):new wC(this.sceneObject,this.czmViewer))));if(!i.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s&&s.obj&&s.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Gu,"type",Gu.register("ESCesiumViewer",Q.ESTextLabel.type,Gu));let Jm=Gu;const Wu=class Wu extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new So(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoDivSwitchPoi;r.showIcon=!1,this.d(p.track([r,"zOrder"],[e,"zOrder"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"text"],[e,"info"],l=>Object.values(l??{title:"请输入内容"}).join())),this.dispose(p.bind([r,"position"],[e,"position"]));const s=()=>{const l=e.anchor,c=e.offset;l?r.originRatioAndOffset=[...l,-c[0],-c[1]]:r.originRatioAndOffset=[0,0,0,0]},a=this.ad(p.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(a.disposableOn(()=>s())),s()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoDivSwitchPoi:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.position?(Be(this.czmViewer.viewer,s.position,1e3,Dn,e),!0):(s.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Wu,"type",Wu.register("ESCesiumViewer",Q.ESUEWidget.type,Wu));let jm=Wu;const qu=class qu extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new On(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(qu,"type",qu.register("ESCesiumViewer",Q.ESUnrealActor.type,qu));let eg=qu;var BO=C.Primitive._modifyShaderPosition;C.Primitive._modifyShaderPosition=function(t,i,e){var i=BO(t,i,e);return t.isCameraVideo&&i.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(i=i.replace("void main()",`
|
|
3661
3661
|
#ifdef XBSJ_CAMERA_VIDEO
|
|
3662
3662
|
uniform mat4 u_boxMV;
|
|
3663
3663
|
#endif
|
|
@@ -3682,7 +3682,7 @@ ${fC}
|
|
|
3682
3682
|
#ifdef XBSJ_CAMERA_VIDEO
|
|
3683
3683
|
position = vec4(position3DLow + position3DHigh, 1.0);
|
|
3684
3684
|
#endif
|
|
3685
|
-
`)),i};var
|
|
3685
|
+
`)),i};var MO=C.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes;C.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes=function(t){return C.defined(t.isCameraVideo)?!0:MO(t)};var DO=C.ShadowVolumeAppearance.prototype.createFragmentShader;C.ShadowVolumeAppearance.prototype.createFragmentShader=function(t){var n=DO.bind(this)(t);if(this._appearance.isCameraVideo){var e=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];e.forEach(function(i){var o=n.defines.indexOf(i);o!==-1&&n.defines.splice(o,1)}),n.defines.push("XBSJ_CAMERA_VIDEO"),n.sources.forEach(function(i,o){i.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(n.sources[o]=i.replace("void main(void)",`
|
|
3686
3686
|
#ifdef XBSJ_CAMERA_VIDEO
|
|
3687
3687
|
uniform mat4 u_inverseBoxMV;
|
|
3688
3688
|
#endif
|
|
@@ -3697,7 +3697,7 @@ ${fC}
|
|
|
3697
3697
|
#endif
|
|
3698
3698
|
|
|
3699
3699
|
czm_material material = czm_getMaterial(materialInput);
|
|
3700
|
-
`))})}return n};var
|
|
3700
|
+
`))})}return n};var RO=C.ShadowVolumeAppearance.prototype.createVertexShader;C.ShadowVolumeAppearance.prototype.createVertexShader=function(t,n,e,i){var o=RO.bind(this)(t,n,e,i);if(this._appearance.isCameraVideo){var r=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];r.forEach(function(s){var a=o.defines.indexOf(s);a!==-1&&o.defines.splice(a,1)}),o.defines.push("XBSJ_CAMERA_VIDEO")}return o};var UO=new C.Cartesian3;function bC(t){var n=new C.Cartesian3(-1,-1,-1),e=new C.Cartesian3(1,1,1);n.y+=1.001,e.y+=1.001;var i=new Float64Array(8*3);i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z;var o=new C.GeometryAttributes;o.position=new C.GeometryAttribute({componentDatatype:C.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:i});var r=new Uint16Array(6*2*3);r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;for(var s=0;s<36;s+=3)r[s]=r[s]^r[s+2],r[s+2]=r[s]^r[s+2],r[s]=r[s]^r[s+2];var a;t&&(a=new Uint16Array(24),a[0]=0,a[1]=1,a[2]=1,a[3]=2,a[4]=2,a[5]=3,a[6]=3,a[7]=0,a[8]=4,a[9]=5,a[10]=5,a[11]=6,a[12]=6,a[13]=7,a[14]=7,a[15]=4,a[16]=0,a[17]=4,a[18]=1,a[19]=5,a[20]=2,a[21]=6,a[22]=3,a[23]=7);var l=C.Cartesian3.subtract(e,n,UO),c=C.Cartesian3.magnitude(l)*.5;return new C.Geometry({attributes:o,indices:t?a:r,primitiveType:t?C.PrimitiveType.LINES:C.PrimitiveType.TRIANGLES,boundingSphere:new C.BoundingSphere(C.Cartesian3.ZERO,c)})}var OO=`
|
|
3701
3701
|
in vec3 position3DHigh;
|
|
3702
3702
|
in vec3 position3DLow;
|
|
3703
3703
|
in vec4 color;
|
|
@@ -3718,7 +3718,7 @@ void main()
|
|
|
3718
3718
|
p.w = 1.0;
|
|
3719
3719
|
gl_Position = czm_projection * p;
|
|
3720
3720
|
}
|
|
3721
|
-
`;function Hl(t){if(!C.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var n=C.defaultValue(t.showHelperPrimitive,!1);this.inverseViewMatrix=C.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new C.Matrix4,C.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new C.PerspectiveFrustum({fov:C.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new C.Matrix4,this._primitiveModelMatrix=new C.Matrix4,this._inverseBoxMV=new C.Matrix4;var e=this,i={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new C.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:C.Material.DefaultImageId},components:{diffuse:"texture(image, fract(materialInput.st)).rgb",alpha:"texture(alphaImage, fract(materialInput.st)).r"}}});{const c=o._uniforms.image_0;o._uniforms.image_0=()=>{const h=this.videoTextureFunc&&this.videoTextureFunc();return h||c()}}{const c=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const h=this.alphaTextureFunc&&this.alphaTextureFunc();return h||c()}}var r=new C.MaterialAppearance({material:o,closed:!1});r._vertexFormat=C.VertexFormat.POSITION_ONLY,r.isCameraVideo=!0;var s=new C.ClassificationPrimitive({geometryInstances:new C.GeometryInstance({geometry:bC(),attributes:{color:C.ColorGeometryInstanceAttribute.fromColor(new C.Color(1,0,0,1)),show:new C.ShowGeometryInstanceAttribute(!0),isCameraVideo:new C.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:C.ClassificationType.CESIUM_3D_TILE,_uniformMap:i,appearance:r,asynchronous:!1,compressVertices:!1,allowPicking:!1});s.isCameraVideo=!0,Object.defineProperties(s,{_sp:{set:function(c){if(this.__sp!==c){if(c){var h=c,u=h.vertexShaderSource;u.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&u.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=h}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=s;var a=new C.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:UO});a.uniforms={u_boxMV:this._boxMV};var l=new C.Primitive({geometryInstances:new C.GeometryInstance({geometry:bC(!0),attributes:{color:C.ColorGeometryInstanceAttribute.fromColor(new C.Color(1,0,0,1)),show:new C.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:a,asynchronous:!1,compressVertices:!1,cull:!1,show:n});this._helperPrimitive=l,this._projectionMatrix=new C.Matrix4,this._inverseViewProjectionMatrix=new C.Matrix4,this._viewProjectionMatrix=new C.Matrix4,this.show=!0}Hl.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new C.Cartesian3,this._scratchBS=this._scratchBS||new C.BoundingSphere;const s=C.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),a=this.frustum.far,l=this._scratchBS;if(C.Cartesian3.clone(s,l.center),l.radius=a,t.cullingVolume.computeVisibility(l)===C.Intersect.OUTSIDE)return;const c=t.camera;if(c&&c.getPixelSize&&Di(c._scene,l.center,20)>l.radius)return}var n=C.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=C.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(n||C.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||C.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!n||!e){var i=this._inverseViewProjectionMatrix;C.Matrix4.inverse(this._projectionMatrix,i),C.Matrix4.multiply(this._inverseViewMatrix,i,i);var o=this._viewProjectionMatrix;C.Matrix4.inverse(i,o);var r=this._primitiveModelMatrix;C.Matrix4.fromUniformScale(this.frustum.far,r),C.Matrix4.multiply(this._inverseViewMatrix,r,r),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),C.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),C.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(Hl.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),Hl.prototype.isDestroyed=function(){return!1},Hl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),C.destroyObject(this)};class ps extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_resetWithCameraInfoEvent",this.disposeVar(new p.Event));L(this,"_sharedCzmTexture");L(this,"_fovy",this.disposeVar(p.react(0)));L(this,"_fovyUpdate",(()=>{const e=C.Math.toRadians,i=C.Math.toDegrees;{const o=()=>{const r=i(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(r-this.fovy)<1e-5||(this.fovy=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=i(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());L(this,"_fovx",this.disposeVar(p.react(0)));L(this,"_fovxUpdate",(()=>{const e=C.Math.toRadians,i=C.Math.toDegrees;{const o=()=>{const r=i(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(r-this.fovx)<1e-5||(this.fovx=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=i(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());L(this,"_xbsjCameraVideoResettingEvent");L(this,"_xbsjCameraVideoResetting");L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this.id=i);{const r=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};r(),this.ad(this.czmTextureIdChanged.don(r))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(p.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new p.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new LO(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const r=e.getCameraInfo();r&&(this.position=r.position,this.rotation=r.rotation)})),this.dispose(this.flyToEvent.disposableOn(r=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}Be(e.viewer,this.position,0,this.rotation,r)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}get sharedCzmTexture(){return this._sharedCzmTexture}getCurrentCzmTexture(){return this._sharedCzmTexture}get fovy(){return this._fovy.value}set fovy(e){this._fovy.value=e}get fovyChanged(){return this._fovy.changed}get fovx(){return this._fovx.value}set fovx(e){this._fovx.value=e}get fovxChanged(){return this._fovx.changed}get xbsjCameraVideoResetting(){return this._xbsjCameraVideoResetting}get xbsjCameraVideoChanged(){return this._xbsjCameraVideoResetting.objChanged}get xbsjCameraVideo(){var e;return(e=this._xbsjCameraVideoResetting.obj)==null?void 0:e.xbsjCameraVideo}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(ps,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(ps||(ps={})),p.extendClassProps(ps.prototype,ps.createDefaultProps);var YA=new C.Matrix3;function OO(t,n){const{position:e,heading:i,pitch:o,roll:r}=t,s=C.Transforms.eastNorthUpToFixedFrame(e,void 0,n);var a=C.Matrix3.fromRotationX(C.Math.PI_OVER_TWO,YA);return C.Matrix4.multiplyByMatrix3(s,a,s),a=C.Matrix3.fromRotationY(-i,YA),C.Matrix4.multiplyByMatrix3(s,a,s),a=C.Matrix3.fromRotationX(o,YA),C.Matrix4.multiplyByMatrix3(s,a,s),a=C.Matrix3.fromRotationZ(-r,YA),C.Matrix4.multiplyByMatrix3(s,a,s),s}class LO extends p.Destroyable{constructor(e,i){super();L(this,"_xbsjCameraVideo");const{viewer:o}=i;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:r}=e;if(!r)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[s,a,l]}=e,c=C.Math.toRadians,h=C.Cartesian3.fromDegrees(...r),u=OO({position:h,heading:c(s),pitch:c(a),roll:c(l)}),{fov:A,aspectRatio:f,near:d,far:g}=e,v=new C.PerspectiveFrustum({fov:c(A),aspectRatio:f,near:d,far:g}),y=new Hl({inverseViewMatrix:u,frustum:v,showHelperPrimitive:!0});this._xbsjCameraVideo=y,this.dispose(()=>y.destroy()),y.ESSceneObjectID=e.id,o.scene.primitives.add(y),this.dispose(()=>o.scene.primitives.remove(y));{const m=()=>{const w=e.getCurrentCzmTexture();if(w&&w instanceof At)return w.texture};this.xbsjCameraVideo.videoTextureFunc=m}{const m=()=>{y.showHelperPrimitive=e.showHelperPrimitive};m(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(m))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const Ku=class Ku extends Ge{constructor(e,i){super(e,i);L(this,"_czmCameraVideo");L(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new ps(i,e.id)),this._czmTexture=this.dv(new At(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:r}=this,{czmTexture:s}=this;r.czmTextureId=s.id,this.d(p.track([r,"show"],[e,"show"])),this.d(p.bind([r,"position"],[e,"position"])),this.d(Dt([r,"rotation"],[e,"rotation"])),this.d(p.track([r,"showHelperPrimitive"],[e,"showFrustum"])),this.d(p.track([s,"uriType"],[e,"videoStreamType"]));{const a=()=>{const c=e.fov??Q.ESVideoFusion.defaults.fov,h=e.aspectRatio??Q.ESVideoFusion.defaults.aspectRatio;r.fovx=C.Math.clamp(c,.001,179.9),r.aspectRatio=C.Math.clamp(h,.001,Number.MAX_SAFE_INTEGER)};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(l.disposableOn(a))}{const a=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};a(),this.ad(e.farChanged.don(a)),this.d(p.track([e,"far"],[r,"far"]))}{const a=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};a(),this.ad(e.nearChanged.don(a))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{r.fovx=e.fov}));{const a=()=>{e.videoStreamUrl&&(s.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};a(),this.d(e.videoStreamUrlChanged.disposableOn(a))}{const a=()=>{s.loop=e.looping};a(),this.d(e.loopingChanged.don(a))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{r.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=o.far??Q.ESVideoFusion.defaults.far;return o.position?(Rn(r,o,i,o.position,s,e),!0):!1}}};L(Ku,"type",Ku.register("ESCesiumViewer",Q.ESVideoFusion.type,Ku));let tg=Ku;function zO(t,n){const e=t,i=n,o=Math.cos,r=Math.sin;var s=[o(-e)*o(-i),r(-e)*o(-i),r(-i)];return s}function _C(t,n,e){return t*(-.5+e/n)}function CC(t,n,e,i){const o=new Float32Array((e+1)*(i+1)*3+3);for(let r=0;r<e+1;++r)for(let s=0;s<i+1;++s){const a=zO(_C(t,e,r),_C(n,i,s));o[(s*(e+1)+r)*3+0]=a[0],o[(s*(e+1)+r)*3+1]=a[1],o[(s*(e+1)+r)*3+2]=a[2]}return o[(e+1)*(i+1)*3+0]=0,o[(e+1)*(i+1)*3+1]=0,o[(e+1)*(i+1)*3+2]=0,o}function QO(t,n){var e=new Uint16Array(t*n*6);for(let i=0;i<t;++i)for(let o=0;o<n;++o){const r=o*(t+1)+i,s=o*(t+1)+i+1,a=(o+1)*(t+1)+i,l=(o+1)*(t+1)+i+1,c=(o*t+i)*6;e[c+0]=r,e[c+1]=s,e[c+2]=l,e[c+3]=r,e[c+4]=l,e[c+5]=a}return e}function VO(t,n,e,i){const o=t*e,r=n*i,s=new Uint16Array((t+1)*(r*2)+(n+1)*(o*2)+4*2);for(let f=0;f<t+1;++f)for(let d=0;d<r;++d){const g=f*e;s[(f*r+d)*2+0]=d*(o+1)+g,s[(f*r+d)*2+1]=(d+1)*(o+1)+g}const a=(t+1)*(r*2);for(let f=0;f<n+1;++f)for(let d=0;d<o;++d){const g=f*i;s[a+(d+f*o)*2+0]=g*(o+1)+d,s[a+(d+f*o)*2+1]=g*(o+1)+d+1}const l=(t+1)*(r*2)+(n+1)*(o*2),c=0,h=o,u=(o+1)*r,A=(o+1)*(r+1)-1;return s[l+0]=c,s[l+1]=(o+1)*(r+1),s[l+2]=h,s[l+3]=(o+1)*(r+1),s[l+4]=u,s[l+5]=(o+1)*(r+1),s[l+6]=A,s[l+7]=(o+1)*(r+1),s}var HO=`
|
|
3721
|
+
`;function Hl(t){if(!C.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var n=C.defaultValue(t.showHelperPrimitive,!1);this.inverseViewMatrix=C.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new C.Matrix4,C.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new C.PerspectiveFrustum({fov:C.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new C.Matrix4,this._primitiveModelMatrix=new C.Matrix4,this._inverseBoxMV=new C.Matrix4;var e=this,i={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new C.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:C.Material.DefaultImageId},components:{diffuse:"texture(image, fract(materialInput.st)).rgb",alpha:"texture(alphaImage, fract(materialInput.st)).r"}}});{const c=o._uniforms.image_0;o._uniforms.image_0=()=>{const h=this.videoTextureFunc&&this.videoTextureFunc();return h||c()}}{const c=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const h=this.alphaTextureFunc&&this.alphaTextureFunc();return h||c()}}var r=new C.MaterialAppearance({material:o,closed:!1});r._vertexFormat=C.VertexFormat.POSITION_ONLY,r.isCameraVideo=!0;var s=new C.ClassificationPrimitive({geometryInstances:new C.GeometryInstance({geometry:bC(),attributes:{color:C.ColorGeometryInstanceAttribute.fromColor(new C.Color(1,0,0,1)),show:new C.ShowGeometryInstanceAttribute(!0),isCameraVideo:new C.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:C.ClassificationType.CESIUM_3D_TILE,_uniformMap:i,appearance:r,asynchronous:!1,compressVertices:!1,allowPicking:!1});s.isCameraVideo=!0,Object.defineProperties(s,{_sp:{set:function(c){if(this.__sp!==c){if(c){var h=c,u=h.vertexShaderSource;u.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&u.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=h}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=s;var a=new C.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:OO});a.uniforms={u_boxMV:this._boxMV};var l=new C.Primitive({geometryInstances:new C.GeometryInstance({geometry:bC(!0),attributes:{color:C.ColorGeometryInstanceAttribute.fromColor(new C.Color(1,0,0,1)),show:new C.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:a,asynchronous:!1,compressVertices:!1,cull:!1,show:n});this._helperPrimitive=l,this._projectionMatrix=new C.Matrix4,this._inverseViewProjectionMatrix=new C.Matrix4,this._viewProjectionMatrix=new C.Matrix4,this.show=!0}Hl.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new C.Cartesian3,this._scratchBS=this._scratchBS||new C.BoundingSphere;const s=C.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),a=this.frustum.far,l=this._scratchBS;if(C.Cartesian3.clone(s,l.center),l.radius=a,t.cullingVolume.computeVisibility(l)===C.Intersect.OUTSIDE)return;const c=t.camera;if(c&&c.getPixelSize&&Di(c._scene,l.center,20)>l.radius)return}var n=C.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=C.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(n||C.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||C.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!n||!e){var i=this._inverseViewProjectionMatrix;C.Matrix4.inverse(this._projectionMatrix,i),C.Matrix4.multiply(this._inverseViewMatrix,i,i);var o=this._viewProjectionMatrix;C.Matrix4.inverse(i,o);var r=this._primitiveModelMatrix;C.Matrix4.fromUniformScale(this.frustum.far,r),C.Matrix4.multiply(this._inverseViewMatrix,r,r),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),C.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),C.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(Hl.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),Hl.prototype.isDestroyed=function(){return!1},Hl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),C.destroyObject(this)};class ps extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_resetWithCameraInfoEvent",this.disposeVar(new p.Event));L(this,"_sharedCzmTexture");L(this,"_fovy",this.disposeVar(p.react(0)));L(this,"_fovyUpdate",(()=>{const e=C.Math.toRadians,i=C.Math.toDegrees;{const o=()=>{const r=i(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(r-this.fovy)<1e-5||(this.fovy=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=i(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());L(this,"_fovx",this.disposeVar(p.react(0)));L(this,"_fovxUpdate",(()=>{const e=C.Math.toRadians,i=C.Math.toDegrees;{const o=()=>{const r=i(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(r-this.fovx)<1e-5||(this.fovx=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=i(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());L(this,"_xbsjCameraVideoResettingEvent");L(this,"_xbsjCameraVideoResetting");L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this.id=i);{const r=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};r(),this.ad(this.czmTextureIdChanged.don(r))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(p.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new p.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new zO(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const r=e.getCameraInfo();r&&(this.position=r.position,this.rotation=r.rotation)})),this.dispose(this.flyToEvent.disposableOn(r=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}Be(e.viewer,this.position,0,this.rotation,r)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}get sharedCzmTexture(){return this._sharedCzmTexture}getCurrentCzmTexture(){return this._sharedCzmTexture}get fovy(){return this._fovy.value}set fovy(e){this._fovy.value=e}get fovyChanged(){return this._fovy.changed}get fovx(){return this._fovx.value}set fovx(e){this._fovx.value=e}get fovxChanged(){return this._fovx.changed}get xbsjCameraVideoResetting(){return this._xbsjCameraVideoResetting}get xbsjCameraVideoChanged(){return this._xbsjCameraVideoResetting.objChanged}get xbsjCameraVideo(){var e;return(e=this._xbsjCameraVideoResetting.obj)==null?void 0:e.xbsjCameraVideo}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(ps,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(ps||(ps={})),p.extendClassProps(ps.prototype,ps.createDefaultProps);var YA=new C.Matrix3;function LO(t,n){const{position:e,heading:i,pitch:o,roll:r}=t,s=C.Transforms.eastNorthUpToFixedFrame(e,void 0,n);var a=C.Matrix3.fromRotationX(C.Math.PI_OVER_TWO,YA);return C.Matrix4.multiplyByMatrix3(s,a,s),a=C.Matrix3.fromRotationY(-i,YA),C.Matrix4.multiplyByMatrix3(s,a,s),a=C.Matrix3.fromRotationX(o,YA),C.Matrix4.multiplyByMatrix3(s,a,s),a=C.Matrix3.fromRotationZ(-r,YA),C.Matrix4.multiplyByMatrix3(s,a,s),s}class zO extends p.Destroyable{constructor(e,i){super();L(this,"_xbsjCameraVideo");const{viewer:o}=i;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:r}=e;if(!r)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[s,a,l]}=e,c=C.Math.toRadians,h=C.Cartesian3.fromDegrees(...r),u=LO({position:h,heading:c(s),pitch:c(a),roll:c(l)}),{fov:A,aspectRatio:f,near:d,far:g}=e,v=new C.PerspectiveFrustum({fov:c(A),aspectRatio:f,near:d,far:g}),y=new Hl({inverseViewMatrix:u,frustum:v,showHelperPrimitive:!0});this._xbsjCameraVideo=y,this.dispose(()=>y.destroy()),y.ESSceneObjectID=e.id,o.scene.primitives.add(y),this.dispose(()=>o.scene.primitives.remove(y));{const m=()=>{const w=e.getCurrentCzmTexture();if(w&&w instanceof At)return w.texture};this.xbsjCameraVideo.videoTextureFunc=m}{const m=()=>{y.showHelperPrimitive=e.showHelperPrimitive};m(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(m))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const Ku=class Ku extends Ge{constructor(e,i){super(e,i);L(this,"_czmCameraVideo");L(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new ps(i,e.id)),this._czmTexture=this.dv(new At(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:r}=this,{czmTexture:s}=this;r.czmTextureId=s.id,this.d(p.track([r,"show"],[e,"show"])),this.d(p.bind([r,"position"],[e,"position"])),this.d(Dt([r,"rotation"],[e,"rotation"])),this.d(p.track([r,"showHelperPrimitive"],[e,"showFrustum"])),this.d(p.track([s,"uriType"],[e,"videoStreamType"]));{const a=()=>{const c=e.fov??Q.ESVideoFusion.defaults.fov,h=e.aspectRatio??Q.ESVideoFusion.defaults.aspectRatio;r.fovx=C.Math.clamp(c,.001,179.9),r.aspectRatio=C.Math.clamp(h,.001,Number.MAX_SAFE_INTEGER)};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(l.disposableOn(a))}{const a=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};a(),this.ad(e.farChanged.don(a)),this.d(p.track([e,"far"],[r,"far"]))}{const a=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};a(),this.ad(e.nearChanged.don(a))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{r.fovx=e.fov}));{const a=()=>{e.videoStreamUrl&&(s.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};a(),this.d(e.videoStreamUrlChanged.disposableOn(a))}{const a=()=>{s.loop=e.looping};a(),this.d(e.loopingChanged.don(a))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{r.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=o.far??Q.ESVideoFusion.defaults.far;return o.position?(Rn(r,o,i,o.position,s,e),!0):!1}}};L(Ku,"type",Ku.register("ESCesiumViewer",Q.ESVideoFusion.type,Ku));let tg=Ku;function QO(t,n){const e=t,i=n,o=Math.cos,r=Math.sin;var s=[o(-e)*o(-i),r(-e)*o(-i),r(-i)];return s}function _C(t,n,e){return t*(-.5+e/n)}function CC(t,n,e,i){const o=new Float32Array((e+1)*(i+1)*3+3);for(let r=0;r<e+1;++r)for(let s=0;s<i+1;++s){const a=QO(_C(t,e,r),_C(n,i,s));o[(s*(e+1)+r)*3+0]=a[0],o[(s*(e+1)+r)*3+1]=a[1],o[(s*(e+1)+r)*3+2]=a[2]}return o[(e+1)*(i+1)*3+0]=0,o[(e+1)*(i+1)*3+1]=0,o[(e+1)*(i+1)*3+2]=0,o}function VO(t,n){var e=new Uint16Array(t*n*6);for(let i=0;i<t;++i)for(let o=0;o<n;++o){const r=o*(t+1)+i,s=o*(t+1)+i+1,a=(o+1)*(t+1)+i,l=(o+1)*(t+1)+i+1,c=(o*t+i)*6;e[c+0]=r,e[c+1]=s,e[c+2]=l,e[c+3]=r,e[c+4]=l,e[c+5]=a}return e}function HO(t,n,e,i){const o=t*e,r=n*i,s=new Uint16Array((t+1)*(r*2)+(n+1)*(o*2)+4*2);for(let f=0;f<t+1;++f)for(let d=0;d<r;++d){const g=f*e;s[(f*r+d)*2+0]=d*(o+1)+g,s[(f*r+d)*2+1]=(d+1)*(o+1)+g}const a=(t+1)*(r*2);for(let f=0;f<n+1;++f)for(let d=0;d<o;++d){const g=f*i;s[a+(d+f*o)*2+0]=g*(o+1)+d,s[a+(d+f*o)*2+1]=g*(o+1)+d+1}const l=(t+1)*(r*2)+(n+1)*(o*2),c=0,h=o,u=(o+1)*r,A=(o+1)*(r+1)-1;return s[l+0]=c,s[l+1]=(o+1)*(r+1),s[l+2]=h,s[l+3]=(o+1)*(r+1),s[l+4]=u,s[l+5]=(o+1)*(r+1),s[l+6]=A,s[l+7]=(o+1)*(r+1),s}var NO=`
|
|
3722
3722
|
// vtxf 使用double类型的position进行计算
|
|
3723
3723
|
// in vec3 position3DHigh;
|
|
3724
3724
|
// in vec3 position3DLow;
|
|
@@ -3745,7 +3745,7 @@ void main()
|
|
|
3745
3745
|
// v_st = st;
|
|
3746
3746
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
3747
3747
|
}
|
|
3748
|
-
`,
|
|
3748
|
+
`,GO=`
|
|
3749
3749
|
in vec3 v_positionEC;
|
|
3750
3750
|
in vec3 v_normalEC;
|
|
3751
3751
|
// vec2 v_st;
|
|
@@ -3780,7 +3780,7 @@ void main()
|
|
|
3780
3780
|
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
3781
3781
|
#endif
|
|
3782
3782
|
}
|
|
3783
|
-
`,GO={position:0,normal:1};class WO{constructor(n){this.modelMatrix=C.defaultValue(n.modelMatrix,new C.Matrix4),this.fovH=C.defaultValue(n.fovH,C.Math.toRadians(60)),this.fovV=C.defaultValue(n.fovV,C.Math.toRadians(30)),this.segmentH=C.defaultValue(n.segmentH,6),this.segmentV=C.defaultValue(n.segmentV,3),this.subSegmentH=C.defaultValue(n.subSegmentH,3),this.subSegmentV=C.defaultValue(n.subSegmentV,3),this._faceColor=C.defaultValue(n.faceColor,new C.Color(1,1,0,.5)),this._lineColor=C.defaultValue(n.lineColor,new C.Color(1,0,0)),this.show=C.defaultValue(n.lineColor,!0),this._modelMatrix=C.Matrix4.clone(C.Matrix4.IDENTITY),this._fovH=0,this._fovV=0,this._segmentH=1,this._segmentV=1,this._subSegmentH=1,this._subSegmentV=1,this._boundingSphere=new C.BoundingSphere,this._initBoundingSphere=void 0,this._command=void 0}_createCommand(n){const e=this._subSegmentH*this._segmentH,i=this._subSegmentV*this._segmentV;var o=CC(this._fovH,this._fovV,e,i),r=CC(this._fovH,this._fovV,e,i),s=QO(e,i),a=VO(this._segmentH,this._segmentV,this._subSegmentH,this._subSegmentV),l=!0,c=!1,h=C.Appearance.getDefaultRenderState(l,c,void 0),u=C.RenderState.fromCache(h),A=new C.ShaderSource({sources:[HO]}),f=new C.ShaderSource({sources:[NO]}),d={xbsjColor:()=>this._faceColor},g={xbsjColor:()=>this._lineColor},v=C.ShaderProgram.fromCache({context:n,vertexShaderSource:A,fragmentShaderSource:f,attributeLocations:GO});this._shaderprogram=v;var y=C.Buffer.createVertexBuffer({context:n,typedArray:o,usage:C.BufferUsage.STATIC_DRAW}),m=C.Buffer.createVertexBuffer({context:n,typedArray:r,usage:C.BufferUsage.STATIC_DRAW}),w=C.Buffer.createIndexBuffer({context:n,typedArray:s,usage:C.BufferUsage.STATIC_DRAW,indexDatatype:C.IndexDatatype.UNSIGNED_SHORT}),_=C.Buffer.createIndexBuffer({context:n,typedArray:a,usage:C.BufferUsage.STATIC_DRAW,indexDatatype:C.IndexDatatype.UNSIGNED_SHORT});const E=new C.VertexArray({context:n,attributes:[{index:0,vertexBuffer:y,componentsPerAttribute:3,componentDatatype:C.ComponentDatatype.FLOAT},{index:1,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:C.ComponentDatatype.FLOAT}],indexBuffer:w}),T=new C.VertexArray({context:n,attributes:[{index:0,vertexBuffer:y,componentsPerAttribute:3,componentDatatype:C.ComponentDatatype.FLOAT},{index:1,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:C.ComponentDatatype.FLOAT}],indexBuffer:_});this._initBoundingSphere=C.BoundingSphere.fromVertices(o),this._command=new C.DrawCommand({vertexArray:E,primitiveType:C.PrimitiveType.TRIANGLES,renderState:u,shaderProgram:v,uniformMap:d,owner:this,pass:C.Pass.TRANSLUCENT,modelMatrix:new C.Matrix4,boundingVolume:new C.BoundingSphere,cull:!0}),this._lineCommand=new C.DrawCommand({vertexArray:T,primitiveType:C.PrimitiveType.LINES,renderState:u,shaderProgram:v,uniformMap:g,owner:this,pass:C.Pass.TRANSLUCENT,modelMatrix:new C.Matrix4,boundingVolume:new C.BoundingSphere,cull:!0})}update(n){if(!this.show||!n.passes.render)return;(this.fovH!==this._fovH||this.fovV!==this._fovV||this.segmentH!==this._segmentH||this.segmentV!==this._segmentV||this.subSegmentH!==this._subSegmentH||this.subSegmentV!==this._subSegmentV)&&(this._fovH=this.fovH,this._fovV=this.fovV,this._segmentH=this.segmentH,this._segmentV=this.segmentV,this._subSegmentH=this.subSegmentH,this._subSegmentV=this.subSegmentV,this._modelMatrix=C.clone(C.Matrix4.IDENTITY),this._destroyVideoMemory()),C.defined(this._command)||this._createCommand(n.context),C.Matrix4.equals(this.modelMatrix,this._modelMatrix)||(C.Matrix4.clone(this.modelMatrix,this._modelMatrix),this._command.modelMatrix=C.Matrix4.IDENTITY,this._command.modelMatrix=this._modelMatrix,this._command.boundingVolume=C.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere),this._lineCommand.modelMatrix=C.Matrix4.IDENTITY,this._lineCommand.modelMatrix=this._modelMatrix,this._lineCommand.boundingVolume=C.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere)),this._command&&n.commandList.push(this._command),this._lineCommand&&n.commandList.push(this._lineCommand)}isDestroyed(){return!1}_destroyVideoMemory(){this._shaderprogram=this._shaderprogram&&this._shaderprogram.destroy(),C.defined(this._command)&&(this._command.vertexArray=this._command.vertexArray&&this._command.vertexArray.destroy(),this._command=void 0),C.defined(this._lineCommand)&&(this._lineCommand.vertexArray=this._lineCommand.vertexArray&&this._lineCommand.vertexArray.destroy(),this._lineCommand=void 0)}destroy(){return this._destroyVideoMemory(),C.destroyObject(this)}}var qO=C.ShadowMapShader.createShadowReceiveFragmentShader;C.ShadowMapShader.createShadowReceiveFragmentShader=function(t,n,e,i,o){var r=n._isSpotLight,s=qO.bind(this)(t,n,e,i,o);if(r){var a="out_FragColor.rgb *= visibility;",l="out_FragColor.rgb *= (visibility < 0.99 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0));";s.sources[s.sources.length-1]=s.sources[s.sources.length-1].replace(a,l);{var a="vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);",l=a+"if (distance(positionEC.xyz, shadowMap_lightPositionEC.xyz) > shadowMap_lightPositionEC.w) { return; }";s.sources[s.sources.length-1]=s.sources[s.sources.length-1].replace(a,l)}}return s};function KO(){var t=C.Matrix3.fromRotationZ(C.Math.PI*.5),n=C.Matrix3.fromRotationY(C.Math.PI*.5),e=new C.Matrix3;return C.Matrix3.multiply(t,n,e),e}const ZO=KO();class xC{_updateFov(){this._fovH<0||this._fovV<0||(this.frustum.aspectRatio=Math.tan(this._fovH*.5)/Math.tan(this._fovV*.5),this.frustum.fov=this._fovH>this._fovV?this._fovH:this._fovV)}constructor(n){this._fovH=C.Math.PI/3,this._fovV=C.Math.PI/6,C.defined(n)||console.error("scene is not defined!"),this._scene=n,this._frustum=new C.PerspectiveFrustum,this._updateFov(),this._frustum.near=1,this._frustum.far=400,this._spotLightCamera=new C.Camera(n),this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap=new C.ShadowMap({context:n.context,lightCamera:this._spotLightCamera,cascadesEnabled:!1}),this._debugCameraPrimitive=new WO({}),this._enabledChangedEvent=new C.Event}update(n){if(this._viewshedShadowMap.enabled){if(n.shadowMaps.unshift(this._viewshedShadowMap),!this._frustum.equals(this._spotLightCamera.frustum)){this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap._pointLightRadius=this._frustum.far;const i=this.shadowMap._boundingSphere;i.radius=Math.random()}if(this._debugCameraPrimitive.show){var e=this._debugCameraPrimitive.modelMatrix;C.Matrix4.clone(this._spotLightCamera.inverseViewMatrix,e),C.Matrix4.multiplyByMatrix3(e,ZO,e),C.Matrix4.multiplyByUniformScale(e,this._spotLightCamera.frustum.far,e);const o=this._spotLightCamera.frustum;this._debugCameraPrimitive.fovV=o.aspectRatio<=1?o.fov:Math.atan(Math.tan(o.fov*.5)/o.aspectRatio)*2,this._debugCameraPrimitive.fovH=o.aspectRatio>1?o.fov:Math.atan(Math.tan(o.fov*.5)*o.aspectRatio)*2,this._debugCameraPrimitive.update(n)}}}setView(n){this._spotLightCamera.setView(n)}get enabledChangedEvent(){return this._enabledChangedEvent}isDestroyed(){return!1}destroy(){return this._debugCameraPrimitive=this._debugCameraPrimitive&&this._debugCameraPrimitive.destroy(),this._viewshedShadowMap=this._viewshedShadowMap&&this._viewshedShadowMap.destroy(),C.destroyObject(this)}}Object.defineProperties(xC.prototype,{frustum:{get:function(){return this._frustum}},fovH:{get:function(){return this._fovH},set:function(t){this._fovH=t,this._updateFov()}},fovV:{get:function(){return this._fovV},set:function(t){this._fovV=t,this._updateFov()}},near:{get:function(){return this.frustum.near},set:function(t){this.frustum.near!==t&&(this.frustum.near=t)}},far:{get:function(){return this.frustum.far},set:function(t){this.frustum.far!==t&&(this.frustum.far=t)}},position:{get:function(){return this._spotLightCamera.positionWC},set:function(t){this.setView({destination:t,orientation:{heading:this._spotLightCamera.heading,pitch:this._spotLightCamera.pitch,roll:this._spotLightCamera.roll}})}},heading:{get:function(){return this._spotLightCamera.heading},set:function(t){this._spotLightCamera.heading!==t&&this.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:t,pitch:this._spotLightCamera.pitch,roll:this._spotLightCamera.roll}})}},pitch:{get:function(){return this._spotLightCamera.pitch},set:function(t){this._spotLightCamera.pitch!==t&&this.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:this._spotLightCamera.heading,pitch:t,roll:this._spotLightCamera.roll}})}},showHelper:{get:function(){return this._debugCameraPrimitive.show},set:function(t){this._debugCameraPrimitive.show=t}},roll:{get:function(){return this._spotLightCamera.roll},set:function(t){this._spotLightCamera.roll!==t&&this._spotLightCamera.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:this._spotLightCamera.heading,pitch:this._spotLightCamera.pitch,roll:t}})}},shadowMap:{get:function(){return this._viewshedShadowMap}},lightCamera:{get:function(){return this._spotLightCamera}},enabled:{get:function(){return this._viewshedShadowMap.enabled},set:function(t){this._viewshedShadowMap.enabled!==t&&(t?(this._viewshedShadowMap.enabled=!0,this._viewshedShadowMap._pointLightRadius=this._spotLightCamera.frustum.far):this._viewshedShadowMap.enabled=!1,this._enabledChangedEvent.raiseEvent(t))}}});const Zu=class Zu extends Ge{constructor(e,i){super(e,i);L(this,"_czmViewShed");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmViewShed=this.disposeVar(new xC(o.scene));const r=this._czmViewShed;r.ESSceneObjectID=e.id,o.scene.primitives.add(r),this.dispose(()=>o.scene.primitives.remove(r));{const s=()=>{if(e.fov==0||e.aspectRatio==0)return;const l=C.Math.toRadians(e.fov),c=C.Math.toRadians(e.fov/e.aspectRatio),h=C.Math.PI-1e-5;r.fovH=C.Math.clamp(l,-h,h),r.fovV=C.Math.clamp(c,-h,h)};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(a.disposableOn(s))}{const s=()=>{r.enabled=!!e.position&&e.show,r.position&&(r.position=vt(e.position))};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.positionChanged,e.showChanged));this.dispose(a.disposableOn(s))}{const s=()=>{r.heading=C.Math.toRadians(e.rotation[0]+90),r.pitch=C.Math.toRadians(e.rotation[1]),r.roll=C.Math.toRadians(e.rotation[2])};s(),this.ad(e.rotationChanged.don(s))}{const s=()=>{r.showHelper=e.showFrustum??Q.ESViewShed.defaults.showFrustum};s(),this.ad(e.showFrustumChanged.don(s))}{const s=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};s(),this.ad(e.farChanged.don(s))}{const s=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};s(),this.ad(e.nearChanged.don(s))}}get czmViewShed(){return this._czmViewShed}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 s=o.far??Q.ESViewShed.defaults.far;return o.position?(Rn(r,o,i,o.position,s,e),!0):!1}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this.czmViewShed&&(this.czmViewShed.showHelper=s&&(e.showFrustum??Q.ESViewShed.defaults.showFrustum),this.czmViewShed.enabled=s&&e.show&&!!e.position)}}};L(Zu,"type",Zu.register("ESCesiumViewer",Q.ESViewShed.type,Zu));let ng=Zu;function XO(t,n,e){const i=document.createElement("div");let o,r="";const s=Object.keys(t.info);for(let l=0;l<s.length;l++){if(s[l].toLowerCase()=="title"){o=t.info[s[l]];continue}r+=`<div style="
|
|
3783
|
+
`,WO={position:0,normal:1};class qO{constructor(n){this.modelMatrix=C.defaultValue(n.modelMatrix,new C.Matrix4),this.fovH=C.defaultValue(n.fovH,C.Math.toRadians(60)),this.fovV=C.defaultValue(n.fovV,C.Math.toRadians(30)),this.segmentH=C.defaultValue(n.segmentH,6),this.segmentV=C.defaultValue(n.segmentV,3),this.subSegmentH=C.defaultValue(n.subSegmentH,3),this.subSegmentV=C.defaultValue(n.subSegmentV,3),this._faceColor=C.defaultValue(n.faceColor,new C.Color(1,1,0,.5)),this._lineColor=C.defaultValue(n.lineColor,new C.Color(1,0,0)),this.show=C.defaultValue(n.lineColor,!0),this._modelMatrix=C.Matrix4.clone(C.Matrix4.IDENTITY),this._fovH=0,this._fovV=0,this._segmentH=1,this._segmentV=1,this._subSegmentH=1,this._subSegmentV=1,this._boundingSphere=new C.BoundingSphere,this._initBoundingSphere=void 0,this._command=void 0}_createCommand(n){const e=this._subSegmentH*this._segmentH,i=this._subSegmentV*this._segmentV;var o=CC(this._fovH,this._fovV,e,i),r=CC(this._fovH,this._fovV,e,i),s=VO(e,i),a=HO(this._segmentH,this._segmentV,this._subSegmentH,this._subSegmentV),l=!0,c=!1,h=C.Appearance.getDefaultRenderState(l,c,void 0),u=C.RenderState.fromCache(h),A=new C.ShaderSource({sources:[NO]}),f=new C.ShaderSource({sources:[GO]}),d={xbsjColor:()=>this._faceColor},g={xbsjColor:()=>this._lineColor},v=C.ShaderProgram.fromCache({context:n,vertexShaderSource:A,fragmentShaderSource:f,attributeLocations:WO});this._shaderprogram=v;var y=C.Buffer.createVertexBuffer({context:n,typedArray:o,usage:C.BufferUsage.STATIC_DRAW}),m=C.Buffer.createVertexBuffer({context:n,typedArray:r,usage:C.BufferUsage.STATIC_DRAW}),w=C.Buffer.createIndexBuffer({context:n,typedArray:s,usage:C.BufferUsage.STATIC_DRAW,indexDatatype:C.IndexDatatype.UNSIGNED_SHORT}),_=C.Buffer.createIndexBuffer({context:n,typedArray:a,usage:C.BufferUsage.STATIC_DRAW,indexDatatype:C.IndexDatatype.UNSIGNED_SHORT});const E=new C.VertexArray({context:n,attributes:[{index:0,vertexBuffer:y,componentsPerAttribute:3,componentDatatype:C.ComponentDatatype.FLOAT},{index:1,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:C.ComponentDatatype.FLOAT}],indexBuffer:w}),T=new C.VertexArray({context:n,attributes:[{index:0,vertexBuffer:y,componentsPerAttribute:3,componentDatatype:C.ComponentDatatype.FLOAT},{index:1,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:C.ComponentDatatype.FLOAT}],indexBuffer:_});this._initBoundingSphere=C.BoundingSphere.fromVertices(o),this._command=new C.DrawCommand({vertexArray:E,primitiveType:C.PrimitiveType.TRIANGLES,renderState:u,shaderProgram:v,uniformMap:d,owner:this,pass:C.Pass.TRANSLUCENT,modelMatrix:new C.Matrix4,boundingVolume:new C.BoundingSphere,cull:!0}),this._lineCommand=new C.DrawCommand({vertexArray:T,primitiveType:C.PrimitiveType.LINES,renderState:u,shaderProgram:v,uniformMap:g,owner:this,pass:C.Pass.TRANSLUCENT,modelMatrix:new C.Matrix4,boundingVolume:new C.BoundingSphere,cull:!0})}update(n){if(!this.show||!n.passes.render)return;(this.fovH!==this._fovH||this.fovV!==this._fovV||this.segmentH!==this._segmentH||this.segmentV!==this._segmentV||this.subSegmentH!==this._subSegmentH||this.subSegmentV!==this._subSegmentV)&&(this._fovH=this.fovH,this._fovV=this.fovV,this._segmentH=this.segmentH,this._segmentV=this.segmentV,this._subSegmentH=this.subSegmentH,this._subSegmentV=this.subSegmentV,this._modelMatrix=C.clone(C.Matrix4.IDENTITY),this._destroyVideoMemory()),C.defined(this._command)||this._createCommand(n.context),C.Matrix4.equals(this.modelMatrix,this._modelMatrix)||(C.Matrix4.clone(this.modelMatrix,this._modelMatrix),this._command.modelMatrix=C.Matrix4.IDENTITY,this._command.modelMatrix=this._modelMatrix,this._command.boundingVolume=C.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere),this._lineCommand.modelMatrix=C.Matrix4.IDENTITY,this._lineCommand.modelMatrix=this._modelMatrix,this._lineCommand.boundingVolume=C.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere)),this._command&&n.commandList.push(this._command),this._lineCommand&&n.commandList.push(this._lineCommand)}isDestroyed(){return!1}_destroyVideoMemory(){this._shaderprogram=this._shaderprogram&&this._shaderprogram.destroy(),C.defined(this._command)&&(this._command.vertexArray=this._command.vertexArray&&this._command.vertexArray.destroy(),this._command=void 0),C.defined(this._lineCommand)&&(this._lineCommand.vertexArray=this._lineCommand.vertexArray&&this._lineCommand.vertexArray.destroy(),this._lineCommand=void 0)}destroy(){return this._destroyVideoMemory(),C.destroyObject(this)}}var KO=C.ShadowMapShader.createShadowReceiveFragmentShader;C.ShadowMapShader.createShadowReceiveFragmentShader=function(t,n,e,i,o){var r=n._isSpotLight,s=KO.bind(this)(t,n,e,i,o);if(r){var a="out_FragColor.rgb *= visibility;",l="out_FragColor.rgb *= (visibility < 0.99 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0));";s.sources[s.sources.length-1]=s.sources[s.sources.length-1].replace(a,l);{var a="vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);",l=a+"if (distance(positionEC.xyz, shadowMap_lightPositionEC.xyz) > shadowMap_lightPositionEC.w) { return; }";s.sources[s.sources.length-1]=s.sources[s.sources.length-1].replace(a,l)}}return s};function ZO(){var t=C.Matrix3.fromRotationZ(C.Math.PI*.5),n=C.Matrix3.fromRotationY(C.Math.PI*.5),e=new C.Matrix3;return C.Matrix3.multiply(t,n,e),e}const XO=ZO();class xC{_updateFov(){this._fovH<0||this._fovV<0||(this.frustum.aspectRatio=Math.tan(this._fovH*.5)/Math.tan(this._fovV*.5),this.frustum.fov=this._fovH>this._fovV?this._fovH:this._fovV)}constructor(n){this._fovH=C.Math.PI/3,this._fovV=C.Math.PI/6,C.defined(n)||console.error("scene is not defined!"),this._scene=n,this._frustum=new C.PerspectiveFrustum,this._updateFov(),this._frustum.near=1,this._frustum.far=400,this._spotLightCamera=new C.Camera(n),this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap=new C.ShadowMap({context:n.context,lightCamera:this._spotLightCamera,cascadesEnabled:!1}),this._debugCameraPrimitive=new qO({}),this._enabledChangedEvent=new C.Event}update(n){if(this._viewshedShadowMap.enabled){if(n.shadowMaps.unshift(this._viewshedShadowMap),!this._frustum.equals(this._spotLightCamera.frustum)){this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap._pointLightRadius=this._frustum.far;const i=this.shadowMap._boundingSphere;i.radius=Math.random()}if(this._debugCameraPrimitive.show){var e=this._debugCameraPrimitive.modelMatrix;C.Matrix4.clone(this._spotLightCamera.inverseViewMatrix,e),C.Matrix4.multiplyByMatrix3(e,XO,e),C.Matrix4.multiplyByUniformScale(e,this._spotLightCamera.frustum.far,e);const o=this._spotLightCamera.frustum;this._debugCameraPrimitive.fovV=o.aspectRatio<=1?o.fov:Math.atan(Math.tan(o.fov*.5)/o.aspectRatio)*2,this._debugCameraPrimitive.fovH=o.aspectRatio>1?o.fov:Math.atan(Math.tan(o.fov*.5)*o.aspectRatio)*2,this._debugCameraPrimitive.update(n)}}}setView(n){this._spotLightCamera.setView(n)}get enabledChangedEvent(){return this._enabledChangedEvent}isDestroyed(){return!1}destroy(){return this._debugCameraPrimitive=this._debugCameraPrimitive&&this._debugCameraPrimitive.destroy(),this._viewshedShadowMap=this._viewshedShadowMap&&this._viewshedShadowMap.destroy(),C.destroyObject(this)}}Object.defineProperties(xC.prototype,{frustum:{get:function(){return this._frustum}},fovH:{get:function(){return this._fovH},set:function(t){this._fovH=t,this._updateFov()}},fovV:{get:function(){return this._fovV},set:function(t){this._fovV=t,this._updateFov()}},near:{get:function(){return this.frustum.near},set:function(t){this.frustum.near!==t&&(this.frustum.near=t)}},far:{get:function(){return this.frustum.far},set:function(t){this.frustum.far!==t&&(this.frustum.far=t)}},position:{get:function(){return this._spotLightCamera.positionWC},set:function(t){this.setView({destination:t,orientation:{heading:this._spotLightCamera.heading,pitch:this._spotLightCamera.pitch,roll:this._spotLightCamera.roll}})}},heading:{get:function(){return this._spotLightCamera.heading},set:function(t){this._spotLightCamera.heading!==t&&this.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:t,pitch:this._spotLightCamera.pitch,roll:this._spotLightCamera.roll}})}},pitch:{get:function(){return this._spotLightCamera.pitch},set:function(t){this._spotLightCamera.pitch!==t&&this.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:this._spotLightCamera.heading,pitch:t,roll:this._spotLightCamera.roll}})}},showHelper:{get:function(){return this._debugCameraPrimitive.show},set:function(t){this._debugCameraPrimitive.show=t}},roll:{get:function(){return this._spotLightCamera.roll},set:function(t){this._spotLightCamera.roll!==t&&this._spotLightCamera.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:this._spotLightCamera.heading,pitch:this._spotLightCamera.pitch,roll:t}})}},shadowMap:{get:function(){return this._viewshedShadowMap}},lightCamera:{get:function(){return this._spotLightCamera}},enabled:{get:function(){return this._viewshedShadowMap.enabled},set:function(t){this._viewshedShadowMap.enabled!==t&&(t?(this._viewshedShadowMap.enabled=!0,this._viewshedShadowMap._pointLightRadius=this._spotLightCamera.frustum.far):this._viewshedShadowMap.enabled=!1,this._enabledChangedEvent.raiseEvent(t))}}});const Zu=class Zu extends Ge{constructor(e,i){super(e,i);L(this,"_czmViewShed");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmViewShed=this.disposeVar(new xC(o.scene));const r=this._czmViewShed;r.ESSceneObjectID=e.id,o.scene.primitives.add(r),this.dispose(()=>o.scene.primitives.remove(r));{const s=()=>{if(e.fov==0||e.aspectRatio==0)return;const l=C.Math.toRadians(e.fov),c=C.Math.toRadians(e.fov/e.aspectRatio),h=C.Math.PI-1e-5;r.fovH=C.Math.clamp(l,-h,h),r.fovV=C.Math.clamp(c,-h,h)};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(a.disposableOn(s))}{const s=()=>{r.enabled=!!e.position&&e.show,r.position&&(r.position=vt(e.position))};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.positionChanged,e.showChanged));this.dispose(a.disposableOn(s))}{const s=()=>{r.heading=C.Math.toRadians(e.rotation[0]+90),r.pitch=C.Math.toRadians(e.rotation[1]),r.roll=C.Math.toRadians(e.rotation[2])};s(),this.ad(e.rotationChanged.don(s))}{const s=()=>{r.showHelper=e.showFrustum??Q.ESViewShed.defaults.showFrustum};s(),this.ad(e.showFrustumChanged.don(s))}{const s=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};s(),this.ad(e.farChanged.don(s))}{const s=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};s(),this.ad(e.nearChanged.don(s))}}get czmViewShed(){return this._czmViewShed}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 s=o.far??Q.ESViewShed.defaults.far;return o.position?(Rn(r,o,i,o.position,s,e),!0):!1}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this.czmViewShed&&(this.czmViewShed.showHelper=s&&(e.showFrustum??Q.ESViewShed.defaults.showFrustum),this.czmViewShed.enabled=s&&e.show&&!!e.position)}}};L(Zu,"type",Zu.register("ESCesiumViewer",Q.ESViewShed.type,Zu));let ng=Zu;function $O(t,n,e){const i=document.createElement("div");let o,r="";const s=Object.keys(t.info);for(let l=0;l<s.length;l++){if(s[l].toLowerCase()=="title"){o=t.info[s[l]];continue}r+=`<div style="
|
|
3784
3784
|
display: flex;
|
|
3785
3785
|
font-size: 10px;
|
|
3786
3786
|
width: 100%;">
|
|
@@ -3824,7 +3824,7 @@ void main()
|
|
|
3824
3824
|
${r}
|
|
3825
3825
|
</div>
|
|
3826
3826
|
</div>
|
|
3827
|
-
</div>`;let a=document.createElement("style");return a.setAttribute("type","text/css"),a.innerHTML
|
|
3827
|
+
</div>`;let a=document.createElement("style");return a.setAttribute("type","text/css"),a.innerHTML=YO,i.appendChild(a),i}const YO=`
|
|
3828
3828
|
/*定义滚动条高宽及背景
|
|
3829
3829
|
高宽分别对应横竖滚动条的尺寸*/
|
|
3830
3830
|
.info ::-webkit-scrollbar,.body ::-webkit-scrollbar {
|
|
@@ -3848,7 +3848,7 @@ void main()
|
|
|
3848
3848
|
border-radius: 8px;
|
|
3849
3849
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
|
|
3850
3850
|
background-color: green;
|
|
3851
|
-
}`,Xu=class Xu extends Ol{constructor(e,i){super(e,i);L(this,"_widgetTemp");if(!i.viewer){console.warn("viewer is undefined!");return}(async()=>{const r="${earthsdk3-assets-script-dir}/assets/img/Info/",s=await Co(Q.ESSceneObject.context.getStrFromEnv(r+"/InfoBackGround.png")),a=await Co(Q.ESSceneObject.context.getStrFromEnv(r+"/InfoItemRowBackGround.png"));{const l=this.dv(p.createNextAnimateFrameEvent(e.screenRenderChanged,e.infoChanged));this.widgetTemp=this.disposeVar(new p.ObjResettingWithEvent(l,()=>{const c
|
|
3851
|
+
}`,Xu=class Xu extends Ol{constructor(e,i){super(e,i);L(this,"_widgetTemp");if(!i.viewer){console.warn("viewer is undefined!");return}(async()=>{const r="${earthsdk3-assets-script-dir}/assets/img/Info/",s=await Co(Q.ESSceneObject.context.getStrFromEnv(r+"/InfoBackGround.png")),a=await Co(Q.ESSceneObject.context.getStrFromEnv(r+"/InfoItemRowBackGround.png"));{const l=this.dv(p.createNextAnimateFrameEvent(e.screenRenderChanged,e.infoChanged));this.widgetTemp=this.disposeVar(new p.ObjResettingWithEvent(l,()=>{const c=$O(e,a,s);return e.screenRender?new br(e,i,c,Object.keys(e.info).length!=0):new cA(e,i,c,Object.keys(e.info).length!=0)}))}})()}get widgetTemp(){return this._widgetTemp}set widgetTemp(e){this._widgetTemp=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,widgetTemp:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(s)s.obj.flyTo(e,i);else{const a=setTimeout(()=>{clearTimeout(a),this.flyTo(e,i)},200)}return o.flyOverEvent.emit(i,"over",r),!0}};L(Xu,"type",Xu.register("ESCesiumViewer",Q.ESWidget.type,Xu));let ig=Xu;const JO=`<?xml version="1.0" encoding="utf-8" ?>
|
|
3852
3852
|
<kml xmlns="http://www.opengis.net/kml/2.2">
|
|
3853
3853
|
<Document id="root_doc">
|
|
3854
3854
|
<Folder><name>高速公路</name>
|
|
@@ -3873,7 +3873,7 @@ void main()
|
|
|
3873
3873
|
<Point><coordinates>118.49952,31.69933</coordinates></Point>
|
|
3874
3874
|
</Placemark>
|
|
3875
3875
|
</Folder>
|
|
3876
|
-
`,
|
|
3876
|
+
`,jO=`KML文件本质上是一个XML文件,完全遵循XML文件格式。但是,KML文件定义了几个特殊的元素标签,常用标签为:Placemark:标记或路径 Linestring:路劲的坐标点 Point:标记位置的坐标 Coordinates:经纬度坐标
|
|
3877
3877
|
\`\`\`
|
|
3878
3878
|
<?xml version="1.0" encoding="utf-8" ?>
|
|
3879
3879
|
<kml xmlns="http://www.opengis.net/kml/2.2">
|
|
@@ -3911,7 +3911,7 @@ void main()
|
|
|
3911
3911
|
viewer.clock.multiplier = 30;
|
|
3912
3912
|
viewer.clock.shouldAnimate = true;
|
|
3913
3913
|
}
|
|
3914
|
-
`,
|
|
3914
|
+
`,eL=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
|
|
3915
3915
|
|
|
3916
3916
|
该路径可以使用下面回调函数
|
|
3917
3917
|
\`\`\`
|
|
@@ -3961,7 +3961,7 @@ ${SC}
|
|
|
3961
3961
|
}
|
|
3962
3962
|
|
|
3963
3963
|
\`\`\`
|
|
3964
|
-
`;function eL(t){return new DOMParser().parseFromString(t,"application/xml")}const Os=class Os extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_loadFuncReact",this.disposeVar(p.react(void 0)));L(this,"_clock");L(this,"_resetClockEvent",this.disposeVar(new p.Event));L(this,"_dataSource",this.dv(p.react(void 0)));this._clock=this.disposeVar(new ze(e)),this.dispose(p.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(p.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(p.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(p.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(p.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(p.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(p.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r;r=document.createElement("div"),o.container.appendChild(r),r.style.pointerEvents="none",r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",this.d(()=>{o.container.removeChild(r)}),this.d(this.flyToEvent.don(h=>{e.actived&&this.dataSource&&(h!==void 0?o.flyTo(this.dataSource,{duration:h/1e3}):o.flyTo(this.dataSource))}));const s=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource),this._dataSource.value=void 0)};this.d(()=>s());const a=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:h}=this;h.clock&&(this.startTime=C.JulianDate.toDate(h.clock.startTime).getTime(),this.stopTime=C.JulianDate.toDate(h.clock.stopTime).getTime(),this.currentTime=C.JulianDate.toDate(h.clock.currentTime).getTime(),this.multiplier=h.clock.multiplier,this.clockStep=ze.getClockStep(h.clock.clockStep),this.clockRange=ze.getClockRange(h.clock.clockRange))};this.d(this.resetClockEvent.don(a));const l=()=>{this.dataSource&&(this.dataSource.show=this.show??Os.defaults.show,r.style.display=this.show??Os.defaults.show?"block":"none")};l(),this.d(this.showChanged.don(l));const c=this.dv(p.react(void 0));{const h=()=>{const A=()=>{var f;if(this.uri)if(this.uri&&typeof this.uri!="string")(f=C.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||f.then(d=>d);else return Q.ESSceneObject.context.getStrFromEnv(this.uri)};c.value=(this.data&&eL(this.data))??A()};h();const u=this.dv(p.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.d(u.don(h))}{const h=this.dv(p.createProcessingFromAsyncFunc(async f=>{if(s(),!c.value)return;let d;try{d=await C.KmlDataSource.load(c.value,{camera:o.scene.camera,canvas:o.scene.canvas,screenOverlayContainer:r,clampToGround:this.clampToGround})}catch(g){d=void 0,console.error(`kml加载报错:${g}`),console.error(g)}if(d&&(d.entities.values.forEach(g=>{C.Entity.prototype&&(d.ESSceneObjectID=i)}),f.check(),o.dataSources.add(d),this._dataSource.value=d,l(),(this.autoResetClock??Os.defaults.autoResetClock)&&a(),!!this.loadFun))try{this.loadFun(d,o)}catch(g){console.error(g)}})),u=()=>{h.isRunning&&h.cancel(),h.restart()};u();const A=this.dv(p.createNextAnimateFrameEvent(c.changed,this.loadFunChanged,this.clampToGroundChanged));this.d(A.don(u))}{const h=()=>{if(this.loadFuncStr)try{const u=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=u}catch(u){console.error(u),this.loadFun=void 0}else this.loadFun=void 0};h(),this.d(this.loadFuncStrChanged.don(h))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};L(Os,"defaults",{show:!0,allowPicking:!0,defaultLoadFuncStr:SC,defaultLoadFuncDocStr:jO,data:YO,dataMd:JO,autoResetClock:!0,clockEnabled:!1,startTime:ze.defaults.startTime,stopTime:ze.defaults.stopTime,currentTime:ze.defaults.currentTime,multiplier:ze.defaults.multiplier,clockStep:ze.defaults.clockStep,clockRange:ze.defaults.clockRange,shouldAnimate:ze.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",clampToGround:!1});let qo=Os;(t=>{t.createDefaultProps=()=>({show:!0,uri:void 0,allowPicking:void 0,loadFuncStr:void 0,data:void 0,autoResetClock:void 0,clockEnabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0,clampToGround:void 0})})(qo||(qo={})),p.extendClassProps(qo.prototype,qo.createDefaultProps);const $u=class $u extends Q.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new qo(e,n.id));this.dispose(p.track([o,"show"],[n,"show"])),this.dispose(p.track([o,"allowPicking"],[n,"allowPicking"])),this.dispose(p.bind([o,"data"],[n,"data"])),this.dispose(p.bind([o,"uri"],[n,"uri"])),this.dispose(p.bind([o,"loadFuncStr"],[n,"loadFuncStr"])),this.dispose(p.bind([o,"autoResetClock"],[n,"autoResetClock"])),this.dispose(p.bind([o,"clockEnabled"],[n,"clockEnabled"])),this.dispose(p.bind([o,"startTime"],[n,"startTime"])),this.dispose(p.bind([o,"stopTime"],[n,"stopTime"])),this.dispose(p.bind([o,"currentTime"],[n,"currentTime"])),this.dispose(p.bind([o,"multiplier"],[n,"multiplier"])),this.dispose(p.bind([o,"clockStep"],[n,"clockStep"])),this.dispose(p.bind([o,"clockRange"],[n,"clockRange"])),this.dispose(p.bind([o,"shouldAnimate"],[n,"shouldAnimate"])),this.dispose(p.bind([o,"clampToGround"],[n,"clampToGround"])),this.dispose(n.flyToEvent.disposableOn(r=>{e.actived&&o.flyTo(r&&r*1e3)}))}};L($u,"type",$u.register("ESCesiumViewer",Zr.type,$u));let rg=$u;const Yu=class Yu extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoCircle");L(this,"_geoPolyline");if(this._czmGeoCircle=this.disposeVar(new Bo(i,e.id)),this._geoPolyline=this.dv(new Je(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoCircle,s=this._geoPolyline;{const a=()=>{s.positions=tL(e.position,e.rotation,e.radius)};a();const l=this.dv(p.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.radiusChanged));this.dispose(l.don(a))}{const a=()=>{r.show=e.show&&e.filled,s.show=e.show&&e.stroked};a();const l=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.strokedChanged,e.strokeGroundChanged));this.dispose(l.don(a))}s.loop=!0,this.d(p.track([s,"ground"],[e,"strokeGround"])),this.d(p.track([s,"color"],[e,"strokeColor"])),this.d(p.bind([s,"width"],[e,"strokeWidth"]));{r.outline=!1,this.dispose(p.track([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(p.bind([r,"radius"],[e,"radius"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"ground"],[e,"fillGround"]));{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:Q.ESLocalCircle.defaults.fillStyle.color}};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(a))}}}get czmGeoCircle(){return this._czmGeoCircle}get geoPolyline(){return this._geoPolyline}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this._czmGeoCircle.show=e.show&&e.filled&&s,this._geoPolyline.show=e.show&&e.stroked&&s}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoCircle:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Rn(r,o,i,o.position,o.radius,e,!0),!0):!1:!1}};L(Yu,"type",Yu.register("ESCesiumViewer",Q.ESLocalCircle.type,Yu));let og=Yu;function tL(t,n,e){const o=2*Math.PI/36,r=[];C.Cartesian3.fromDegrees(...t);let s=function(l){let c=new C.Cartesian3(l.x,l.y,l.z),h=C.Cartographic.fromCartesian(c),u=C.Math.toDegrees(h.latitude),A=C.Math.toDegrees(h.longitude),f=h.height;return[A,u,f]};const a=at({initialRotation:"yForwardzUp",rotation:[n[0],n[2],-n[1]],position:t});if(!a)return r;for(let l=0;l<36;l++){let c=new C.Cartesian3(e*Math.cos(o*l),e*Math.sin(o*l),0),h=C.Matrix4.multiplyByPoint(a,c,new C.Cartesian3);r.push(s(h))}return r}const Ju=class Ju extends Ge{constructor(e,i){super(e,i);L(this,"_czmESLocalLineStringZ");if(this._czmESLocalLineStringZ=this.disposeVar(new Yi(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESLocalLineStringZ;i.add(r),this.dispose(()=>i.delete(r));{this.dispose(p.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"strokeColor"],[e,"strokeColor"]));const s=()=>{r.show=e.show&&e.stroked};s();const a=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.don(s))}this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"hasDash"],[e,"hasDash"])),this.dispose(p.track([r,"gapColor"],[e,"gapColor"])),this.dispose(p.track([r,"dashLength"],[e,"dashLength"])),this.dispose(p.track([r,"dashPattern"],[e,"dashPattern"])),this.dispose(p.track([r,"hasArrow"],[e,"hasArrow"])),this.dispose(p.track([r,"depthTest"],[e,"depthTest"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"position"],[e,"position"])),this.dispose(p.track([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(!e.points){r.points=void 0;return}r.points=e.points.map(a=>[a[0],a[1],0])};s(),this.dispose(e.pointsChanged.disposableOn(s))}}get czmESLocalLineStringZ(){return this._czmESLocalLineStringZ}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this._czmESLocalLineStringZ.show=e.show&&e.stroked&&s}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESLocalLineStringZ:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.points&&s.flyTo(e),!0):!1}};L(Ju,"type",Ju.register("ESCesiumViewer",Xr.type,Ju));let ag=Ju;const ju=class ju extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoPolyline");if(this._czmGeoPolyline=this.disposeVar(new Je(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPolyline;r.arcType="NONE";{this.dispose(p.track([r,"width"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"strokeColor"]));const s=()=>{r.show=e.show&&e.stroked};s();const a=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.don(s))}this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"hasDash"],[e,"hasDash"])),this.dispose(p.track([r,"gapColor"],[e,"gapColor"])),this.dispose(p.track([r,"dashLength"],[e,"dashLength"])),this.dispose(p.track([r,"dashPattern"],[e,"dashPattern"])),this.dispose(p.track([r,"hasArrow"],[e,"hasArrow"])),this.dispose(p.track([r,"depthTest"],[e,"depthTest"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"ground"],[e,"strokeGround"]));{const s=()=>{if(!e.points)return;if(e.scale&&e.scale.some(c=>c===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[l]=pr({originPosition:e.position,originRotation:e.rotation,originScale:e.scale},e.points);r.positions=l};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(a.disposableOn(s))}}get czmGeoPolyline(){return this._czmGeoPolyline}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this._czmGeoPolyline.show=e.show&&e.stroked&&s}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPolyline:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(ju,"type",ju.register("ESCesiumViewer",Yi.type,ju));let sg=ju;const ec=class ec extends XA{constructor(e,i){super(e,i);L(this,"_czmESLocalPolygon");if(this._czmESLocalPolygon=this.disposeVar(new Q.ESLocalPolygonZ(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESLocalPolygon;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(p.track([r,"stroked"],[e,"stroked"])),this.dispose(p.track([r,"strokeColor"],[e,"strokeColor"])),this.dispose(p.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"fillColor"],[e,"fillColor"])),this.dispose(p.track([r,"filled"],[e,"filled"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"fillGround"],[e,"fillGround"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"scale"],[e,"scale"]));{const s=()=>{if(!e.points){r.points=void 0;return}r.points=e.points.map(a=>[a[0],a[1],0])};s(),this.dispose(e.pointsChanged.disposableOn(s))}}get czmESLocalPolygon(){return this._czmESLocalPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESLocalPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ec,"type",ec.register("ESCesiumViewer",Q.ESLocalPolygon.type,ec));let lg=ec;const tc=class tc extends XA{constructor(e,i){super(e,i);L(this,"_czmGeoPolygon");if(this._czmGeoPolygon=this.disposeVar(new _i(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPolygon;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"outline"],[e,"stroked"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(p.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"fillColor"])),this.dispose(p.track([r,"fill"],[e,"filled"])),this.dispose(p.track([r,"ground"],[e,"fillGround"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(!e.points)return;if(e.scale&&e.scale.some(c=>c===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[l]=pr({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},e.points);r.positions=l};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(a.disposableOn(s))}}get czmGeoPolygon(){return this._czmGeoPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(tc,"type",tc.register("ESCesiumViewer",Q.ESLocalPolygonZ.type,tc));let ug=tc;const nc=class nc extends Ge{constructor(e,i){super(e,i);L(this,"_czmLocalRectangle");if(this._czmLocalRectangle=this.disposeVar(new Q.ESLocalPolygon(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmLocalRectangle;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(p.track([r,"stroked"],[e,"stroked"])),this.dispose(p.track([r,"strokeColor"],[e,"strokeColor"])),this.dispose(p.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"fillColor"],[e,"fillColor"])),this.dispose(p.track([r,"filled"],[e,"filled"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"fillGround"],[e,"fillGround"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"scale"],[e,"scale"]));{const s=()=>{const a=e.width??0,l=e.height??0;r.points=[[-a,-l],[-a,l],[a,l],[a,-l]]};this.dispose(e.widthChanged.disposableOn(s)),this.dispose(e.heightChanged.disposableOn(s)),s()}}get czmLocalRectangle(){return this._czmLocalRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmLocalRectangle:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(nc,"type",nc.register("ESCesiumViewer",Q.ESLocalRectangle.type,nc));let cg=nc;const ic=class ic extends Q.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new Q.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends p.Destroyable{constructor(a,l,c){super(),this._subContainer=a;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h));{const d=()=>{const g=i.getCameraInfo(),v=g==null?void 0:g.position,m=[...g==null?void 0:g.rotation];m[0]=360,Be(i.viewer,v,void 0,m)};h.addEventListener("click",d),h.style.cursor="pointer",this.dispose(()=>h.removeEventListener("click",d))}{const d=()=>{h.style.display=e.show??Q.ESNavigator.defaults.show?"block":"none"};d(),e.dispose(e.showChanged.disposableOn(d))}{const d=()=>{h.style.width=`${e.cssSize?e.cssSize:Q.ESNavigator.defaults.cssSize}px`,h.style.height=`${e.cssSize?e.cssSize:Q.ESNavigator.defaults.cssSize}px`};d(),e.dispose(e.cssSizeChanged.disposableOn(d))}h.style.position="fixed";{const d=()=>{h.style.top=`${e.cssPosition?e.cssPosition[0]:Q.ESNavigator.defaults.cssPosition[0]}px`,h.style.right=`${e.cssPosition?e.cssPosition[1]:Q.ESNavigator.defaults.cssPosition[1]}px`};d(),e.dispose(e.cssPositionChanged.disposableOn(d))}h.style.transition=" right 0.4s linear",h.style.transition=" right 0.4s linear",h.style.cursor="pointer";const u=document.createElement("div");h.appendChild(u),this.dispose(()=>h.removeChild(u)),u.style.width="100%",u.style.height="100%",u.style.position="relative";const A=document.createElement("img");u.appendChild(A),this.dispose(()=>u.removeChild(A)),A.style.width="100%",A.style.height="100%",A.style.border="none";{const d=()=>A.src=e.imgUrl;d(),e.dispose(e.imgUrlChanged.disposableOn(d))}const f=p.createAnimateFrameWithStartValues(()=>{const d=i.getCameraInfo(),g=d==null?void 0:d.rotation[0];A.style.transform=`rotate(-${g}deg)`});f.start(),this.dispose(()=>f.destroy()),A.style.transformOrigin="50% 50%"}}}get customDiv(){return this._customDiv}};L(ic,"type",ic.register("ESCesiumViewer",Q.ESNavigator.type,ic));let hg=ic;const nL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAEACAYAAADFkM5nAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNzdjMTM2OS1jOWY2LTNhNGEtOWM3My01OTJmNWM0Mzg3NjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjJCQzhDNzQyRkFGMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjJCQzhDNzMyRkFGMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmE0ZWU5OWFlLTUyNmYtODY0ZC05OTk0LWQwMzE5MTdjZWUyZSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjdiN2Q4YjQzLTM4ZDktZjI0ZS04MjIyLWI3MTdiMGQxZDY3MiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrRBvqMAAAx2SURBVHja7N1/qF51HQfwM5FhMmSIyLBYsmSImQzZhrPMWU1zqKGiVkuHyZQlS1ZYVg6pIVELppg/1hKVUhgi5RY49A+VzMI7QkRusSLWCJMV4xJjLVk9fb48Z3rddrd7n/vc557v+b5e8OFe73Yv5/k47ud9vuc83zOj0+lUAEBZTtACABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAQAAAAAQAAEAAAAAEAABAAAAA8nGiFgBHsfAoX9uhLSAAAO0e/ldHfXvU1w5EPR71qDAA7TCj0+noAjB6+L8YNesYf+epqI1CAAgAQHuG/zNRc8fxd0eirqxXBgQByJCbAIFDbhjn8E9mR/26Dg0LtQ4EACDfs/9revi+h6OWCwGQHzcBAofM6/H7vhu1p/7c5QCwAgBkZM0kvz+tBJxtJQAEACAvM/vwM34WtVgIgDx4FwCQ/D1qTp9+1qL6o8sBYAUAaLB0xn56H3/e0KifCwgAQEG/C4a0FAQAoEzPWAUAAQAoT9pUaLMQAAIAUJ4FUTcKAdA8NgICptpXo06qP/fOALACABTk1qg7rASAFQCgPF+K2mUlAAQAoDx3R/1HCAABACjP+qjdQgBML/cAANPhiahZlXsCQAAAivNi/VEIAAEAKIwtg0EAAAplt0AQAIACpd0CnxACQAAAynNO1ANCAAgAQHkuiLpXCAABACjPpVFfFwJg6tkICGiaz0e9VX9uoyAQAIApMr+Bx/S1qINCAEwdlwCAeQ09rm/Ux+ZyAAgAwBT4WIOPbUvUHCEABACgv9JgvWaMP9vXkGPc5n8TCABA/411L9CsBh3jNqsAIAAA/XNeJseZLgM8JwSAAABMXhqmqzI63tOEABAAgP64ILPjTSHAcwNAAAAmcfb/mUyP/RwhAAQAoHffz/jYUwj4lhAAAgAwsbP/T7TgdaS3L64RAqA3tgKGMm1syeu4KepP9ee2DAYBADjG2f/DLXtN66N2CwEwMS4BQFnDf0HVziXzdFPg/MrlABi3GZ1ORxegjOGfDLX8dS6yCgBWAID3GyrgNf7WKgAIAMB7Z/+lPFAn3df0GyEABAAw/KtqbdXdS78UMysbBcFxuQcA2j3810VdVejrH45aWbknAAQAKGjwJ7+I+lDhvXil6q6ACAEgAEARw39IK961teruFSAEwCjuAYD2DP5Utxj+R0iXQDw3AKwAgLP+Qq2Ket1KAAgA0JbBvynqfO0Yl5uj3hQCQACAXId+8nTUmVoyYUuiDgoBCAACAOQy8JM7o67XlklbVH8UAiiWpwFC84Z8cm7UJVHLo07Tor4bGhUCwAoAMLAhf0rU3HrIp2HvGv7gjUQtswqAAAD0e9CnIT+nPtO8MGqx9jTOzqgVQgACADDRIX9G/THdWHZW1NLKkn1u/hZ1tRCAAAAcPuQP/fdH6o9p6M/XolZ5Lep2IQABAMoc9Oma/OeiTq3rQu0pyhtVdydFIYAieBcApQ35U+shP6/q3nyX/vtkLSKcF3Vt/bkQgAAAmQ77dD3+tqjTq+6S/WytYRzuivqHEEAJXAKgTUP/nqgLKjfhMXm2DEYAgIYP/fRWuxcqT7ak/+wWiAAADR3+nn6HEAACAAUN/rTUf4V2IASAAEAZwz/drf+yViAEwOS5bkouw3+14c80crkJKwAwDcN/fdRntYJptj/qYqsAWAGAwQz/+w1/GiJdgnqyOvrjm0EAgD6f+duOlyZJz4B4UAhAAICpG/73OPOnodJjndcIAeTOVsA0cfinbXy9zY8muylqb/25ewLIkpsAaWIAcMc1uUg3Be4XAsiRSwA0bfg/pw1k5OVR/3ZBAIAeh/+CyoN8yM+QEIAAAJOzWQsQAkAAoKyz/7XagBAAAgDl+aIWIASAAEBZZ/9rtIEWhgAQAOA4btICWuY5qwAIAADlSe9muV8IQACAsX1TC2ip9ByL1UIATWUrYKZT+sW4VBtosS9HvVV/brdArADAKDb+oe3ujjrDSgACAEB5nq0/CgEIABDO1gIK4u2BCABQu1wLKMwqqwAIAFBVM7WAwtyqBQgAAGXaZhUAAYDSeRsqJZrj3z4CAECZ7BKIAABQoMVagAAAUKZPWQVAAKBUroNSsh9oAQIAACAAAAACAEBbrdACBACA8qSdAd0IiAAAUJiTtQABAAAQACjCQS0AEAAAAAGAAtgICEAAAAAEAABAAAAABACANhjWAgQAgPI8ELVDGxAAAMpi+CMAAAACAEDbjWgBAgClshUwJUuPAnYJAAEAoDB7tAABAKAsP9ECBACA8myuLP8jAFAw9wBQooe0AAGA0r2jBRToMWf/CACU7oAWUJjVWoAAAFX1rBZQkOH6zN/ZPwIAxXtLCyho+K80/BEAAMpi+CMAwGHe1gJabpEWIADA+6Uzoq3aQIvdOOrfOggAMMpmLaCl0h3/fzT8EQBgbJ6KRtv8qHLHPwIAHFP6BblBG2iR7VFbDH8EADi+57WAFg3/dYY/AgCMnx3SaAPDn2ycqAU0gF+Y5G5/1MXagBUA6M1lWkCmLq7c9IcAAD2vAuyNek0ryOzM30Y/ZGlGp9PRBZpkYdSQNpCBg1FLnPVjBQD659NaQAYuMvwRAKB/0i/Uf0V9RytosBvrFQDIlncB0NQQkHwg6m7toGFs8YsAAAMIAenf6F3aQUPcV7nbHwEABhYCKiGABngo6knDn7bwLgBykN4ZcEbUs1rBNPl91G2GPwIATE8ISF6Imq0dDNBw1ErDHwEApj8IXBp1r1YwADujVhj+CADQrNWATVHnawdT5ND+/oY/AgA0NAjcH3WhdtBHdvlDAICMgkAKAZdELY+aqS1MwiLDHwEA8g0E6V6BD0bNizo76kytYRyW1CsAAgACALQoFCRn1aHgw1ELok4XDqila/77DX8EACgvHMytA0EKB1fVYcHlhDLcEfWq4Y8AAIwOB2nXzFOr7oZEH436ZOUdCG2SHj71vOGPAABMZNWgqlcN5lfdRxnPr4s8PBL1qOGPAABMRThI9xxcFnWF9jTKU1EbDX8EAGCQweBQOEg3Ii6LWqpFA7U9ap3hjwAANDEcpGDwlcqNiP22K+o6wx8BAMglHJwS9UzlgUiT8UbULYY/AoAAALkGAg9FmriRqruqYvgjAAgAkH0QWBq1QTvGxRa/UDtRCyBbOw4bbMmWqvuOA44+/AErANDaVYEhbTjCtVG7nf3De07QAmjlme52bXjXasMfrABASSsBSyv3BqyNesXwBysAUIo08F6KurngHvzY8AcrAFDySkC6KXBLYa/7vqgnDX+wAgAlrwT8JerOgl7zVsMfBADgvcsBWwt4rb+LWm/4w/G5BADlaPtbBNPQX234gxUA4Eht3gzH8AcBABjjDDlZJ9gALgFAedp2KWBJ1EFn/2AFADi+a1v0Ogx/6IGHAUF5Dg3L9Gjc2Rm/jhsqW/yCFQBgwiEg570Bflh19zcw/EEAACbo9UyP+6dRTxv+IAAAvXsks+NNmxltMvxBAAB6l4botsyGv13+QAAA+mDPMf5sX4OO8yXDHwQAoL+Gx/j6rAYd452GPwgAQP+kofqrhh+jXf5AAACmwF8zGP7O/kEAAPpsuKHHdaXhDwIAMHX2NfCY0i5/bxv+IAAA5bDLHwyAZwEATfK9qrs3geEPVgCAATjYgGN43PAHAQAYrOleDUy7/D1o+IMAAJTDFr8gAACFGTH8QQAAyrPM8AcBACiLLX5BAAAKY5c/EACABvjfgIe/Xf5gms3odDq6APx3QCcEt0e9ZviDFQCgGQaxEdA6wx8EAKCsAJCG/3bDHwQAoFmmcifAhwx/EACAslYAfh71mOEPzeMmQCD5d9RJff6ZO6NWGP4gAADlBIB3oj5u+ENzuQQAJLv7/PMMfxAAgAzs7OPPssUvCABAJvb06edcVH909g8CAJCBP/ThZ1wedcDwBwEAyMdL9fDu1Rei/mn4gwAA5CUN7ld7/N7rov5s+IMAAORpYw/fsyxql+EPAgCQr/SI3l+O8+++WXXv9h8x/CFPNgICRltYdbfuPXeMP0/3CayPet7gBwEAaF8ImBe1YdTX9kZtqoe+wQ8CAACQI/cAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAE32fwEGAMnMSDh4qI2qAAAAAElFTkSuQmCC",iL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAEACAYAAADFkM5nAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNzdjMTM2OS1jOWY2LTNhNGEtOWM3My01OTJmNWM0Mzg3NjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NkJCOEQ5RUQyRkIxMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NkJCOEQ5RUMyRkIxMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmE0ZWU5OWFlLTUyNmYtODY0ZC05OTk0LWQwMzE5MTdjZWUyZSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjdiN2Q4YjQzLTM4ZDktZjI0ZS04MjIyLWI3MTdiMGQxZDY3MiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmdWjtQAABYrSURBVHja7N0L9HZTnQfwbWrNtNZQRteJpBvpMiLkkstErlGKilJC94uRS7ohFU1rpqRJy9JFpXLJpUgSDbpIEc1MMmqV0lsuMciExDv7t85+12rNwvunZ5/9PPv5fNb6La3V6xzf/37+7/k9Z5+9zzKLFy9OAMB8+Ss/AgDQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADcCs2DrXd3M9WSa5GtiiZHpKZ2O1Za4L5AINwDRaJtc7c52ea/1cF+Z6YQeZ3vH/Mu3Q6Vi9oINMB+Q6488yvaiTsYpcX821nlyQPzyLFy/2U5gey+U65m4u+DFIh+U6MNedMk19rkNLrrtmLNOyuT6da8e7yfTB0uzM4lgtW8bqRXeT659zvUsuNAC0tFquU3Ktfi9/5sxcL8t1w4xkWrVkekpHmRaa62u5Xj5DuZ5UMj31Xv7M2blemuv6GRqryHXqUsbqrFy7yMW8MQUwHbZLw6271Zfy57bK9YNca8xIpu+npc9JzlKm+5Jr6xnKtW3J9NSl/LnNc12Ua80ZGavnLXCstihj9Qy50AAw5s//4FxfzvWQBf47j0/Dw1k7T2mmmJM8qHw76SVTr7ki07tzfSXX8gv8d1bJ9Z1cu075WB1Yfq8WmutxZazkYm6YAmgnLiKfK98o76+P5No315+mJNODS6bt/4JjHJ5rvynKNKlcH861f2djdUT5/N3R2VjJhQaAauLWXcy3rjqBY52X68W5rm2cafWSabWOMk0617kl13WNMz25ZJrEssVvlUxXdzZW55dc18hFr0wBjC+e2L1wQhf/sEmui3Ot2zDTC0um1TrKVCPXprl+2DjXC0qmSe1ZsFEangtYv/FYRa7vTXCsNi6fwWfJhQaAv9QDcr0/14lpWL4zSSuVzn6PRpm+lIZlcT1k6jVX/K4fkuvkNNxOnqQVc/17rtc2+jvsfRVznScXvTIFMI4Vcn0+DU+813ZUrr1y3S6TXMXyJdM2I2T6ZK43jjRWcs1WLjQAc+cfShf/hBHPuWQ3sEUVM8Wc5ONHzBS3QXesmKlVrti+daeKuZ5WMj1xxEzfL2N1VcVzPL38Xo2dK36vfi0XPTAFUN+bR774h5jfi3m+jSsd/y0jXyTDepUztcoVc+cxh75RpeO/ceSLSVi3jNWmFc/RMtcmcqEBYCFenWvvNP7yr0emYee2t1Q49p4dZmqZ61G5zqmU6/XluGMv/Xp4rm+Un2cNr2uU6xHlM7iXXMw6UwDjiW+ux5e/7McW64fjgZ9bJ3zcTUqmR3aUqddcG+Q6IQ0PgI3ti6W5+kOFY29Ycj1arpnIhQZgbsVfvrEKoMWSqUvTsKztFx1luqRkurKzsaqV61Glsdm4QaYflUw/r3BsuWYrF1PCFMC44kGvTXMd2eDcsR947Au+RUeZYk/6iypkmpZcm0/4uLFZz2Zp2JVwbGuUz9/WFY69JNfhDXNtJRcaAJbmj2l40OeVqc7t63vz0DS85z3eH75MhUy75bqtk0zTkOvMCrni+Ya3puGtfreMnCmWWJ6ehtcKT3qsIlc8b7Bzw1zvkItZYgqgrfimd1IaXtgxtpPKhe0WmeY2V7z9L5acrdog06mlCb65wrFb5jqljJVcaABY0De9Y1ObW22X5doh1xUVMsVGJlt2lKnXXLHL3DHl2GO7vJz38grHjlyfzfV8uWYiFw2YAmjv+jS8jz22/Ry7G4uXEsU83/aVMr2/UabY2GS7imPVU674RhebwMRt3jtHzhTvI4hNq15Q4dg3l4vVO+WaiVy4AzD3ti/d/UNGPu/i0oAcnOsumaY+1yGlJp0rHjr8QhrW8I+d6bA0vOu+xkUtcsXStoc1yHVoyXWXXGgAWJonpWGe72kNzh0P070s140TPm7MWZ7UWaZec62chpcgrdMg05kl0w0Vjr1yGau1G+T6Wsn1P3IxTUwBTJ+fpmHb2y80OHe8fCSmBJ4+4ePGvPX65dtKL5l6zfWrNGxL/IkGmbYqmdaocOyWuWLp40VyoQFgIf63dNaxLefYW4LGPuTfTcMysUmKJ9h3aZzpJRWO3WOueDNcbGEdu8GNvfzx8SXTzhWOfZtcM5WLykwBTL/YEjR2A2uxheu/pmEd+qT3xn92yTT2NqeLS6a3pzr7/bfOFWM16Tn0Z6bhFvNjG3z+YgOc/SqN1dol18oNcsVGTPvLhQaAhYgtQY9Lbd7W9c1yN+C6CplabXNaK1PrXOeUb2KTzhXLH2Oa47kNMp2X68W5rq1w7Ja5zi25rpOLVkwBzIbYEnTz8i1v7I7tOWmY53tmhUyxzemHOsrUOtdmlXLF8seY722x/DGa3nhV7boVjr0k16ENcm1acq0jF+4AsFA75fpUrmVHPm/MLcarZY+Raa5ztVr+GM8lxLbMn6x0/OeXXA+WayZyoQGYW7Ehxynln2P7eK5/SsM++ZO0ehqWP7bIdGTJVOMhvh5ztVyqelQaHri8vcKx5ZqtXGgA5tay5dvlTg3O/d1y3t9M+LjLlUw7Nsj0nTTMXf6mwrFb54qx+u2Ej/u3uY5ObZ7+/l75WS6q9HsVuV7aINcFZazkYhSeAZhdsfwsln/tk8Z/6naDNMw1bzjh4/6+XIT3bZBpw0qZpiHXxRVyxVLVXVK9Oyf3Zr2SaeNKv1fR1OzdINf65TP4bLlwB4CFigelYpXAo0Y+7x3lAnBkhWNvmoYnmXvK1Guu2IgmVj78fYNM0VQdUen4Pec6odFnsGYuNABz69HlL6sWXfYxaXjobNKbkKxYGpueMvWaq+Xyx8/lem2uWysc+1HlYrmRXDORi/vAFEA/Yu46lrcd3uDcu6VhrnnSm8UsKpk+0ijTt1OdDVV6zNVy+eOu5fP3uArHvrqMVctcq8iFOwAsVMw3x/KbsZef/S4NDxmdU+HY8bzDJxpkig1Ndq6UqXWuGKtvVjh2PKAXDz0uN3KmWP8ezyWcVen4O5Xfqxa5YqzOlgt3AFiauLUXG6dcPvJ547WkX0/DPN8yEz523F5+VoNMD6+YqXWusyrl+lL5/F02cqbYAS/eknhApbE6seT6SYNc8abE/eXCHQAWquVSwbiwxctJbpnwcVsuqauVqddcy5a7Gy9pkCn2w9+t0ljJNVu5cAdgLi1ZKvjWNP7yszhvrP990oSPu2RJ3T6NMsUeCE+scOwec8XnL27xtlgq+KJcF+ZatdLvVeTaW66ZyIU7AHOv1dKfG9Pw0M/pnWWK1zWf0eFY1coVKx5i5cPYb7W8Kdcrcn2l0vFb5orfq9Mq5mrxZsvauXAHYC59K9ea5Z9jWj7Xl3MdlCY/zxdZ1mqU6bRKmXrNFSsP4lW1542cKd5ZcGquQyr9fdcyV/xeHVwx1zM7zIU7AHPtgbk+mIbbsmM/eHNa6e5vqpRp7wY/z1qZes0VmQ5Lw1TH2J+/M8odjhsrjVWrXF/N9fKKuT6QhmnEnnKhAZhrn0/DkqmxxbexHWSa+1yfScOt+bHFVNR2FY/fKlc0bNvLxX3hFsv8eVAa1vy2uKCcVL5V1sj0qUaZvlQpU6+5ItPRjS4mp5Y7AKmzXCdXzvWJDnOhAZg7sVNa7MC1+8jnvTPX29OwHPGWCpniCfZXNcj0tjQ8uX9LpbHqLVfsFBnPNew5cqa7cr0r1wtz3Vzh+K1yxVi9Mw1LR39f4firpOFZgD06y0XxQD+CubFNGvbgXmHk89bcnW3bXJ9tlKnmDmY95toq17Fp2PxlTDeUb5FnVjq+XLOVC3cA5m6MD07DXNrYF5RLc61T4eIfmd6ThqVdY2e6JA1PfZ9daax6yxWZDkzDA11jX0x+VD5/Z1Yaq15zHdRhLtwBmDsPLd/6t25w7vj2EG/8+kOFTMeWbyhjq/kWsx5zrVDuZGzbIFO8cnnPCp+/3nPFZ2GbznLhDsDciTW8FzW4+McOYnul4QGySf8yr10ybdUo0ysqXfx7zLVmyTT2RTJ2UYwla7tUupj0mmutkmubznLhDsDciYd2/i0NT/CO6Zo0PDx2foVjx7eDj3aWqddc8eDikQ0yXVcynVvp+L3mioeCP9ZhLjQAc+VB5Rd59wbnjn28Yz/vRTLN9VgdkevVDTL9oGS6qtJY9Zrro2n81Qu1c7FApgD60WqJX4j1z5tUuKAsWQrXU6Zecy1ZCtfiIhl7JWxc6WLSMlfs17FRpVyrpDZLF2vnQgMwd7YuHfVaI5/39lyvKXX7hI8dc5ExJ7lmR5l6zbVlrovT8CzDmP6Y6w1pmPK6rcLxW+WK8XlduTjX+AxuVT6DveVCAzB34xdLdmJ707GX7Cwq3ySPrpSpxbLFWpla5/p1pVyxN3xssHNGg8/fb3L9Y66PVzh2y1yLSq6jKuV6d2qzxK9mLu4nzwDMrr9Lw5KdFkuR4sGxeHjnmgqZjk1tliHVypRS2+VV55Vc1074uMuXTM9rkCmmumJXyd9WOHbLXN8uua6ulOvYRn9f1MyFOwBz5xlpuDXZ4pc5HobavMKFckmmFhfJj+TarNLFP3Jd1DDX5hUu/mukYcqpxUXyY+WbZI2L/xplrFrkilU7z6l0kVzyGdy2s1xoAObOK9PwANnjRj5vrBOP9eKxbvyOCpkuaJAp1h3H60bj1ch/qjRWveXatXz+njhyptvKz/NNFT5/f57rCY1yvbliru90mIsJMAUwO/4m14dzvb7Bua9Mw4tULqmQ6fA0PBg0tl+UTJdWGqvecv11rg/lemODTL8smX5Y4dg954q/L97QWS40AHNnpTS8nvVZDc4d+/jHLl3XT/i4j8l1YmeZluSKsVq3o1wrlrFav0Gmc9LwgqLfVTj2imWs1pNrJnIxYaYApt9zSic99oVyca4PpGHu+voKmS7uLFPYrORat6Ncm5bP3/oNMv1LGpbi1biY/GPJtZ5cM5ELDcBciSU7byvf6h4+8rnjPfDx1O7b0/BubpmWnuuAXF/vbKz2zfWNXI9okGnnXPtVGqt9y2dQrunPRUWmAKbTg3Mdk2uHBue+opz3MpnmNtdyadhdb8cGmX6Whvnj/6xw7Mj16TRsQTu2n5Zc/1XpM/ipDnOhAZg7T8l1cq7VGpw7NqmJp4ZvkmlBnlpyrdpRrifnOqX8c2yx8c7Lct1Y4dirl7Fqkev0MlZyMVVMAUyX2LDlwgYXyrtyHZzr+RUuKD1mCi/J9b0GF//IdVClXPEN8vsNLiYxf/zeXNtVupi0zPWeMlZy4Q4A9zgOh+XaJw1zeWO6sXTxp8u04FzxwN1bG+V6WfmmPEkPyPX+XPs3yHRzGauvVDh25Do0DXPTY+e6qeQ6TS40ANyTeGjs+DQ8vTu2H6dhDvmnMi041wlpeDJ+bDEnHnOtP5vwcR+W67g0rGAY22Ul039XGqsvNswVn8Er5GKamQJoK5aLXdzoQhnrutercKFsmen4SplCLFn8YaOLf+TaoMLFf+0yVi0uJieVn2mNi3/kuqhxrivkQgPAPYn3i8cLaB4z8nljmU4sxYs57Fs6yhS3Q3eukCnEK3TjpTordZRr9zS8D37lBpliyeJOlcZqD7lmKhcNmQIY34PS8IKMPRqcOzboiF26zpFpbnPFNsVHlKZmbLFJUexUeFaFY8s1W7nQAMyd6N5ji851Gpw7bl/HfOsvZVpwrrjtuXZHuVpuKX1pyfSLCsdeqYzVunLNRC6mhCmA8cS83UWNLpSfzbVhhQtKj5n+PNfaHeXaNLXZUjp8vmSqcTFZsvXtunLNRC40AHMllunEPG6LbWLjNZzxOs54LedtMi0o1/4d5oqlmN9okCleRRyvJI5XE/+hwlhFrrMajdVecjHzF6fFixf7KdR1ZGrzCt+r0/DgzrdlmutcR5TGYmzXpmETqPMqHf+jud7UINc1Jdf5cqEBYGniifjYqnPM28kXlAvKIpnuc65Tc63VUa4Vy1iNeSs5dqeLXep+XfEcLebHLyy5FslFD0wB1HdVro1yfW6k8x2VhvnDRTLdr1wx93nsSLk+noa5+Zq54tibpOElOGP4ZK6NK1/8Uzl+5PrMSLmOLudbJBcaAO6LmNN9Ra690zAvWsPtufbM9bryv2W6/7l2rZwrzhFLC9+Q648jZYp1/29JwzxvrbF6bRmvMcdqt5Kr5mfwNaXkoiumAMYX32RjO9mHTfhbw5IXg8g0Oc9Jwy58k8x1Vcn1g0aZ4tte7AI5yQfMFpVMFzYcK7lmKxcagLn12DS8cnXNCRwrHrKKh3eu7SjTuSXTdVMwVqukYQ69p1yTfNbh/JLpmikYq5XLZ1Cu2chFY6YA2og13s9Ow0s9/hIfzrX5FFz8J53puVNy8Q9XllzHdZRrUs86HFE+f9NyMflVGSu5ZiMXGoC5FetsY5vNWE9/5/38d+OVtH+SaZRcsR///h3lWvKsw/3577o1Dc9/xJrxO6ZsrG4tufaRayZy0ZApgOnw3PLN+aEL+LM/T8MWnT+SqVmuuBuwQke5NiuZFvKsw5Ul0yUzMFaR6/gFfgblwh0Amohd2mLd738s5c+dmYZtd38kU9Nc63SW65zy33rpUv7c2WnY+2FWLibnlP/epY3BWXKhAaCl+LYY73w/4W7+v7hNc2iu5+W6QaapyBVz6Cd2lOvKkum4e8j0wVxbpeENcWnGcm1wL7k+kGsbuZhHpgCmcExyvS3X+3I9INfv07Am+GSZpjLXAbneW3LdnOtVHeSKZzgOK5niHfC730OzM2tjtV9pzpbkis/gSXKhAWDabJ3rwPKX709kmolccfG/vJNMW+Q6JA0bFv24o7HaMtfBJddlcqEBAADmimcAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAHDv/k+AAQD4HcieQJZ+TQAAAABJRU5ErkJggg==",rc=class rc extends As{constructor(e,i){super(e,i);L(this,"_signal");if(this._signal=this.disposeVar(new tr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._signal;this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),r.color=[1,1,1,1];{const s=()=>{r.show=e.show&&e.materialMode!=="pureColor"&&e.stroked};s();const a=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.materialModeChanged));this.d(a.don(s))}{const s=this.disposeVar(p.createNextAnimateFrameEvent(e.pointsChanged,e.speedChanged,e.materialModeChanged,e.strokeWidthChanged,e.strokeMaterialParamsChanged));this.dispose(s.disposableOn(()=>c()));const a=iL,l=nL,c=()=>{var v;if(!(e.points&&e.points.length>=2))return;r.width=e.strokeWidth*2;const h=((v=e.strokeMaterialParams)==null?void 0:v.Elongation)??5,u=this.sceneObject.getDistance()??0,A=Math.ceil(u/(10*h)),f=A;r.repeat=A;const d=e.speed;r.duration=u/f/d*1e3;const g=e.materialMode;g==="singleArrow"||g==="purple"?r.imageUrl=l:(g==="multipleArrows"||g==="blue")&&(r.imageUrl=a)};c()}}get signal(){return this._signal}flyTo(e,i){const{sceneObject:o,czmViewer:r,signal:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,signal:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(rc,"type",rc.register("ESCesiumViewer",Q.ESPath.type,rc));let Ag=rc;const sr=class sr extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_czmCustomPrimitive");L(this,"_geoBoundingSphere");this._czmCustomPrimitive=this.disposeVar(new st(e,i)),this._geoBoundingSphere=this.disposeVar(_0([this,"positions"]));const{czmCustomPrimitive:o}=this;this.dispose(p.track([o,"show"],[this,"show"])),this.dispose(p.track([o,"allowPicking"],[this,"allowPicking"]));const r=this.disposeVar(p.react(0));{const s=()=>{if(!this.positions||this.positions.length<3){o.show=!1;return}o.show=!0;const[l,c,h]=fn({originPosition:this.positions[0]},this.positions);o.modelMatrix=c,o.cull=!1,l.push(l[0]);const u=l.length,A=[...l,...l.map(m=>[m[0],m[1],m[2]+(this.height??sr.defaults.height)])],f=l.reduce((m,w,_,E)=>{if(_===0)return m.push(0),m;const T=_-1,P=E[T],F=Math.sqrt((P[0]-w[0])*(P[0]-w[0])+(P[1]-w[1])*(P[1]-w[1]));return m.push(m[T]+F),m},[]);r.value=f[u-1];const d=f.map(m=>m/r.value),g=[...d.map(m=>[m,0]),...d.map(m=>[m,1])];o.attributes={a_position:{typedArray:new Float32Array(A.flat(1)),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(g.flat(1)),componentsPerAttribute:2}};const v=o.computeLocalAxisedBoundingBoxFromAttribute("a_position");if(!v){console.warn("包围盒计算存在问题!");return}o.setLocalAxisedBoundingBox(v.min,v.max);const y=[...new Array(u-1).keys()].map(m=>[[m,m+1,m+u+1],[m,m+u+1,m+u],[m+u+1,m+1,m],[m+u,m+u+1,m]]).flat(2);o.indexTypedArray=new Uint16Array(y),o.vertexShaderSource=` in vec3 a_position;
|
|
3964
|
+
`;function tL(t){return new DOMParser().parseFromString(t,"application/xml")}const Os=class Os extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_loadFuncReact",this.disposeVar(p.react(void 0)));L(this,"_clock");L(this,"_resetClockEvent",this.disposeVar(new p.Event));L(this,"_dataSource",this.dv(p.react(void 0)));this._clock=this.disposeVar(new ze(e)),this.dispose(p.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(p.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(p.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(p.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(p.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(p.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(p.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r;r=document.createElement("div"),o.container.appendChild(r),r.style.pointerEvents="none",r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",this.d(()=>{o.container.removeChild(r)}),this.d(this.flyToEvent.don(h=>{e.actived&&this.dataSource&&(h!==void 0?o.flyTo(this.dataSource,{duration:h/1e3}):o.flyTo(this.dataSource))}));const s=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource),this._dataSource.value=void 0)};this.d(()=>s());const a=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:h}=this;h.clock&&(this.startTime=C.JulianDate.toDate(h.clock.startTime).getTime(),this.stopTime=C.JulianDate.toDate(h.clock.stopTime).getTime(),this.currentTime=C.JulianDate.toDate(h.clock.currentTime).getTime(),this.multiplier=h.clock.multiplier,this.clockStep=ze.getClockStep(h.clock.clockStep),this.clockRange=ze.getClockRange(h.clock.clockRange))};this.d(this.resetClockEvent.don(a));const l=()=>{this.dataSource&&(this.dataSource.show=this.show??Os.defaults.show,r.style.display=this.show??Os.defaults.show?"block":"none")};l(),this.d(this.showChanged.don(l));const c=this.dv(p.react(void 0));{const h=()=>{const A=()=>{var f;if(this.uri)if(this.uri&&typeof this.uri!="string")(f=C.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||f.then(d=>d);else return Q.ESSceneObject.context.getStrFromEnv(this.uri)};c.value=(this.data&&tL(this.data))??A()};h();const u=this.dv(p.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.d(u.don(h))}{const h=this.dv(p.createProcessingFromAsyncFunc(async f=>{if(s(),!c.value)return;let d;try{d=await C.KmlDataSource.load(c.value,{camera:o.scene.camera,canvas:o.scene.canvas,screenOverlayContainer:r,clampToGround:this.clampToGround})}catch(g){d=void 0,console.error(`kml加载报错:${g}`),console.error(g)}if(d&&(d.entities.values.forEach(g=>{C.Entity.prototype&&(d.ESSceneObjectID=i)}),f.check(),o.dataSources.add(d),this._dataSource.value=d,l(),(this.autoResetClock??Os.defaults.autoResetClock)&&a(),!!this.loadFun))try{this.loadFun(d,o)}catch(g){console.error(g)}})),u=()=>{h.isRunning&&h.cancel(),h.restart()};u();const A=this.dv(p.createNextAnimateFrameEvent(c.changed,this.loadFunChanged,this.clampToGroundChanged));this.d(A.don(u))}{const h=()=>{if(this.loadFuncStr)try{const u=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=u}catch(u){console.error(u),this.loadFun=void 0}else this.loadFun=void 0};h(),this.d(this.loadFuncStrChanged.don(h))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};L(Os,"defaults",{show:!0,allowPicking:!0,defaultLoadFuncStr:SC,defaultLoadFuncDocStr:eL,data:JO,dataMd:jO,autoResetClock:!0,clockEnabled:!1,startTime:ze.defaults.startTime,stopTime:ze.defaults.stopTime,currentTime:ze.defaults.currentTime,multiplier:ze.defaults.multiplier,clockStep:ze.defaults.clockStep,clockRange:ze.defaults.clockRange,shouldAnimate:ze.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",clampToGround:!1});let qo=Os;(t=>{t.createDefaultProps=()=>({show:!0,uri:void 0,allowPicking:void 0,loadFuncStr:void 0,data:void 0,autoResetClock:void 0,clockEnabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0,clampToGround:void 0})})(qo||(qo={})),p.extendClassProps(qo.prototype,qo.createDefaultProps);const $u=class $u extends Q.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new qo(e,n.id));this.dispose(p.track([o,"show"],[n,"show"])),this.dispose(p.track([o,"allowPicking"],[n,"allowPicking"])),this.dispose(p.bind([o,"data"],[n,"data"])),this.dispose(p.bind([o,"uri"],[n,"uri"])),this.dispose(p.bind([o,"loadFuncStr"],[n,"loadFuncStr"])),this.dispose(p.bind([o,"autoResetClock"],[n,"autoResetClock"])),this.dispose(p.bind([o,"clockEnabled"],[n,"clockEnabled"])),this.dispose(p.bind([o,"startTime"],[n,"startTime"])),this.dispose(p.bind([o,"stopTime"],[n,"stopTime"])),this.dispose(p.bind([o,"currentTime"],[n,"currentTime"])),this.dispose(p.bind([o,"multiplier"],[n,"multiplier"])),this.dispose(p.bind([o,"clockStep"],[n,"clockStep"])),this.dispose(p.bind([o,"clockRange"],[n,"clockRange"])),this.dispose(p.bind([o,"shouldAnimate"],[n,"shouldAnimate"])),this.dispose(p.bind([o,"clampToGround"],[n,"clampToGround"])),this.dispose(n.flyToEvent.disposableOn(r=>{e.actived&&o.flyTo(r&&r*1e3)}))}};L($u,"type",$u.register("ESCesiumViewer",Zr.type,$u));let rg=$u;const Yu=class Yu extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoCircle");L(this,"_geoPolyline");if(this._czmGeoCircle=this.disposeVar(new Bo(i,e.id)),this._geoPolyline=this.dv(new Je(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoCircle,s=this._geoPolyline;{const a=()=>{s.positions=nL(e.position,e.rotation,e.radius)};a();const l=this.dv(p.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.radiusChanged));this.dispose(l.don(a))}{const a=()=>{r.show=e.show&&e.filled,s.show=e.show&&e.stroked};a();const l=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.strokedChanged,e.strokeGroundChanged));this.dispose(l.don(a))}s.loop=!0,this.d(p.track([s,"ground"],[e,"strokeGround"])),this.d(p.track([s,"color"],[e,"strokeColor"])),this.d(p.bind([s,"width"],[e,"strokeWidth"]));{r.outline=!1,this.dispose(p.track([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(p.bind([r,"radius"],[e,"radius"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"ground"],[e,"fillGround"]));{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:Q.ESLocalCircle.defaults.fillStyle.color}};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(a))}}}get czmGeoCircle(){return this._czmGeoCircle}get geoPolyline(){return this._geoPolyline}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this._czmGeoCircle.show=e.show&&e.filled&&s,this._geoPolyline.show=e.show&&e.stroked&&s}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoCircle:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Rn(r,o,i,o.position,o.radius,e,!0),!0):!1:!1}};L(Yu,"type",Yu.register("ESCesiumViewer",Q.ESLocalCircle.type,Yu));let og=Yu;function nL(t,n,e){const o=2*Math.PI/36,r=[];C.Cartesian3.fromDegrees(...t);let s=function(l){let c=new C.Cartesian3(l.x,l.y,l.z),h=C.Cartographic.fromCartesian(c),u=C.Math.toDegrees(h.latitude),A=C.Math.toDegrees(h.longitude),f=h.height;return[A,u,f]};const a=at({initialRotation:"yForwardzUp",rotation:[n[0],n[2],-n[1]],position:t});if(!a)return r;for(let l=0;l<36;l++){let c=new C.Cartesian3(e*Math.cos(o*l),e*Math.sin(o*l),0),h=C.Matrix4.multiplyByPoint(a,c,new C.Cartesian3);r.push(s(h))}return r}const Ju=class Ju extends Ge{constructor(e,i){super(e,i);L(this,"_czmESLocalLineStringZ");if(this._czmESLocalLineStringZ=this.disposeVar(new Yi(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESLocalLineStringZ;i.add(r),this.dispose(()=>i.delete(r));{this.dispose(p.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"strokeColor"],[e,"strokeColor"]));const s=()=>{r.show=e.show&&e.stroked};s();const a=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.don(s))}this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"hasDash"],[e,"hasDash"])),this.dispose(p.track([r,"gapColor"],[e,"gapColor"])),this.dispose(p.track([r,"dashLength"],[e,"dashLength"])),this.dispose(p.track([r,"dashPattern"],[e,"dashPattern"])),this.dispose(p.track([r,"hasArrow"],[e,"hasArrow"])),this.dispose(p.track([r,"depthTest"],[e,"depthTest"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"position"],[e,"position"])),this.dispose(p.track([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(!e.points){r.points=void 0;return}r.points=e.points.map(a=>[a[0],a[1],0])};s(),this.dispose(e.pointsChanged.disposableOn(s))}}get czmESLocalLineStringZ(){return this._czmESLocalLineStringZ}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this._czmESLocalLineStringZ.show=e.show&&e.stroked&&s}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESLocalLineStringZ:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.points&&s.flyTo(e),!0):!1}};L(Ju,"type",Ju.register("ESCesiumViewer",Xr.type,Ju));let ag=Ju;const ju=class ju extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoPolyline");if(this._czmGeoPolyline=this.disposeVar(new Je(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPolyline;r.arcType="NONE";{this.dispose(p.track([r,"width"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"strokeColor"]));const s=()=>{r.show=e.show&&e.stroked};s();const a=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.don(s))}this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"hasDash"],[e,"hasDash"])),this.dispose(p.track([r,"gapColor"],[e,"gapColor"])),this.dispose(p.track([r,"dashLength"],[e,"dashLength"])),this.dispose(p.track([r,"dashPattern"],[e,"dashPattern"])),this.dispose(p.track([r,"hasArrow"],[e,"hasArrow"])),this.dispose(p.track([r,"depthTest"],[e,"depthTest"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"ground"],[e,"strokeGround"]));{const s=()=>{if(!e.points)return;if(e.scale&&e.scale.some(c=>c===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[l]=pr({originPosition:e.position,originRotation:e.rotation,originScale:e.scale},e.points);r.positions=l};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(a.disposableOn(s))}}get czmGeoPolyline(){return this._czmGeoPolyline}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this._czmGeoPolyline.show=e.show&&e.stroked&&s}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPolyline:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(ju,"type",ju.register("ESCesiumViewer",Yi.type,ju));let sg=ju;const ec=class ec extends XA{constructor(e,i){super(e,i);L(this,"_czmESLocalPolygon");if(this._czmESLocalPolygon=this.disposeVar(new Q.ESLocalPolygonZ(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESLocalPolygon;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(p.track([r,"stroked"],[e,"stroked"])),this.dispose(p.track([r,"strokeColor"],[e,"strokeColor"])),this.dispose(p.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"fillColor"],[e,"fillColor"])),this.dispose(p.track([r,"filled"],[e,"filled"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"fillGround"],[e,"fillGround"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"scale"],[e,"scale"]));{const s=()=>{if(!e.points){r.points=void 0;return}r.points=e.points.map(a=>[a[0],a[1],0])};s(),this.dispose(e.pointsChanged.disposableOn(s))}}get czmESLocalPolygon(){return this._czmESLocalPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESLocalPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ec,"type",ec.register("ESCesiumViewer",Q.ESLocalPolygon.type,ec));let lg=ec;const tc=class tc extends XA{constructor(e,i){super(e,i);L(this,"_czmGeoPolygon");if(this._czmGeoPolygon=this.disposeVar(new _i(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPolygon;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"outline"],[e,"stroked"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(p.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"fillColor"])),this.dispose(p.track([r,"fill"],[e,"filled"])),this.dispose(p.track([r,"ground"],[e,"fillGround"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"]));{const s=()=>{if(!e.points)return;if(e.scale&&e.scale.some(c=>c===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[l]=pr({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},e.points);r.positions=l};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(a.disposableOn(s))}}get czmGeoPolygon(){return this._czmGeoPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPolygon:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(tc,"type",tc.register("ESCesiumViewer",Q.ESLocalPolygonZ.type,tc));let ug=tc;const nc=class nc extends Ge{constructor(e,i){super(e,i);L(this,"_czmLocalRectangle");if(this._czmLocalRectangle=this.disposeVar(new Q.ESLocalPolygon(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmLocalRectangle;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(p.track([r,"stroked"],[e,"stroked"])),this.dispose(p.track([r,"strokeColor"],[e,"strokeColor"])),this.dispose(p.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(p.track([r,"fillColor"],[e,"fillColor"])),this.dispose(p.track([r,"filled"],[e,"filled"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"fillGround"],[e,"fillGround"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"position"],[e,"position"])),this.dispose(p.bind([r,"rotation"],[e,"rotation"])),this.dispose(p.bind([r,"scale"],[e,"scale"]));{const s=()=>{const a=e.width??0,l=e.height??0;r.points=[[-a,-l],[-a,l],[a,l],[a,-l]]};this.dispose(e.widthChanged.disposableOn(s)),this.dispose(e.heightChanged.disposableOn(s)),s()}}get czmLocalRectangle(){return this._czmLocalRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmLocalRectangle:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(nc,"type",nc.register("ESCesiumViewer",Q.ESLocalRectangle.type,nc));let cg=nc;const ic=class ic extends Q.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new Q.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends p.Destroyable{constructor(a,l,c){super(),this._subContainer=a;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h));{const d=()=>{const g=i.getCameraInfo(),v=g==null?void 0:g.position,m=[...g==null?void 0:g.rotation];m[0]=360,Be(i.viewer,v,void 0,m)};h.addEventListener("click",d),h.style.cursor="pointer",this.dispose(()=>h.removeEventListener("click",d))}{const d=()=>{h.style.display=e.show??Q.ESNavigator.defaults.show?"block":"none"};d(),e.dispose(e.showChanged.disposableOn(d))}{const d=()=>{h.style.width=`${e.cssSize?e.cssSize:Q.ESNavigator.defaults.cssSize}px`,h.style.height=`${e.cssSize?e.cssSize:Q.ESNavigator.defaults.cssSize}px`};d(),e.dispose(e.cssSizeChanged.disposableOn(d))}h.style.position="fixed";{const d=()=>{h.style.top=`${e.cssPosition?e.cssPosition[0]:Q.ESNavigator.defaults.cssPosition[0]}px`,h.style.right=`${e.cssPosition?e.cssPosition[1]:Q.ESNavigator.defaults.cssPosition[1]}px`};d(),e.dispose(e.cssPositionChanged.disposableOn(d))}h.style.transition=" right 0.4s linear",h.style.transition=" right 0.4s linear",h.style.cursor="pointer";const u=document.createElement("div");h.appendChild(u),this.dispose(()=>h.removeChild(u)),u.style.width="100%",u.style.height="100%",u.style.position="relative";const A=document.createElement("img");u.appendChild(A),this.dispose(()=>u.removeChild(A)),A.style.width="100%",A.style.height="100%",A.style.border="none";{const d=()=>A.src=e.imgUrl;d(),e.dispose(e.imgUrlChanged.disposableOn(d))}const f=p.createAnimateFrameWithStartValues(()=>{const d=i.getCameraInfo(),g=d==null?void 0:d.rotation[0];A.style.transform=`rotate(-${g}deg)`});f.start(),this.dispose(()=>f.destroy()),A.style.transformOrigin="50% 50%"}}}get customDiv(){return this._customDiv}};L(ic,"type",ic.register("ESCesiumViewer",Q.ESNavigator.type,ic));let hg=ic;const iL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAEACAYAAADFkM5nAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNzdjMTM2OS1jOWY2LTNhNGEtOWM3My01OTJmNWM0Mzg3NjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjJCQzhDNzQyRkFGMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjJCQzhDNzMyRkFGMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmE0ZWU5OWFlLTUyNmYtODY0ZC05OTk0LWQwMzE5MTdjZWUyZSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjdiN2Q4YjQzLTM4ZDktZjI0ZS04MjIyLWI3MTdiMGQxZDY3MiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrRBvqMAAAx2SURBVHja7N1/qF51HQfwM5FhMmSIyLBYsmSImQzZhrPMWU1zqKGiVkuHyZQlS1ZYVg6pIVELppg/1hKVUhgi5RY49A+VzMI7QkRusSLWCJMV4xJjLVk9fb48Z3rddrd7n/vc557v+b5e8OFe73Yv5/k47ud9vuc83zOj0+lUAEBZTtACABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAQAAAAAQAAEAAAAAEAABAAAAA8nGiFgBHsfAoX9uhLSAAAO0e/ldHfXvU1w5EPR71qDAA7TCj0+noAjB6+L8YNesYf+epqI1CAAgAQHuG/zNRc8fxd0eirqxXBgQByJCbAIFDbhjn8E9mR/26Dg0LtQ4EACDfs/9revi+h6OWCwGQHzcBAofM6/H7vhu1p/7c5QCwAgBkZM0kvz+tBJxtJQAEACAvM/vwM34WtVgIgDx4FwCQ/D1qTp9+1qL6o8sBYAUAaLB0xn56H3/e0KifCwgAQEG/C4a0FAQAoEzPWAUAAQAoT9pUaLMQAAIAUJ4FUTcKAdA8NgICptpXo06qP/fOALACABTk1qg7rASAFQCgPF+K2mUlAAQAoDx3R/1HCAABACjP+qjdQgBML/cAANPhiahZlXsCQAAAivNi/VEIAAEAKIwtg0EAAAplt0AQAIACpd0CnxACQAAAynNO1ANCAAgAQHkuiLpXCAABACjPpVFfFwJg6tkICGiaz0e9VX9uoyAQAIApMr+Bx/S1qINCAEwdlwCAeQ09rm/Ux+ZyAAgAwBT4WIOPbUvUHCEABACgv9JgvWaMP9vXkGPc5n8TCABA/411L9CsBh3jNqsAIAAA/XNeJseZLgM8JwSAAABMXhqmqzI63tOEABAAgP64ILPjTSHAcwNAAAAmcfb/mUyP/RwhAAQAoHffz/jYUwj4lhAAAgAwsbP/T7TgdaS3L64RAqA3tgKGMm1syeu4KepP9ee2DAYBADjG2f/DLXtN66N2CwEwMS4BQFnDf0HVziXzdFPg/MrlABi3GZ1ORxegjOGfDLX8dS6yCgBWAID3GyrgNf7WKgAIAMB7Z/+lPFAn3df0GyEABAAw/KtqbdXdS78UMysbBcFxuQcA2j3810VdVejrH45aWbknAAQAKGjwJ7+I+lDhvXil6q6ACAEgAEARw39IK961teruFSAEwCjuAYD2DP5Utxj+R0iXQDw3AKwAgLP+Qq2Ket1KAAgA0JbBvynqfO0Yl5uj3hQCQACAXId+8nTUmVoyYUuiDgoBCAACAOQy8JM7o67XlklbVH8UAiiWpwFC84Z8cm7UJVHLo07Tor4bGhUCwAoAMLAhf0rU3HrIp2HvGv7gjUQtswqAAAD0e9CnIT+nPtO8MGqx9jTOzqgVQgACADDRIX9G/THdWHZW1NLKkn1u/hZ1tRCAAAAcPuQP/fdH6o9p6M/XolZ5Lep2IQABAMoc9Oma/OeiTq3rQu0pyhtVdydFIYAieBcApQ35U+shP6/q3nyX/vtkLSKcF3Vt/bkQgAAAmQ77dD3+tqjTq+6S/WytYRzuivqHEEAJXAKgTUP/nqgLKjfhMXm2DEYAgIYP/fRWuxcqT7ak/+wWiAAADR3+nn6HEAACAAUN/rTUf4V2IASAAEAZwz/drf+yViAEwOS5bkouw3+14c80crkJKwAwDcN/fdRntYJptj/qYqsAWAGAwQz/+w1/GiJdgnqyOvrjm0EAgD6f+duOlyZJz4B4UAhAAICpG/73OPOnodJjndcIAeTOVsA0cfinbXy9zY8muylqb/25ewLIkpsAaWIAcMc1uUg3Be4XAsiRSwA0bfg/pw1k5OVR/3ZBAIAeh/+CyoN8yM+QEIAAAJOzWQsQAkAAoKyz/7XagBAAAgDl+aIWIASAAEBZZ/9rtIEWhgAQAOA4btICWuY5qwAIAADlSe9muV8IQACAsX1TC2ip9ByL1UIATWUrYKZT+sW4VBtosS9HvVV/brdArADAKDb+oe3ujjrDSgACAEB5nq0/CgEIABDO1gIK4u2BCABQu1wLKMwqqwAIAFBVM7WAwtyqBQgAAGXaZhUAAYDSeRsqJZrj3z4CAECZ7BKIAABQoMVagAAAUKZPWQVAAKBUroNSsh9oAQIAACAAAAACAEBbrdACBACA8qSdAd0IiAAAUJiTtQABAAAQACjCQS0AEAAAAAGAAtgICEAAAAAEAABAAAAABACANhjWAgQAgPI8ELVDGxAAAMpi+CMAAAACAEDbjWgBAgClshUwJUuPAnYJAAEAoDB7tAABAKAsP9ECBACA8myuLP8jAFAw9wBQooe0AAGA0r2jBRToMWf/CACU7oAWUJjVWoAAAFX1rBZQkOH6zN/ZPwIAxXtLCyho+K80/BEAAMpi+CMAwGHe1gJabpEWIADA+6Uzoq3aQIvdOOrfOggAMMpmLaCl0h3/fzT8EQBgbJ6KRtv8qHLHPwIAHFP6BblBG2iR7VFbDH8EADi+57WAFg3/dYY/AgCMnx3SaAPDn2ycqAU0gF+Y5G5/1MXagBUA6M1lWkCmLq7c9IcAAD2vAuyNek0ryOzM30Y/ZGlGp9PRBZpkYdSQNpCBg1FLnPVjBQD659NaQAYuMvwRAKB/0i/Uf0V9RytosBvrFQDIlncB0NQQkHwg6m7toGFs8YsAAAMIAenf6F3aQUPcV7nbHwEABhYCKiGABngo6knDn7bwLgBykN4ZcEbUs1rBNPl91G2GPwIATE8ISF6Imq0dDNBw1ErDHwEApj8IXBp1r1YwADujVhj+CADQrNWATVHnawdT5ND+/oY/AgA0NAjcH3WhdtBHdvlDAICMgkAKAZdELY+aqS1MwiLDHwEA8g0E6V6BD0bNizo76kytYRyW1CsAAgACALQoFCRn1aHgw1ELok4XDqila/77DX8EACgvHMytA0EKB1fVYcHlhDLcEfWq4Y8AAIwOB2nXzFOr7oZEH436ZOUdCG2SHj71vOGPAABMZNWgqlcN5lfdRxnPr4s8PBL1qOGPAABMRThI9xxcFnWF9jTKU1EbDX8EAGCQweBQOEg3Ii6LWqpFA7U9ap3hjwAANDEcpGDwlcqNiP22K+o6wx8BAMglHJwS9UzlgUiT8UbULYY/AoAAALkGAg9FmriRqruqYvgjAAgAkH0QWBq1QTvGxRa/UDtRCyBbOw4bbMmWqvuOA44+/AErANDaVYEhbTjCtVG7nf3De07QAmjlme52bXjXasMfrABASSsBSyv3BqyNesXwBysAUIo08F6KurngHvzY8AcrAFDySkC6KXBLYa/7vqgnDX+wAgAlrwT8JerOgl7zVsMfBADgvcsBWwt4rb+LWm/4w/G5BADlaPtbBNPQX234gxUA4Eht3gzH8AcBABjjDDlZJ9gALgFAedp2KWBJ1EFn/2AFADi+a1v0Ogx/6IGHAUF5Dg3L9Gjc2Rm/jhsqW/yCFQBgwiEg570Bflh19zcw/EEAACbo9UyP+6dRTxv+IAAAvXsks+NNmxltMvxBAAB6l4botsyGv13+QAAA+mDPMf5sX4OO8yXDHwQAoL+Gx/j6rAYd452GPwgAQP+kofqrhh+jXf5AAACmwF8zGP7O/kEAAPpsuKHHdaXhDwIAMHX2NfCY0i5/bxv+IAAA5bDLHwyAZwEATfK9qrs3geEPVgCAATjYgGN43PAHAQAYrOleDUy7/D1o+IMAAJTDFr8gAACFGTH8QQAAyrPM8AcBACiLLX5BAAAKY5c/EACABvjfgIe/Xf5gms3odDq6APx3QCcEt0e9ZviDFQCgGQaxEdA6wx8EAKCsAJCG/3bDHwQAoFmmcifAhwx/EACAslYAfh71mOEPzeMmQCD5d9RJff6ZO6NWGP4gAADlBIB3oj5u+ENzuQQAJLv7/PMMfxAAgAzs7OPPssUvCABAJvb06edcVH909g8CAJCBP/ThZ1wedcDwBwEAyMdL9fDu1Rei/mn4gwAA5CUN7ld7/N7rov5s+IMAAORpYw/fsyxql+EPAgCQr/SI3l+O8+++WXXv9h8x/CFPNgICRltYdbfuPXeMP0/3CayPet7gBwEAaF8ImBe1YdTX9kZtqoe+wQ8CAACQI/cAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAE32fwEGAMnMSDh4qI2qAAAAAElFTkSuQmCC",rL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAEACAYAAADFkM5nAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNzdjMTM2OS1jOWY2LTNhNGEtOWM3My01OTJmNWM0Mzg3NjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NkJCOEQ5RUQyRkIxMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NkJCOEQ5RUMyRkIxMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmE0ZWU5OWFlLTUyNmYtODY0ZC05OTk0LWQwMzE5MTdjZWUyZSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjdiN2Q4YjQzLTM4ZDktZjI0ZS04MjIyLWI3MTdiMGQxZDY3MiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmdWjtQAABYrSURBVHja7N0L9HZTnQfwbWrNtNZQRteJpBvpMiLkkstErlGKilJC94uRS7ohFU1rpqRJy9JFpXLJpUgSDbpIEc1MMmqV0lsuMciExDv7t85+12rNwvunZ5/9PPv5fNb6La3V6xzf/37+7/k9Z5+9zzKLFy9OAMB8+Ss/AgDQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADcCs2DrXd3M9WSa5GtiiZHpKZ2O1Za4L5AINwDRaJtc7c52ea/1cF+Z6YQeZ3vH/Mu3Q6Vi9oINMB+Q6488yvaiTsYpcX821nlyQPzyLFy/2U5gey+U65m4u+DFIh+U6MNedMk19rkNLrrtmLNOyuT6da8e7yfTB0uzM4lgtW8bqRXeT659zvUsuNAC0tFquU3Ktfi9/5sxcL8t1w4xkWrVkekpHmRaa62u5Xj5DuZ5UMj31Xv7M2blemuv6GRqryHXqUsbqrFy7yMW8MQUwHbZLw6271Zfy57bK9YNca8xIpu+npc9JzlKm+5Jr6xnKtW3J9NSl/LnNc12Ua80ZGavnLXCstihj9Qy50AAw5s//4FxfzvWQBf47j0/Dw1k7T2mmmJM8qHw76SVTr7ki07tzfSXX8gv8d1bJ9Z1cu075WB1Yfq8WmutxZazkYm6YAmgnLiKfK98o76+P5No315+mJNODS6bt/4JjHJ5rvynKNKlcH861f2djdUT5/N3R2VjJhQaAauLWXcy3rjqBY52X68W5rm2cafWSabWOMk0617kl13WNMz25ZJrEssVvlUxXdzZW55dc18hFr0wBjC+e2L1wQhf/sEmui3Ot2zDTC0um1TrKVCPXprl+2DjXC0qmSe1ZsFEangtYv/FYRa7vTXCsNi6fwWfJhQaAv9QDcr0/14lpWL4zSSuVzn6PRpm+lIZlcT1k6jVX/K4fkuvkNNxOnqQVc/17rtc2+jvsfRVznScXvTIFMI4Vcn0+DU+813ZUrr1y3S6TXMXyJdM2I2T6ZK43jjRWcs1WLjQAc+cfShf/hBHPuWQ3sEUVM8Wc5ONHzBS3QXesmKlVrti+daeKuZ5WMj1xxEzfL2N1VcVzPL38Xo2dK36vfi0XPTAFUN+bR774h5jfi3m+jSsd/y0jXyTDepUztcoVc+cxh75RpeO/ceSLSVi3jNWmFc/RMtcmcqEBYCFenWvvNP7yr0emYee2t1Q49p4dZmqZ61G5zqmU6/XluGMv/Xp4rm+Un2cNr2uU6xHlM7iXXMw6UwDjiW+ux5e/7McW64fjgZ9bJ3zcTUqmR3aUqddcG+Q6IQ0PgI3ti6W5+kOFY29Ycj1arpnIhQZgbsVfvrEKoMWSqUvTsKztFx1luqRkurKzsaqV61Glsdm4QaYflUw/r3BsuWYrF1PCFMC44kGvTXMd2eDcsR947Au+RUeZYk/6iypkmpZcm0/4uLFZz2Zp2JVwbGuUz9/WFY69JNfhDXNtJRcaAJbmj2l40OeVqc7t63vz0DS85z3eH75MhUy75bqtk0zTkOvMCrni+Ya3puGtfreMnCmWWJ6ehtcKT3qsIlc8b7Bzw1zvkItZYgqgrfimd1IaXtgxtpPKhe0WmeY2V7z9L5acrdog06mlCb65wrFb5jqljJVcaABY0De9Y1ObW22X5doh1xUVMsVGJlt2lKnXXLHL3DHl2GO7vJz38grHjlyfzfV8uWYiFw2YAmjv+jS8jz22/Ry7G4uXEsU83/aVMr2/UabY2GS7imPVU674RhebwMRt3jtHzhTvI4hNq15Q4dg3l4vVO+WaiVy4AzD3ti/d/UNGPu/i0oAcnOsumaY+1yGlJp0rHjr8QhrW8I+d6bA0vOu+xkUtcsXStoc1yHVoyXWXXGgAWJonpWGe72kNzh0P070s140TPm7MWZ7UWaZec62chpcgrdMg05kl0w0Vjr1yGau1G+T6Wsn1P3IxTUwBTJ+fpmHb2y80OHe8fCSmBJ4+4ePGvPX65dtKL5l6zfWrNGxL/IkGmbYqmdaocOyWuWLp40VyoQFgIf63dNaxLefYW4LGPuTfTcMysUmKJ9h3aZzpJRWO3WOueDNcbGEdu8GNvfzx8SXTzhWOfZtcM5WLykwBTL/YEjR2A2uxheu/pmEd+qT3xn92yTT2NqeLS6a3pzr7/bfOFWM16Tn0Z6bhFvNjG3z+YgOc/SqN1dol18oNcsVGTPvLhQaAhYgtQY9Lbd7W9c1yN+C6CplabXNaK1PrXOeUb2KTzhXLH2Oa47kNMp2X68W5rq1w7Ja5zi25rpOLVkwBzIbYEnTz8i1v7I7tOWmY53tmhUyxzemHOsrUOtdmlXLF8seY722x/DGa3nhV7boVjr0k16ENcm1acq0jF+4AsFA75fpUrmVHPm/MLcarZY+Raa5ztVr+GM8lxLbMn6x0/OeXXA+WayZyoQGYW7Ehxynln2P7eK5/SsM++ZO0ehqWP7bIdGTJVOMhvh5ztVyqelQaHri8vcKx5ZqtXGgA5tay5dvlTg3O/d1y3t9M+LjLlUw7Nsj0nTTMXf6mwrFb54qx+u2Ej/u3uY5ObZ7+/l75WS6q9HsVuV7aINcFZazkYhSeAZhdsfwsln/tk8Z/6naDNMw1bzjh4/6+XIT3bZBpw0qZpiHXxRVyxVLVXVK9Oyf3Zr2SaeNKv1fR1OzdINf65TP4bLlwB4CFigelYpXAo0Y+7x3lAnBkhWNvmoYnmXvK1Guu2IgmVj78fYNM0VQdUen4Pec6odFnsGYuNABz69HlL6sWXfYxaXjobNKbkKxYGpueMvWaq+Xyx8/lem2uWysc+1HlYrmRXDORi/vAFEA/Yu46lrcd3uDcu6VhrnnSm8UsKpk+0ijTt1OdDVV6zNVy+eOu5fP3uArHvrqMVctcq8iFOwAsVMw3x/KbsZef/S4NDxmdU+HY8bzDJxpkig1Ndq6UqXWuGKtvVjh2PKAXDz0uN3KmWP8ezyWcVen4O5Xfqxa5YqzOlgt3AFiauLUXG6dcPvJ547WkX0/DPN8yEz523F5+VoNMD6+YqXWusyrl+lL5/F02cqbYAS/eknhApbE6seT6SYNc8abE/eXCHQAWquVSwbiwxctJbpnwcVsuqauVqddcy5a7Gy9pkCn2w9+t0ljJNVu5cAdgLi1ZKvjWNP7yszhvrP990oSPu2RJ3T6NMsUeCE+scOwec8XnL27xtlgq+KJcF+ZatdLvVeTaW66ZyIU7AHOv1dKfG9Pw0M/pnWWK1zWf0eFY1coVKx5i5cPYb7W8Kdcrcn2l0vFb5orfq9Mq5mrxZsvauXAHYC59K9ea5Z9jWj7Xl3MdlCY/zxdZ1mqU6bRKmXrNFSsP4lW1542cKd5ZcGquQyr9fdcyV/xeHVwx1zM7zIU7AHPtgbk+mIbbsmM/eHNa6e5vqpRp7wY/z1qZes0VmQ5Lw1TH2J+/M8odjhsrjVWrXF/N9fKKuT6QhmnEnnKhAZhrn0/DkqmxxbexHWSa+1yfScOt+bHFVNR2FY/fKlc0bNvLxX3hFsv8eVAa1vy2uKCcVL5V1sj0qUaZvlQpU6+5ItPRjS4mp5Y7AKmzXCdXzvWJDnOhAZg7sVNa7MC1+8jnvTPX29OwHPGWCpniCfZXNcj0tjQ8uX9LpbHqLVfsFBnPNew5cqa7cr0r1wtz3Vzh+K1yxVi9Mw1LR39f4firpOFZgD06y0XxQD+CubFNGvbgXmHk89bcnW3bXJ9tlKnmDmY95toq17Fp2PxlTDeUb5FnVjq+XLOVC3cA5m6MD07DXNrYF5RLc61T4eIfmd6ThqVdY2e6JA1PfZ9daax6yxWZDkzDA11jX0x+VD5/Z1Yaq15zHdRhLtwBmDsPLd/6t25w7vj2EG/8+kOFTMeWbyhjq/kWsx5zrVDuZGzbIFO8cnnPCp+/3nPFZ2GbznLhDsDciTW8FzW4+McOYnul4QGySf8yr10ybdUo0ysqXfx7zLVmyTT2RTJ2UYwla7tUupj0mmutkmubznLhDsDciYd2/i0NT/CO6Zo0PDx2foVjx7eDj3aWqddc8eDikQ0yXVcynVvp+L3mioeCP9ZhLjQAc+VB5Rd59wbnjn28Yz/vRTLN9VgdkevVDTL9oGS6qtJY9Zrro2n81Qu1c7FApgD60WqJX4j1z5tUuKAsWQrXU6Zecy1ZCtfiIhl7JWxc6WLSMlfs17FRpVyrpDZLF2vnQgMwd7YuHfVaI5/39lyvKXX7hI8dc5ExJ7lmR5l6zbVlrovT8CzDmP6Y6w1pmPK6rcLxW+WK8XlduTjX+AxuVT6DveVCAzB34xdLdmJ707GX7Cwq3ySPrpSpxbLFWpla5/p1pVyxN3xssHNGg8/fb3L9Y66PVzh2y1yLSq6jKuV6d2qzxK9mLu4nzwDMrr9Lw5KdFkuR4sGxeHjnmgqZjk1tliHVypRS2+VV55Vc1074uMuXTM9rkCmmumJXyd9WOHbLXN8uua6ulOvYRn9f1MyFOwBz5xlpuDXZ4pc5HobavMKFckmmFhfJj+TarNLFP3Jd1DDX5hUu/mukYcqpxUXyY+WbZI2L/xplrFrkilU7z6l0kVzyGdy2s1xoAObOK9PwANnjRj5vrBOP9eKxbvyOCpkuaJAp1h3H60bj1ch/qjRWveXatXz+njhyptvKz/NNFT5/f57rCY1yvbliru90mIsJMAUwO/4m14dzvb7Bua9Mw4tULqmQ6fA0PBg0tl+UTJdWGqvecv11rg/lemODTL8smX5Y4dg954q/L97QWS40AHNnpTS8nvVZDc4d+/jHLl3XT/i4j8l1YmeZluSKsVq3o1wrlrFav0Gmc9LwgqLfVTj2imWs1pNrJnIxYaYApt9zSic99oVyca4PpGHu+voKmS7uLFPYrORat6Ncm5bP3/oNMv1LGpbi1biY/GPJtZ5cM5ELDcBciSU7byvf6h4+8rnjPfDx1O7b0/BubpmWnuuAXF/vbKz2zfWNXI9okGnnXPtVGqt9y2dQrunPRUWmAKbTg3Mdk2uHBue+opz3MpnmNtdyadhdb8cGmX6Whvnj/6xw7Mj16TRsQTu2n5Zc/1XpM/ipDnOhAZg7T8l1cq7VGpw7NqmJp4ZvkmlBnlpyrdpRrifnOqX8c2yx8c7Lct1Y4dirl7Fqkev0MlZyMVVMAUyX2LDlwgYXyrtyHZzr+RUuKD1mCi/J9b0GF//IdVClXPEN8vsNLiYxf/zeXNtVupi0zPWeMlZy4Q4A9zgOh+XaJw1zeWO6sXTxp8u04FzxwN1bG+V6WfmmPEkPyPX+XPs3yHRzGauvVDh25Do0DXPTY+e6qeQ6TS40ANyTeGjs+DQ8vTu2H6dhDvmnMi041wlpeDJ+bDEnHnOtP5vwcR+W67g0rGAY22Ul039XGqsvNswVn8Er5GKamQJoK5aLXdzoQhnrutercKFsmen4SplCLFn8YaOLf+TaoMLFf+0yVi0uJieVn2mNi3/kuqhxrivkQgPAPYn3i8cLaB4z8nljmU4sxYs57Fs6yhS3Q3eukCnEK3TjpTordZRr9zS8D37lBpliyeJOlcZqD7lmKhcNmQIY34PS8IKMPRqcOzboiF26zpFpbnPFNsVHlKZmbLFJUexUeFaFY8s1W7nQAMyd6N5ji851Gpw7bl/HfOsvZVpwrrjtuXZHuVpuKX1pyfSLCsdeqYzVunLNRC6mhCmA8cS83UWNLpSfzbVhhQtKj5n+PNfaHeXaNLXZUjp8vmSqcTFZsvXtunLNRC40AHMllunEPG6LbWLjNZzxOs54LedtMi0o1/4d5oqlmN9okCleRRyvJI5XE/+hwlhFrrMajdVecjHzF6fFixf7KdR1ZGrzCt+r0/DgzrdlmutcR5TGYmzXpmETqPMqHf+jud7UINc1Jdf5cqEBYGniifjYqnPM28kXlAvKIpnuc65Tc63VUa4Vy1iNeSs5dqeLXep+XfEcLebHLyy5FslFD0wB1HdVro1yfW6k8x2VhvnDRTLdr1wx93nsSLk+noa5+Zq54tibpOElOGP4ZK6NK1/8Uzl+5PrMSLmOLudbJBcaAO6LmNN9Ra690zAvWsPtufbM9bryv2W6/7l2rZwrzhFLC9+Q648jZYp1/29JwzxvrbF6bRmvMcdqt5Kr5mfwNaXkoiumAMYX32RjO9mHTfhbw5IXg8g0Oc9Jwy58k8x1Vcn1g0aZ4tte7AI5yQfMFpVMFzYcK7lmKxcagLn12DS8cnXNCRwrHrKKh3eu7SjTuSXTdVMwVqukYQ69p1yTfNbh/JLpmikYq5XLZ1Cu2chFY6YA2og13s9Ow0s9/hIfzrX5FFz8J53puVNy8Q9XllzHdZRrUs86HFE+f9NyMflVGSu5ZiMXGoC5FetsY5vNWE9/5/38d+OVtH+SaZRcsR///h3lWvKsw/3577o1Dc9/xJrxO6ZsrG4tufaRayZy0ZApgOnw3PLN+aEL+LM/T8MWnT+SqVmuuBuwQke5NiuZFvKsw5Ul0yUzMFaR6/gFfgblwh0Amohd2mLd738s5c+dmYZtd38kU9Nc63SW65zy33rpUv7c2WnY+2FWLibnlP/epY3BWXKhAaCl+LYY73w/4W7+v7hNc2iu5+W6QaapyBVz6Cd2lOvKkum4e8j0wVxbpeENcWnGcm1wL7k+kGsbuZhHpgCmcExyvS3X+3I9INfv07Am+GSZpjLXAbneW3LdnOtVHeSKZzgOK5niHfC730OzM2tjtV9pzpbkis/gSXKhAWDabJ3rwPKX709kmolccfG/vJNMW+Q6JA0bFv24o7HaMtfBJddlcqEBAADmimcAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAHDv/k+AAQD4HcieQJZ+TQAAAABJRU5ErkJggg==",rc=class rc extends As{constructor(e,i){super(e,i);L(this,"_signal");if(this._signal=this.disposeVar(new tr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._signal;this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),r.color=[1,1,1,1];{const s=()=>{r.show=e.show&&e.materialMode!=="pureColor"&&e.stroked};s();const a=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.materialModeChanged));this.d(a.don(s))}{const s=this.disposeVar(p.createNextAnimateFrameEvent(e.pointsChanged,e.speedChanged,e.materialModeChanged,e.strokeWidthChanged,e.strokeMaterialParamsChanged));this.dispose(s.disposableOn(()=>c()));const a=rL,l=iL,c=()=>{var v;if(!(e.points&&e.points.length>=2))return;r.width=e.strokeWidth*2;const h=((v=e.strokeMaterialParams)==null?void 0:v.Elongation)??5,u=this.sceneObject.getDistance()??0,A=Math.ceil(u/(10*h)),f=A;r.repeat=A;const d=e.speed;r.duration=u/f/d*1e3;const g=e.materialMode;g==="singleArrow"||g==="purple"?r.imageUrl=l:(g==="multipleArrows"||g==="blue")&&(r.imageUrl=a)};c()}}get signal(){return this._signal}flyTo(e,i){const{sceneObject:o,czmViewer:r,signal:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,signal:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(rc,"type",rc.register("ESCesiumViewer",Q.ESPath.type,rc));let Ag=rc;const sr=class sr extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_czmCustomPrimitive");L(this,"_geoBoundingSphere");this._czmCustomPrimitive=this.disposeVar(new st(e,i)),this._geoBoundingSphere=this.disposeVar(_0([this,"positions"]));const{czmCustomPrimitive:o}=this;this.dispose(p.track([o,"show"],[this,"show"])),this.dispose(p.track([o,"allowPicking"],[this,"allowPicking"]));const r=this.disposeVar(p.react(0));{const s=()=>{if(!this.positions||this.positions.length<3){o.show=!1;return}o.show=!0;const[l,c,h]=fn({originPosition:this.positions[0]},this.positions);o.modelMatrix=c,o.cull=!1,l.push(l[0]);const u=l.length,A=[...l,...l.map(m=>[m[0],m[1],m[2]+(this.height??sr.defaults.height)])],f=l.reduce((m,w,_,E)=>{if(_===0)return m.push(0),m;const T=_-1,P=E[T],F=Math.sqrt((P[0]-w[0])*(P[0]-w[0])+(P[1]-w[1])*(P[1]-w[1]));return m.push(m[T]+F),m},[]);r.value=f[u-1];const d=f.map(m=>m/r.value),g=[...d.map(m=>[m,0]),...d.map(m=>[m,1])];o.attributes={a_position:{typedArray:new Float32Array(A.flat(1)),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(g.flat(1)),componentsPerAttribute:2}};const v=o.computeLocalAxisedBoundingBoxFromAttribute("a_position");if(!v){console.warn("包围盒计算存在问题!");return}o.setLocalAxisedBoundingBox(v.min,v.max);const y=[...new Array(u-1).keys()].map(m=>[[m,m+1,m+u+1],[m,m+u+1,m+u],[m+u+1,m+1,m],[m+u,m+u+1,m]]).flat(2);o.indexTypedArray=new Uint16Array(y),o.vertexShaderSource=` in vec3 a_position;
|
|
3965
3965
|
in vec2 a_st;
|
|
3966
3966
|
out vec2 v_st;
|
|
3967
3967
|
void main()
|
|
@@ -3980,7 +3980,7 @@ ${SC}
|
|
|
3980
3980
|
vec4 imageColor = texture(u_image, fract(v_st * u_stScale - addst));
|
|
3981
3981
|
out_FragColor = imageColor * u_color;
|
|
3982
3982
|
}
|
|
3983
|
-
`};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(a.disposableOn(s))}this.dispose(this.flyToEvent.disposableOn(s=>{this.czmCustomPrimitive.flyTo(s)}));{const s=()=>{const l=r.value?r.value:1,c=this.height??sr.defaults.height,{textureSizeInMeters:h=sr.defaults.textureSizeInMeters}=this,{textureUri:u=sr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:u},u_stScale:[l/h[0],c/h[1]],u_speed:this.textureMoveSpeed??sr.defaults.textureMoveSpeed,u_color:this.textureColor??sr.defaults.textureColor}};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(a.disposableOn(s))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};L(sr,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Ko=sr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:p.reactPositions(void 0),height:void 0,textureSizeInMeters:p.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:p.reactArrayWithUndefined(void 0),textureColor:p.reactArrayWithUndefined(void 0)})})(Ko||(Ko={})),p.extendClassProps(Ko.prototype,Ko.createDefaultProps);const oc=class oc extends an{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Ko(i,e.id)),this._czmPolygon=this.dv(new Q.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,s=this._czmPolygon;i.add(s),this.dispose(()=>i.delete(s)),s.filled=!1,this.d(p.track([s,"points"],[e,"points"])),this.d(p.track([s,"stroked"],[e,"stroked"])),this.d(p.track([s,"strokeColor"],[e,"strokeColor"])),this.d(p.track([s,"strokeWidth"],[e,"strokeWidth"])),this.d(p.track([s,"strokeGround"],[e,"strokeGround"]));{const a={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},l=(A,f)=>{switch(A){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[f,f]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[f,f]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[f,f]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[f*.5,2]}}},c="${earthsdk3-assets-script-dir}/assets/img/fence/",h=()=>{const A=e.materialMode,f=a[A];if(!f)return;r.textureUri=c+f.image,r.textureColor=A!=="gradientColor"?f.color:e.fillColor;const{textureMoveSpeed:d,textureSizeInMeters:g}=l(A,e.height);r.textureMoveSpeed=d,r.textureSizeInMeters=g};h();const u=this.disposeVar(p.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(u.disposableOn(h))}{this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"height"],[e,"height"]));{const a=()=>{r.show=e.show&&e.filled};a();const l=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(a))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(dn(r,o,i,e,s.czmCustomPrimitive),!0):!1}};L(oc,"type",oc.register("ESCesiumViewer",Q.ESPolygonFence.type,oc));let fg=oc;const ac=class ac extends an{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new pi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(p.bind([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"ground"],[e,"fillGround"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(p.bind([r,"height"],[e,"height"])),this.dispose(p.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(p.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(p.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(p.bind([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"outline"],[e,"stroked"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"]));{const s=()=>{const a=e.points;if(a&&a.length>=2){const{minPos:l,maxPos:c}=Q.getMinMaxCorner(a);r.rectangle=[l[0],l[1],c[0],c[1]],r.height=a[1][2],r.extrudedHeight=a[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};s(),this.dispose(e.pointsChanged.disposableOn(()=>s()))}{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(s))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(s.rectangle){const a=[[s.rectangle[0],s.rectangle[1],s.height],[s.rectangle[2],s.rectangle[3],s.height],[s.rectangle[0],s.rectangle[1],s.extrudedHeight],[s.rectangle[2],s.rectangle[3],s.extrudedHeight]];return Me(r,o,i,a,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:s}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(s.rectangle){const a=[[s.rectangle[0],s.rectangle[1],s.height],[s.rectangle[2],s.rectangle[3],s.height],[s.rectangle[0],s.rectangle[1],s.extrudedHeight],[s.rectangle[2],s.rectangle[3],s.extrudedHeight]];return Me(r,o,i,a,e),!0}return!1}};L(ac,"type",ac.register("ESCesiumViewer",Q.ESRectangle.type,ac));let dg=ac;const lo=class lo extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=Q.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],lo.defaults.imageUrl),s=this.disposeVar(p.react(void 0)),a=()=>{const m=C.Material.fromType(C.Material.ImageType);m.uniforms.image=r.value,m.uniforms.repeat=Xe(this.repeat??lo.defaults.repeat),s.value=m};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(a));const c=(m,w)=>{const _=new C.PolylineMaterialAppearance({material:w,renderState:{depthTest:{enabled:!1}}});_.renderState.depthMask=!1;const E=[];if(m.length<2)return;E.push(new C.GeometryInstance({geometry:new C.GroundPolylineGeometry({positions:m,width:this.width??lo.defaults.width,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??lo.defaults.arcType]}),id:this}));const T=new bi({geometryInstances:E,appearance:_,asynchronous:!1,allowPicking:this.allowPicking??lo.defaults.allowPicking,compressVertices:!1});return T.ESSceneObjectID=i,T};let h;const u=new C.BoundingSphere,A=()=>{h&&(o.scene.primitives.remove(h),h=void 0)};this.dispose(A);const f=()=>{if(A(),!this.positions)return;const m=Zt(this.positions);if(m.length<2||!s.value){u.radius=-1;return}C.BoundingSphere.fromPoints(m,u),h=c(m,s.value),h&&o.scene.primitives.add(h)},d=()=>{h&&(h.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(m=>{if(e.actived&&u.radius>0){const w=Ue(u.center);w&&Be(o,w,u.radius*4,void 0,m)}})),f(),d();const g=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,s.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(g.disposableOn(()=>{f(),d()}));const v=this.disposeVar(p.createNextAnimateFrameEvent(this.showChanged));this.dispose(v.disposableOn(()=>{d()}));const{extensions:y}=e;if(!y){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(lo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Zo=lo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:p.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Zo||(Zo={})),p.extendClassProps(Zo.prototype,Zo.createDefaultProps);const sc=class sc extends an{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Zo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const s=()=>{r.show=e.show&&e.stroked};s();const a=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.don(s))}this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"width"],[e,"width"])),this.dispose(p.track([r,"arcType"],[e,"arcType"])),this.dispose(p.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(p.track([r,"repeat"],[e,"repeat"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(sc,"type",sc.register("ESCesiumViewer",Jr.type,sc));let pg=sc;const lc=class lc extends Q.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new Q.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends p.Destroyable{constructor(a,l,c){super(),this._subContainer=a;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h));{const g=()=>{h.style.display=e.show??Q.ESScale.defaults.show?"block":"none"};g(),e.dispose(e.showChanged.disposableOn(g))}h.style.position="fixed",h.style.width="125px",h.style.height="30px",h.style.border="1px solid rgba(49,50,56,.8)",h.style.padding="0 5px",h.style.backgroundColor="rgba(37,38,42,.8)",h.style.borderRadius="15px",h.style.pointerEvents="auto",h.style.transition=" right 0.4s linear";{const g=()=>{h.style.bottom=`${e.cssPosition?e.cssPosition[0]:Q.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(h.style.right="auto",h.style.left=`${e.cssPosition?e.cssPosition[1]:Q.ESScale.defaults.cssPosition[1]}px`):(h.style.left="auto",h.style.right=`${e.cssPosition?e.cssPosition[1]:Q.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(p.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));g(),this.dispose(v.disposableOn(()=>g()))}const u=document.createElement("div");h.appendChild(u),this.dispose(()=>h.removeChild(u)),u.style.width="125px",u.style.display="inline-block",u.style.textAlign="center",u.style.fontSize="14px",u.style.fontWeight="lighter",u.style.lineHeight="30px",u.style.color="#fff",u.innerHTML="1000km";const A=document.createElement("div");h.appendChild(A),this.dispose(()=>h.removeChild(A)),A.style.borderRight="1px solid #fff",A.style.borderLeft="1px solid #fff",A.style.borderBottom="1px solid #fff",A.style.position="absolute",A.style.height="10px",A.style.top="15px",A.style.width="75px",A.style.left="30px";const f=()=>{const g=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||g&&g>1e6)h.style.display="none";else{h.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(u.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){A.style.width=`${y}px`;const m=(135-y)/2;A.style.left=`${m}px`}}};f();const d=setInterval(()=>{f()},200);this.dispose(()=>clearInterval(d))}}}get customDiv(){return this._customDiv}};L(lc,"type",lc.register("ESCesiumViewer",Q.ESScale.type,lc));let mg=lc;const uc=class uc extends Ge{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new st(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"position"],[e,"position"])),this.dispose(p.track([r,"scale"],[e,"scale"])),this.dispose(p.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(p.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(p.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(p.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(p.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(p.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(p.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(p.track([r,"cull"],[e,"cull"])),this.dispose(p.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(p.track([r,"pass"],[e,"pass"])),this.dispose(p.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(p.track([r,"renderState"],[e,"renderState"])),this.dispose(p.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(p.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(p.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(p.track([r,"attributes"],[e,"attributes"])),this.dispose(p.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(p.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(p.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(p.track([r,"count"],[e,"count"])),this.dispose(p.track([r,"offset"],[e,"offset"])),this.dispose(p.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(p.track([r,"localPosition"],[e,"localPosition"])),this.dispose(p.track([r,"localScale"],[e,"localScale"])),this.dispose(p.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(p.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(p.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(p.track([r,"occlude"],[e,"occlude"])),this.dispose(p.track([r,"castShadows"],[e,"castShadows"])),this.dispose(p.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(p.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(p.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(p.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const s=()=>{if(e.localRotation){const a=[...e.localRotation];a[0]-=90,r.localRotation=a}else r.localRotation=[-90,0,0]};s(),this.dispose(e.localRotationChanged.disposableOn(s))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s,!0),!0):!1}};L(uc,"type",uc.register("ESCesiumViewer",$r.type,uc));let gg=uc;const cc=class cc extends XA{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Sn(i.viewer))return;this.czmGeoPolyline=this.dv(new Je(i,e.id)),this.czmWater=this.dv(new Mo(i,e.id));const{czmGeoPolyline:s,czmWater:a}=this;this.d(p.track([a,"allowPicking"],[e,"allowPicking"])),this.d(p.track([a,"ground"],[e,"fillGround"])),this.d(p.track([s,"allowPicking"],[e,"allowPicking"])),this.d(p.track([s,"color"],[e,"strokeColor"])),this.d(p.track([s,"width"],[e,"strokeWidth"])),this.d(p.track([s,"ground"],[e,"strokeGround"]));{const l=this.dv(p.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),c=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??Q.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??Q.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??Q.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??Q.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??Q.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??Q.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??Q.ESDynamicWater.defaults.flowSpeed});else{const h=Object.assign({},td[e.waterType]);h.frequency&&(h.frequency/=10),h.waveVelocity&&(h.waveVelocity/=100),h.amplitude&&(h.amplitude*=100),this.updateWater(h)}};c(),this.d(l.don(c))}{const l=()=>{s.show=e.show&&e.stroked},c=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(c.don(l)),l()}{const l=()=>{a.show=!!(e.show&&e.filled)},c=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(c.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){s.positions=[],a.points=[];return}if(e.scale&&e.scale.some(A=>A===0)){console.warn("缩放属性(scale)不能设置值为0");return}const h=e.points.map(A=>[A[0],A[1],0]),[u]=pr({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},h);s.positions=[...u,u[0]],a.points=[...u]};l();const c=this.dv(p.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(c.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&s),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&s)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s!=null&&s.points?(Me(r,o,i,s.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:i}=this;i&&(e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection)}};L(cc,"type",cc.register("ESCesiumViewer",Q.ESDynamicWater.type,cc));let yg=cc;const hc=class hc extends Bn{constructor(e,i){super(e,i);L(this,"_scaleFactor",.6);L(this,"_urlData",this.dv(p.react(void 0)));L(this,"_dataSource",new C.CustomDataSource);L(this,"_clusterImages",{});L(this,"_clusterImageAttribute",{});L(this,"_clusterImageUrl","");if(!i.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var a;const r=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(r).then(l=>l.json()).then(l=>{this._clusterImageAttribute=l}).catch(l=>{console.error(l)});for(const l in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,l)){const c=this._clusterImageAttribute[l];this._clusterImages[l]=new C.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:C.VerticalOrigin.BOTTOM,horizontalOrigin:C.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:c.imageSize[0],height:c.imageSize[1],pixelOffset:new C.Cartesian2(-c.anchorPixelOffset[0]*this._scaleFactor,-c.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new C.BoundingRectangle(...c.imagePixelOffset,...c.imageSize)})}const s=this._dataSource;(a=i.viewer)==null||a.dataSources.add(s),this.d(()=>{var l;(l=i.viewer)==null||l.dataSources.remove(s)}),s.clustering.enabled=s.clustering.clusterBillboards=s.clustering.clusterLabels=s.clustering.clusterPoints=!0,this.d(p.track([s.clustering,"pixelRange"],[e,"pixelRange"])),this.d(p.track([s.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(p.track([s.clustering,"show"],[e,"show"]));{const l=()=>{if(e.url)do{if(typeof e.url=="object"&&e.url.url){fetch(Q.ESSceneObject.context.getStrFromEnv(e.url.url)).then(c=>c.json()).then(c=>{this.urlData=c}).catch(c=>{console.warn("ESEntityCluster数据加载失败",c)});break}if(typeof e.url=="object"){this.urlData=e.url;break}if(Q.isJSONString(e.url)){this.urlData=JSON.parse(e.url);break}fetch(Q.ESSceneObject.getStrFromEnv(e.url)).then(c=>c.json()).then(c=>{this.urlData=c}).catch(c=>{console.warn("ESEntityCluster数据加载失败",c)})}while(!1)};l(),this.d(e.urlChanged.don(l))}{const l=this.dv(p.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),c=this;this.d(l.don(()=>{this.updateEntityCluster(c)}))}{const l=(c,h)=>{c!=null&&((c==null?void 0:c.nonCluster.mode)!=(h==null?void 0:h.nonCluster.mode)||(c==null?void 0:c.nonCluster.style)!=(h==null?void 0:h.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((c,h)=>l(c,h)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var f,d,g,v,y,m,w,_,E,T,P,F;const{czmViewer:i,_dataSource:o,sceneObject:r}=e;if(!((f=i.viewer)==null?void 0:f.scene))return;const a=o.entities,l=new C.NearFarScalar(100,1,1e3,1),c=r.heightReference=="None"?C.HeightReference.NONE:r.heightReference=="CLAMP_TO_GROUND"?C.HeightReference.CLAMP_TO_GROUND:C.HeightReference.CLAMP_TO_TERRAIN;a.removeAll();const h=(d=this.czmViewer.viewer)==null?void 0:d.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(D=>{D.id.billboard.imageSubRegion=void 0}),h&&h())}),u=r.style??Q.ESEntityCluster.defaults.style;this._clusterImages[((g=u.nonCluster)==null?void 0:g.mode)??"SquareH01"].heightReference=c,this._clusterImages[((v=u.nonCluster)==null?void 0:v.mode)??"SquareH01"].scaleByDistance=l;const A=[-this._clusterImageAttribute[((y=u.nonCluster)==null?void 0:y.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((m=u.nonCluster)==null?void 0:m.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((w=u.nonCluster)==null?void 0:w.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((_=u.nonCluster)==null?void 0:_.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let D=0;D<this.urlData.features.length;D++){const B=this.urlData.features[D];if(B.geometry.type=="Point")this._addEntities(a,B.properties.name??(D+1).toString(),B.geometry.coordinates,A,c,l,(E=u.nonCluster)==null?void 0:E.mode,B.properties);else if(B.geometry.type=="MultiPoint")for(let S=0;S<B.geometry.coordinates.length;S++)this._addEntities(a,B.properties.name??(D+1).toString(),B.geometry.coordinates[S],A,c,l,(T=u.nonCluster)==null?void 0:T.mode,B.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",B.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let D=0;D<this.urlData.geometries.length;D++){const B=this.urlData.geometries[D];if(B.type=="Point")this._addEntities(a,B.name??(D+1).toString(),B.coordinates,A,c,l,(P=u.nonCluster)==null?void 0:P.mode,B.properties);else if(B.type=="MultiPoint")for(let S=0;S<B.coordinates.length;S++)this._addEntities(a,B.name??(D+1).toString(),B.coordinates[S],A,c,l,(F=u.nonCluster)==null?void 0:F.mode,B.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",B.type)}this.updateStyle(c,l)}async updateStyle(e,i){var l,c;const o=this,{_dataSource:r,sceneObject:s}=this,a=((l=s.style)==null?void 0:l.cluster)??Q.ESEntityCluster.defaults.style.cluster;r.entities.values.forEach(h=>{C.Entity.prototype&&(h.ESSceneObjectID=s.id)}),r.clustering.clusterEvent.addEventListener(async function(h,u){if(u.label.ESSceneObjectID=u.billboard.ESSceneObjectID=u.point.ESSceneObjectID=s.id,u.label.show=!0,u.label.font="16px sans-serif",u.label.scale=1*o._scaleFactor,u.label.verticalOrigin=C.VerticalOrigin.BOTTOM,u.label.horizontalOrigin=C.HorizontalOrigin.CENTER,u.label.eyeOffset=new C.Cartesian3(0,0,-10),e&&(u.label.heightReference=e),i&&(u.label.scaleByDistance=i),u.billboard.id=u.label.id,u.billboard.show=!0,u.billboard.scale=1*o._scaleFactor,u.billboard.verticalOrigin=C.VerticalOrigin.BOTTOM,u.billboard.horizontalOrigin=C.HorizontalOrigin.CENTER,e&&(u.billboard.heightReference=e),i&&(u.billboard.scaleByDistance=i),a){const A=o.getClusterStyle(a,h.length).mode,f=[-o._clusterImageAttribute[A].anchorPixelOffset[0]+o._clusterImageAttribute[A].textPixelOffset[0],-o._clusterImageAttribute[A].anchorPixelOffset[1]-o._clusterImageAttribute[A].textPixelOffset[1]];u.label.pixelOffset=new C.Cartesian2(f[0]*o._scaleFactor,f[1]*o._scaleFactor),u.billboard.width=o._clusterImageAttribute[A].imageSize[0],u.billboard.height=o._clusterImageAttribute[A].imageSize[1],u.billboard.pixelOffset=new C.Cartesian2(-o._clusterImageAttribute[A].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[A].anchorPixelOffset[1]*o._scaleFactor),u.billboard.setImage(A,o._clusterImageUrl),u.billboard.setImageSubRegion(A,new C.BoundingRectangle(...o._clusterImageAttribute[A].imagePixelOffset,...o._clusterImageAttribute[A].imageSize))}});{const h=()=>{const A=r.clustering.pixelRange;r.clustering.pixelRange=0,r.clustering.pixelRange=A};h();let u=(c=this.czmViewer.viewer)==null?void 0:c.camera.moveEnd.addEventListener(()=>{h()});this.d(()=>{var A;u&&((A=this.czmViewer.viewer)==null||A.camera.moveEnd.removeEventListener(u))})}}getClusterStyle(e,i){return e.find(o=>{if(o.value!==void 0)return o.value===i;const r=o.minValue!==void 0?o.minValue<=i:!0,s=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&s})}_addEntities(e,i,o,r,s,a,l,c){const h=C.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:h,label:{text:i,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:C.VerticalOrigin.BOTTOM,horizontalOrigin:C.HorizontalOrigin.CENTER,pixelOffset:new C.Cartesian2(r[0]*this._scaleFactor,r[1]*this._scaleFactor),heightReference:s,scaleByDistance:a,eyeOffset:new C.Cartesian3(0,0,-10)},billboard:this._clusterImages[l??"SquareH01"].clone(new C.BillboardGraphics),properties:c})}_getPositionLLH(e){const i=C.Cartographic.fromCartesian(e);return[C.Math.toDegrees(i.longitude),C.Math.toDegrees(i.latitude),i.height]}};L(hc,"type",hc.register("ESCesiumViewer",Q.ESEntityCluster.type,hc));let vg=hc;const Ac=class Ac extends Bn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(Ac,"type",Ac.register("ESCesiumViewer",Kr.type,Ac));let wg=Ac;const fc=class fc extends Tn{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Sn(i.viewer))return;this.geoPolyline=this.dv(new Je(i,e.id)),this.czmWater=this.dv(new Mo(i,e.id));const{geoPolyline:s,czmWater:a}=this;this.d(p.track([a,"allowPicking"],[e,"allowPicking"])),this.d(p.track([a,"ground"],[e,"fillGround"])),this.d(p.track([s,"allowPicking"],[e,"allowPicking"])),this.d(p.track([s,"color"],[e,"strokeColor"])),this.d(p.track([s,"width"],[e,"strokeWidth"])),this.d(p.track([s,"ground"],[e,"strokeGround"]));{const l=this.dv(p.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),c=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??Q.ESGeoWater.defaults.waterColor,frequency:(e.frequency??Q.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??Q.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??Q.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??Q.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??Q.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??Q.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??Q.ESGeoWater.defaults.waterImage});else{const h=Object.assign({},td[e.waterType]);h.frequency&&(h.frequency/=10),h.waveVelocity&&(h.waveVelocity/=100),h.amplitude&&(h.amplitude*=100),this.updateWater(h)}};c(),this.d(l.don(c))}{const l=()=>{s.show=!!(e.show&&e.stroked)},c=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(c.don(l)),l()}{const l=()=>{a.show=e.show&&e.filled},c=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(c.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(s.positions=[...e.points,e.points[0]],a.points=[...e.points]):(s.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],a.points=[])};l();const c=this.dv(p.createNextAnimateFrameEvent(e.pointsChanged));this.d(c.don(l))}this.ad(e.editingChanged.don(l=>{a.updateBoundingSphere(l)}))}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}updateWater(e){const{czmWater:i}=this;e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection}};L(fc,"type",fc.register("ESCesiumViewer",Q.ESGeoWater.type,fc));let bg=fc;const dc=class dc extends Bn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Nr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(p.track([r,"show"],[e,"show"])),this.d(p.track([r,"zIndex"],[e,"zIndex"])),this.d(p.track([r,"rectangle"],[e,"rectangle"])),this.d(p.bind([r,"alpha"],[e,"opacity"])),this.d(p.bind([r,"alpha"],[e,"czmAlpha"])),this.d(p.track([r,"splitDirection"],[e,"splitDirection"])),this.d(p.track([r,"brightness"],[e,"czmBrightness"])),this.d(p.track([r,"contrast"],[e,"czmContrast"])),this.d(p.track([r,"hue"],[e,"czmHue"])),this.d(p.track([r,"saturation"],[e,"czmSaturation"])),this.d(p.track([r,"gamma"],[e,"czmGamma"]));{const s=this.dv(p.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),a=()=>{r.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};a(),this.d(s.don(a))}}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(dc,"type",dc.register("ESCesiumViewer",qr.type,dc));let _g=dc;class rL extends p.Destroyable{constructor(n,e){super(),this._czmESPipeFence=n,this._sceneObject=e;const i=this._sceneObject,o=this._czmESPipeFence,r=o.czmCustomPrimitive;if(!i.points||i.points.length<2){this.clear(r);return}const s=i.points.length;let a=[],l=[],c=[],h=[],u=[];for(let y=0;y<s-1;y++){const{outlinePionts:m,customPrimitivePoints:w}=this.divideFourPoints(i.points[y],i.points[y+1]);h.push(...w),u.push(...m),c.push(...this.setIndexs(y))}const[A,f,d]=fn({originPosition:h[0]},h),g=this.setFaces(A);a.push(...g.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(r,f,a,c,l)}divideFourPoints(n,e){const i=Q.geoHeading(n,e),o=Q.geoDestination(n,this._sceneObject.width/2,90+i),r=Q.geoDestination(n,this._sceneObject.width/2,i-90),s=Q.geoDestination(e,this._sceneObject.width/2,i-90),a=Q.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],c=[o[0],o[1],o[2]-this._sceneObject.height/2],h=[r[0],r[1],r[2]+this._sceneObject.height/2],u=[r[0],r[1],r[2]-this._sceneObject.height/2],A=[a[0],a[1],a[2]+this._sceneObject.height/2],f=[a[0],a[1],a[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],g=[s[0],s[1],s[2]-this._sceneObject.height/2],v=[[l,h],[l,A],[l,c],[c,f]],y=[[c,u],[h,d],[h,u],[u,g]],m=[[A,f],[A,d],[f,g],[d,g]];return{outlinePionts:[...v,...y,...m],customPrimitivePoints:[c,l,h,u,f,A,d,g]}}setIndexs(n){const e=n*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(n){const e=[],i=n.length/8;for(let r=0;r<i;r++){const s=n.slice(8*r,8*(r+1));e.push(s)}return[...e.map(r=>[r[4],r[5],r[1],r[0],r[5],r[6],r[2],r[1],r[6],r[7],r[3],r[2],r[7],r[4],r[0],r[3]]).flat()]}getDistances(n,e){const[i]=fn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,c,h,u)=>{if(h===0)return l.push(0),l;const A=h-1,f=u[A],d=Math.sqrt((f[0]-c[0])*(f[0]-c[0])+(f[1]-c[1])*(f[1]-c[1]));return l.push(l[A]+d),l},[]),s=r[o-1];return e.distances=s,r.map(l=>l/s)}setTextureCoordinates(n,e){if(!n.points||n.points.length<2)return;const i=this.getDistances(n.points,e),o=[];for(let r=1;r<i.length;r++){let s=[];if(r===i.length-1){const a=[1,0,1,1,i[r-1],1,i[r-1],0];s=[...a,...a,...a,...a]}else{const a=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];s=[...a,...a,...a,...a]}o.push(s)}return o}updateCustomPrimitive(n,e,i,o,r){n.modelMatrix=e,n.indexTypedArray=new Uint16Array(o),n.attributes={position:{typedArray:new Float32Array(i),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(r),componentsPerAttribute:2}}}clear(n){n.indexTypedArray=void 0,n.modelMatrix=void 0,n.attributes=void 0}}const pc=class pc extends an{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Je(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new At(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new st(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(p.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,s=this._line;this.d(p.bind([s,"positions"],[e,"points"])),this.d(p.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(p.track([this.line,"color"],[e,"strokeColor"])),this.d(p.track([this.line,"width"],[e,"strokeWidth"])),this.d(p.track([this.line,"ground"],[e,"strokeGround"]));{const h=this.dv(p.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new p.ObjResettingWithEvent(h,()=>new rL(this,this.sceneObject)))}{const h=()=>{s.show=e.show&&e.stroked};h();const u=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(h))}this.bindCustomPrimitive(e);let a="";const l=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),c=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const h=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?a=c:a=l,r.uri=a,this._czmCustomPrimitive.uniformMap={u_image:{type:"texture",id:r.id},u_stScale:[this.distances/50,1],u_speed:[.02,0],u_color:e.fillColor}};h(),this.dispose(this.sceneObject.fillColorChanged.disposableOn(h)),this.d(this.sceneObject.materialModeChanged.don(h)),this.d(this.distancesChanged.don(h))}}get line(){return this._line}czmTexture(){return this._czmTexture}get czmCustomPrimitive(){return this._czmCustomPrimitive}get distances(){return this._distances.value}set distances(e){this._distances.value=e}get distancesChanged(){return this._distances.changed}computeBoundingBox(){const e=this._czmCustomPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!e)return;const{min:i,max:o}=e;this._czmCustomPrimitive.setLocalAxisedBoundingBox(i,o)}bindCustomPrimitive(e){const i=this._czmCustomPrimitive;this.d(p.track([i,"allowPicking"],[e,"allowPicking"])),i.renderState={depthTest:{enabled:!0},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},i.vertexShaderSource=` in vec3 position;
|
|
3983
|
+
`};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(a.disposableOn(s))}this.dispose(this.flyToEvent.disposableOn(s=>{this.czmCustomPrimitive.flyTo(s)}));{const s=()=>{const l=r.value?r.value:1,c=this.height??sr.defaults.height,{textureSizeInMeters:h=sr.defaults.textureSizeInMeters}=this,{textureUri:u=sr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:u},u_stScale:[l/h[0],c/h[1]],u_speed:this.textureMoveSpeed??sr.defaults.textureMoveSpeed,u_color:this.textureColor??sr.defaults.textureColor}};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(a.disposableOn(s))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};L(sr,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Ko=sr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:p.reactPositions(void 0),height:void 0,textureSizeInMeters:p.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:p.reactArrayWithUndefined(void 0),textureColor:p.reactArrayWithUndefined(void 0)})})(Ko||(Ko={})),p.extendClassProps(Ko.prototype,Ko.createDefaultProps);const oc=class oc extends an{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Ko(i,e.id)),this._czmPolygon=this.dv(new Q.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,s=this._czmPolygon;i.add(s),this.dispose(()=>i.delete(s)),s.filled=!1,this.d(p.track([s,"points"],[e,"points"])),this.d(p.track([s,"stroked"],[e,"stroked"])),this.d(p.track([s,"strokeColor"],[e,"strokeColor"])),this.d(p.track([s,"strokeWidth"],[e,"strokeWidth"])),this.d(p.track([s,"strokeGround"],[e,"strokeGround"]));{const a={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},l=(A,f)=>{switch(A){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[f,f]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[f,f]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[f,f]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[f*.5,2]}}},c="${earthsdk3-assets-script-dir}/assets/img/fence/",h=()=>{const A=e.materialMode,f=a[A];if(!f)return;r.textureUri=c+f.image,r.textureColor=A!=="gradientColor"?f.color:e.fillColor;const{textureMoveSpeed:d,textureSizeInMeters:g}=l(A,e.height);r.textureMoveSpeed=d,r.textureSizeInMeters=g};h();const u=this.disposeVar(p.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(u.disposableOn(h))}{this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"height"],[e,"height"]));{const a=()=>{r.show=e.show&&e.filled};a();const l=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(a))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(dn(r,o,i,e,s.czmCustomPrimitive),!0):!1}};L(oc,"type",oc.register("ESCesiumViewer",Q.ESPolygonFence.type,oc));let fg=oc;const ac=class ac extends an{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new pi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(p.bind([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"ground"],[e,"fillGround"])),this.dispose(p.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(p.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(p.bind([r,"height"],[e,"height"])),this.dispose(p.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(p.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(p.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(p.bind([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"outline"],[e,"stroked"])),this.dispose(p.track([r,"outlineColor"],[e,"strokeColor"]));{const s=()=>{const a=e.points;if(a&&a.length>=2){const{minPos:l,maxPos:c}=Q.getMinMaxCorner(a);r.rectangle=[l[0],l[1],c[0],c[1]],r.height=a[1][2],r.extrudedHeight=a[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};s(),this.dispose(e.pointsChanged.disposableOn(()=>s()))}{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(a.disposableOn(s))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:s}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(s.rectangle){const a=[[s.rectangle[0],s.rectangle[1],s.height],[s.rectangle[2],s.rectangle[3],s.height],[s.rectangle[0],s.rectangle[1],s.extrudedHeight],[s.rectangle[2],s.rectangle[3],s.extrudedHeight]];return Me(r,o,i,a,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:s}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(s.rectangle){const a=[[s.rectangle[0],s.rectangle[1],s.height],[s.rectangle[2],s.rectangle[3],s.height],[s.rectangle[0],s.rectangle[1],s.extrudedHeight],[s.rectangle[2],s.rectangle[3],s.extrudedHeight]];return Me(r,o,i,a,e),!0}return!1}};L(ac,"type",ac.register("ESCesiumViewer",Q.ESRectangle.type,ac));let dg=ac;const lo=class lo extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=Q.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],lo.defaults.imageUrl),s=this.disposeVar(p.react(void 0)),a=()=>{const m=C.Material.fromType(C.Material.ImageType);m.uniforms.image=r.value,m.uniforms.repeat=Xe(this.repeat??lo.defaults.repeat),s.value=m};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(a));const c=(m,w)=>{const _=new C.PolylineMaterialAppearance({material:w,renderState:{depthTest:{enabled:!1}}});_.renderState.depthMask=!1;const E=[];if(m.length<2)return;E.push(new C.GeometryInstance({geometry:new C.GroundPolylineGeometry({positions:m,width:this.width??lo.defaults.width,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:C.ArcType[this.arcType??lo.defaults.arcType]}),id:this}));const T=new bi({geometryInstances:E,appearance:_,asynchronous:!1,allowPicking:this.allowPicking??lo.defaults.allowPicking,compressVertices:!1});return T.ESSceneObjectID=i,T};let h;const u=new C.BoundingSphere,A=()=>{h&&(o.scene.primitives.remove(h),h=void 0)};this.dispose(A);const f=()=>{if(A(),!this.positions)return;const m=Zt(this.positions);if(m.length<2||!s.value){u.radius=-1;return}C.BoundingSphere.fromPoints(m,u),h=c(m,s.value),h&&o.scene.primitives.add(h)},d=()=>{h&&(h.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(m=>{if(e.actived&&u.radius>0){const w=Ue(u.center);w&&Be(o,w,u.radius*4,void 0,m)}})),f(),d();const g=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,s.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(g.disposableOn(()=>{f(),d()}));const v=this.disposeVar(p.createNextAnimateFrameEvent(this.showChanged));this.dispose(v.disposableOn(()=>{d()}));const{extensions:y}=e;if(!y){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(lo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Zo=lo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:p.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Zo||(Zo={})),p.extendClassProps(Zo.prototype,Zo.createDefaultProps);const sc=class sc extends an{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Zo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const s=()=>{r.show=e.show&&e.stroked};s();const a=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(a.don(s))}this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"width"],[e,"width"])),this.dispose(p.track([r,"arcType"],[e,"arcType"])),this.dispose(p.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(p.track([r,"repeat"],[e,"repeat"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(sc,"type",sc.register("ESCesiumViewer",Jr.type,sc));let pg=sc;const lc=class lc extends Q.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new Q.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends p.Destroyable{constructor(a,l,c){super(),this._subContainer=a;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h));{const g=()=>{h.style.display=e.show??Q.ESScale.defaults.show?"block":"none"};g(),e.dispose(e.showChanged.disposableOn(g))}h.style.position="fixed",h.style.width="125px",h.style.height="30px",h.style.border="1px solid rgba(49,50,56,.8)",h.style.padding="0 5px",h.style.backgroundColor="rgba(37,38,42,.8)",h.style.borderRadius="15px",h.style.pointerEvents="auto",h.style.transition=" right 0.4s linear";{const g=()=>{h.style.bottom=`${e.cssPosition?e.cssPosition[0]:Q.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(h.style.right="auto",h.style.left=`${e.cssPosition?e.cssPosition[1]:Q.ESScale.defaults.cssPosition[1]}px`):(h.style.left="auto",h.style.right=`${e.cssPosition?e.cssPosition[1]:Q.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(p.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));g(),this.dispose(v.disposableOn(()=>g()))}const u=document.createElement("div");h.appendChild(u),this.dispose(()=>h.removeChild(u)),u.style.width="125px",u.style.display="inline-block",u.style.textAlign="center",u.style.fontSize="14px",u.style.fontWeight="lighter",u.style.lineHeight="30px",u.style.color="#fff",u.innerHTML="1000km";const A=document.createElement("div");h.appendChild(A),this.dispose(()=>h.removeChild(A)),A.style.borderRight="1px solid #fff",A.style.borderLeft="1px solid #fff",A.style.borderBottom="1px solid #fff",A.style.position="absolute",A.style.height="10px",A.style.top="15px",A.style.width="75px",A.style.left="30px";const f=()=>{const g=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||g&&g>1e6)h.style.display="none";else{h.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(u.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){A.style.width=`${y}px`;const m=(135-y)/2;A.style.left=`${m}px`}}};f();const d=setInterval(()=>{f()},200);this.dispose(()=>clearInterval(d))}}}get customDiv(){return this._customDiv}};L(lc,"type",lc.register("ESCesiumViewer",Q.ESScale.type,lc));let mg=lc;const uc=class uc extends Ge{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new st(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(p.track([r,"position"],[e,"position"])),this.dispose(p.track([r,"scale"],[e,"scale"])),this.dispose(p.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(p.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(p.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(p.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(p.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(p.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(p.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(p.track([r,"cull"],[e,"cull"])),this.dispose(p.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(p.track([r,"pass"],[e,"pass"])),this.dispose(p.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(p.track([r,"renderState"],[e,"renderState"])),this.dispose(p.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(p.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(p.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(p.track([r,"attributes"],[e,"attributes"])),this.dispose(p.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(p.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(p.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(p.track([r,"count"],[e,"count"])),this.dispose(p.track([r,"offset"],[e,"offset"])),this.dispose(p.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(p.track([r,"localPosition"],[e,"localPosition"])),this.dispose(p.track([r,"localScale"],[e,"localScale"])),this.dispose(p.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(p.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(p.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(p.track([r,"occlude"],[e,"occlude"])),this.dispose(p.track([r,"castShadows"],[e,"castShadows"])),this.dispose(p.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(p.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(p.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(p.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const s=()=>{if(e.localRotation){const a=[...e.localRotation];a[0]-=90,r.localRotation=a}else r.localRotation=[-90,0,0]};s(),this.dispose(e.localRotationChanged.disposableOn(s))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(dn(r,o,i,e,s,!0),!0):!1}};L(uc,"type",uc.register("ESCesiumViewer",$r.type,uc));let gg=uc;const cc=class cc extends XA{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Sn(i.viewer))return;this.czmGeoPolyline=this.dv(new Je(i,e.id)),this.czmWater=this.dv(new Mo(i,e.id));const{czmGeoPolyline:s,czmWater:a}=this;this.d(p.track([a,"allowPicking"],[e,"allowPicking"])),this.d(p.track([a,"ground"],[e,"fillGround"])),this.d(p.track([s,"allowPicking"],[e,"allowPicking"])),this.d(p.track([s,"color"],[e,"strokeColor"])),this.d(p.track([s,"width"],[e,"strokeWidth"])),this.d(p.track([s,"ground"],[e,"strokeGround"]));{const l=this.dv(p.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),c=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??Q.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??Q.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??Q.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??Q.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??Q.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??Q.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??Q.ESDynamicWater.defaults.flowSpeed});else{const h=Object.assign({},td[e.waterType]);h.frequency&&(h.frequency/=10),h.waveVelocity&&(h.waveVelocity/=100),h.amplitude&&(h.amplitude*=100),this.updateWater(h)}};c(),this.d(l.don(c))}{const l=()=>{s.show=e.show&&e.stroked},c=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(c.don(l)),l()}{const l=()=>{a.show=!!(e.show&&e.filled)},c=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(c.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){s.positions=[],a.points=[];return}if(e.scale&&e.scale.some(A=>A===0)){console.warn("缩放属性(scale)不能设置值为0");return}const h=e.points.map(A=>[A[0],A[1],0]),[u]=pr({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},h);s.positions=[...u,u[0]],a.points=[...u]};l();const c=this.dv(p.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(c.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=Q.getDistancesFromPositions([e.position,_n(i.viewer.camera)],"NONE")[0];let s=!1;e.minVisibleDistance<e.maxVisibleDistance?s=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(s=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&s),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&s)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s!=null&&s.points?(Me(r,o,i,s.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:i}=this;i&&(e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection)}};L(cc,"type",cc.register("ESCesiumViewer",Q.ESDynamicWater.type,cc));let yg=cc;const hc=class hc extends Bn{constructor(e,i){super(e,i);L(this,"_scaleFactor",.6);L(this,"_urlData",this.dv(p.react(void 0)));L(this,"_dataSource",new C.CustomDataSource);L(this,"_clusterImages",{});L(this,"_clusterImageAttribute",{});L(this,"_clusterImageUrl","");if(!i.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var a;const r=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(r).then(l=>l.json()).then(l=>{this._clusterImageAttribute=l}).catch(l=>{console.error(l)});for(const l in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,l)){const c=this._clusterImageAttribute[l];this._clusterImages[l]=new C.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:C.VerticalOrigin.BOTTOM,horizontalOrigin:C.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:c.imageSize[0],height:c.imageSize[1],pixelOffset:new C.Cartesian2(-c.anchorPixelOffset[0]*this._scaleFactor,-c.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new C.BoundingRectangle(...c.imagePixelOffset,...c.imageSize)})}const s=this._dataSource;(a=i.viewer)==null||a.dataSources.add(s),this.d(()=>{var l;(l=i.viewer)==null||l.dataSources.remove(s)}),s.clustering.enabled=s.clustering.clusterBillboards=s.clustering.clusterLabels=s.clustering.clusterPoints=!0,this.d(p.track([s.clustering,"pixelRange"],[e,"pixelRange"])),this.d(p.track([s.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(p.track([s.clustering,"show"],[e,"show"]));{const l=()=>{if(e.url)do{if(typeof e.url=="object"&&e.url.url){fetch(Q.ESSceneObject.context.getStrFromEnv(e.url.url)).then(c=>c.json()).then(c=>{this.urlData=c}).catch(c=>{console.warn("ESEntityCluster数据加载失败",c)});break}if(typeof e.url=="object"){this.urlData=e.url;break}if(Q.isJSONString(e.url)){this.urlData=JSON.parse(e.url);break}fetch(Q.ESSceneObject.getStrFromEnv(e.url)).then(c=>c.json()).then(c=>{this.urlData=c}).catch(c=>{console.warn("ESEntityCluster数据加载失败",c)})}while(!1)};l(),this.d(e.urlChanged.don(l))}{const l=this.dv(p.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),c=this;this.d(l.don(()=>{this.updateEntityCluster(c)}))}{const l=(c,h)=>{c!=null&&((c==null?void 0:c.nonCluster.mode)!=(h==null?void 0:h.nonCluster.mode)||(c==null?void 0:c.nonCluster.style)!=(h==null?void 0:h.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((c,h)=>l(c,h)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var f,d,g,v,y,m,w,_,E,T,P,F;const{czmViewer:i,_dataSource:o,sceneObject:r}=e;if(!((f=i.viewer)==null?void 0:f.scene))return;const a=o.entities,l=new C.NearFarScalar(100,1,1e3,1),c=r.heightReference=="None"?C.HeightReference.NONE:r.heightReference=="CLAMP_TO_GROUND"?C.HeightReference.CLAMP_TO_GROUND:C.HeightReference.CLAMP_TO_TERRAIN;a.removeAll();const h=(d=this.czmViewer.viewer)==null?void 0:d.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(D=>{D.id.billboard.imageSubRegion=void 0}),h&&h())}),u=r.style??Q.ESEntityCluster.defaults.style;this._clusterImages[((g=u.nonCluster)==null?void 0:g.mode)??"SquareH01"].heightReference=c,this._clusterImages[((v=u.nonCluster)==null?void 0:v.mode)??"SquareH01"].scaleByDistance=l;const A=[-this._clusterImageAttribute[((y=u.nonCluster)==null?void 0:y.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((m=u.nonCluster)==null?void 0:m.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((w=u.nonCluster)==null?void 0:w.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((_=u.nonCluster)==null?void 0:_.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let D=0;D<this.urlData.features.length;D++){const B=this.urlData.features[D];if(B.geometry.type=="Point")this._addEntities(a,B.properties.name??(D+1).toString(),B.geometry.coordinates,A,c,l,(E=u.nonCluster)==null?void 0:E.mode,B.properties);else if(B.geometry.type=="MultiPoint")for(let S=0;S<B.geometry.coordinates.length;S++)this._addEntities(a,B.properties.name??(D+1).toString(),B.geometry.coordinates[S],A,c,l,(T=u.nonCluster)==null?void 0:T.mode,B.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",B.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let D=0;D<this.urlData.geometries.length;D++){const B=this.urlData.geometries[D];if(B.type=="Point")this._addEntities(a,B.name??(D+1).toString(),B.coordinates,A,c,l,(P=u.nonCluster)==null?void 0:P.mode,B.properties);else if(B.type=="MultiPoint")for(let S=0;S<B.coordinates.length;S++)this._addEntities(a,B.name??(D+1).toString(),B.coordinates[S],A,c,l,(F=u.nonCluster)==null?void 0:F.mode,B.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",B.type)}this.updateStyle(c,l)}async updateStyle(e,i){var l,c;const o=this,{_dataSource:r,sceneObject:s}=this,a=((l=s.style)==null?void 0:l.cluster)??Q.ESEntityCluster.defaults.style.cluster;r.entities.values.forEach(h=>{C.Entity.prototype&&(h.ESSceneObjectID=s.id)}),r.clustering.clusterEvent.addEventListener(async function(h,u){if(u.label.ESSceneObjectID=u.billboard.ESSceneObjectID=u.point.ESSceneObjectID=s.id,u.label.show=!0,u.label.font="16px sans-serif",u.label.scale=1*o._scaleFactor,u.label.verticalOrigin=C.VerticalOrigin.BOTTOM,u.label.horizontalOrigin=C.HorizontalOrigin.CENTER,u.label.eyeOffset=new C.Cartesian3(0,0,-10),e&&(u.label.heightReference=e),i&&(u.label.scaleByDistance=i),u.billboard.id=u.label.id,u.billboard.show=!0,u.billboard.scale=1*o._scaleFactor,u.billboard.verticalOrigin=C.VerticalOrigin.BOTTOM,u.billboard.horizontalOrigin=C.HorizontalOrigin.CENTER,e&&(u.billboard.heightReference=e),i&&(u.billboard.scaleByDistance=i),a){const A=o.getClusterStyle(a,h.length).mode,f=[-o._clusterImageAttribute[A].anchorPixelOffset[0]+o._clusterImageAttribute[A].textPixelOffset[0],-o._clusterImageAttribute[A].anchorPixelOffset[1]-o._clusterImageAttribute[A].textPixelOffset[1]];u.label.pixelOffset=new C.Cartesian2(f[0]*o._scaleFactor,f[1]*o._scaleFactor),u.billboard.width=o._clusterImageAttribute[A].imageSize[0],u.billboard.height=o._clusterImageAttribute[A].imageSize[1],u.billboard.pixelOffset=new C.Cartesian2(-o._clusterImageAttribute[A].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[A].anchorPixelOffset[1]*o._scaleFactor),u.billboard.setImage(A,o._clusterImageUrl),u.billboard.setImageSubRegion(A,new C.BoundingRectangle(...o._clusterImageAttribute[A].imagePixelOffset,...o._clusterImageAttribute[A].imageSize))}});{const h=()=>{const A=r.clustering.pixelRange;r.clustering.pixelRange=0,r.clustering.pixelRange=A};h();let u=(c=this.czmViewer.viewer)==null?void 0:c.camera.moveEnd.addEventListener(()=>{h()});this.d(()=>{var A;u&&((A=this.czmViewer.viewer)==null||A.camera.moveEnd.removeEventListener(u))})}}getClusterStyle(e,i){return e.find(o=>{if(o.value!==void 0)return o.value===i;const r=o.minValue!==void 0?o.minValue<=i:!0,s=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&s})}_addEntities(e,i,o,r,s,a,l,c){const h=C.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:h,label:{text:i,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:C.VerticalOrigin.BOTTOM,horizontalOrigin:C.HorizontalOrigin.CENTER,pixelOffset:new C.Cartesian2(r[0]*this._scaleFactor,r[1]*this._scaleFactor),heightReference:s,scaleByDistance:a,eyeOffset:new C.Cartesian3(0,0,-10)},billboard:this._clusterImages[l??"SquareH01"].clone(new C.BillboardGraphics),properties:c})}_getPositionLLH(e){const i=C.Cartographic.fromCartesian(e);return[C.Math.toDegrees(i.longitude),C.Math.toDegrees(i.latitude),i.height]}};L(hc,"type",hc.register("ESCesiumViewer",Q.ESEntityCluster.type,hc));let vg=hc;const Ac=class Ac extends Bn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(Ac,"type",Ac.register("ESCesiumViewer",Kr.type,Ac));let wg=Ac;const fc=class fc extends Tn{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Sn(i.viewer))return;this.geoPolyline=this.dv(new Je(i,e.id)),this.czmWater=this.dv(new Mo(i,e.id));const{geoPolyline:s,czmWater:a}=this;this.d(p.track([a,"allowPicking"],[e,"allowPicking"])),this.d(p.track([a,"ground"],[e,"fillGround"])),this.d(p.track([s,"allowPicking"],[e,"allowPicking"])),this.d(p.track([s,"color"],[e,"strokeColor"])),this.d(p.track([s,"width"],[e,"strokeWidth"])),this.d(p.track([s,"ground"],[e,"strokeGround"]));{const l=this.dv(p.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),c=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??Q.ESGeoWater.defaults.waterColor,frequency:(e.frequency??Q.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??Q.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??Q.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??Q.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??Q.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??Q.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??Q.ESGeoWater.defaults.waterImage});else{const h=Object.assign({},td[e.waterType]);h.frequency&&(h.frequency/=10),h.waveVelocity&&(h.waveVelocity/=100),h.amplitude&&(h.amplitude*=100),this.updateWater(h)}};c(),this.d(l.don(c))}{const l=()=>{s.show=!!(e.show&&e.stroked)},c=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(c.don(l)),l()}{const l=()=>{a.show=e.show&&e.filled},c=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(c.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(s.positions=[...e.points,e.points[0]],a.points=[...e.points]):(s.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],a.points=[])};l();const c=this.dv(p.createNextAnimateFrameEvent(e.pointsChanged));this.d(c.don(l))}this.ad(e.editingChanged.don(l=>{a.updateBoundingSphere(l)}))}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}updateWater(e){const{czmWater:i}=this;e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection}};L(fc,"type",fc.register("ESCesiumViewer",Q.ESGeoWater.type,fc));let bg=fc;const dc=class dc extends Bn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Nr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(p.track([r,"show"],[e,"show"])),this.d(p.track([r,"zIndex"],[e,"zIndex"])),this.d(p.track([r,"rectangle"],[e,"rectangle"])),this.d(p.bind([r,"alpha"],[e,"opacity"])),this.d(p.bind([r,"alpha"],[e,"czmAlpha"])),this.d(p.track([r,"splitDirection"],[e,"splitDirection"])),this.d(p.track([r,"brightness"],[e,"czmBrightness"])),this.d(p.track([r,"contrast"],[e,"czmContrast"])),this.d(p.track([r,"hue"],[e,"czmHue"])),this.d(p.track([r,"saturation"],[e,"czmSaturation"])),this.d(p.track([r,"gamma"],[e,"czmGamma"]));{const s=this.dv(p.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),a=()=>{r.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};a(),this.d(s.don(a))}}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(dc,"type",dc.register("ESCesiumViewer",qr.type,dc));let _g=dc;class oL extends p.Destroyable{constructor(n,e){super(),this._czmESPipeFence=n,this._sceneObject=e;const i=this._sceneObject,o=this._czmESPipeFence,r=o.czmCustomPrimitive;if(!i.points||i.points.length<2){this.clear(r);return}const s=i.points.length;let a=[],l=[],c=[],h=[],u=[];for(let y=0;y<s-1;y++){const{outlinePionts:m,customPrimitivePoints:w}=this.divideFourPoints(i.points[y],i.points[y+1]);h.push(...w),u.push(...m),c.push(...this.setIndexs(y))}const[A,f,d]=fn({originPosition:h[0]},h),g=this.setFaces(A);a.push(...g.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(r,f,a,c,l)}divideFourPoints(n,e){const i=Q.geoHeading(n,e),o=Q.geoDestination(n,this._sceneObject.width/2,90+i),r=Q.geoDestination(n,this._sceneObject.width/2,i-90),s=Q.geoDestination(e,this._sceneObject.width/2,i-90),a=Q.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],c=[o[0],o[1],o[2]-this._sceneObject.height/2],h=[r[0],r[1],r[2]+this._sceneObject.height/2],u=[r[0],r[1],r[2]-this._sceneObject.height/2],A=[a[0],a[1],a[2]+this._sceneObject.height/2],f=[a[0],a[1],a[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],g=[s[0],s[1],s[2]-this._sceneObject.height/2],v=[[l,h],[l,A],[l,c],[c,f]],y=[[c,u],[h,d],[h,u],[u,g]],m=[[A,f],[A,d],[f,g],[d,g]];return{outlinePionts:[...v,...y,...m],customPrimitivePoints:[c,l,h,u,f,A,d,g]}}setIndexs(n){const e=n*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(n){const e=[],i=n.length/8;for(let r=0;r<i;r++){const s=n.slice(8*r,8*(r+1));e.push(s)}return[...e.map(r=>[r[4],r[5],r[1],r[0],r[5],r[6],r[2],r[1],r[6],r[7],r[3],r[2],r[7],r[4],r[0],r[3]]).flat()]}getDistances(n,e){const[i]=fn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,c,h,u)=>{if(h===0)return l.push(0),l;const A=h-1,f=u[A],d=Math.sqrt((f[0]-c[0])*(f[0]-c[0])+(f[1]-c[1])*(f[1]-c[1]));return l.push(l[A]+d),l},[]),s=r[o-1];return e.distances=s,r.map(l=>l/s)}setTextureCoordinates(n,e){if(!n.points||n.points.length<2)return;const i=this.getDistances(n.points,e),o=[];for(let r=1;r<i.length;r++){let s=[];if(r===i.length-1){const a=[1,0,1,1,i[r-1],1,i[r-1],0];s=[...a,...a,...a,...a]}else{const a=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];s=[...a,...a,...a,...a]}o.push(s)}return o}updateCustomPrimitive(n,e,i,o,r){n.modelMatrix=e,n.indexTypedArray=new Uint16Array(o),n.attributes={position:{typedArray:new Float32Array(i),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(r),componentsPerAttribute:2}}}clear(n){n.indexTypedArray=void 0,n.modelMatrix=void 0,n.attributes=void 0}}const pc=class pc extends an{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Je(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new At(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new st(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(p.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,s=this._line;this.d(p.bind([s,"positions"],[e,"points"])),this.d(p.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(p.track([this.line,"color"],[e,"strokeColor"])),this.d(p.track([this.line,"width"],[e,"strokeWidth"])),this.d(p.track([this.line,"ground"],[e,"strokeGround"]));{const h=this.dv(p.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new p.ObjResettingWithEvent(h,()=>new oL(this,this.sceneObject)))}{const h=()=>{s.show=e.show&&e.stroked};h();const u=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(h))}this.bindCustomPrimitive(e);let a="";const l=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),c=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const h=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?a=c:a=l,r.uri=a,this._czmCustomPrimitive.uniformMap={u_image:{type:"texture",id:r.id},u_stScale:[this.distances/50,1],u_speed:[.02,0],u_color:e.fillColor}};h(),this.dispose(this.sceneObject.fillColorChanged.disposableOn(h)),this.d(this.sceneObject.materialModeChanged.don(h)),this.d(this.distancesChanged.don(h))}}get line(){return this._line}czmTexture(){return this._czmTexture}get czmCustomPrimitive(){return this._czmCustomPrimitive}get distances(){return this._distances.value}set distances(e){this._distances.value=e}get distancesChanged(){return this._distances.changed}computeBoundingBox(){const e=this._czmCustomPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!e)return;const{min:i,max:o}=e;this._czmCustomPrimitive.setLocalAxisedBoundingBox(i,o)}bindCustomPrimitive(e){const i=this._czmCustomPrimitive;this.d(p.track([i,"allowPicking"],[e,"allowPicking"])),i.renderState={depthTest:{enabled:!0},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},i.vertexShaderSource=` in vec3 position;
|
|
3984
3984
|
in vec2 a_st;
|
|
3985
3985
|
out vec2 v_st;
|
|
3986
3986
|
void main()
|
|
@@ -4002,7 +4002,7 @@ ${SC}
|
|
|
4002
4002
|
tempColor.rgb = imageColor.rgb*imageColor.a + tempColor.rgb*(1.0-imageColor.a);
|
|
4003
4003
|
out_FragColor =tempColor;
|
|
4004
4004
|
}
|
|
4005
|
-
`,this.computeBoundingBox();{const o=()=>{i.show=e.show&&e.filled};o();const r=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(r.don(o))}return i}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.line.positions?(Me(r,o,i,this.line.positions,e),!0):!1:!1}};L(pc,"type",pc.register("ESCesiumViewer",Q.ESPipeFence.type,pc));let Cg=pc;const mc=class mc extends As{constructor(e,i){super(e,i);L(this,"czmCustomPrimitive");L(this,"czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(new st(i,e.id)),s=this.ad(new At(i,e.id));this.czmCustomPrimitive=r,this.czmTexture=s,this.d(p.track([r,"allowPicking"],[e,"allowPicking"]));const a=this.dv(p.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new p.ObjResettingWithEvent(a,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new
|
|
4005
|
+
`,this.computeBoundingBox();{const o=()=>{i.show=e.show&&e.filled};o();const r=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(r.don(o))}return i}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.line.positions?(Me(r,o,i,this.line.positions,e),!0):!1:!1}};L(pc,"type",pc.register("ESCesiumViewer",Q.ESPipeFence.type,pc));let Cg=pc;const mc=class mc extends As{constructor(e,i){super(e,i);L(this,"czmCustomPrimitive");L(this,"czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(new st(i,e.id)),s=this.ad(new At(i,e.id));this.czmCustomPrimitive=r,this.czmTexture=s,this.d(p.track([r,"allowPicking"],[e,"allowPicking"]));const a=this.dv(p.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new p.ObjResettingWithEvent(a,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new aL(e,this);r.attributes=void 0}))}};L(mc,"type",mc.register("ESCesiumViewer",Q.ESPipeline.type,mc));let xg=mc;class aL extends p.Destroyable{constructor(n,e){super(),this._sceneObject=n,this._czmESPipeline=e;const i=this._sceneObject,o=this._czmESPipeline,r=o.czmCustomPrimitive,s=o.czmTexture;if(!r||!s)return;{const c=()=>{r.show=i.show&&i.filled};c();const h=this.dv(p.createNextAnimateFrameEvent(i.showChanged,i.filledChanged));this.d(h.don(c))}const a=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),l=Q.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const c=()=>{i.materialImage.url!=""?s.uri=typeof i.materialImage.url=="string"?i.materialImage.url:i.materialImage.url.url:i.materialMode==="multipleArrows"||i.materialMode==="blue"?s.uri=l:s.uri=a;const u=Q.getDistancesFromPositions(i.points,"GEODESIC"),f=u[u.length-1]/i.materialImage.uDis;r.uniformMap={u_image:{type:"texture",id:s.id},u_stScale:[f,2*Math.PI*i.radius/i.materialImage.vDis],u_speed:[i.speed/i.materialImage.uDis,0],u_color:i.fillColor}};c();const h=this.dv(p.createNextAnimateFrameEvent(i.speedChanged,i.materialImageChanged,i.materialModeChanged,i.fillColorChanged));this.d(h.don(c))}(()=>{if(!i.points||i.points.length>=2&&Q.equalsN3(i.points[i.points.length-2],i.points[i.points.length-1]))return;const{position:h,modelMatrix:u,indexes:A,uvCoordinates:f}=this.coordinateTransformation(i.points,i.sides);r.modelMatrix=u,r.attributes={position:{typedArray:new Float32Array(h),componentsPerAttribute:3},st:{typedArray:new Float32Array([...f,...f.reverse()]),componentsPerAttribute:2}},r.indexTypedArray=new Uint16Array([...A,...A.reverse()]),r.fragmentShaderSource=`
|
|
4006
4006
|
in vec2 v_st;
|
|
4007
4007
|
uniform sampler2D u_image;
|
|
4008
4008
|
uniform vec4 u_color;
|
|
@@ -4024,7 +4024,7 @@ ${SC}
|
|
|
4024
4024
|
v_st = a_st;
|
|
4025
4025
|
gl_Position = czm_modelViewProjection * vec4(position,1.0);
|
|
4026
4026
|
}
|
|
4027
|
-
`;const d=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!d)return;const{min:g,max:v}=d;r.setLocalAxisedBoundingBox(g,v)})()}coordinateTransformation(n,e){const i=Q.getDistancesFromPositions(n,"GEODESIC"),o=i[i.length-1],{circlePoints:r,uvCoordinates:s}=this.getCircularCoordinates(n,o),[a,l,c]=fn({originPosition:r[0]},r),h=this.triangleIndices(e);return{modelMatrix:l,position:a.flat(),indexes:h,uvCoordinates:s}}getCircularCoordinates(n,e){const{_sceneObject:i}=this,o=i.radius,r=i.sides,s=[],a=[];let l=0,c=function(h){let u=new C.Cartesian3(h.x,h.y,h.z),A=C.Cartographic.fromCartesian(u),f=C.Math.toDegrees(A.latitude),d=C.Math.toDegrees(A.longitude),g=A.height;return[d,f,g]};for(let h=0;h<n.length-1;h++){const u=n[h],A=n[h+1],f=l;l+=Q.getDistancesFromPositions([u,A],"GEODESIC")[0];const d=f/e,g=l/e,v=C.Cartesian3.fromDegrees(...u),y=C.Cartesian3.fromDegrees(...A),m=C.Cartesian3.subtract(y,v,new C.Cartesian3);if(m.equals(C.Cartesian3.ZERO)){s.push(s[s.length-1]),a.push(a[a.length-3],a[a.length-2],a[a.length-1]);continue}const w=C.Cartesian3.normalize(m,new C.Cartesian3),_=new C.Cartesian3(0,0,1),E=new C.Cartesian3(1,0,0),T=C.Cartesian3.cross(w,Math.abs(C.Cartesian3.dot(w,_))!=1?_:E,new C.Cartesian3);if(T.equals(C.Cartesian3.ZERO)){s.push(s[s.length-1]),a.push(a[a.length-3],a[a.length-2],a[a.length-1]);continue}C.Cartesian3.normalize(T,T),C.Cartesian3.multiplyByScalar(T,o,T);for(let P=0;P<=r;P++){let F=C.Quaternion.fromAxisAngle(w,P*2*Math.PI/r),D=C.Matrix3.fromQuaternion(F),B=C.Matrix4.fromRotationTranslation(D,C.Cartesian3.ZERO);C.Matrix4.multiplyByTranslation(B,T,B);const S=C.Matrix4.getTranslation(B,new C.Cartesian3);C.Cartesian3.add(v,S,S);const I=C.Cartesian3.add(S,m,new C.Cartesian3);s.push(c(S),c(I)),a.push(d,P/r,g,P/r)}}return{circlePoints:s,uvCoordinates:a}}triangleIndices(n){var s;const{_sceneObject:e}=this,o=(((s=e.points)==null?void 0:s.length)-1)*(n+1);let r=new Uint32Array(o*6);for(let a=0;a<o;a++)r[a*6+0]=a*2+0,r[a*6+1]=a*2+1,r[a*6+2]=(a+1)%(n+1)==0?(a-n)*2:a*2+2,r[a*6+3]=a*2+1,r[a*6+4]=(a+1)%(n+1)==0?(a-n)*2+1:a*2+3,r[a*6+5]=(a+1)%(n+1)==0?(a-n)*2:a*2+2;return r}}function Sg(t,n,e="children",i="dragType"){const o=[];return t.forEach(r=>{if(r[i]&&r[i]==="layer"){const s={id:r.id,visable:r.checked,color:r.config.color};n==="color"?delete s.visable:delete s.color,o.push(s)}if(r[e]&&r[e].length){const s=Sg(r[e],n,e,i);s.length&&o.push(...s)}}),o}const gc=class gc extends ss{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.setLayerVisibleEvent.don((o,r)=>{try{let s=[];typeof r=="string"?s=JSON.parse(r):s=r;const l=Sg(s,"visable").map(c=>{const h=typeof c.id=="string"?`'${c.id}'`:`'${c.id.toString()}'`;return[`\${${o}} === `+h,c.visable.toString()]});this.setFeatureVisable(l)}catch(s){console.error(s)}})),this.d(n.setLayerColorEvent.don((o,r)=>{try{let s=[];typeof r=="string"?s=JSON.parse(r):s=r;const l=Sg(s,"color").map(c=>{const h=typeof c.id=="string"?`'${c.id}'`:`'${c.id.toString()}'`;return[`\${${o}} === `+h,c.color]});this.setFeatureColor(l)}catch(s){console.error(s)}}))}flyTo(n,e){const{sceneObject:i,czmViewer:o,czm3DTiles:r}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(r.flyTo(n&&n*1e3),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o,czm3DTiles:r}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(r.flyTo(n&&n*1e3),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(gc,"type",gc.register("ESCesiumViewer",Q.ESPipeserTileset.type,gc));let Eg=gc;var JA={exports:{}},EC;function aL(){if(EC)return JA.exports;EC=1,JA.exports=t,JA.exports.default=t;function t(k,M,R){R=R||2;var O=M&&M.length,z=O?M[0]*R:k.length,V=n(k,0,z,R,!0),H=[];if(!V||V.next===V.prev)return H;var q,J,j,re,oe,ue,ce;if(O&&(V=l(k,M,V,R)),k.length>80*R){q=j=k[0],J=re=k[1];for(var ne=R;ne<z;ne+=R)oe=k[ne],ue=k[ne+1],oe<q&&(q=oe),ue<J&&(J=ue),oe>j&&(j=oe),ue>re&&(re=ue);ce=Math.max(j-q,re-J),ce=ce!==0?32767/ce:0}return i(V,H,R,q,J,ce,0),H}function n(k,M,R,O,z){var V,H;if(z===U(k,M,R,O)>0)for(V=M;V<R;V+=O)H=I(V,k[V],k[V+1],H);else for(V=R-O;V>=M;V-=O)H=I(V,k[V],k[V+1],H);return H&&_(H,H.next)&&(b(H),H=H.next),H}function e(k,M){if(!k)return k;M||(M=k);var R=k,O;do if(O=!1,!R.steiner&&(_(R,R.next)||w(R.prev,R,R.next)===0)){if(b(R),R=M=R.prev,R===R.next)break;O=!0}else R=R.next;while(O||R!==M);return M}function i(k,M,R,O,z,V,H){if(k){!H&&V&&f(k,O,z,V);for(var q=k,J,j;k.prev!==k.next;){if(J=k.prev,j=k.next,V?r(k,O,z,V):o(k)){M.push(J.i/R|0),M.push(k.i/R|0),M.push(j.i/R|0),b(k),k=j.next,q=j.next;continue}if(k=j,k===q){H?H===1?(k=s(e(k),M,R),i(k,M,R,O,z,V,2)):H===2&&a(k,M,R,O,z,V):i(e(k),M,R,O,z,V,1);break}}}}function o(k){var M=k.prev,R=k,O=k.next;if(w(M,R,O)>=0)return!1;for(var z=M.x,V=R.x,H=O.x,q=M.y,J=R.y,j=O.y,re=z<V?z<H?z:H:V<H?V:H,oe=q<J?q<j?q:j:J<j?J:j,ue=z>V?z>H?z:H:V>H?V:H,ce=q>J?q>j?q:j:J>j?J:j,ne=O.next;ne!==M;){if(ne.x>=re&&ne.x<=ue&&ne.y>=oe&&ne.y<=ce&&y(z,q,V,J,H,j,ne.x,ne.y)&&w(ne.prev,ne,ne.next)>=0)return!1;ne=ne.next}return!0}function r(k,M,R,O){var z=k.prev,V=k,H=k.next;if(w(z,V,H)>=0)return!1;for(var q=z.x,J=V.x,j=H.x,re=z.y,oe=V.y,ue=H.y,ce=q<J?q<j?q:j:J<j?J:j,ne=re<oe?re<ue?re:ue:oe<ue?oe:ue,he=q>J?q>j?q:j:J>j?J:j,Y=re>oe?re>ue?re:ue:oe>ue?oe:ue,Z=g(ce,ne,M,R,O),G=g(he,Y,M,R,O),$=k.prevZ,X=k.nextZ;$&&$.z>=Z&&X&&X.z<=G;){if($.x>=ce&&$.x<=he&&$.y>=ne&&$.y<=Y&&$!==z&&$!==H&&y(q,re,J,oe,j,ue,$.x,$.y)&&w($.prev,$,$.next)>=0||($=$.prevZ,X.x>=ce&&X.x<=he&&X.y>=ne&&X.y<=Y&&X!==z&&X!==H&&y(q,re,J,oe,j,ue,X.x,X.y)&&w(X.prev,X,X.next)>=0))return!1;X=X.nextZ}for(;$&&$.z>=Z;){if($.x>=ce&&$.x<=he&&$.y>=ne&&$.y<=Y&&$!==z&&$!==H&&y(q,re,J,oe,j,ue,$.x,$.y)&&w($.prev,$,$.next)>=0)return!1;$=$.prevZ}for(;X&&X.z<=G;){if(X.x>=ce&&X.x<=he&&X.y>=ne&&X.y<=Y&&X!==z&&X!==H&&y(q,re,J,oe,j,ue,X.x,X.y)&&w(X.prev,X,X.next)>=0)return!1;X=X.nextZ}return!0}function s(k,M,R){var O=k;do{var z=O.prev,V=O.next.next;!_(z,V)&&E(z,O,O.next,V)&&D(z,V)&&D(V,z)&&(M.push(z.i/R|0),M.push(O.i/R|0),M.push(V.i/R|0),b(O),b(O.next),O=k=V),O=O.next}while(O!==k);return e(O)}function a(k,M,R,O,z,V){var H=k;do{for(var q=H.next.next;q!==H.prev;){if(H.i!==q.i&&m(H,q)){var J=S(H,q);H=e(H,H.next),J=e(J,J.next),i(H,M,R,O,z,V,0),i(J,M,R,O,z,V,0);return}q=q.next}H=H.next}while(H!==k)}function l(k,M,R,O){var z=[],V,H,q,J,j;for(V=0,H=M.length;V<H;V++)q=M[V]*O,J=V<H-1?M[V+1]*O:k.length,j=n(k,q,J,O,!1),j===j.next&&(j.steiner=!0),z.push(v(j));for(z.sort(c),V=0;V<z.length;V++)R=h(z[V],R);return R}function c(k,M){return k.x-M.x}function h(k,M){var R=u(k,M);if(!R)return M;var O=S(R,k);return e(O,O.next),e(R,R.next)}function u(k,M){var R=M,O=k.x,z=k.y,V=-1/0,H;do{if(z<=R.y&&z>=R.next.y&&R.next.y!==R.y){var q=R.x+(z-R.y)*(R.next.x-R.x)/(R.next.y-R.y);if(q<=O&&q>V&&(V=q,H=R.x<R.next.x?R:R.next,q===O))return H}R=R.next}while(R!==M);if(!H)return null;var J=H,j=H.x,re=H.y,oe=1/0,ue;R=H;do O>=R.x&&R.x>=j&&O!==R.x&&y(z<re?O:V,z,j,re,z<re?V:O,z,R.x,R.y)&&(ue=Math.abs(z-R.y)/(O-R.x),D(R,k)&&(ue<oe||ue===oe&&(R.x>H.x||R.x===H.x&&A(H,R)))&&(H=R,oe=ue)),R=R.next;while(R!==J);return H}function A(k,M){return w(k.prev,k,M.prev)<0&&w(M.next,k,k.next)<0}function f(k,M,R,O){var z=k;do z.z===0&&(z.z=g(z.x,z.y,M,R,O)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==k);z.prevZ.nextZ=null,z.prevZ=null,d(z)}function d(k){var M,R,O,z,V,H,q,J,j=1;do{for(R=k,k=null,V=null,H=0;R;){for(H++,O=R,q=0,M=0;M<j&&(q++,O=O.nextZ,!!O);M++);for(J=j;q>0||J>0&&O;)q!==0&&(J===0||!O||R.z<=O.z)?(z=R,R=R.nextZ,q--):(z=O,O=O.nextZ,J--),V?V.nextZ=z:k=z,z.prevZ=V,V=z;R=O}V.nextZ=null,j*=2}while(H>1);return k}function g(k,M,R,O,z){return k=(k-R)*z|0,M=(M-O)*z|0,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,M=(M|M<<8)&16711935,M=(M|M<<4)&252645135,M=(M|M<<2)&858993459,M=(M|M<<1)&1431655765,k|M<<1}function v(k){var M=k,R=k;do(M.x<R.x||M.x===R.x&&M.y<R.y)&&(R=M),M=M.next;while(M!==k);return R}function y(k,M,R,O,z,V,H,q){return(z-H)*(M-q)>=(k-H)*(V-q)&&(k-H)*(O-q)>=(R-H)*(M-q)&&(R-H)*(V-q)>=(z-H)*(O-q)}function m(k,M){return k.next.i!==M.i&&k.prev.i!==M.i&&!F(k,M)&&(D(k,M)&&D(M,k)&&B(k,M)&&(w(k.prev,k,M.prev)||w(k,M.prev,M))||_(k,M)&&w(k.prev,k,k.next)>0&&w(M.prev,M,M.next)>0)}function w(k,M,R){return(M.y-k.y)*(R.x-M.x)-(M.x-k.x)*(R.y-M.y)}function _(k,M){return k.x===M.x&&k.y===M.y}function E(k,M,R,O){var z=P(w(k,M,R)),V=P(w(k,M,O)),H=P(w(R,O,k)),q=P(w(R,O,M));return!!(z!==V&&H!==q||z===0&&T(k,R,M)||V===0&&T(k,O,M)||H===0&&T(R,k,O)||q===0&&T(R,M,O))}function T(k,M,R){return M.x<=Math.max(k.x,R.x)&&M.x>=Math.min(k.x,R.x)&&M.y<=Math.max(k.y,R.y)&&M.y>=Math.min(k.y,R.y)}function P(k){return k>0?1:k<0?-1:0}function F(k,M){var R=k;do{if(R.i!==k.i&&R.next.i!==k.i&&R.i!==M.i&&R.next.i!==M.i&&E(R,R.next,k,M))return!0;R=R.next}while(R!==k);return!1}function D(k,M){return w(k.prev,k,k.next)<0?w(k,M,k.next)>=0&&w(k,k.prev,M)>=0:w(k,M,k.prev)<0||w(k,k.next,M)<0}function B(k,M){var R=k,O=!1,z=(k.x+M.x)/2,V=(k.y+M.y)/2;do R.y>V!=R.next.y>V&&R.next.y!==R.y&&z<(R.next.x-R.x)*(V-R.y)/(R.next.y-R.y)+R.x&&(O=!O),R=R.next;while(R!==k);return O}function S(k,M){var R=new x(k.i,k.x,k.y),O=new x(M.i,M.x,M.y),z=k.next,V=M.prev;return k.next=M,M.prev=k,R.next=z,z.prev=R,O.next=R,R.prev=O,V.next=O,O.prev=V,O}function I(k,M,R,O){var z=new x(k,M,R);return O?(z.next=O.next,z.prev=O,O.next.prev=z,O.next=z):(z.prev=z,z.next=z),z}function b(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function x(k,M,R){this.i=k,this.x=M,this.y=R,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}t.deviation=function(k,M,R,O){var z=M&&M.length,V=z?M[0]*R:k.length,H=Math.abs(U(k,0,V,R));if(z)for(var q=0,J=M.length;q<J;q++){var j=M[q]*R,re=q<J-1?M[q+1]*R:k.length;H-=Math.abs(U(k,j,re,R))}var oe=0;for(q=0;q<O.length;q+=3){var ue=O[q]*R,ce=O[q+1]*R,ne=O[q+2]*R;oe+=Math.abs((k[ue]-k[ne])*(k[ce+1]-k[ue+1])-(k[ue]-k[ce])*(k[ne+1]-k[ue+1]))}return H===0&&oe===0?0:Math.abs((oe-H)/H)};function U(k,M,R,O){for(var z=0,V=M,H=R-O;V<R;V+=O)z+=(k[H]-k[V])*(k[V+1]+k[H+1]),H=V;return z}return t.flatten=function(k){for(var M=k[0][0].length,R={vertices:[],holes:[],dimensions:M},O=0,z=0;z<k.length;z++){for(var V=0;V<k[z].length;V++)for(var H=0;H<M;H++)R.vertices.push(k[z][V][H]);z>0&&(O+=k[z-1].length,R.holes.push(O))}return R},JA.exports}var sL=aL();const lL=Va(sL),yc=class yc extends Tn{constructor(e,i){super(e,i);L(this,"czmSideCustomPrimitive");L(this,"czmBottomCustomPrimitive");L(this,"czmSideTexture");L(this,"czmBottomTexture");L(this,"_width",0);L(this,"_height",0);if(!i.viewer){console.log("viewer is undefined!");return}{const c=()=>{this.geoPolygon&&(this.geoPolygon.fill=!1)};c(),this.d(e.filledChanged.don(c))}const r=this.czmSideCustomPrimitive=this.dv(new st(i,e.id)),s=this.czmSideTexture=this.ad(new At(i)),a=this.czmBottomCustomPrimitive=this.dv(new st(i,e.id)),l=this.czmBottomTexture=this.ad(new At(i));this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([a,"allowPicking"],[e,"allowPicking"]));{const c=()=>{r.show=e.show&&e.filled&&e.points&&e.points.length>2,a.show=e.show&&e.filled&&e.points&&e.points.length>2};c();const h=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.pointsChanged));this.dispose(h.don(c))}{const c=(A,f,d,g,v)=>{A.position=f;const y=d.flat();let m=g=="bottom"?lL(y,null,3):this._triangleIndices(d.length),w=[],_=-1/0,E=1/0,T=-1/0,P=1/0,F=0;if(g=="bottom"){for(let x=0;x<d.length;x++)T=T>d[x][0]?T:d[x][0],P=P<d[x][0]?P:d[x][0],_=_>d[x][1]?_:d[x][1],E=E<d[x][1]?E:d[x][1];this._width=T-P,this._height=_-E;for(let x=0;x<d.length;x++)w.push((d[x][0]-this._width/2)/this._width,(d[x][1]-this._height/2)/this._height)}else{for(let x=0;x<d.length;x++)this._width+=this._getDistance(d[x],d[x-1<0?0:x-1]),_=_>d[x][2]?_:d[x][2],E=E<d[x][2]?E:d[x][2];this._height=_-E;for(let x=0;x<d.length;x++)F+=this._getDistance(d[x],d[x-1<0?0:x-1]),w.push(F/this._width,(d[x][2]-E)/this._height)}A.indexTypedArray=new Uint16Array(v?m:m.reverse()),A.attributes={position:{typedArray:new Float32Array(y),componentsPerAttribute:3},st:{typedArray:new Float32Array(v?w:w.reverse()),componentsPerAttribute:2}};const D=g=="bottom"?e.bottomImage.uDis??50:e.sideImage.uDis??50,B=g=="bottom"?e.bottomImage.vDis??50:e.sideImage.vDis??50;A.fragmentShaderSource=`in vec2 v_st;
|
|
4027
|
+
`;const d=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!d)return;const{min:g,max:v}=d;r.setLocalAxisedBoundingBox(g,v)})()}coordinateTransformation(n,e){const i=Q.getDistancesFromPositions(n,"GEODESIC"),o=i[i.length-1],{circlePoints:r,uvCoordinates:s}=this.getCircularCoordinates(n,o),[a,l,c]=fn({originPosition:r[0]},r),h=this.triangleIndices(e);return{modelMatrix:l,position:a.flat(),indexes:h,uvCoordinates:s}}getCircularCoordinates(n,e){const{_sceneObject:i}=this,o=i.radius,r=i.sides,s=[],a=[];let l=0,c=function(h){let u=new C.Cartesian3(h.x,h.y,h.z),A=C.Cartographic.fromCartesian(u),f=C.Math.toDegrees(A.latitude),d=C.Math.toDegrees(A.longitude),g=A.height;return[d,f,g]};for(let h=0;h<n.length-1;h++){const u=n[h],A=n[h+1],f=l;l+=Q.getDistancesFromPositions([u,A],"GEODESIC")[0];const d=f/e,g=l/e,v=C.Cartesian3.fromDegrees(...u),y=C.Cartesian3.fromDegrees(...A),m=C.Cartesian3.subtract(y,v,new C.Cartesian3);if(m.equals(C.Cartesian3.ZERO)){s.push(s[s.length-1]),a.push(a[a.length-3],a[a.length-2],a[a.length-1]);continue}const w=C.Cartesian3.normalize(m,new C.Cartesian3),_=new C.Cartesian3(0,0,1),E=new C.Cartesian3(1,0,0),T=C.Cartesian3.cross(w,Math.abs(C.Cartesian3.dot(w,_))!=1?_:E,new C.Cartesian3);if(T.equals(C.Cartesian3.ZERO)){s.push(s[s.length-1]),a.push(a[a.length-3],a[a.length-2],a[a.length-1]);continue}C.Cartesian3.normalize(T,T),C.Cartesian3.multiplyByScalar(T,o,T);for(let P=0;P<=r;P++){let F=C.Quaternion.fromAxisAngle(w,P*2*Math.PI/r),D=C.Matrix3.fromQuaternion(F),B=C.Matrix4.fromRotationTranslation(D,C.Cartesian3.ZERO);C.Matrix4.multiplyByTranslation(B,T,B);const S=C.Matrix4.getTranslation(B,new C.Cartesian3);C.Cartesian3.add(v,S,S);const I=C.Cartesian3.add(S,m,new C.Cartesian3);s.push(c(S),c(I)),a.push(d,P/r,g,P/r)}}return{circlePoints:s,uvCoordinates:a}}triangleIndices(n){var s;const{_sceneObject:e}=this,o=(((s=e.points)==null?void 0:s.length)-1)*(n+1);let r=new Uint32Array(o*6);for(let a=0;a<o;a++)r[a*6+0]=a*2+0,r[a*6+1]=a*2+1,r[a*6+2]=(a+1)%(n+1)==0?(a-n)*2:a*2+2,r[a*6+3]=a*2+1,r[a*6+4]=(a+1)%(n+1)==0?(a-n)*2+1:a*2+3,r[a*6+5]=(a+1)%(n+1)==0?(a-n)*2:a*2+2;return r}}function Sg(t,n,e="children",i="dragType"){const o=[];return t.forEach(r=>{if(r[i]&&r[i]==="layer"){const s={id:r.id,visable:r.checked,color:r.config.color};n==="color"?delete s.visable:delete s.color,o.push(s)}if(r[e]&&r[e].length){const s=Sg(r[e],n,e,i);s.length&&o.push(...s)}}),o}const gc=class gc extends ss{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.setLayerVisibleEvent.don((o,r)=>{try{let s=[];typeof r=="string"?s=JSON.parse(r):s=r;const l=Sg(s,"visable").map(c=>{const h=typeof c.id=="string"?`'${c.id}'`:`'${c.id.toString()}'`;return[`\${${o}} === `+h,c.visable.toString()]});this.setFeatureVisable(l)}catch(s){console.error(s)}})),this.d(n.setLayerColorEvent.don((o,r)=>{try{let s=[];typeof r=="string"?s=JSON.parse(r):s=r;const l=Sg(s,"color").map(c=>{const h=typeof c.id=="string"?`'${c.id}'`:`'${c.id.toString()}'`;return[`\${${o}} === `+h,c.color]});this.setFeatureColor(l)}catch(s){console.error(s)}}))}flyTo(n,e){const{sceneObject:i,czmViewer:o,czm3DTiles:r}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(r.flyTo(n&&n*1e3),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o,czm3DTiles:r}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(r.flyTo(n&&n*1e3),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(gc,"type",gc.register("ESCesiumViewer",Q.ESPipeserTileset.type,gc));let Eg=gc;var JA={exports:{}},EC;function sL(){if(EC)return JA.exports;EC=1,JA.exports=t,JA.exports.default=t;function t(k,M,R){R=R||2;var O=M&&M.length,z=O?M[0]*R:k.length,V=n(k,0,z,R,!0),H=[];if(!V||V.next===V.prev)return H;var q,J,j,re,oe,ue,ce;if(O&&(V=l(k,M,V,R)),k.length>80*R){q=j=k[0],J=re=k[1];for(var ne=R;ne<z;ne+=R)oe=k[ne],ue=k[ne+1],oe<q&&(q=oe),ue<J&&(J=ue),oe>j&&(j=oe),ue>re&&(re=ue);ce=Math.max(j-q,re-J),ce=ce!==0?32767/ce:0}return i(V,H,R,q,J,ce,0),H}function n(k,M,R,O,z){var V,H;if(z===U(k,M,R,O)>0)for(V=M;V<R;V+=O)H=I(V,k[V],k[V+1],H);else for(V=R-O;V>=M;V-=O)H=I(V,k[V],k[V+1],H);return H&&_(H,H.next)&&(b(H),H=H.next),H}function e(k,M){if(!k)return k;M||(M=k);var R=k,O;do if(O=!1,!R.steiner&&(_(R,R.next)||w(R.prev,R,R.next)===0)){if(b(R),R=M=R.prev,R===R.next)break;O=!0}else R=R.next;while(O||R!==M);return M}function i(k,M,R,O,z,V,H){if(k){!H&&V&&f(k,O,z,V);for(var q=k,J,j;k.prev!==k.next;){if(J=k.prev,j=k.next,V?r(k,O,z,V):o(k)){M.push(J.i/R|0),M.push(k.i/R|0),M.push(j.i/R|0),b(k),k=j.next,q=j.next;continue}if(k=j,k===q){H?H===1?(k=s(e(k),M,R),i(k,M,R,O,z,V,2)):H===2&&a(k,M,R,O,z,V):i(e(k),M,R,O,z,V,1);break}}}}function o(k){var M=k.prev,R=k,O=k.next;if(w(M,R,O)>=0)return!1;for(var z=M.x,V=R.x,H=O.x,q=M.y,J=R.y,j=O.y,re=z<V?z<H?z:H:V<H?V:H,oe=q<J?q<j?q:j:J<j?J:j,ue=z>V?z>H?z:H:V>H?V:H,ce=q>J?q>j?q:j:J>j?J:j,ne=O.next;ne!==M;){if(ne.x>=re&&ne.x<=ue&&ne.y>=oe&&ne.y<=ce&&y(z,q,V,J,H,j,ne.x,ne.y)&&w(ne.prev,ne,ne.next)>=0)return!1;ne=ne.next}return!0}function r(k,M,R,O){var z=k.prev,V=k,H=k.next;if(w(z,V,H)>=0)return!1;for(var q=z.x,J=V.x,j=H.x,re=z.y,oe=V.y,ue=H.y,ce=q<J?q<j?q:j:J<j?J:j,ne=re<oe?re<ue?re:ue:oe<ue?oe:ue,he=q>J?q>j?q:j:J>j?J:j,Y=re>oe?re>ue?re:ue:oe>ue?oe:ue,Z=g(ce,ne,M,R,O),G=g(he,Y,M,R,O),$=k.prevZ,X=k.nextZ;$&&$.z>=Z&&X&&X.z<=G;){if($.x>=ce&&$.x<=he&&$.y>=ne&&$.y<=Y&&$!==z&&$!==H&&y(q,re,J,oe,j,ue,$.x,$.y)&&w($.prev,$,$.next)>=0||($=$.prevZ,X.x>=ce&&X.x<=he&&X.y>=ne&&X.y<=Y&&X!==z&&X!==H&&y(q,re,J,oe,j,ue,X.x,X.y)&&w(X.prev,X,X.next)>=0))return!1;X=X.nextZ}for(;$&&$.z>=Z;){if($.x>=ce&&$.x<=he&&$.y>=ne&&$.y<=Y&&$!==z&&$!==H&&y(q,re,J,oe,j,ue,$.x,$.y)&&w($.prev,$,$.next)>=0)return!1;$=$.prevZ}for(;X&&X.z<=G;){if(X.x>=ce&&X.x<=he&&X.y>=ne&&X.y<=Y&&X!==z&&X!==H&&y(q,re,J,oe,j,ue,X.x,X.y)&&w(X.prev,X,X.next)>=0)return!1;X=X.nextZ}return!0}function s(k,M,R){var O=k;do{var z=O.prev,V=O.next.next;!_(z,V)&&E(z,O,O.next,V)&&D(z,V)&&D(V,z)&&(M.push(z.i/R|0),M.push(O.i/R|0),M.push(V.i/R|0),b(O),b(O.next),O=k=V),O=O.next}while(O!==k);return e(O)}function a(k,M,R,O,z,V){var H=k;do{for(var q=H.next.next;q!==H.prev;){if(H.i!==q.i&&m(H,q)){var J=S(H,q);H=e(H,H.next),J=e(J,J.next),i(H,M,R,O,z,V,0),i(J,M,R,O,z,V,0);return}q=q.next}H=H.next}while(H!==k)}function l(k,M,R,O){var z=[],V,H,q,J,j;for(V=0,H=M.length;V<H;V++)q=M[V]*O,J=V<H-1?M[V+1]*O:k.length,j=n(k,q,J,O,!1),j===j.next&&(j.steiner=!0),z.push(v(j));for(z.sort(c),V=0;V<z.length;V++)R=h(z[V],R);return R}function c(k,M){return k.x-M.x}function h(k,M){var R=u(k,M);if(!R)return M;var O=S(R,k);return e(O,O.next),e(R,R.next)}function u(k,M){var R=M,O=k.x,z=k.y,V=-1/0,H;do{if(z<=R.y&&z>=R.next.y&&R.next.y!==R.y){var q=R.x+(z-R.y)*(R.next.x-R.x)/(R.next.y-R.y);if(q<=O&&q>V&&(V=q,H=R.x<R.next.x?R:R.next,q===O))return H}R=R.next}while(R!==M);if(!H)return null;var J=H,j=H.x,re=H.y,oe=1/0,ue;R=H;do O>=R.x&&R.x>=j&&O!==R.x&&y(z<re?O:V,z,j,re,z<re?V:O,z,R.x,R.y)&&(ue=Math.abs(z-R.y)/(O-R.x),D(R,k)&&(ue<oe||ue===oe&&(R.x>H.x||R.x===H.x&&A(H,R)))&&(H=R,oe=ue)),R=R.next;while(R!==J);return H}function A(k,M){return w(k.prev,k,M.prev)<0&&w(M.next,k,k.next)<0}function f(k,M,R,O){var z=k;do z.z===0&&(z.z=g(z.x,z.y,M,R,O)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==k);z.prevZ.nextZ=null,z.prevZ=null,d(z)}function d(k){var M,R,O,z,V,H,q,J,j=1;do{for(R=k,k=null,V=null,H=0;R;){for(H++,O=R,q=0,M=0;M<j&&(q++,O=O.nextZ,!!O);M++);for(J=j;q>0||J>0&&O;)q!==0&&(J===0||!O||R.z<=O.z)?(z=R,R=R.nextZ,q--):(z=O,O=O.nextZ,J--),V?V.nextZ=z:k=z,z.prevZ=V,V=z;R=O}V.nextZ=null,j*=2}while(H>1);return k}function g(k,M,R,O,z){return k=(k-R)*z|0,M=(M-O)*z|0,k=(k|k<<8)&16711935,k=(k|k<<4)&252645135,k=(k|k<<2)&858993459,k=(k|k<<1)&1431655765,M=(M|M<<8)&16711935,M=(M|M<<4)&252645135,M=(M|M<<2)&858993459,M=(M|M<<1)&1431655765,k|M<<1}function v(k){var M=k,R=k;do(M.x<R.x||M.x===R.x&&M.y<R.y)&&(R=M),M=M.next;while(M!==k);return R}function y(k,M,R,O,z,V,H,q){return(z-H)*(M-q)>=(k-H)*(V-q)&&(k-H)*(O-q)>=(R-H)*(M-q)&&(R-H)*(V-q)>=(z-H)*(O-q)}function m(k,M){return k.next.i!==M.i&&k.prev.i!==M.i&&!F(k,M)&&(D(k,M)&&D(M,k)&&B(k,M)&&(w(k.prev,k,M.prev)||w(k,M.prev,M))||_(k,M)&&w(k.prev,k,k.next)>0&&w(M.prev,M,M.next)>0)}function w(k,M,R){return(M.y-k.y)*(R.x-M.x)-(M.x-k.x)*(R.y-M.y)}function _(k,M){return k.x===M.x&&k.y===M.y}function E(k,M,R,O){var z=P(w(k,M,R)),V=P(w(k,M,O)),H=P(w(R,O,k)),q=P(w(R,O,M));return!!(z!==V&&H!==q||z===0&&T(k,R,M)||V===0&&T(k,O,M)||H===0&&T(R,k,O)||q===0&&T(R,M,O))}function T(k,M,R){return M.x<=Math.max(k.x,R.x)&&M.x>=Math.min(k.x,R.x)&&M.y<=Math.max(k.y,R.y)&&M.y>=Math.min(k.y,R.y)}function P(k){return k>0?1:k<0?-1:0}function F(k,M){var R=k;do{if(R.i!==k.i&&R.next.i!==k.i&&R.i!==M.i&&R.next.i!==M.i&&E(R,R.next,k,M))return!0;R=R.next}while(R!==k);return!1}function D(k,M){return w(k.prev,k,k.next)<0?w(k,M,k.next)>=0&&w(k,k.prev,M)>=0:w(k,M,k.prev)<0||w(k,k.next,M)<0}function B(k,M){var R=k,O=!1,z=(k.x+M.x)/2,V=(k.y+M.y)/2;do R.y>V!=R.next.y>V&&R.next.y!==R.y&&z<(R.next.x-R.x)*(V-R.y)/(R.next.y-R.y)+R.x&&(O=!O),R=R.next;while(R!==k);return O}function S(k,M){var R=new x(k.i,k.x,k.y),O=new x(M.i,M.x,M.y),z=k.next,V=M.prev;return k.next=M,M.prev=k,R.next=z,z.prev=R,O.next=R,R.prev=O,V.next=O,O.prev=V,O}function I(k,M,R,O){var z=new x(k,M,R);return O?(z.next=O.next,z.prev=O,O.next.prev=z,O.next=z):(z.prev=z,z.next=z),z}function b(k){k.next.prev=k.prev,k.prev.next=k.next,k.prevZ&&(k.prevZ.nextZ=k.nextZ),k.nextZ&&(k.nextZ.prevZ=k.prevZ)}function x(k,M,R){this.i=k,this.x=M,this.y=R,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}t.deviation=function(k,M,R,O){var z=M&&M.length,V=z?M[0]*R:k.length,H=Math.abs(U(k,0,V,R));if(z)for(var q=0,J=M.length;q<J;q++){var j=M[q]*R,re=q<J-1?M[q+1]*R:k.length;H-=Math.abs(U(k,j,re,R))}var oe=0;for(q=0;q<O.length;q+=3){var ue=O[q]*R,ce=O[q+1]*R,ne=O[q+2]*R;oe+=Math.abs((k[ue]-k[ne])*(k[ce+1]-k[ue+1])-(k[ue]-k[ce])*(k[ne+1]-k[ue+1]))}return H===0&&oe===0?0:Math.abs((oe-H)/H)};function U(k,M,R,O){for(var z=0,V=M,H=R-O;V<R;V+=O)z+=(k[H]-k[V])*(k[V+1]+k[H+1]),H=V;return z}return t.flatten=function(k){for(var M=k[0][0].length,R={vertices:[],holes:[],dimensions:M},O=0,z=0;z<k.length;z++){for(var V=0;V<k[z].length;V++)for(var H=0;H<M;H++)R.vertices.push(k[z][V][H]);z>0&&(O+=k[z-1].length,R.holes.push(O))}return R},JA.exports}var lL=sL();const uL=Va(lL),yc=class yc extends Tn{constructor(e,i){super(e,i);L(this,"czmSideCustomPrimitive");L(this,"czmBottomCustomPrimitive");L(this,"czmSideTexture");L(this,"czmBottomTexture");L(this,"_width",0);L(this,"_height",0);if(!i.viewer){console.log("viewer is undefined!");return}{const c=()=>{this.geoPolygon&&(this.geoPolygon.fill=!1)};c(),this.d(e.filledChanged.don(c))}const r=this.czmSideCustomPrimitive=this.dv(new st(i,e.id)),s=this.czmSideTexture=this.ad(new At(i)),a=this.czmBottomCustomPrimitive=this.dv(new st(i,e.id)),l=this.czmBottomTexture=this.ad(new At(i));this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([a,"allowPicking"],[e,"allowPicking"]));{const c=()=>{r.show=e.show&&e.filled&&e.points&&e.points.length>2,a.show=e.show&&e.filled&&e.points&&e.points.length>2};c();const h=this.dv(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.pointsChanged));this.dispose(h.don(c))}{const c=(A,f,d,g,v)=>{A.position=f;const y=d.flat();let m=g=="bottom"?uL(y,null,3):this._triangleIndices(d.length),w=[],_=-1/0,E=1/0,T=-1/0,P=1/0,F=0;if(g=="bottom"){for(let x=0;x<d.length;x++)T=T>d[x][0]?T:d[x][0],P=P<d[x][0]?P:d[x][0],_=_>d[x][1]?_:d[x][1],E=E<d[x][1]?E:d[x][1];this._width=T-P,this._height=_-E;for(let x=0;x<d.length;x++)w.push((d[x][0]-this._width/2)/this._width,(d[x][1]-this._height/2)/this._height)}else{for(let x=0;x<d.length;x++)this._width+=this._getDistance(d[x],d[x-1<0?0:x-1]),_=_>d[x][2]?_:d[x][2],E=E<d[x][2]?E:d[x][2];this._height=_-E;for(let x=0;x<d.length;x++)F+=this._getDistance(d[x],d[x-1<0?0:x-1]),w.push(F/this._width,(d[x][2]-E)/this._height)}A.indexTypedArray=new Uint16Array(v?m:m.reverse()),A.attributes={position:{typedArray:new Float32Array(y),componentsPerAttribute:3},st:{typedArray:new Float32Array(v?w:w.reverse()),componentsPerAttribute:2}};const D=g=="bottom"?e.bottomImage.uDis??50:e.sideImage.uDis??50,B=g=="bottom"?e.bottomImage.vDis??50:e.sideImage.vDis??50;A.fragmentShaderSource=`in vec2 v_st;
|
|
4028
4028
|
uniform sampler2D u_image;
|
|
4029
4029
|
uniform vec4 u_color;
|
|
4030
4030
|
void main()
|
|
@@ -4035,7 +4035,7 @@ ${SC}
|
|
|
4035
4035
|
vec4 imageColor = texture(u_image, st);
|
|
4036
4036
|
out_FragColor = imageColor * u_color;
|
|
4037
4037
|
}
|
|
4038
|
-
`;const S=A.computeLocalAxisedBoundingBoxFromAttribute("position");if(!S)return;const{min:I,max:b}=S;A.setLocalAxisedBoundingBox(I,b)},h=async()=>{if(e.points&&e.points.length>2){const{minPos:A,center:f}=Q.getMinMaxCorner(e.points),d=A[2]-e.depth;if(!Q.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const _=fn({originPosition:f},e.points.map((E,T)=>{let P=[...E];return P[2]=d,P}));c(a,f,_[0],"bottom",!0)}const g=this._interpolationAlongPolygon(e.points.map((_,E)=>C.Cartesian3.fromArray(Q.lbhToXyz(_))),e.interpolation),v=await i.getHeightsByLonLats(g.map(_=>[_[0],_[1]]));let y=[];for(let _=0;_<g.length;_++){const E=g[_];y.push([E[0],E[1],v[_]??E[2]],[E[0],E[1],d])}const m=fn({originPosition:f},y);let w=this._isClockwise(e.points,i);c(r,f,m[0],"side",w)}else r.attributes=void 0,a.attributes=void 0};h();const u=this.dv(p.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(u.don(h))}{const c=()=>{s.uri=e.sideImage.url,l.uri=e.bottomImage.url,r.uniformMap={u_image:{type:"texture",id:s.id},u_color:[1,1,1,e.opacity]},a.uniformMap={u_image:{type:"texture",id:l.id},u_color:[1,1,1,e.opacity]}};c();const h=this.ad(p.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(h.don(c))}}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}_interpolationAlongPolygon(e,i){var o=[];for(let l=0;l<e.length;++l){var r=e[l],s=e[(l+1)%e.length],a=this._interpolationAlongLine(r,s,i);o.push(...a)}return o.push(o[0]),o}_interpolationAlongLine(e,i,o){var r=[],s=C.Cartesian3.distance(e,i),a=C.Cartesian3.subtract(i,e,new C.Cartesian3);a.equals(C.Cartesian3.ZERO)||C.Cartesian3.normalize(a,a);for(var l=0;l<s;){var c=new C.Cartesian3(a.x*l,a.y*l,a.z*l),h=C.Cartesian3.add(e,c,new C.Cartesian3);const u=Ue(h);u&&r.push(u),l+=o}return r}_isClockwise(e,i){if(i.viewer)for(let o=0;o<e.length;o++){let r=C.Cartesian3.fromDegrees(...e[o]),s=C.Cartesian3.fromDegrees(...e[(o+1)%e.length]),a=C.Cartesian3.fromDegrees(...e[(o+2)%e.length]),l=C.Cartesian3.subtract(s,r,new C.Cartesian3),c=C.Cartesian3.subtract(a,s,new C.Cartesian3);if(l.equals(C.Cartesian3.ZERO)||c.equals(C.Cartesian3.ZERO))return!0;if(C.Cartesian3.normalize(l,l),C.Cartesian3.normalize(c,c),Math.abs(C.Cartesian3.dot(l,c))==1){if(o==e.length-1)return!0;continue}let h=C.Cartesian3.cross(l,c,new C.Cartesian3);return C.Cartesian3.dot(h,i.viewer.camera.directionWC)>0}}_triangleIndices(e){let i=new Uint32Array(e*3);for(let o=0;o<e;++o)i[o*3+0]=o,i[o*3+1]=o%2?(o+2)%e:(o+1)%e,i[o*3+2]=o%2?(o+1)%e:(o+2)%e;return i}_getDistance(e,i){return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}};L(yc,"type",yc.register("ESCesiumViewer",Q.ESPit.type,yc));let Pg=yc;const vc=class vc extends Tn{constructor(e,i){super(e,i);L(this,"_czmPolygonPrimitive");L(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new Fr(i,e.id)),console.log(this.czmPolygonPrimitive),this._geoPolylines=this.disposeVar(new $n(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}{const a=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};a(),this.ad(this.sceneObject.showChanged.don(a))}const r=this._geoPolylines;r.arcType="RHUMB";const s=this._czmPolygonPrimitive;this.dispose(p.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"color"],[e,"strokeColor"])),this.dispose(p.track([r,"width"],[e,"strokeWidth"]));{s.perPositionHeight=!0;const a=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled,s.material={type:"Color",color:e.fillColor}};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(l.don(a))}{const a=()=>{const c={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(r.positions=[[...e.points,e.points[0]]],c.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let h=0;h<e.innerRings.length;h++){const u=e.innerRings[h];c.holes.push({positions:u}),r.positions.push([...u,u[0]])}s.polygonHierarchy=c}else s.polygonHierarchy=c};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>a()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(vc,"type",vc.register("ESCesiumViewer",Q.ESPolygonWithHole.type,vc));let Tg=vc;var wn=63710088e-1,uL={centimeters:wn*100,centimetres:wn*100,degrees:wn/111325,feet:wn*3.28084,inches:wn*39.37,kilometers:wn/1e3,kilometres:wn/1e3,meters:wn,metres:wn,miles:wn/1609.344,millimeters:wn*1e3,millimetres:wn*1e3,nauticalmiles:wn/1852,radians:1,yards:wn*1.0936};function Ci(t,n,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=n||{},i.geometry=t,i}function eo(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!PC(t[0])||!PC(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return Ci(i,n,e)}function sn(t,n,e){e===void 0&&(e={});for(var i=0,o=t;i<o.length;i++){var r=o[i];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<r[r.length-1].length;s++)if(r[r.length-1][s]!==r[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:t};return Ci(a,n,e)}function jA(t,n,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:t};return Ci(i,n,e)}function xi(t,n){n===void 0&&(n={});var e={type:"FeatureCollection"};return n.id&&(e.id=n.id),n.bbox&&(e.bbox=n.bbox),e.features=t,e}function cL(t,n,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:t};return Ci(i,n,e)}function hL(t,n,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:t};return Ci(i,n,e)}function AL(t,n){n===void 0&&(n="kilometers");var e=uL[n];if(!e)throw new Error(n+" units is invalid");return t*e}function ef(t){var n=t%360;return n*Math.PI/180}function PC(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function tf(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Si(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function fL(t,n,e){if(!t)throw new Error("No featureCollection passed");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var i=0,o=t.features;i<o.length;i++){var r=o[i];if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==n)throw new Error("Invalid input to "+e+": must be a "+n+", given "+r.geometry.type)}}function Ei(t){return t.type==="Feature"?t.geometry:t}function dL(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Pi(t,n,e){e===void 0&&(e={});var i=tf(t),o=tf(n),r=ef(o[1]-i[1]),s=ef(o[0]-i[0]),a=ef(i[1]),l=ef(o[1]),c=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return AL(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),e.units)}function nf(t,n,e){if(t!==null)for(var i,o,r,s,a,l,c,h=0,u=0,A,f=t.type,d=f==="FeatureCollection",g=f==="Feature",v=d?t.features.length:1,y=0;y<v;y++){c=d?t.features[y].geometry:g?t.geometry:t,A=c?c.type==="GeometryCollection":!1,a=A?c.geometries.length:1;for(var m=0;m<a;m++){var w=0,_=0;if(s=A?c.geometries[m]:c,s!==null){l=s.coordinates;var E=s.type;switch(h=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,u,y,w,_)===!1)return!1;u++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],u,y,w,_)===!1)return!1;u++,E==="MultiPoint"&&w++}E==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-h;o++){if(n(l[i][o],u,y,w,_)===!1)return!1;u++}E==="MultiLineString"&&w++,E==="Polygon"&&_++}E==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(_=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-h;r++){if(n(l[i][o][r],u,y,w,_)===!1)return!1;u++}_++}w++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(nf(s.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function rf(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function pL(t,n){var e,i,o,r,s,a,l,c,h,u,A=0,f=t.type==="FeatureCollection",d=t.type==="Feature",g=f?t.features.length:1;for(e=0;e<g;e++){for(a=f?t.features[e].geometry:d?t.geometry:t,c=f?t.features[e].properties:d?t.properties:{},h=f?t.features[e].bbox:d?t.bbox:void 0,u=f?t.features[e].id:d?t.id:void 0,l=a?a.type==="GeometryCollection":!1,s=l?a.geometries.length:1,o=0;o<s;o++){if(r=l?a.geometries[o]:a,r===null){if(n(null,A,c,h,u)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,A,c,h,u)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],A,c,h,u)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}A++}}function ms(t,n){pL(t,function(e,i,o,r,s){var a=e===null?null:e.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return n(Ci(e,o,{bbox:r,id:s}),i,0)===!1?!1:void 0}var l;switch(a){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var c=0;c<e.coordinates.length;c++){var h=e.coordinates[c],u={type:l,coordinates:h};if(n(Ci(u,o),i,c)===!1)return!1}})}function mL(t,n){ms(t,function(e,i,o){var r=0;if(e.geometry){var s=e.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var a,l=0,c=0,h=0;if(nf(e,function(u,A,f,d,g){if(a===void 0||i>l||d>c||g>h){a=u,l=i,c=d,h=g,r=0;return}var v=jA([a,u],e.properties);if(n(v,i,o,g,r)===!1)return!1;r++,a=u})===!1)return!1}}})}function gL(t,n,e){var i=e,o=!1;return mL(t,function(r,s,a,l,c){o===!1&&e===void 0?i=r:i=n(i,r,s,a,l,c),o=!0}),i}function yL(t,n){return n===void 0&&(n={}),gL(t,function(e,i){var o=i.geometry.coordinates;return e+Pi(o[0],o[1],n)},0)}function vL(t){var n=jA(t),e=yL(n,{units:"meters"});return e}function*wL(t){t.type==="FeatureCollection"?yield*t.features.map(n=>[n.geometry,n]):t.type==="Feature"&&(yield[t.geometry,t])}function*bL(t){for(const[n,e]of wL(t))if(n.type==="LineString")yield[n.coordinates,e];else if(n.type==="MultiLineString")for(let i of n.coordinates)yield[i,e]}function _L(t,n,e){return[...bL(t)].map(([i,o])=>{if(i.length<2)return;const r=i.map(l=>[l[0],l[1],l[2]??0]),a=vL(r)/e;return{positions:r,repeat:a,width:n,extra:{geojson:{feature:o}}}}).filter(i=>!!i)}const Nl=C.ArcType,CL=C.arrayRemoveDuplicates,xL=C.BoundingSphere,Ft=C.Cartesian3,bn=C.Color,gs=C.ComponentDatatype,Ti=C.defaultValue,In=C.defined,ys=C.DeveloperError,Ii=C.Ellipsoid,SL=C.Geometry,vs=C.GeometryAttribute,EL=C.GeometryAttributes,PL=C.GeometryType,TL=C.IndexDatatype,TC=C.Math,Gl=C.PolylinePipeline,IL=C.PrimitiveType,ji=C.VertexFormat;var IC=[];function kL(t,n,e,i,o){var r=IC;r.length=o;var s,a=e.red,l=e.green,c=e.blue,h=e.alpha,u=i.red,A=i.green,f=i.blue,d=i.alpha;if(bn.equals(e,i)){for(s=0;s<o;s++)r[s]=bn.clone(e);return r}var g=(u-a)/o,v=(A-l)/o,y=(f-c)/o,m=(d-h)/o;for(s=0;s<o;s++)r[s]=new bn(a+s*g,l+s*v,c+s*y,h+s*m);return r}function ws(t){t=Ti(t,Ti.EMPTY_OBJECT);var n=t.positions,e=t.colors,i=Ti(t.width,1),o=Ti(t.colorsPerVertex,!1);if(!In(n)||n.length<2)throw new ys("At least two positions are required.");if(typeof i!="number")throw new ys("width must be a number");if(In(e)&&(o&&e.length<n.length||!o&&e.length<n.length-1))throw new ys("colors has an invalid length.");this._positions=n,this._colors=e,this._width=i,this._colorsPerVertex=o,this._vertexFormat=ji.clone(Ti(t.vertexFormat,ji.DEFAULT)),this._arcType=Ti(t.arcType,Nl.GEODESIC),this._granularity=Ti(t.granularity,TC.RADIANS_PER_DEGREE),this._ellipsoid=Ii.clone(Ti(t.ellipsoid,Ii.WGS84)),this._workerName="createPolylineGeometry";var r=1+n.length*Ft.packedLength;r+=In(e)?1+e.length*bn.packedLength:1,this.packedLength=r+Ii.packedLength+ji.packedLength+4}ws.pack=function(t,n,e){if(!In(t))throw new ys("value is required");if(!In(n))throw new ys("array is required");e=Ti(e,0);var i,o=t._positions,r=o.length;for(n[e++]=r,i=0;i<r;++i,e+=Ft.packedLength)Ft.pack(o[i],n,e);var s=t._colors;for(r=In(s)?s.length:0,n[e++]=r,i=0;i<r;++i,e+=bn.packedLength)bn.pack(s[i],n,e);return Ii.pack(t._ellipsoid,n,e),e+=Ii.packedLength,ji.pack(t._vertexFormat,n,e),e+=ji.packedLength,n[e++]=t._width,n[e++]=t._colorsPerVertex?1:0,n[e++]=t._arcType,n[e]=t._granularity,n};var kC=Ii.clone(Ii.UNIT_SPHERE),FC=new ji,Xo={positions:void 0,colors:void 0,ellipsoid:kC,vertexFormat:FC,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};ws.unpack=function(t,n,e){if(!In(t))throw new ys("array is required");n=Ti(n,0);var i,o=t[n++],r=new Array(o);for(i=0;i<o;++i,n+=Ft.packedLength)r[i]=Ft.unpack(t,n);o=t[n++];var s=o>0?new Array(o):void 0;for(i=0;i<o;++i,n+=bn.packedLength)s[i]=bn.unpack(t,n);var a=Ii.unpack(t,n,kC);n+=Ii.packedLength;var l=ji.unpack(t,n,FC);n+=ji.packedLength;var c=t[n++],h=t[n++]===1,u=t[n++],A=t[n];return In(e)?(e._positions=r,e._colors=s,e._ellipsoid=Ii.clone(a,e._ellipsoid),e._vertexFormat=ji.clone(l,e._vertexFormat),e._width=c,e._colorsPerVertex=h,e._arcType=u,e._granularity=A,e):(Xo.positions=r,Xo.colors=s,Xo.width=c,Xo.colorsPerVertex=h,Xo.arcType=u,Xo.granularity=A,new ws(Xo))};var BC=new Ft,MC=new Ft,DC=new Ft,RC=new Ft;ws.createGeometry=function(t){var n=t._width,e=t._vertexFormat,i=t._colors,o=t._colorsPerVertex,r=t._arcType,s=t._granularity,a=t._ellipsoid,l,c,h,u=CL(t._positions,Ft.equalsEpsilon),A=u.length;if(A<2||n<=0)return;if(r===Nl.GEODESIC||r===Nl.RHUMB){var f,d;r===Nl.GEODESIC?(f=TC.chordLength(s,a.maximumRadius),d=Gl.numberOfPoints):(f=s,d=Gl.numberOfPointsRhumbLine);var g=Gl.extractHeights(u,a);if(In(i)){var v=1;for(l=0;l<A-1;++l)v+=d(u[l],u[l+1],f);var y=new Array(v),m=0;for(l=0;l<A-1;++l){var w=u[l],_=u[l+1],E=i[l],T=d(w,_,f);if(o&&l<v){var P=i[l+1],F=kL(w,_,E,P,T),D=F.length;for(c=0;c<D;++c)y[m++]=F[c]}else for(c=0;c<T;++c)y[m++]=bn.clone(E)}y[m]=bn.clone(i[i.length-1]),i=y,IC.length=0}r===Nl.GEODESIC?u=Gl.generateCartesianArc({positions:u,minDistance:f,ellipsoid:a,height:g}):u=Gl.generateCartesianRhumbArc({positions:u,granularity:f,ellipsoid:a,height:g})}A=u.length;var B=A*4-4,S=new Float64Array(B*3),I=new Float64Array(B*3),b=new Float64Array(B*3),x=new Float32Array(B*2),U=e.st?new Float32Array(B*2):void 0,k=In(i)?new Uint8Array(B*4):void 0,M=0,R=0,O=0,z=0,V;let H=[0];{for(l=0;l<A-1;l++){const G=C.Cartesian3.distance(u[l],u[l+1]);H.push(H[H.length-1]+G)}H=H.map(G=>G/H[H.length-1])}for(c=0;c<A;++c){c===0?(V=BC,Ft.subtract(u[0],u[1],V),Ft.add(u[0],V,V)):V=u[c-1],Ft.clone(V,DC),Ft.clone(u[c],MC),c===A-1?(V=BC,Ft.subtract(u[A-1],u[A-2],V),Ft.add(u[A-1],V,V)):V=u[c+1],Ft.clone(V,RC);var q,J;In(k)&&(c!==0&&!o?q=i[c-1]:q=i[c],c!==A-1&&(J=i[c]));var j=c===0?2:0,re=c===A-1?2:4;for(h=j;h<re;++h){Ft.pack(MC,S,M),Ft.pack(DC,I,M),Ft.pack(RC,b,M),M+=3;var oe=h-2<0?-1:1;if(x[R++]=2*(h%2)-1,x[R++]=oe*n,e.st&&(U[O++]=H[c],U[O++]=Math.max(x[R-2],0)),In(k)){var ue=h<2?q:J;k[z++]=bn.floatToByte(ue.red),k[z++]=bn.floatToByte(ue.green),k[z++]=bn.floatToByte(ue.blue),k[z++]=bn.floatToByte(ue.alpha)}}}var ce=new EL;ce.position=new vs({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:S}),ce.prevPosition=new vs({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:I}),ce.nextPosition=new vs({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:b}),ce.expandAndWidth=new vs({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:x}),e.st&&(ce.st=new vs({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:U})),In(k)&&(ce.color=new vs({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:4,values:k,normalize:!0}));var ne=TL.createTypedArray(B,A*6-6),he=0,Y=0,Z=A-1;for(c=0;c<Z;++c)ne[Y++]=he,ne[Y++]=he+2,ne[Y++]=he+1,ne[Y++]=he+1,ne[Y++]=he+2,ne[Y++]=he+3,he+=4;return new SL({attributes:ce,indices:ne,primitiveType:IL.TRIANGLES,boundingSphere:xL.fromPoints(u),geometryType:PL.POLYLINES})};var Ig;function FL(){return typeof Ig>"u"&&(Ig=new C.EllipsoidGeodesic),Ig}function BL(t,n){var e=n/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function ML(t,n,e,i=1){var o=FL(),r=C.Cartesian3.fromDegreesArray([t[0],t[1],n[0],n[1]]),s=[0,0];t.length>=3&&n.length>=3&&(s=[t[2],n[2]]);var a=C.PolylinePipeline.generateCartesianArc({positions:r,height:s,minDistance:e}),l=C.Cartographic.fromDegrees(t[0],t[1]),c=C.Cartographic.fromDegrees(n[0],n[1]);o.setEndPoints(l,c);var h=o.surfaceDistance,u=a.length;return a.forEach(function(A,f){var d=f/(u-1),g=BL(d,h*i),v=C.Cartographic.fromCartesian(A);v.height+=g,C.Cartesian3.fromRadians(v.longitude,v.latitude,v.height,C.Ellipsoid.WGS84,a[f])}),a}function DL(t=[.8,.8,0,1],n=!0,e=!0,i){var o;const r=i?{type:"Image",uniforms:{color:new C.Color(...t)}}:{type:"Color",uniforms:{color:new C.Color(...t)}};n?(o=new C.PolylineMaterialAppearance({material:new C.Material({fabric:r,translucent:!1}),translucent:!1}),o.renderState.blending=C.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const h=C.Appearance.prototype.getRenderState.call(this);return h.depthTest={enabled:e},h.depthMask=!1,h},o.material.type==="Image"&&(o.material._uniforms.image_1=i)):(o=new C.PolylineMaterialAppearance({material:new C.Material({fabric:r,translucent:!0})}),o.getRenderState=function(){const h=C.Appearance.prototype.getRenderState.call(this);return h.depthTest={enabled:e},h.depthMask=!1,h},o.material.type==="Image"&&(o.material._uniforms.image_1=i));var s=C.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),a=`out vec4 v_twp;
|
|
4038
|
+
`;const S=A.computeLocalAxisedBoundingBoxFromAttribute("position");if(!S)return;const{min:I,max:b}=S;A.setLocalAxisedBoundingBox(I,b)},h=async()=>{if(e.points&&e.points.length>2){const{minPos:A,center:f}=Q.getMinMaxCorner(e.points),d=A[2]-e.depth;if(!Q.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const _=fn({originPosition:f},e.points.map((E,T)=>{let P=[...E];return P[2]=d,P}));c(a,f,_[0],"bottom",!0)}const g=this._interpolationAlongPolygon(e.points.map((_,E)=>C.Cartesian3.fromArray(Q.lbhToXyz(_))),e.interpolation),v=await i.getHeightsByLonLats(g.map(_=>[_[0],_[1]]));let y=[];for(let _=0;_<g.length;_++){const E=g[_];y.push([E[0],E[1],v[_]??E[2]],[E[0],E[1],d])}const m=fn({originPosition:f},y);let w=this._isClockwise(e.points,i);c(r,f,m[0],"side",w)}else r.attributes=void 0,a.attributes=void 0};h();const u=this.dv(p.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(u.don(h))}{const c=()=>{s.uri=e.sideImage.url,l.uri=e.bottomImage.url,r.uniformMap={u_image:{type:"texture",id:s.id},u_color:[1,1,1,e.opacity]},a.uniformMap={u_image:{type:"texture",id:l.id},u_color:[1,1,1,e.opacity]}};c();const h=this.ad(p.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(h.don(c))}}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}_interpolationAlongPolygon(e,i){var o=[];for(let l=0;l<e.length;++l){var r=e[l],s=e[(l+1)%e.length],a=this._interpolationAlongLine(r,s,i);o.push(...a)}return o.push(o[0]),o}_interpolationAlongLine(e,i,o){var r=[],s=C.Cartesian3.distance(e,i),a=C.Cartesian3.subtract(i,e,new C.Cartesian3);a.equals(C.Cartesian3.ZERO)||C.Cartesian3.normalize(a,a);for(var l=0;l<s;){var c=new C.Cartesian3(a.x*l,a.y*l,a.z*l),h=C.Cartesian3.add(e,c,new C.Cartesian3);const u=Ue(h);u&&r.push(u),l+=o}return r}_isClockwise(e,i){if(i.viewer)for(let o=0;o<e.length;o++){let r=C.Cartesian3.fromDegrees(...e[o]),s=C.Cartesian3.fromDegrees(...e[(o+1)%e.length]),a=C.Cartesian3.fromDegrees(...e[(o+2)%e.length]),l=C.Cartesian3.subtract(s,r,new C.Cartesian3),c=C.Cartesian3.subtract(a,s,new C.Cartesian3);if(l.equals(C.Cartesian3.ZERO)||c.equals(C.Cartesian3.ZERO))return!0;if(C.Cartesian3.normalize(l,l),C.Cartesian3.normalize(c,c),Math.abs(C.Cartesian3.dot(l,c))==1){if(o==e.length-1)return!0;continue}let h=C.Cartesian3.cross(l,c,new C.Cartesian3);return C.Cartesian3.dot(h,i.viewer.camera.directionWC)>0}}_triangleIndices(e){let i=new Uint32Array(e*3);for(let o=0;o<e;++o)i[o*3+0]=o,i[o*3+1]=o%2?(o+2)%e:(o+1)%e,i[o*3+2]=o%2?(o+1)%e:(o+2)%e;return i}_getDistance(e,i){return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}};L(yc,"type",yc.register("ESCesiumViewer",Q.ESPit.type,yc));let Pg=yc;const vc=class vc extends Tn{constructor(e,i){super(e,i);L(this,"_czmPolygonPrimitive");L(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new Fr(i,e.id)),console.log(this.czmPolygonPrimitive),this._geoPolylines=this.disposeVar(new $n(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}{const a=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};a(),this.ad(this.sceneObject.showChanged.don(a))}const r=this._geoPolylines;r.arcType="RHUMB";const s=this._czmPolygonPrimitive;this.dispose(p.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.track([r,"color"],[e,"strokeColor"])),this.dispose(p.track([r,"width"],[e,"strokeWidth"]));{s.perPositionHeight=!0;const a=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled,s.material={type:"Color",color:e.fillColor}};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(l.don(a))}{const a=()=>{const c={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(r.positions=[[...e.points,e.points[0]]],c.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let h=0;h<e.innerRings.length;h++){const u=e.innerRings[h];c.holes.push({positions:u}),r.positions.push([...u,u[0]])}s.polygonHierarchy=c}else s.polygonHierarchy=c};a();const l=this.disposeVar(p.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>a()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(vc,"type",vc.register("ESCesiumViewer",Q.ESPolygonWithHole.type,vc));let Tg=vc;var wn=63710088e-1,cL={centimeters:wn*100,centimetres:wn*100,degrees:wn/111325,feet:wn*3.28084,inches:wn*39.37,kilometers:wn/1e3,kilometres:wn/1e3,meters:wn,metres:wn,miles:wn/1609.344,millimeters:wn*1e3,millimetres:wn*1e3,nauticalmiles:wn/1852,radians:1,yards:wn*1.0936};function Ci(t,n,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=n||{},i.geometry=t,i}function eo(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!PC(t[0])||!PC(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return Ci(i,n,e)}function sn(t,n,e){e===void 0&&(e={});for(var i=0,o=t;i<o.length;i++){var r=o[i];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<r[r.length-1].length;s++)if(r[r.length-1][s]!==r[0][s])throw new Error("First and last Position are not equivalent.")}var a={type:"Polygon",coordinates:t};return Ci(a,n,e)}function jA(t,n,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:t};return Ci(i,n,e)}function xi(t,n){n===void 0&&(n={});var e={type:"FeatureCollection"};return n.id&&(e.id=n.id),n.bbox&&(e.bbox=n.bbox),e.features=t,e}function hL(t,n,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:t};return Ci(i,n,e)}function AL(t,n,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:t};return Ci(i,n,e)}function fL(t,n){n===void 0&&(n="kilometers");var e=cL[n];if(!e)throw new Error(n+" units is invalid");return t*e}function ef(t){var n=t%360;return n*Math.PI/180}function PC(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function tf(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Si(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function dL(t,n,e){if(!t)throw new Error("No featureCollection passed");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var i=0,o=t.features;i<o.length;i++){var r=o[i];if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==n)throw new Error("Invalid input to "+e+": must be a "+n+", given "+r.geometry.type)}}function Ei(t){return t.type==="Feature"?t.geometry:t}function pL(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Pi(t,n,e){e===void 0&&(e={});var i=tf(t),o=tf(n),r=ef(o[1]-i[1]),s=ef(o[0]-i[0]),a=ef(i[1]),l=ef(o[1]),c=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(a)*Math.cos(l);return fL(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),e.units)}function nf(t,n,e){if(t!==null)for(var i,o,r,s,a,l,c,h=0,u=0,A,f=t.type,d=f==="FeatureCollection",g=f==="Feature",v=d?t.features.length:1,y=0;y<v;y++){c=d?t.features[y].geometry:g?t.geometry:t,A=c?c.type==="GeometryCollection":!1,a=A?c.geometries.length:1;for(var m=0;m<a;m++){var w=0,_=0;if(s=A?c.geometries[m]:c,s!==null){l=s.coordinates;var E=s.type;switch(h=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,u,y,w,_)===!1)return!1;u++,w++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],u,y,w,_)===!1)return!1;u++,E==="MultiPoint"&&w++}E==="LineString"&&w++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-h;o++){if(n(l[i][o],u,y,w,_)===!1)return!1;u++}E==="MultiLineString"&&w++,E==="Polygon"&&_++}E==="Polygon"&&w++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(_=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-h;r++){if(n(l[i][o][r],u,y,w,_)===!1)return!1;u++}_++}w++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(nf(s.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function rf(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function mL(t,n){var e,i,o,r,s,a,l,c,h,u,A=0,f=t.type==="FeatureCollection",d=t.type==="Feature",g=f?t.features.length:1;for(e=0;e<g;e++){for(a=f?t.features[e].geometry:d?t.geometry:t,c=f?t.features[e].properties:d?t.properties:{},h=f?t.features[e].bbox:d?t.bbox:void 0,u=f?t.features[e].id:d?t.id:void 0,l=a?a.type==="GeometryCollection":!1,s=l?a.geometries.length:1,o=0;o<s;o++){if(r=l?a.geometries[o]:a,r===null){if(n(null,A,c,h,u)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,A,c,h,u)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],A,c,h,u)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}A++}}function ms(t,n){mL(t,function(e,i,o,r,s){var a=e===null?null:e.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return n(Ci(e,o,{bbox:r,id:s}),i,0)===!1?!1:void 0}var l;switch(a){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var c=0;c<e.coordinates.length;c++){var h=e.coordinates[c],u={type:l,coordinates:h};if(n(Ci(u,o),i,c)===!1)return!1}})}function gL(t,n){ms(t,function(e,i,o){var r=0;if(e.geometry){var s=e.geometry.type;if(!(s==="Point"||s==="MultiPoint")){var a,l=0,c=0,h=0;if(nf(e,function(u,A,f,d,g){if(a===void 0||i>l||d>c||g>h){a=u,l=i,c=d,h=g,r=0;return}var v=jA([a,u],e.properties);if(n(v,i,o,g,r)===!1)return!1;r++,a=u})===!1)return!1}}})}function yL(t,n,e){var i=e,o=!1;return gL(t,function(r,s,a,l,c){o===!1&&e===void 0?i=r:i=n(i,r,s,a,l,c),o=!0}),i}function vL(t,n){return n===void 0&&(n={}),yL(t,function(e,i){var o=i.geometry.coordinates;return e+Pi(o[0],o[1],n)},0)}function wL(t){var n=jA(t),e=vL(n,{units:"meters"});return e}function*bL(t){t.type==="FeatureCollection"?yield*t.features.map(n=>[n.geometry,n]):t.type==="Feature"&&(yield[t.geometry,t])}function*_L(t){for(const[n,e]of bL(t))if(n.type==="LineString")yield[n.coordinates,e];else if(n.type==="MultiLineString")for(let i of n.coordinates)yield[i,e]}function CL(t,n,e){return[..._L(t)].map(([i,o])=>{if(i.length<2)return;const r=i.map(l=>[l[0],l[1],l[2]??0]),a=wL(r)/e;return{positions:r,repeat:a,width:n,extra:{geojson:{feature:o}}}}).filter(i=>!!i)}const Nl=C.ArcType,xL=C.arrayRemoveDuplicates,SL=C.BoundingSphere,Ft=C.Cartesian3,bn=C.Color,gs=C.ComponentDatatype,Ti=C.defaultValue,In=C.defined,ys=C.DeveloperError,Ii=C.Ellipsoid,EL=C.Geometry,vs=C.GeometryAttribute,PL=C.GeometryAttributes,TL=C.GeometryType,IL=C.IndexDatatype,TC=C.Math,Gl=C.PolylinePipeline,kL=C.PrimitiveType,ji=C.VertexFormat;var IC=[];function FL(t,n,e,i,o){var r=IC;r.length=o;var s,a=e.red,l=e.green,c=e.blue,h=e.alpha,u=i.red,A=i.green,f=i.blue,d=i.alpha;if(bn.equals(e,i)){for(s=0;s<o;s++)r[s]=bn.clone(e);return r}var g=(u-a)/o,v=(A-l)/o,y=(f-c)/o,m=(d-h)/o;for(s=0;s<o;s++)r[s]=new bn(a+s*g,l+s*v,c+s*y,h+s*m);return r}function ws(t){t=Ti(t,Ti.EMPTY_OBJECT);var n=t.positions,e=t.colors,i=Ti(t.width,1),o=Ti(t.colorsPerVertex,!1);if(!In(n)||n.length<2)throw new ys("At least two positions are required.");if(typeof i!="number")throw new ys("width must be a number");if(In(e)&&(o&&e.length<n.length||!o&&e.length<n.length-1))throw new ys("colors has an invalid length.");this._positions=n,this._colors=e,this._width=i,this._colorsPerVertex=o,this._vertexFormat=ji.clone(Ti(t.vertexFormat,ji.DEFAULT)),this._arcType=Ti(t.arcType,Nl.GEODESIC),this._granularity=Ti(t.granularity,TC.RADIANS_PER_DEGREE),this._ellipsoid=Ii.clone(Ti(t.ellipsoid,Ii.WGS84)),this._workerName="createPolylineGeometry";var r=1+n.length*Ft.packedLength;r+=In(e)?1+e.length*bn.packedLength:1,this.packedLength=r+Ii.packedLength+ji.packedLength+4}ws.pack=function(t,n,e){if(!In(t))throw new ys("value is required");if(!In(n))throw new ys("array is required");e=Ti(e,0);var i,o=t._positions,r=o.length;for(n[e++]=r,i=0;i<r;++i,e+=Ft.packedLength)Ft.pack(o[i],n,e);var s=t._colors;for(r=In(s)?s.length:0,n[e++]=r,i=0;i<r;++i,e+=bn.packedLength)bn.pack(s[i],n,e);return Ii.pack(t._ellipsoid,n,e),e+=Ii.packedLength,ji.pack(t._vertexFormat,n,e),e+=ji.packedLength,n[e++]=t._width,n[e++]=t._colorsPerVertex?1:0,n[e++]=t._arcType,n[e]=t._granularity,n};var kC=Ii.clone(Ii.UNIT_SPHERE),FC=new ji,Xo={positions:void 0,colors:void 0,ellipsoid:kC,vertexFormat:FC,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};ws.unpack=function(t,n,e){if(!In(t))throw new ys("array is required");n=Ti(n,0);var i,o=t[n++],r=new Array(o);for(i=0;i<o;++i,n+=Ft.packedLength)r[i]=Ft.unpack(t,n);o=t[n++];var s=o>0?new Array(o):void 0;for(i=0;i<o;++i,n+=bn.packedLength)s[i]=bn.unpack(t,n);var a=Ii.unpack(t,n,kC);n+=Ii.packedLength;var l=ji.unpack(t,n,FC);n+=ji.packedLength;var c=t[n++],h=t[n++]===1,u=t[n++],A=t[n];return In(e)?(e._positions=r,e._colors=s,e._ellipsoid=Ii.clone(a,e._ellipsoid),e._vertexFormat=ji.clone(l,e._vertexFormat),e._width=c,e._colorsPerVertex=h,e._arcType=u,e._granularity=A,e):(Xo.positions=r,Xo.colors=s,Xo.width=c,Xo.colorsPerVertex=h,Xo.arcType=u,Xo.granularity=A,new ws(Xo))};var BC=new Ft,MC=new Ft,DC=new Ft,RC=new Ft;ws.createGeometry=function(t){var n=t._width,e=t._vertexFormat,i=t._colors,o=t._colorsPerVertex,r=t._arcType,s=t._granularity,a=t._ellipsoid,l,c,h,u=xL(t._positions,Ft.equalsEpsilon),A=u.length;if(A<2||n<=0)return;if(r===Nl.GEODESIC||r===Nl.RHUMB){var f,d;r===Nl.GEODESIC?(f=TC.chordLength(s,a.maximumRadius),d=Gl.numberOfPoints):(f=s,d=Gl.numberOfPointsRhumbLine);var g=Gl.extractHeights(u,a);if(In(i)){var v=1;for(l=0;l<A-1;++l)v+=d(u[l],u[l+1],f);var y=new Array(v),m=0;for(l=0;l<A-1;++l){var w=u[l],_=u[l+1],E=i[l],T=d(w,_,f);if(o&&l<v){var P=i[l+1],F=FL(w,_,E,P,T),D=F.length;for(c=0;c<D;++c)y[m++]=F[c]}else for(c=0;c<T;++c)y[m++]=bn.clone(E)}y[m]=bn.clone(i[i.length-1]),i=y,IC.length=0}r===Nl.GEODESIC?u=Gl.generateCartesianArc({positions:u,minDistance:f,ellipsoid:a,height:g}):u=Gl.generateCartesianRhumbArc({positions:u,granularity:f,ellipsoid:a,height:g})}A=u.length;var B=A*4-4,S=new Float64Array(B*3),I=new Float64Array(B*3),b=new Float64Array(B*3),x=new Float32Array(B*2),U=e.st?new Float32Array(B*2):void 0,k=In(i)?new Uint8Array(B*4):void 0,M=0,R=0,O=0,z=0,V;let H=[0];{for(l=0;l<A-1;l++){const G=C.Cartesian3.distance(u[l],u[l+1]);H.push(H[H.length-1]+G)}H=H.map(G=>G/H[H.length-1])}for(c=0;c<A;++c){c===0?(V=BC,Ft.subtract(u[0],u[1],V),Ft.add(u[0],V,V)):V=u[c-1],Ft.clone(V,DC),Ft.clone(u[c],MC),c===A-1?(V=BC,Ft.subtract(u[A-1],u[A-2],V),Ft.add(u[A-1],V,V)):V=u[c+1],Ft.clone(V,RC);var q,J;In(k)&&(c!==0&&!o?q=i[c-1]:q=i[c],c!==A-1&&(J=i[c]));var j=c===0?2:0,re=c===A-1?2:4;for(h=j;h<re;++h){Ft.pack(MC,S,M),Ft.pack(DC,I,M),Ft.pack(RC,b,M),M+=3;var oe=h-2<0?-1:1;if(x[R++]=2*(h%2)-1,x[R++]=oe*n,e.st&&(U[O++]=H[c],U[O++]=Math.max(x[R-2],0)),In(k)){var ue=h<2?q:J;k[z++]=bn.floatToByte(ue.red),k[z++]=bn.floatToByte(ue.green),k[z++]=bn.floatToByte(ue.blue),k[z++]=bn.floatToByte(ue.alpha)}}}var ce=new PL;ce.position=new vs({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:S}),ce.prevPosition=new vs({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:I}),ce.nextPosition=new vs({componentDatatype:gs.DOUBLE,componentsPerAttribute:3,values:b}),ce.expandAndWidth=new vs({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:x}),e.st&&(ce.st=new vs({componentDatatype:gs.FLOAT,componentsPerAttribute:2,values:U})),In(k)&&(ce.color=new vs({componentDatatype:gs.UNSIGNED_BYTE,componentsPerAttribute:4,values:k,normalize:!0}));var ne=IL.createTypedArray(B,A*6-6),he=0,Y=0,Z=A-1;for(c=0;c<Z;++c)ne[Y++]=he,ne[Y++]=he+2,ne[Y++]=he+1,ne[Y++]=he+1,ne[Y++]=he+2,ne[Y++]=he+3,he+=4;return new EL({attributes:ce,indices:ne,primitiveType:kL.TRIANGLES,boundingSphere:SL.fromPoints(u),geometryType:TL.POLYLINES})};var Ig;function BL(){return typeof Ig>"u"&&(Ig=new C.EllipsoidGeodesic),Ig}function ML(t,n){var e=n/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function DL(t,n,e,i=1){var o=BL(),r=C.Cartesian3.fromDegreesArray([t[0],t[1],n[0],n[1]]),s=[0,0];t.length>=3&&n.length>=3&&(s=[t[2],n[2]]);var a=C.PolylinePipeline.generateCartesianArc({positions:r,height:s,minDistance:e}),l=C.Cartographic.fromDegrees(t[0],t[1]),c=C.Cartographic.fromDegrees(n[0],n[1]);o.setEndPoints(l,c);var h=o.surfaceDistance,u=a.length;return a.forEach(function(A,f){var d=f/(u-1),g=ML(d,h*i),v=C.Cartographic.fromCartesian(A);v.height+=g,C.Cartesian3.fromRadians(v.longitude,v.latitude,v.height,C.Ellipsoid.WGS84,a[f])}),a}function RL(t=[.8,.8,0,1],n=!0,e=!0,i){var o;const r=i?{type:"Image",uniforms:{color:new C.Color(...t)}}:{type:"Color",uniforms:{color:new C.Color(...t)}};n?(o=new C.PolylineMaterialAppearance({material:new C.Material({fabric:r,translucent:!1}),translucent:!1}),o.renderState.blending=C.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const h=C.Appearance.prototype.getRenderState.call(this);return h.depthTest={enabled:e},h.depthMask=!1,h},o.material.type==="Image"&&(o.material._uniforms.image_1=i)):(o=new C.PolylineMaterialAppearance({material:new C.Material({fabric:r,translucent:!0})}),o.getRenderState=function(){const h=C.Appearance.prototype.getRenderState.call(this);return h.depthTest={enabled:e},h.depthMask=!1,h},o.material.type==="Image"&&(o.material._uniforms.image_1=i));var s=C.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),a=`out vec4 v_twp;
|
|
4039
4039
|
out vec4 v_color;
|
|
4040
4040
|
out vec4 v_bgColor;
|
|
4041
4041
|
out float v_expand;
|
|
@@ -4061,7 +4061,7 @@ void main()
|
|
|
4061
4061
|
{
|
|
4062
4062
|
czm_twp2_main();
|
|
4063
4063
|
float t = v_twp.x; float bidirectional = v_twp.z; t *= 1.03; float alpha0 = smoothstep(t - 0.03, t, v_st.s) * step(v_st.s, t); float mt = 1. - t; float alpha1 = smoothstep(mt + 0.03, mt, v_st.s) * step(mt, v_st.s); float a0 = step(abs(bidirectional - 0.0) - 0.001, 0.); float a1 = step(abs(bidirectional - 1.0) - 0.001, 0.); float db = step(abs(bidirectional - 2.0) - 0.001, 0.); float alpha = alpha0 * (a0 + db) + alpha1 * (a1 + db); alpha = clamp(alpha, 0., 1.); out_FragColor.rgb *= (v_color.rgb * alpha + v_bgColor.rgb * (1. - alpha)); out_FragColor.a *= (v_color.a * alpha + v_bgColor.a * (1. - alpha));}`;return o._fragmentShaderSource=l+`
|
|
4064
|
-
`+c,o}function
|
|
4064
|
+
`+c,o}function UL(t,n,e,i,o,r,s){const a=ws.createGeometry(new ws({positions:n,width:e,vertexFormat:C.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:i}));if(a){r||(r=C.Color.clone(o||C.Color.WHITE),r.alpha=.2);var l=new C.GeometryInstance({geometry:a,id:t,attributes:{color:C.ColorGeometryInstanceAttribute.fromColor(o||C.Color.WHITE),bgColor:C.ColorGeometryInstanceAttribute.fromColor(r),twp:new C.GeometryInstanceAttribute({componentDatatype:C.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:s})}});return l}}const of=new C.Cartesian4(0,0,0,0),ki=new C.Cartesian4(0,0,0,0),Wl={timeRatio:0,repeat:1,color:[1,1,1,1],bgColor:[1,1,1,1],bidirectional:0};function OL(t,n,e,i,o=!0,r=!0,s,a){var l=[];try{t.forEach(function(h,u){var A=h.positions&&h.positions.map(P=>C.Cartesian3.fromDegrees(...P))||DL(h.startPos,h.endPos,void 0,typeof h.heightRatio>"u"?1:h.heightRatio);const f=i(u,void 0,Wl),{timeRatio:d,repeat:g,color:v,bidirectional:y,bgColor:m}=f,w=new C.Color(...v),_=new C.Color(...m),E=[d,g,y,0];var T=UL(u,A,h.width,e,w,_,E);if(!T)throw new Error("cannot get geoemetry instance!");l.push(T)})}catch{return}var c=new C.Primitive({geometryInstances:l,appearance:RL(n,o,r,s),asynchronous:!1});return C.Primitive.prototype&&(c.ESSceneObjectID=a),c.update=function(h){const u=this;if(typeof u._batchTable<"u")for(var A=u._batchTableAttributeIndices.twp,f=u._batchTableAttributeIndices.color,d=u._batchTableAttributeIndices.bgColor,g=u._batchTable._numberOfInstances,v=0;v<g;++v){var y=v;Wl.timeRatio=0,Wl.repeat=1,Wl.color.splice(0,4,1,1,1);const m=i(y,h,Wl),{timeRatio:w,repeat:_,color:E,bidirectional:T,bgColor:P}=m;of.x=w,of.y=_,of.z=typeof T!="number"?0:T,u._batchTable.setBatchedAttribute(y,A,of),ki.x=255*E[0],ki.y=255*E[1],ki.z=255*E[2],ki.w=255*E[3],u._batchTable.setBatchedAttribute(y,f,ki),ki.x=255*P[0],ki.y=255*P[1],ki.z=255*P[2],ki.w=255*P[3],u._batchTable.setBatchedAttribute(y,d,ki)}C.Primitive.prototype.update.call(u,h)},c}class LL extends p.Destroyable{constructor(e,i,o){super();L(this,"_nativePrimitive");this._viewer=e;const r=this._viewer,s=i.routePaths;if(!s)throw new Error("!routePath");const a=i.arcType!==void 0?C.ArcType[i.arcType]:C.ArcType.GEODESIC,l=OL(s,[1,1,1,1],a,(c,h,u)=>{const A=s[c];if(!i)return u;u.repeat=(A.repeat??1)*i.repeat;const f=A.startTime??i.startTime,d=A.transmissionTime??i.transmissionTime??i.duration??er.defaults.duration,g=i.currentTime??er.defaults.currentTime,v=p.clamp((g-f)/d,0,1);u.timeRatio=v/u.repeat;const y=A.color??i.color,m=A.bgColor??i.bgColor;return u.color.splice(0,4,...y),u.bgColor.splice(0,4,...m),u.bidirectional=A.bidirectional??i.bidirectional,(i.routePathCallback&&i.routePathCallback(u,c,h))??u},i.brightening,i.depthTest,o,i.id);l&&(r.scene.primitives.add(l),this.dispose(()=>{r.scene.primitives.remove(l)}),l.show=i.show??!0,this.dispose(i.showChanged.disposableOn(()=>{l&&(l.show=i.show??!0)})),this._nativePrimitive=l)}get nativePrimitive(){return this._nativePrimitive}}const zL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAATUlEQVQYlaXLOQqEUBQF0SMmojgvpfe/JiccEvlNwwuM24IK7oXKUkof7ylQoUGHHsPDMf4WNcpociTcuHBgx4oFczg9/O0tPKP7D3wBky8UMt76XnoAAAAASUVORK5CYII=",QL=`默认示例代码
|
|
4065
4065
|
\`\`\`
|
|
4066
4066
|
// result 最后的结果
|
|
4067
4067
|
// this 是当前的信号传输器集合
|
|
@@ -4075,7 +4075,7 @@ function (result, this, instanceIndex, frameState) {
|
|
|
4075
4075
|
result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
|
|
4076
4076
|
return result;
|
|
4077
4077
|
}\`\`\`
|
|
4078
|
-
`,uo=class uo extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_player");L(this,"_finalImageUrlReact",this.disposeVar(Q.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));L(this,"_routePaths",this.disposeVar(p.react(void 0)));L(this,"routePathCallback");L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new Q.Player);{const A=uo.defaults;this.dispose(p.bind([this._player,"loop"],[this,"loop"],f=>f??A.loop,f=>f??A.loop)),this.dispose(p.bind([this._player,"currentTime"],[this,"currentTime"],f=>f??A.currentTime,f=>f??A.currentTime)),this.dispose(p.bind([this._player,"duration"],[this,"duration"],f=>f??A.duration,f=>f??A.duration)),this.dispose(p.bind([this._player,"playing"],[this,"playing"],f=>f??A.playing,f=>f??A.playing)),this.dispose(p.bind([this._player,"speed"],[this,"speed"],f=>f??A.speed,f=>f??A.speed))}const o=this.disposeVar(Q.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(p.createProcessingFromAsyncFunc(async A=>{this.routePaths=void 0;const f=o.value;if(f)try{const g=await(await fetch(f)).json();this.routePaths=_L(g,this.width,this.repeatLength);return}catch(d){console.error(`geojson加载解析出错!${d}`),console.error(d)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const d=this.positionsSet;if(d){this.routePaths=d.map(g=>({positions:g,width:this.width}));return}}}));{const A=()=>{r.restart()};A();const f=this.disposeVar(p.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(f.disposableOn(A))}{const A=()=>{const f=Zf(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);f&&(this.routePathCallback=f)};A(),this.dispose(this.routePathCallbackStrChanged.disposableOn(A))}const s=e.viewer;if(!s){console.warn("viewer is undefined!");return}const a=this.finalImageUrlReact,l=this.disposeVar(new pa),c=this.disposeVar(p.createProcessingFromAsyncFunc(async A=>{if(!a.value)return;const f=k0(s.scene.context).getTextureHandler(a.value);if(f instanceof pa)l.reset(f);else{const d=await A.promise(f);l.reset(d)}})),h=()=>l.valid?l.raw:s.scene.context.defaultTexture,u=()=>c.restart();u(),this.dispose(a.changed.disposableOn(u)),this.disposeVar(new p.ObjResettingWithEvent(this.routePathsChanged,()=>this.routePaths?new OL(s,this,a.value&&h||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(A=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Be(s,this.routePaths[0].startPos,s.camera.positionCartographic.height,void 0,A);else{const f=computeBoundingSphere(this.routePaths[0].positions);if(!f)return;const[d,g]=f;Be(s,d,g*3,void 0,A)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};L(uo,"whiteGradientImageBase64",LL),L(uo,"defaultRoutePathCallback",function(e,i,o){const r=i/50,s=r-Math.floor(r);return e.color=[s*.5+.5,(1-s)*.5+.5,.5,1],e.bgColor=[s*.5+.5,(1-s)*.5+.5,.5,.3],e}),L(uo,"routePathCallbackStrMd",zL),L(uo,"defaults",{loop:!0,startTime:0,currentTime:0,playerCurrentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(uo,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let er=uo;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:p.reactArray([0,1,0,1]),bgColor:p.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:p.reactPositionsSet(void 0),data:p.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(er||(er={})),p.extendClassProps(er.prototype,er.createDefaultProps);class tr extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_collection");this._collection=this.disposeVar(new er(e,i)),this.dispose(p.track([this._collection,"show"],[this,"show"])),this.dispose(p.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(p.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(p.track([this._collection,"color"],[this,"color"])),this.dispose(p.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(p.track([this._collection,"width"],[this,"width"])),this.dispose(p.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(p.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(p.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(p.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(p.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(p.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(p.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(p.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(p.bind([this._collection,"playing"],[this,"playing"])),this.dispose(p.track([this._collection,"loop"],[this,"loop"])),this.dispose(p.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this._collection,"duration"],[this,"duration"])),this.dispose(p.bind([this._collection,"speed"],[this,"speed"])),this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=[{startPos:this.positions[0],endPos:this.positions[this.positions.length-1],width:this.width,heightRatio:this.heightRatio}];return}this._collection.data=void 0};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}L(tr,"defaults",{loop:!0,currentTime:0,playerCurrentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(tr,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:p.reactArray([0,1,0,1]),bgColor:p.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:p.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(tr||(tr={})),p.extendClassProps(tr.prototype,tr.createDefaultProps);const wc=class wc extends an{constructor(e,i){super(e,i);L(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new tr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"width"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"strokeColor"])),this.dispose(p.track([r,"startTime"],[e,"startTime"])),this.dispose(p.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(p.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(p.track([r,"arcType"],[e,"arcType"])),this.dispose(p.track([r,"brightening"],[e,"brightening"])),this.dispose(p.track([r,"depthTest"],[e,"depthTest"])),this.dispose(p.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(p.track([r,"repeat"],[e,"repeat"])),this.dispose(p.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"currentTime"],[e,"currentTime"])),this.dispose(p.track([r,"duration"],[e,"duration"])),this.dispose(p.track([r,"playing"],[e,"playing"])),this.dispose(p.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(wc,"type",wc.register("ESCesiumViewer",Yr.type,wc));let kg=wc;function $o(t){var n=[1/0,1/0,-1/0,-1/0];return nf(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}$o.default=$o;var af={exports:{}},QL=af.exports,UC;function VL(){return UC||(UC=1,function(t,n){(function(e,i){t.exports=i()})(QL,function(){function e(m,w,_,E,T){(function P(F,D,B,S,I){for(;S>B;){if(S-B>600){var b=S-B+1,x=D-B+1,U=Math.log(b),k=.5*Math.exp(2*U/3),M=.5*Math.sqrt(U*k*(b-k)/b)*(x-b/2<0?-1:1),R=Math.max(B,Math.floor(D-x*k/b+M)),O=Math.min(S,Math.floor(D+(b-x)*k/b+M));P(F,D,R,O,I)}var z=F[D],V=B,H=S;for(i(F,B,D),I(F[S],z)>0&&i(F,B,S);V<H;){for(i(F,V,H),V++,H--;I(F[V],z)<0;)V++;for(;I(F[H],z)>0;)H--}I(F[B],z)===0?i(F,B,H):i(F,++H,S),H<=D&&(B=H+1),D<=H&&(S=H-1)}})(m,w,_||0,E||m.length-1,T||o)}function i(m,w,_){var E=m[w];m[w]=m[_],m[_]=E}function o(m,w){return m<w?-1:m>w?1:0}var r=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(m,w,_){if(!_)return w.indexOf(m);for(var E=0;E<w.length;E++)if(_(m,w[E]))return E;return-1}function a(m,w){l(m,0,m.children.length,w,m)}function l(m,w,_,E,T){T||(T=v(null)),T.minX=1/0,T.minY=1/0,T.maxX=-1/0,T.maxY=-1/0;for(var P=w;P<_;P++){var F=m.children[P];c(T,m.leaf?E(F):F)}return T}function c(m,w){return m.minX=Math.min(m.minX,w.minX),m.minY=Math.min(m.minY,w.minY),m.maxX=Math.max(m.maxX,w.maxX),m.maxY=Math.max(m.maxY,w.maxY),m}function h(m,w){return m.minX-w.minX}function u(m,w){return m.minY-w.minY}function A(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function f(m){return m.maxX-m.minX+(m.maxY-m.minY)}function d(m,w){return m.minX<=w.minX&&m.minY<=w.minY&&w.maxX<=m.maxX&&w.maxY<=m.maxY}function g(m,w){return w.minX<=m.maxX&&w.minY<=m.maxY&&w.maxX>=m.minX&&w.maxY>=m.minY}function v(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(m,w,_,E,T){for(var P=[w,_];P.length;)if(!((_=P.pop())-(w=P.pop())<=E)){var F=w+Math.ceil((_-w)/E/2)*E;e(m,F,w,_,T),P.push(w,F,F,_)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(m){var w=this.data,_=[];if(!g(m,w))return _;for(var E=this.toBBox,T=[];w;){for(var P=0;P<w.children.length;P++){var F=w.children[P],D=w.leaf?E(F):F;g(m,D)&&(w.leaf?_.push(F):d(m,D)?this._all(F,_):T.push(F))}w=T.pop()}return _},r.prototype.collides=function(m){var w=this.data;if(!g(m,w))return!1;for(var _=[];w;){for(var E=0;E<w.children.length;E++){var T=w.children[E],P=w.leaf?this.toBBox(T):T;if(g(m,P)){if(w.leaf||d(m,P))return!0;_.push(T)}}w=_.pop()}return!1},r.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var w=0;w<m.length;w++)this.insert(m[w]);return this}var _=this._build(m.slice(),0,m.length-1,0);if(this.data.children.length)if(this.data.height===_.height)this._splitRoot(this.data,_);else{if(this.data.height<_.height){var E=this.data;this.data=_,_=E}this._insert(_,this.data.height-_.height-1,!0)}else this.data=_;return this},r.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(m,w){if(!m)return this;for(var _,E,T,P=this.data,F=this.toBBox(m),D=[],B=[];P||D.length;){if(P||(P=D.pop(),E=D[D.length-1],_=B.pop(),T=!0),P.leaf){var S=s(m,P.children,w);if(S!==-1)return P.children.splice(S,1),D.push(P),this._condense(D),this}T||P.leaf||!d(P,F)?E?(_++,P=E.children[_],T=!1):P=null:(D.push(P),B.push(_),_=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(m){return m},r.prototype.compareMinX=function(m,w){return m.minX-w.minX},r.prototype.compareMinY=function(m,w){return m.minY-w.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(m){return this.data=m,this},r.prototype._all=function(m,w){for(var _=[];m;)m.leaf?w.push.apply(w,m.children):_.push.apply(_,m.children),m=_.pop();return w},r.prototype._build=function(m,w,_,E){var T,P=_-w+1,F=this._maxEntries;if(P<=F)return a(T=v(m.slice(w,_+1)),this.toBBox),T;E||(E=Math.ceil(Math.log(P)/Math.log(F)),F=Math.ceil(P/Math.pow(F,E-1))),(T=v([])).leaf=!1,T.height=E;var D=Math.ceil(P/F),B=D*Math.ceil(Math.sqrt(F));y(m,w,_,B,this.compareMinX);for(var S=w;S<=_;S+=B){var I=Math.min(S+B-1,_);y(m,S,I,D,this.compareMinY);for(var b=S;b<=I;b+=D){var x=Math.min(b+D-1,I);T.children.push(this._build(m,b,x,E-1))}}return a(T,this.toBBox),T},r.prototype._chooseSubtree=function(m,w,_,E){for(;E.push(w),!w.leaf&&E.length-1!==_;){for(var T=1/0,P=1/0,F=void 0,D=0;D<w.children.length;D++){var B=w.children[D],S=A(B),I=(b=m,x=B,(Math.max(x.maxX,b.maxX)-Math.min(x.minX,b.minX))*(Math.max(x.maxY,b.maxY)-Math.min(x.minY,b.minY))-S);I<P?(P=I,T=S<T?S:T,F=B):I===P&&S<T&&(T=S,F=B)}w=F||w.children[0]}var b,x;return w},r.prototype._insert=function(m,w,_){var E=_?m:this.toBBox(m),T=[],P=this._chooseSubtree(E,this.data,w,T);for(P.children.push(m),c(P,E);w>=0&&T[w].children.length>this._maxEntries;)this._split(T,w),w--;this._adjustParentBBoxes(E,T,w)},r.prototype._split=function(m,w){var _=m[w],E=_.children.length,T=this._minEntries;this._chooseSplitAxis(_,T,E);var P=this._chooseSplitIndex(_,T,E),F=v(_.children.splice(P,_.children.length-P));F.height=_.height,F.leaf=_.leaf,a(_,this.toBBox),a(F,this.toBBox),w?m[w-1].children.push(F):this._splitRoot(_,F)},r.prototype._splitRoot=function(m,w){this.data=v([m,w]),this.data.height=m.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(m,w,_){for(var E,T,P,F,D,B,S,I=1/0,b=1/0,x=w;x<=_-w;x++){var U=l(m,0,x,this.toBBox),k=l(m,x,_,this.toBBox),M=(T=U,P=k,F=void 0,D=void 0,B=void 0,S=void 0,F=Math.max(T.minX,P.minX),D=Math.max(T.minY,P.minY),B=Math.min(T.maxX,P.maxX),S=Math.min(T.maxY,P.maxY),Math.max(0,B-F)*Math.max(0,S-D)),R=A(U)+A(k);M<I?(I=M,E=x,b=R<b?R:b):M===I&&R<b&&(b=R,E=x)}return E||_-w},r.prototype._chooseSplitAxis=function(m,w,_){var E=m.leaf?this.compareMinX:h,T=m.leaf?this.compareMinY:u;this._allDistMargin(m,w,_,E)<this._allDistMargin(m,w,_,T)&&m.children.sort(E)},r.prototype._allDistMargin=function(m,w,_,E){m.children.sort(E);for(var T=this.toBBox,P=l(m,0,w,T),F=l(m,_-w,_,T),D=f(P)+f(F),B=w;B<_-w;B++){var S=m.children[B];c(P,m.leaf?T(S):S),D+=f(P)}for(var I=_-w-1;I>=w;I--){var b=m.children[I];c(F,m.leaf?T(b):b),D+=f(F)}return D},r.prototype._adjustParentBBoxes=function(m,w,_){for(var E=_;E>=0;E--)c(w[E],m)},r.prototype._condense=function(m){for(var w=m.length-1,_=void 0;w>=0;w--)m[w].children.length===0?w>0?(_=m[w-1].children).splice(_.indexOf(m[w]),1):this.clear():a(m[w],this.toBBox)},r})}(af)),af.exports}function ln(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=tf(t),o=Ei(n),r=o.type,s=n.bbox,a=o.coordinates;if(s&&HL(i,s)===!1)return!1;r==="Polygon"&&(a=[a]);for(var l=!1,c=0;c<a.length&&!l;c++)if(OC(i,a[c][0],e.ignoreBoundary)){for(var h=!1,u=1;u<a[c].length&&!h;)OC(i,a[c][u],!e.ignoreBoundary)&&(h=!0),u++;h||(l=!0)}return l}function OC(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var s=n[o][0],a=n[o][1],l=n[r][0],c=n[r][1],h=t[1]*(s-l)+a*(l-t[0])+c*(t[0]-s)===0&&(s-t[0])*(l-t[0])<=0&&(a-t[1])*(c-t[1])<=0;if(h)return!e;var u=a>t[1]!=c>t[1]&&t[0]<(l-s)*(t[1]-a)/(c-a)+s;u&&(i=!i)}return i}function HL(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function NL(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return LC(t);case"FeatureCollection":return GL(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Fg(t);default:throw new Error("unknown GeoJSON type")}}function LC(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=zC(t.properties),n.geometry=Fg(t.geometry),n}function zC(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=zC(i):n[e]=i}),n}function GL(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return LC(e)}),n}function Fg(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return Fg(e)}),n):(n.coordinates=QC(t.coordinates),n)}function QC(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return QC(e)})}function VC(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=dL(t),o=[];switch(i){case"LineString":o=Bg(t);break;case"MultiLineString":case"Polygon":Si(t).forEach(function(s){o.push(Bg(s))});break;case"MultiPolygon":Si(t).forEach(function(s){var a=[];s.forEach(function(l){a.push(Bg(l))}),o.push(a)});break;case"Point":return t;case"MultiPoint":var r={};Si(t).forEach(function(s){var a=s.join("-");Object.prototype.hasOwnProperty.call(r,a)||(o.push(s),r[a]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ci({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Bg(t){var n=Si(t);if(n.length===2&&!HC(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var s=e[e.length-1];n[r][0]===s[0]&&n[r][1]===s[1]||(e.push(n[r]),o=e.length,o>2&&NC(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,HC(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return NC(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function HC(t,n){return t[0]===n[0]&&t[1]===n[1]}function NC(t,n,e){var i=e[0],o=e[1],r=t[0],s=t[1],a=n[0],l=n[1],c=i-r,h=o-s,u=a-r,A=l-s,f=c*A-h*u;return f!==0?!1:Math.abs(u)>=Math.abs(A)?u>0?r<=i&&i<=a:a<=i&&i<=r:A>0?s<=o&&o<=l:l<=o&&o<=s}function WL(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return nf(t,function(r){e+=r[0],i+=r[1],o++},!0),eo([e/o,i/o],n.properties)}function GC(t){if(!t)throw new Error("geojson is required");var n=[];return ms(t,function(e){qL(e,n)}),xi(n)}function qL(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Si(i);break;case"LineString":e=[Si(i)]}e.forEach(function(o){var r=KL(o,t.properties);r.forEach(function(s){s.id=n.length,n.push(s)})})}}function KL(t,n){var e=[];return t.reduce(function(i,o){var r=jA([i,o],n);return r.bbox=ZL(i,o),e.push(r),o}),e}function ZL(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],s=e<o?e:o,a=i<r?i:r,l=e>o?e:o,c=i>r?i:r;return[s,a,l,c]}var sf={exports:{}},Mg={},WC;function qC(){return WC||(WC=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function n(S,I,b){b===void 0&&(b={});var x={type:"Feature"};return(b.id===0||b.id)&&(x.id=b.id),b.bbox&&(x.bbox=b.bbox),x.properties=I||{},x.geometry=S,x}t.feature=n;function e(S,I,b){switch(S){case"Point":return i(I).geometry;case"LineString":return a(I).geometry;case"Polygon":return r(I).geometry;case"MultiPoint":return u(I).geometry;case"MultiLineString":return h(I).geometry;case"MultiPolygon":return A(I).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,I,b){if(b===void 0&&(b={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var x={type:"Point",coordinates:S};return n(x,I,b)}t.point=i;function o(S,I,b){return b===void 0&&(b={}),c(S.map(function(x){return i(x,I)}),b)}t.points=o;function r(S,I,b){b===void 0&&(b={});for(var x=0,U=S;x<U.length;x++){var k=U[x];if(k.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var M=0;M<k[k.length-1].length;M++)if(k[k.length-1][M]!==k[0][M])throw new Error("First and last Position are not equivalent.")}var R={type:"Polygon",coordinates:S};return n(R,I,b)}t.polygon=r;function s(S,I,b){return b===void 0&&(b={}),c(S.map(function(x){return r(x,I)}),b)}t.polygons=s;function a(S,I,b){if(b===void 0&&(b={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var x={type:"LineString",coordinates:S};return n(x,I,b)}t.lineString=a;function l(S,I,b){return b===void 0&&(b={}),c(S.map(function(x){return a(x,I)}),b)}t.lineStrings=l;function c(S,I){I===void 0&&(I={});var b={type:"FeatureCollection"};return I.id&&(b.id=I.id),I.bbox&&(b.bbox=I.bbox),b.features=S,b}t.featureCollection=c;function h(S,I,b){b===void 0&&(b={});var x={type:"MultiLineString",coordinates:S};return n(x,I,b)}t.multiLineString=h;function u(S,I,b){b===void 0&&(b={});var x={type:"MultiPoint",coordinates:S};return n(x,I,b)}t.multiPoint=u;function A(S,I,b){b===void 0&&(b={});var x={type:"MultiPolygon",coordinates:S};return n(x,I,b)}t.multiPolygon=A;function f(S,I,b){b===void 0&&(b={});var x={type:"GeometryCollection",geometries:S};return n(x,I,b)}t.geometryCollection=f;function d(S,I){if(I===void 0&&(I=0),I&&!(I>=0))throw new Error("precision must be a positive number");var b=Math.pow(10,I||0);return Math.round(S*b)/b}t.round=d;function g(S,I){I===void 0&&(I="kilometers");var b=t.factors[I];if(!b)throw new Error(I+" units is invalid");return S*b}t.radiansToLength=g;function v(S,I){I===void 0&&(I="kilometers");var b=t.factors[I];if(!b)throw new Error(I+" units is invalid");return S/b}t.lengthToRadians=v;function y(S,I){return w(v(S,I))}t.lengthToDegrees=y;function m(S){var I=S%360;return I<0&&(I+=360),I}t.bearingToAzimuth=m;function w(S){var I=S%(2*Math.PI);return I*180/Math.PI}t.radiansToDegrees=w;function _(S){var I=S%360;return I*Math.PI/180}t.degreesToRadians=_;function E(S,I,b){if(I===void 0&&(I="kilometers"),b===void 0&&(b="kilometers"),!(S>=0))throw new Error("length must be a positive number");return g(v(S,I),b)}t.convertLength=E;function T(S,I,b){if(I===void 0&&(I="meters"),b===void 0&&(b="kilometers"),!(S>=0))throw new Error("area must be a positive number");var x=t.areaFactors[I];if(!x)throw new Error("invalid original units");var U=t.areaFactors[b];if(!U)throw new Error("invalid final units");return S/x*U}t.convertArea=T;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function F(S){return!!S&&S.constructor===Object}t.isObject=F;function D(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(I){if(!P(I))throw new Error("bbox must only contain numbers")})}t.validateBBox=D;function B(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=B}(Mg)),Mg}var Bt={},KC;function ZC(){if(KC)return Bt;KC=1,Object.defineProperty(Bt,"__esModule",{value:!0});var t=qC();function n(m,w,_){if(m!==null)for(var E,T,P,F,D,B,S,I=0,b=0,x,U=m.type,k=U==="FeatureCollection",M=U==="Feature",R=k?m.features.length:1,O=0;O<R;O++){S=k?m.features[O].geometry:M?m.geometry:m,x=S?S.type==="GeometryCollection":!1,D=x?S.geometries.length:1;for(var z=0;z<D;z++){var V=0,H=0;if(F=x?S.geometries[z]:S,F!==null){B=F.coordinates;var q=F.type;switch(I=_&&(q==="Polygon"||q==="MultiPolygon")?1:0,q){case null:break;case"Point":if(w(B,b,O,V,H)===!1)return!1;b++,V++;break;case"LineString":case"MultiPoint":for(E=0;E<B.length;E++){if(w(B[E],b,O,V,H)===!1)return!1;b++,q==="MultiPoint"&&V++}q==="LineString"&&V++;break;case"Polygon":case"MultiLineString":for(E=0;E<B.length;E++){for(T=0;T<B[E].length-I;T++){if(w(B[E][T],b,O,V,H)===!1)return!1;b++}q==="MultiLineString"&&V++,q==="Polygon"&&H++}q==="Polygon"&&V++;break;case"MultiPolygon":for(E=0;E<B.length;E++){for(H=0,T=0;T<B[E].length;T++){for(P=0;P<B[E][T].length-I;P++){if(w(B[E][T][P],b,O,V,H)===!1)return!1;b++}H++}V++}break;case"GeometryCollection":for(E=0;E<F.geometries.length;E++)if(n(F.geometries[E],w,_)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(m,w,_,E){var T=_;return n(m,function(P,F,D,B,S){F===0&&_===void 0?T=P:T=w(T,P,F,D,B,S)},E),T}function i(m,w){var _;switch(m.type){case"FeatureCollection":for(_=0;_<m.features.length&&w(m.features[_].properties,_)!==!1;_++);break;case"Feature":w(m.properties,0);break}}function o(m,w,_){var E=_;return i(m,function(T,P){P===0&&_===void 0?E=T:E=w(E,T,P)}),E}function r(m,w){if(m.type==="Feature")w(m,0);else if(m.type==="FeatureCollection")for(var _=0;_<m.features.length&&w(m.features[_],_)!==!1;_++);}function s(m,w,_){var E=_;return r(m,function(T,P){P===0&&_===void 0?E=T:E=w(E,T,P)}),E}function a(m){var w=[];return n(m,function(_){w.push(_)}),w}function l(m,w){var _,E,T,P,F,D,B,S,I,b,x=0,U=m.type==="FeatureCollection",k=m.type==="Feature",M=U?m.features.length:1;for(_=0;_<M;_++){for(D=U?m.features[_].geometry:k?m.geometry:m,S=U?m.features[_].properties:k?m.properties:{},I=U?m.features[_].bbox:k?m.bbox:void 0,b=U?m.features[_].id:k?m.id:void 0,B=D?D.type==="GeometryCollection":!1,F=B?D.geometries.length:1,T=0;T<F;T++){if(P=B?D.geometries[T]:D,P===null){if(w(null,x,S,I,b)===!1)return!1;continue}switch(P.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(w(P,x,S,I,b)===!1)return!1;break}case"GeometryCollection":{for(E=0;E<P.geometries.length;E++)if(w(P.geometries[E],x,S,I,b)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function c(m,w,_){var E=_;return l(m,function(T,P,F,D,B){P===0&&_===void 0?E=T:E=w(E,T,P,F,D,B)}),E}function h(m,w){l(m,function(_,E,T,P,F){var D=_===null?null:_.type;switch(D){case null:case"Point":case"LineString":case"Polygon":return w(t.feature(_,T,{bbox:P,id:F}),E,0)===!1?!1:void 0}var B;switch(D){case"MultiPoint":B="Point";break;case"MultiLineString":B="LineString";break;case"MultiPolygon":B="Polygon";break}for(var S=0;S<_.coordinates.length;S++){var I=_.coordinates[S],b={type:B,coordinates:I};if(w(t.feature(b,T),E,S)===!1)return!1}})}function u(m,w,_){var E=_;return h(m,function(T,P,F){P===0&&F===0&&_===void 0?E=T:E=w(E,T,P,F)}),E}function A(m,w){h(m,function(_,E,T){var P=0;if(_.geometry){var F=_.geometry.type;if(!(F==="Point"||F==="MultiPoint")){var D,B=0,S=0,I=0;if(n(_,function(b,x,U,k,M){if(D===void 0||E>B||k>S||M>I){D=b,B=E,S=k,I=M,P=0;return}var R=t.lineString([D,b],_.properties);if(w(R,E,T,M,P)===!1)return!1;P++,D=b})===!1)return!1}}})}function f(m,w,_){var E=_,T=!1;return A(m,function(P,F,D,B,S){T===!1&&_===void 0?E=P:E=w(E,P,F,D,B,S),T=!0}),E}function d(m,w){if(!m)throw new Error("geojson is required");h(m,function(_,E,T){if(_.geometry!==null){var P=_.geometry.type,F=_.geometry.coordinates;switch(P){case"LineString":if(w(_,E,T,0,0)===!1)return!1;break;case"Polygon":for(var D=0;D<F.length;D++)if(w(t.lineString(F[D],_.properties),E,T,D)===!1)return!1;break}}})}function g(m,w,_){var E=_;return d(m,function(T,P,F,D){P===0&&_===void 0?E=T:E=w(E,T,P,F,D)}),E}function v(m,w){if(w=w||{},!t.isObject(w))throw new Error("options is invalid");var _=w.featureIndex||0,E=w.multiFeatureIndex||0,T=w.geometryIndex||0,P=w.segmentIndex||0,F=w.properties,D;switch(m.type){case"FeatureCollection":_<0&&(_=m.features.length+_),F=F||m.features[_].properties,D=m.features[_].geometry;break;case"Feature":F=F||m.properties,D=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=m;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var B=D.coordinates;switch(D.type){case"Point":case"MultiPoint":return null;case"LineString":return P<0&&(P=B.length+P-1),t.lineString([B[P],B[P+1]],F,w);case"Polygon":return T<0&&(T=B.length+T),P<0&&(P=B[T].length+P-1),t.lineString([B[T][P],B[T][P+1]],F,w);case"MultiLineString":return E<0&&(E=B.length+E),P<0&&(P=B[E].length+P-1),t.lineString([B[E][P],B[E][P+1]],F,w);case"MultiPolygon":return E<0&&(E=B.length+E),T<0&&(T=B[E].length+T),P<0&&(P=B[E][T].length-P-1),t.lineString([B[E][T][P],B[E][T][P+1]],F,w)}throw new Error("geojson is invalid")}function y(m,w){if(w=w||{},!t.isObject(w))throw new Error("options is invalid");var _=w.featureIndex||0,E=w.multiFeatureIndex||0,T=w.geometryIndex||0,P=w.coordIndex||0,F=w.properties,D;switch(m.type){case"FeatureCollection":_<0&&(_=m.features.length+_),F=F||m.features[_].properties,D=m.features[_].geometry;break;case"Feature":F=F||m.properties,D=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=m;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var B=D.coordinates;switch(D.type){case"Point":return t.point(B,F,w);case"MultiPoint":return E<0&&(E=B.length+E),t.point(B[E],F,w);case"LineString":return P<0&&(P=B.length+P),t.point(B[P],F,w);case"Polygon":return T<0&&(T=B.length+T),P<0&&(P=B[T].length+P),t.point(B[T][P],F,w);case"MultiLineString":return E<0&&(E=B.length+E),P<0&&(P=B[E].length+P),t.point(B[E][P],F,w);case"MultiPolygon":return E<0&&(E=B.length+E),T<0&&(T=B[E].length+T),P<0&&(P=B[E][T].length-P),t.point(B[E][T][P],F,w)}throw new Error("geojson is invalid")}return Bt.coordAll=a,Bt.coordEach=n,Bt.coordReduce=e,Bt.featureEach=r,Bt.featureReduce=s,Bt.findPoint=y,Bt.findSegment=v,Bt.flattenEach=h,Bt.flattenReduce=u,Bt.geomEach=l,Bt.geomReduce=c,Bt.lineEach=d,Bt.lineReduce=g,Bt.propEach=i,Bt.propReduce=o,Bt.segmentEach=A,Bt.segmentReduce=f,Bt}var lf={},XC;function XL(){if(XC)return lf;XC=1,Object.defineProperty(lf,"__esModule",{value:!0});var t=ZC();function n(e){var i=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){i[0]>o[0]&&(i[0]=o[0]),i[1]>o[1]&&(i[1]=o[1]),i[2]<o[0]&&(i[2]=o[0]),i[3]<o[1]&&(i[3]=o[1])}),i}return n.default=n,lf.default=n,lf}var $C;function $L(){if($C)return sf.exports;$C=1;var t=VL(),n=qC(),e=ZC(),i=XL().default,o=e.featureEach;e.coordEach,n.polygon;var r=n.featureCollection;function s(a){var l=new t(a);return l.insert=function(c){if(c.type!=="Feature")throw new Error("invalid feature");return c.bbox=c.bbox?c.bbox:i(c),t.prototype.insert.call(this,c)},l.load=function(c){var h=[];return Array.isArray(c)?c.forEach(function(u){if(u.type!=="Feature")throw new Error("invalid features");u.bbox=u.bbox?u.bbox:i(u),h.push(u)}):o(c,function(u){if(u.type!=="Feature")throw new Error("invalid features");u.bbox=u.bbox?u.bbox:i(u),h.push(u)}),t.prototype.load.call(this,h)},l.remove=function(c,h){if(c.type!=="Feature")throw new Error("invalid feature");return c.bbox=c.bbox?c.bbox:i(c),t.prototype.remove.call(this,c,h)},l.clear=function(){return t.prototype.clear.call(this)},l.search=function(c){var h=t.prototype.search.call(this,this.toBBox(c));return r(h)},l.collides=function(c){return t.prototype.collides.call(this,this.toBBox(c))},l.all=function(){var c=t.prototype.all.call(this);return r(c)},l.toJSON=function(){return t.prototype.toJSON.call(this)},l.fromJSON=function(c){return t.prototype.fromJSON.call(this,c)},l.toBBox=function(c){var h;if(c.bbox)h=c.bbox;else if(Array.isArray(c)&&c.length===4)h=c;else if(Array.isArray(c)&&c.length===6)h=[c[0],c[1],c[3],c[4]];else if(c.type==="Feature")h=i(c);else if(c.type==="FeatureCollection")h=i(c);else throw new Error("invalid geojson");return{minX:h[0],minY:h[1],maxX:h[2],maxY:h[3]}},l}return sf.exports=s,sf.exports.default=s,sf.exports}var YL=$L();const JL=Va(YL);function Dg(t,n){var e={},i=[];if(t.type==="LineString"&&(t=Ci(t)),n.type==="LineString"&&(n=Ci(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=YC(t,n);return o&&i.push(o),xi(i)}var r=JL();return r.load(GC(n)),rf(GC(t),function(s){rf(r.search(s),function(a){var l=YC(s,a);if(l){var c=Si(l).join(",");e[c]||(e[c]=!0,i.push(l))}})}),xi(i)}function YC(t,n){var e=Si(t),i=Si(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],s=e[1][0],a=e[1][1],l=i[0][0],c=i[0][1],h=i[1][0],u=i[1][1],A=(u-c)*(s-o)-(h-l)*(a-r),f=(h-l)*(r-c)-(u-c)*(o-l),d=(s-o)*(r-c)-(a-r)*(o-l);if(A===0)return null;var g=f/A,v=d/A;if(g>=0&&g<=1&&v>=0&&v<=1){var y=o+g*(s-o),m=r+g*(a-r);return eo([y,m])}return null}function uf(t,n,e){e===void 0&&(e={});for(var i=tf(t),o=Si(n),r=0;r<o.length-1;r++){var s=!1;if(e.ignoreEndVertices&&(r===0&&(s="start"),r===o.length-2&&(s="end"),r===0&&r+1===o.length-1&&(s="both")),jL(o[r],o[r+1],i,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function jL(t,n,e,i,o){var r=e[0],s=e[1],a=t[0],l=t[1],c=n[0],h=n[1],u=e[0]-a,A=e[1]-l,f=c-a,d=h-l,g=u*d-A*f;if(o!==null){if(Math.abs(g)>o)return!1}else if(g!==0)return!1;if(i){if(i==="start")return Math.abs(f)>=Math.abs(d)?f>0?a<r&&r<=c:c<=r&&r<a:d>0?l<s&&s<=h:h<=s&&s<l;if(i==="end")return Math.abs(f)>=Math.abs(d)?f>0?a<=r&&r<c:c<r&&r<=a:d>0?l<=s&&s<h:h<s&&s<=l;if(i==="both")return Math.abs(f)>=Math.abs(d)?f>0?a<r&&r<c:c<r&&r<a:d>0?l<s&&s<h:h<s&&s<l}else return Math.abs(f)>=Math.abs(d)?f>0?a<=r&&r<=c:c<=r&&r<=a:d>0?l<=s&&s<=h:h<=s&&s<=l;return!1}function ez(t,n){var e=Ei(t),i=Ei(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return tz(e,i);case"LineString":return uf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return ln(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return nz(e,i);case"LineString":return iz(e,i);case"Polygon":case"MultiPolygon":return rz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return oz(e,i);case"Polygon":case"MultiPolygon":return az(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return sz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function tz(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(jC(n.coordinates[e],t.coordinates)){i=!0;break}return i}function nz(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)jC(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function iz(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!uf(t.coordinates[i],n))return!1;e||(e=uf(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function rz(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=ln(t.coordinates[1],n),!i){e=!1;break}i=ln(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function oz(t,n){for(var e=0;e<t.coordinates.length;e++)if(!uf(t.coordinates[e],n))return!1;return!0}function az(t,n){var e=$o(n),i=$o(t);if(!JC(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!ln(t.coordinates[r],n))return!1;if(o||(o=ln(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var s=lz(t.coordinates[r],t.coordinates[r+1]);o=ln(s,n,{ignoreBoundary:!0})}}return o}function sz(t,n){var e=$o(t),i=$o(n);if(!JC(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!ln(t.coordinates[0][o],n))return!1;return!0}function JC(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function jC(t,n){return t[0]===n[0]&&t[1]===n[1]}function lz(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function ex(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],s=t[2],a=t[3],l=n/Pi([o,r],[s,r],e),c=l*(s-o),h=n/Pi([o,r],[o,a],e),u=h*(a-r),A=s-o,f=a-r,d=Math.floor(A/c),g=Math.floor(f/u),v=(A-d*c)/2,y=(f-g*u)/2,m=o+v;m<=s;){for(var w=r+y;w<=a;){var _=eo([m,w],e.properties);e.mask?ez(_,e.mask)&&i.push(_):i.push(_),w+=u}m+=c}return xi(i)}function Rg(t,n){n===void 0&&(n={});var e=Ei(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return uz(e,n);case"MultiPolygon":return cz(e,n);default:throw new Error("invalid poly")}}function uz(t,n){n===void 0&&(n={});var e=Ei(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return tx(i,o)}function cz(t,n){n===void 0&&(n={});var e=Ei(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(s){r.push(tx(s,o))}),xi(r)}function tx(t,n){return t.length>1?cL(t,n):jA(t[0],n)}var Ug,nx;function ix(){if(nx)return Ug;nx=1;var t=Object.prototype.toString;return Ug=function(e){var i=t.call(e),o=i==="[object Arguments]";return o||(o=i!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Ug}var Og,rx;function hz(){if(rx)return Og;rx=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=ix(),o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),s=o.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(A){var f=A.constructor;return f&&f.prototype===A},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if(typeof window>"u")return!1;for(var A in window)try{if(!c["$"+A]&&n.call(window,A)&&window[A]!==null&&typeof window[A]=="object")try{l(window[A])}catch{return!0}}catch{return!0}return!1}(),u=function(A){if(typeof window>"u"||!h)return l(A);try{return l(A)}catch{return!1}};t=function(f){var d=f!==null&&typeof f=="object",g=e.call(f)==="[object Function]",v=i(f),y=d&&e.call(f)==="[object String]",m=[];if(!d&&!g&&!v)throw new TypeError("Object.keys called on a non-object");var w=s&&g;if(y&&f.length>0&&!n.call(f,0))for(var _=0;_<f.length;++_)m.push(String(_));if(v&&f.length>0)for(var E=0;E<f.length;++E)m.push(String(E));else for(var T in f)!(w&&T==="prototype")&&n.call(f,T)&&m.push(String(T));if(r)for(var P=u(f),F=0;F<a.length;++F)!(P&&a[F]==="constructor")&&n.call(f,a[F])&&m.push(a[F]);return m}}return Og=t,Og}var Lg,ox;function ax(){if(ox)return Lg;ox=1;var t=Array.prototype.slice,n=ix(),e=Object.keys,i=e?function(s){return e(s)}:hz(),o=Object.keys;return i.shim=function(){if(Object.keys){var s=function(){var a=Object.keys(arguments);return a&&a.length===arguments.length}(1,2);s||(Object.keys=function(l){return n(l)?o(t.call(l)):o(l)})}else Object.keys=i;return Object.keys||i},Lg=i,Lg}var zg,sx;function lx(){return sx||(sx=1,zg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var s=Object.getOwnPropertySymbols(n);if(s.length!==1||s[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(n,e);if(a.value!==o||a.enumerable!==!0)return!1}return!0}),zg}var Qg,ux;function Vg(){if(ux)return Qg;ux=1;var t=lx();return Qg=function(){return t()&&!!Symbol.toStringTag},Qg}var Hg,cx;function hx(){return cx||(cx=1,Hg=Object),Hg}var Ng,Ax;function fx(){return Ax||(Ax=1,Ng=Error),Ng}var Gg,dx;function Az(){return dx||(dx=1,Gg=EvalError),Gg}var Wg,px;function fz(){return px||(px=1,Wg=RangeError),Wg}var qg,mx;function dz(){return mx||(mx=1,qg=ReferenceError),qg}var Kg,gx;function yx(){return gx||(gx=1,Kg=SyntaxError),Kg}var Zg,vx;function bs(){return vx||(vx=1,Zg=TypeError),Zg}var Xg,wx;function pz(){return wx||(wx=1,Xg=URIError),Xg}var $g,bx;function mz(){return bx||(bx=1,$g=Math.abs),$g}var Yg,_x;function gz(){return _x||(_x=1,Yg=Math.floor),Yg}var Jg,Cx;function yz(){return Cx||(Cx=1,Jg=Math.max),Jg}var jg,xx;function vz(){return xx||(xx=1,jg=Math.min),jg}var ey,Sx;function wz(){return Sx||(Sx=1,ey=Math.pow),ey}var ty,Ex;function bz(){return Ex||(Ex=1,ty=Math.round),ty}var ny,Px;function _z(){return Px||(Px=1,ny=Number.isNaN||function(n){return n!==n}),ny}var iy,Tx;function Cz(){if(Tx)return iy;Tx=1;var t=_z();return iy=function(e){return t(e)||e===0?e:e<0?-1:1},iy}var ry,Ix;function xz(){return Ix||(Ix=1,ry=Object.getOwnPropertyDescriptor),ry}var oy,kx;function _s(){if(kx)return oy;kx=1;var t=xz();if(t)try{t([],"length")}catch{t=null}return oy=t,oy}var ay,Fx;function cf(){if(Fx)return ay;Fx=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return ay=t,ay}var sy,Bx;function Sz(){if(Bx)return sy;Bx=1;var t=typeof Symbol<"u"&&Symbol,n=lx();return sy=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},sy}var ly,Mx;function Dx(){return Mx||(Mx=1,ly=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),ly}var uy,Rx;function Ux(){if(Rx)return uy;Rx=1;var t=hx();return uy=t.getPrototypeOf||null,uy}var cy,Ox;function Ez(){if(Ox)return cy;Ox=1;var t="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,e=Math.max,i="[object Function]",o=function(l,c){for(var h=[],u=0;u<l.length;u+=1)h[u]=l[u];for(var A=0;A<c.length;A+=1)h[A+l.length]=c[A];return h},r=function(l,c){for(var h=[],u=c,A=0;u<l.length;u+=1,A+=1)h[A]=l[u];return h},s=function(a,l){for(var c="",h=0;h<a.length;h+=1)c+=a[h],h+1<a.length&&(c+=l);return c};return cy=function(l){var c=this;if(typeof c!="function"||n.apply(c)!==i)throw new TypeError(t+c);for(var h=r(arguments,1),u,A=function(){if(this instanceof u){var y=c.apply(this,o(h,arguments));return Object(y)===y?y:this}return c.apply(l,o(h,arguments))},f=e(0,c.length-h.length),d=[],g=0;g<f;g++)d[g]="$"+g;if(u=Function("binder","return function ("+s(d,",")+"){ return binder.apply(this,arguments); }")(A),c.prototype){var v=function(){};v.prototype=c.prototype,u.prototype=new v,v.prototype=null}return u},cy}var hy,Lx;function ql(){if(Lx)return hy;Lx=1;var t=Ez();return hy=Function.prototype.bind||t,hy}var Ay,zx;function fy(){return zx||(zx=1,Ay=Function.prototype.call),Ay}var dy,Qx;function py(){return Qx||(Qx=1,dy=Function.prototype.apply),dy}var my,Vx;function Pz(){return Vx||(Vx=1,my=typeof Reflect<"u"&&Reflect&&Reflect.apply),my}var gy,Hx;function Nx(){if(Hx)return gy;Hx=1;var t=ql(),n=py(),e=fy(),i=Pz();return gy=i||t.call(e,n),gy}var yy,Gx;function vy(){if(Gx)return yy;Gx=1;var t=ql(),n=bs(),e=fy(),i=Nx();return yy=function(r){if(r.length<1||typeof r[0]!="function")throw new n("a function is required");return i(t,e,r)},yy}var wy,Wx;function Tz(){if(Wx)return wy;Wx=1;var t=vy(),n=_s(),e;try{e=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var i=!!e&&n&&n(Object.prototype,"__proto__"),o=Object,r=o.getPrototypeOf;return wy=i&&typeof i.get=="function"?t([i.get]):typeof r=="function"?function(a){return r(a==null?a:o(a))}:!1,wy}var by,qx;function Kx(){if(qx)return by;qx=1;var t=Dx(),n=Ux(),e=Tz();return by=t?function(o){return t(o)}:n?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return n(o)}:e?function(o){return e(o)}:null,by}var _y,Zx;function Xx(){if(Zx)return _y;Zx=1;var t=Function.prototype.call,n=Object.prototype.hasOwnProperty,e=ql();return _y=e.call(t,n),_y}var Cy,$x;function Yx(){if($x)return Cy;$x=1;var t,n=hx(),e=fx(),i=Az(),o=fz(),r=dz(),s=yx(),a=bs(),l=pz(),c=mz(),h=gz(),u=yz(),A=vz(),f=wz(),d=bz(),g=Cz(),v=Function,y=function(ce){try{return v('"use strict"; return ('+ce+").constructor;")()}catch{}},m=_s(),w=cf(),_=function(){throw new a},E=m?function(){try{return arguments.callee,_}catch{try{return m(arguments,"callee").get}catch{return _}}}():_,T=Sz()(),P=Kx(),F=Ux(),D=Dx(),B=py(),S=fy(),I={},b=typeof Uint8Array>"u"||!P?t:P(Uint8Array),x={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":T&&P?P([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&P?P(P([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!P?t:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":m,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!P?t:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&P?P(""[Symbol.iterator]()):t,"%Symbol%":T?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":E,"%TypedArray%":b,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":S,"%Function.prototype.apply%":B,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":F,"%Math.abs%":c,"%Math.floor%":h,"%Math.max%":u,"%Math.min%":A,"%Math.pow%":f,"%Math.round%":d,"%Math.sign%":g,"%Reflect.getPrototypeOf%":D};if(P)try{null.error}catch(ce){var U=P(P(ce));x["%Error.prototype%"]=U}var k=function ce(ne){var he;if(ne==="%AsyncFunction%")he=y("async function () {}");else if(ne==="%GeneratorFunction%")he=y("function* () {}");else if(ne==="%AsyncGeneratorFunction%")he=y("async function* () {}");else if(ne==="%AsyncGenerator%"){var Y=ce("%AsyncGeneratorFunction%");Y&&(he=Y.prototype)}else if(ne==="%AsyncIteratorPrototype%"){var Z=ce("%AsyncGenerator%");Z&&P&&(he=P(Z.prototype))}return x[ne]=he,he},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=ql(),O=Xx(),z=R.call(S,Array.prototype.concat),V=R.call(B,Array.prototype.splice),H=R.call(S,String.prototype.replace),q=R.call(S,String.prototype.slice),J=R.call(S,RegExp.prototype.exec),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,re=/\\(\\)?/g,oe=function(ne){var he=q(ne,0,1),Y=q(ne,-1);if(he==="%"&&Y!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&he!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var Z=[];return H(ne,j,function(G,$,X,K){Z[Z.length]=X?H(K,re,"$1"):$||G}),Z},ue=function(ne,he){var Y=ne,Z;if(O(M,Y)&&(Z=M[Y],Y="%"+Z[0]+"%"),O(x,Y)){var G=x[Y];if(G===I&&(G=k(Y)),typeof G>"u"&&!he)throw new a("intrinsic "+ne+" exists, but is not available. Please file an issue!");return{alias:Z,name:Y,value:G}}throw new s("intrinsic "+ne+" does not exist!")};return Cy=function(ne,he){if(typeof ne!="string"||ne.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof he!="boolean")throw new a('"allowMissing" argument must be a boolean');if(J(/^%?[^%]*%?$/,ne)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=oe(ne),Z=Y.length>0?Y[0]:"",G=ue("%"+Z+"%",he),$=G.name,X=G.value,K=!1,W=G.alias;W&&(Z=W[0],V(Y,z([0,1],W)));for(var ee=1,te=!0;ee<Y.length;ee+=1){var se=Y[ee],fe=q(se,0,1),de=q(se,-1);if((fe==='"'||fe==="'"||fe==="`"||de==='"'||de==="'"||de==="`")&&fe!==de)throw new s("property names with quotes must have matching quotes");if((se==="constructor"||!te)&&(K=!0),Z+="."+se,$="%"+Z+"%",O(x,$))X=x[$];else if(X!=null){if(!(se in X)){if(!he)throw new a("base intrinsic for "+ne+" exists, but the property is not available.");return}if(m&&ee+1>=Y.length){var me=m(X,se);te=!!me,te&&"get"in me&&!("originalValue"in me.get)?X=me.get:X=X[se]}else te=O(X,se),X=X[se];te&&!K&&(x[$]=X)}}return X},Cy}var xy,Jx;function Sy(){if(Jx)return xy;Jx=1;var t=Yx(),n=vy(),e=n([t("%String.prototype.indexOf%")]);return xy=function(o,r){var s=t(o,!!r);return typeof s=="function"&&e(o,".prototype.")>-1?n([s]):s},xy}var Ey,jx;function Iz(){if(jx)return Ey;jx=1;var t=Vg()(),n=Sy(),e=n("Object.prototype.toString"),i=function(a){return t&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:e(a)==="[object Arguments]"},o=function(a){return i(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&e(a)!=="[object Array]"&&"callee"in a&&e(a.callee)==="[object Function]"},r=function(){return i(arguments)}();return i.isLegacyArguments=o,Ey=r?i:o,Ey}var Py,eS;function Ty(){if(eS)return Py;eS=1;var t=cf(),n=yx(),e=bs(),i=_s();return Py=function(r,s,a){if(!r||typeof r!="object"&&typeof r!="function")throw new e("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,A=!!i&&i(r,s);if(t)t(r,s,{configurable:h===null&&A?A.configurable:!h,enumerable:l===null&&A?A.enumerable:!l,value:a,writable:c===null&&A?A.writable:!c});else if(u||!l&&!c&&!h)r[s]=a;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Py}var Iy,tS;function ky(){if(tS)return Iy;tS=1;var t=cf(),n=function(){return!!t};return n.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Iy=n,Iy}var Fy,nS;function Kl(){if(nS)return Fy;nS=1;var t=ax(),n=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,i=Array.prototype.concat,o=Ty(),r=function(c){return typeof c=="function"&&e.call(c)==="[object Function]"},s=ky()(),a=function(c,h,u,A){if(h in c){if(A===!0){if(c[h]===u)return}else if(!r(A)||!A())return}s?o(c,h,u,!0):o(c,h,u)},l=function(c,h){var u=arguments.length>2?arguments[2]:{},A=t(h);n&&(A=i.call(A,Object.getOwnPropertySymbols(h)));for(var f=0;f<A.length;f+=1)a(c,A[f],h[A[f]],u[A[f]])};return l.supportsDescriptors=!!s,Fy=l,Fy}var By={exports:{}},My,iS;function kz(){if(iS)return My;iS=1;var t=Yx(),n=Ty(),e=ky()(),i=_s(),o=bs(),r=t("%Math.floor%");return My=function(a,l){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||r(l)!==l)throw new o("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],h=!0,u=!0;if("length"in a&&i){var A=i(a,"length");A&&!A.configurable&&(h=!1),A&&!A.writable&&(u=!1)}return(h||u||!c)&&(e?n(a,"length",l,!0,!0):n(a,"length",l)),a},My}var Dy,rS;function Fz(){if(rS)return Dy;rS=1;var t=ql(),n=py(),e=Nx();return Dy=function(){return e(t,n,arguments)},Dy}var oS;function aS(){return oS||(oS=1,function(t){var n=kz(),e=cf(),i=vy(),o=Fz();t.exports=function(s){var a=i(arguments),l=s.length-(arguments.length-1);return n(a,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o}(By)),By.exports}var Ry,sS;function lS(){if(sS)return Ry;sS=1;var t=function(n){return n!==n};return Ry=function(e,i){return e===0&&i===0?1/e===1/i:!!(e===i||t(e)&&t(i))},Ry}var Uy,uS;function cS(){if(uS)return Uy;uS=1;var t=lS();return Uy=function(){return typeof Object.is=="function"?Object.is:t},Uy}var Oy,hS;function Bz(){if(hS)return Oy;hS=1;var t=cS(),n=Kl();return Oy=function(){var i=t();return n(Object,{is:i},{is:function(){return Object.is!==i}}),i},Oy}var Ly,AS;function Mz(){if(AS)return Ly;AS=1;var t=Kl(),n=aS(),e=lS(),i=cS(),o=Bz(),r=n(i(),Object);return t(r,{getPolyfill:i,implementation:e,shim:o}),Ly=r,Ly}var zy,fS;function Dz(){if(fS)return zy;fS=1;var t=Sy(),n=Vg()(),e=Xx(),i=_s(),o;if(n){var r=t("RegExp.prototype.exec"),s={},a=function(){throw s},l={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=a),o=function(A){if(!A||typeof A!="object")return!1;var f=i(A,"lastIndex"),d=f&&e(f,"value");if(!d)return!1;try{r(A,l)}catch(g){return g===s}}}else{var c=t("Object.prototype.toString"),h="[object RegExp]";o=function(A){return!A||typeof A!="object"&&typeof A!="function"?!1:c(A)===h}}return zy=o,zy}var Qy,dS;function Rz(){if(dS)return Qy;dS=1;var t=function(){return typeof(function(){}).name=="string"},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch{n=null}t.functionsHaveConfigurableNames=function(){if(!t()||!n)return!1;var o=n(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},Qy=t,Qy}var Vy,pS;function Uz(){if(pS)return Vy;pS=1;var t=Ty(),n=ky()(),e=Rz().functionsHaveConfigurableNames(),i=bs();return Vy=function(r,s){if(typeof r!="function")throw new i("`fn` is not a function");var a=arguments.length>2&&!!arguments[2];return(!a||e)&&(n?t(r,"name",s,!0,!0):t(r,"name",s)),r},Vy}var Hy,mS;function gS(){if(mS)return Hy;mS=1;var t=Uz(),n=bs(),e=Object;return Hy=t(function(){if(this==null||this!==e(this))throw new n("RegExp.prototype.flags getter called on non-object");var o="";return this.hasIndices&&(o+="d"),this.global&&(o+="g"),this.ignoreCase&&(o+="i"),this.multiline&&(o+="m"),this.dotAll&&(o+="s"),this.unicode&&(o+="u"),this.unicodeSets&&(o+="v"),this.sticky&&(o+="y"),o},"get flags",!0),Hy}var Ny,yS;function vS(){if(yS)return Ny;yS=1;var t=gS(),n=Kl().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return Ny=function(){if(n&&/a/mig.flags==="gim"){var o=e(RegExp.prototype,"flags");if(o&&typeof o.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",s={};if(Object.defineProperty(s,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(s,"sticky",{get:function(){r+="y"}}),o.get.call(s),r==="dy")return o.get}}return t},Ny}var Gy,wS;function Oz(){if(wS)return Gy;wS=1;var t=Kl().supportsDescriptors,n=vS(),e=_s(),i=Object.defineProperty,o=fx(),r=Kx(),s=/a/;return Gy=function(){if(!t||!r)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=n(),c=r(s),h=e(c,"flags");return(!h||h.get!==l)&&i(c,"flags",{configurable:!0,enumerable:!1,get:l}),l},Gy}var Wy,bS;function Lz(){if(bS)return Wy;bS=1;var t=Kl(),n=aS(),e=gS(),i=vS(),o=Oz(),r=n(i());return t(r,{getPolyfill:i,implementation:e,shim:o}),Wy=r,Wy}var qy,_S;function zz(){if(_S)return qy;_S=1;var t=Sy(),n=t("Date.prototype.getDay"),e=function(a){try{return n(a),!0}catch{return!1}},i=t("Object.prototype.toString"),o="[object Date]",r=Vg()();return qy=function(a){return typeof a!="object"||a===null?!1:r?e(a):i(a)===o},qy}var Ky,CS;function Qz(){if(CS)return Ky;CS=1;var t=ax(),n=Iz(),e=Mz(),i=Dz(),o=Lz(),r=zz(),s=Date.prototype.getTime;function a(u,A,f){var d=f||{};return(d.strict?e(u,A):u===A)?!0:!u||!A||typeof u!="object"&&typeof A!="object"?d.strict?e(u,A):u==A:h(u,A,d)}function l(u){return u==null}function c(u){return!(!u||typeof u!="object"||typeof u.length!="number"||typeof u.copy!="function"||typeof u.slice!="function"||u.length>0&&typeof u[0]!="number")}function h(u,A,f){var d,g;if(typeof u!=typeof A||l(u)||l(A)||u.prototype!==A.prototype||n(u)!==n(A))return!1;var v=i(u),y=i(A);if(v!==y)return!1;if(v||y)return u.source===A.source&&o(u)===o(A);if(r(u)&&r(A))return s.call(u)===s.call(A);var m=c(u),w=c(A);if(m!==w)return!1;if(m||w){if(u.length!==A.length)return!1;for(d=0;d<u.length;d++)if(u[d]!==A[d])return!1;return!0}if(typeof u!=typeof A)return!1;try{var _=t(u),E=t(A)}catch{return!1}if(_.length!==E.length)return!1;for(_.sort(),E.sort(),d=_.length-1;d>=0;d--)if(_[d]!=E[d])return!1;for(d=_.length-1;d>=0;d--)if(g=_[d],!a(u[g],A[g],f))return!1;return!0}return Ky=a,Ky}function Vz(t,n){var e=!0;return ms(t,function(i){ms(n,function(o){if(e===!1)return!1;e=Hz(i.geometry,o.geometry)})}),e}function Hz(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!qz(t.coordinates,n.coordinates);case"LineString":return!xS(n,t);case"Polygon":return!ln(t,n)}break;case"LineString":switch(n.type){case"Point":return!xS(t,n);case"LineString":return!Nz(t,n);case"Polygon":return!SS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!ln(n,t);case"LineString":return!SS(t,n);case"Polygon":return!Gz(n,t)}}return!1}function xS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(Wz(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function Nz(t,n){var e=Dg(t,n);return e.features.length>0}function SS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(ln(o,t))return!0}var r=Dg(n,Rg(t));return r.features.length>0}function Gz(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(ln(o,n))return!0}for(var r=0,s=n.coordinates[0];r<s.length;r++){var a=s[r];if(ln(a,t))return!0}var l=Dg(Rg(t),Rg(n));return l.features.length>0}function Wz(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],s=n[1]-t[1],a=i*s-o*r;return a!==0?!1:Math.abs(r)>=Math.abs(s)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:s>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function qz(t,n){return t[0]===n[0]&&t[1]===n[1]}var Zy,ES;function Kz(){if(ES)return Zy;ES=1;var t=Qz(),n=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:o};n.prototype.compare=function(r,s){if(r.type!==s.type||!i(r,s))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,s.coordinates);case"LineString":return this.compareLine(r.coordinates,s.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,s);case"Feature":return this.compareFeature(r,s);default:if(r.type.indexOf("Multi")===0){var a=this,l=e(r),c=e(s);return l.every(function(h){return this.some(function(u){return a.compare(h,u)})},c)}}return!1};function e(r){return r.coordinates.map(function(s){return{type:r.type.replace("Multi",""),coordinates:s}})}function i(r,s){return r.hasOwnProperty("coordinates")?r.coordinates.length===s.coordinates.length:r.length===s.length}n.prototype.compareCoord=function(r,s){if(r.length!==s.length)return!1;for(var a=0;a<r.length;a++)if(r[a].toFixed(this.precision)!==s[a].toFixed(this.precision))return!1;return!0},n.prototype.compareLine=function(r,s,a,l){if(!i(r,s))return!1;var c=this.pseudoNode?r:this.removePseudo(r),h=this.pseudoNode?s:this.removePseudo(s);if(!(l&&!this.compareCoord(c[0],h[0])&&(h=this.fixStartIndex(h,c),!h))){var u=this.compareCoord(c[a],h[a]);return this.direction||u?this.comparePath(c,h):this.compareCoord(c[a],h[h.length-(1+a)])?this.comparePath(c.slice().reverse(),h):!1}},n.prototype.fixStartIndex=function(r,s){for(var a,l=-1,c=0;c<r.length;c++)if(this.compareCoord(r[c],s[0])){l=c;break}return l>=0&&(a=[].concat(r.slice(l,r.length),r.slice(1,l+1))),a},n.prototype.comparePath=function(r,s){var a=this;return r.every(function(l,c){return a.compareCoord(l,this[c])},s)},n.prototype.comparePolygon=function(r,s){if(this.compareLine(r.coordinates[0],s.coordinates[0],1,!0)){var a=r.coordinates.slice(1,r.coordinates.length),l=s.coordinates.slice(1,s.coordinates.length),c=this;return a.every(function(h){return this.some(function(u){return c.compareLine(h,u,1,!0)})},l)}else return!1},n.prototype.compareFeature=function(r,s){return r.id!==s.id||!this.objectComparator(r.properties,s.properties)||!this.compareBBox(r,s)?!1:this.compare(r.geometry,s.geometry)},n.prototype.compareBBox=function(r,s){return!!(!r.bbox&&!s.bbox||r.bbox&&s.bbox&&this.compareCoord(r.bbox,s.bbox))},n.prototype.removePseudo=function(r){return r};function o(r,s){return t(r,s,{strict:!0})}return Zy=n,Zy}var Zz=Kz();const Xz=Va(Zz);function $z(t,n){var e=Ei(t).type,i=Ei(n).type;if(e!==i)return!1;var o=new Xz({precision:6});return o.compare(VC(t),VC(n))}function Yz(t,n){var e=!1;return ms(t,function(i){ms(n,function(o){if(e===!0)return!0;e=!Vz(i.geometry,o.geometry)})}),e}/**
|
|
4078
|
+
`,uo=class uo extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_player");L(this,"_finalImageUrlReact",this.disposeVar(Q.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));L(this,"_routePaths",this.disposeVar(p.react(void 0)));L(this,"routePathCallback");L(this,"_id",this.disposeVar(p.react(p.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new Q.Player);{const A=uo.defaults;this.dispose(p.bind([this._player,"loop"],[this,"loop"],f=>f??A.loop,f=>f??A.loop)),this.dispose(p.bind([this._player,"currentTime"],[this,"currentTime"],f=>f??A.currentTime,f=>f??A.currentTime)),this.dispose(p.bind([this._player,"duration"],[this,"duration"],f=>f??A.duration,f=>f??A.duration)),this.dispose(p.bind([this._player,"playing"],[this,"playing"],f=>f??A.playing,f=>f??A.playing)),this.dispose(p.bind([this._player,"speed"],[this,"speed"],f=>f??A.speed,f=>f??A.speed))}const o=this.disposeVar(Q.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(p.createProcessingFromAsyncFunc(async A=>{this.routePaths=void 0;const f=o.value;if(f)try{const g=await(await fetch(f)).json();this.routePaths=CL(g,this.width,this.repeatLength);return}catch(d){console.error(`geojson加载解析出错!${d}`),console.error(d)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const d=this.positionsSet;if(d){this.routePaths=d.map(g=>({positions:g,width:this.width}));return}}}));{const A=()=>{r.restart()};A();const f=this.disposeVar(p.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(f.disposableOn(A))}{const A=()=>{const f=Zf(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);f&&(this.routePathCallback=f)};A(),this.dispose(this.routePathCallbackStrChanged.disposableOn(A))}const s=e.viewer;if(!s){console.warn("viewer is undefined!");return}const a=this.finalImageUrlReact,l=this.disposeVar(new pa),c=this.disposeVar(p.createProcessingFromAsyncFunc(async A=>{if(!a.value)return;const f=k0(s.scene.context).getTextureHandler(a.value);if(f instanceof pa)l.reset(f);else{const d=await A.promise(f);l.reset(d)}})),h=()=>l.valid?l.raw:s.scene.context.defaultTexture,u=()=>c.restart();u(),this.dispose(a.changed.disposableOn(u)),this.disposeVar(new p.ObjResettingWithEvent(this.routePathsChanged,()=>this.routePaths?new LL(s,this,a.value&&h||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(A=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Be(s,this.routePaths[0].startPos,s.camera.positionCartographic.height,void 0,A);else{const f=computeBoundingSphere(this.routePaths[0].positions);if(!f)return;const[d,g]=f;Be(s,d,g*3,void 0,A)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};L(uo,"whiteGradientImageBase64",zL),L(uo,"defaultRoutePathCallback",function(e,i,o){const r=i/50,s=r-Math.floor(r);return e.color=[s*.5+.5,(1-s)*.5+.5,.5,1],e.bgColor=[s*.5+.5,(1-s)*.5+.5,.5,.3],e}),L(uo,"routePathCallbackStrMd",QL),L(uo,"defaults",{loop:!0,startTime:0,currentTime:0,playerCurrentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(uo,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let er=uo;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:p.reactArray([0,1,0,1]),bgColor:p.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:p.reactPositionsSet(void 0),data:p.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(er||(er={})),p.extendClassProps(er.prototype,er.createDefaultProps);class tr extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_collection");this._collection=this.disposeVar(new er(e,i)),this.dispose(p.track([this._collection,"show"],[this,"show"])),this.dispose(p.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(p.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(p.track([this._collection,"color"],[this,"color"])),this.dispose(p.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(p.track([this._collection,"width"],[this,"width"])),this.dispose(p.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(p.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(p.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(p.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(p.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(p.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(p.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(p.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(p.bind([this._collection,"playing"],[this,"playing"])),this.dispose(p.track([this._collection,"loop"],[this,"loop"])),this.dispose(p.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(p.bind([this._collection,"duration"],[this,"duration"])),this.dispose(p.bind([this._collection,"speed"],[this,"speed"])),this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=[{startPos:this.positions[0],endPos:this.positions[this.positions.length-1],width:this.width,heightRatio:this.heightRatio}];return}this._collection.data=void 0};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}L(tr,"defaults",{loop:!0,currentTime:0,playerCurrentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(tr,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:p.reactArray([0,1,0,1]),bgColor:p.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:p.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(tr||(tr={})),p.extendClassProps(tr.prototype,tr.createDefaultProps);const wc=class wc extends an{constructor(e,i){super(e,i);L(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new tr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(p.bind([r,"positions"],[e,"points"])),this.dispose(p.track([r,"width"],[e,"strokeWidth"])),this.dispose(p.track([r,"color"],[e,"strokeColor"])),this.dispose(p.track([r,"startTime"],[e,"startTime"])),this.dispose(p.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(p.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(p.track([r,"arcType"],[e,"arcType"])),this.dispose(p.track([r,"brightening"],[e,"brightening"])),this.dispose(p.track([r,"depthTest"],[e,"depthTest"])),this.dispose(p.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(p.track([r,"repeat"],[e,"repeat"])),this.dispose(p.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(p.track([r,"loop"],[e,"loop"])),this.dispose(p.track([r,"currentTime"],[e,"currentTime"])),this.dispose(p.track([r,"duration"],[e,"duration"])),this.dispose(p.track([r,"playing"],[e,"playing"])),this.dispose(p.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:s}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(wc,"type",wc.register("ESCesiumViewer",Yr.type,wc));let kg=wc;function $o(t){var n=[1/0,1/0,-1/0,-1/0];return nf(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}$o.default=$o;var af={exports:{}},VL=af.exports,UC;function HL(){return UC||(UC=1,function(t,n){(function(e,i){t.exports=i()})(VL,function(){function e(m,w,_,E,T){(function P(F,D,B,S,I){for(;S>B;){if(S-B>600){var b=S-B+1,x=D-B+1,U=Math.log(b),k=.5*Math.exp(2*U/3),M=.5*Math.sqrt(U*k*(b-k)/b)*(x-b/2<0?-1:1),R=Math.max(B,Math.floor(D-x*k/b+M)),O=Math.min(S,Math.floor(D+(b-x)*k/b+M));P(F,D,R,O,I)}var z=F[D],V=B,H=S;for(i(F,B,D),I(F[S],z)>0&&i(F,B,S);V<H;){for(i(F,V,H),V++,H--;I(F[V],z)<0;)V++;for(;I(F[H],z)>0;)H--}I(F[B],z)===0?i(F,B,H):i(F,++H,S),H<=D&&(B=H+1),D<=H&&(S=H-1)}})(m,w,_||0,E||m.length-1,T||o)}function i(m,w,_){var E=m[w];m[w]=m[_],m[_]=E}function o(m,w){return m<w?-1:m>w?1:0}var r=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(m,w,_){if(!_)return w.indexOf(m);for(var E=0;E<w.length;E++)if(_(m,w[E]))return E;return-1}function a(m,w){l(m,0,m.children.length,w,m)}function l(m,w,_,E,T){T||(T=v(null)),T.minX=1/0,T.minY=1/0,T.maxX=-1/0,T.maxY=-1/0;for(var P=w;P<_;P++){var F=m.children[P];c(T,m.leaf?E(F):F)}return T}function c(m,w){return m.minX=Math.min(m.minX,w.minX),m.minY=Math.min(m.minY,w.minY),m.maxX=Math.max(m.maxX,w.maxX),m.maxY=Math.max(m.maxY,w.maxY),m}function h(m,w){return m.minX-w.minX}function u(m,w){return m.minY-w.minY}function A(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function f(m){return m.maxX-m.minX+(m.maxY-m.minY)}function d(m,w){return m.minX<=w.minX&&m.minY<=w.minY&&w.maxX<=m.maxX&&w.maxY<=m.maxY}function g(m,w){return w.minX<=m.maxX&&w.minY<=m.maxY&&w.maxX>=m.minX&&w.maxY>=m.minY}function v(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(m,w,_,E,T){for(var P=[w,_];P.length;)if(!((_=P.pop())-(w=P.pop())<=E)){var F=w+Math.ceil((_-w)/E/2)*E;e(m,F,w,_,T),P.push(w,F,F,_)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(m){var w=this.data,_=[];if(!g(m,w))return _;for(var E=this.toBBox,T=[];w;){for(var P=0;P<w.children.length;P++){var F=w.children[P],D=w.leaf?E(F):F;g(m,D)&&(w.leaf?_.push(F):d(m,D)?this._all(F,_):T.push(F))}w=T.pop()}return _},r.prototype.collides=function(m){var w=this.data;if(!g(m,w))return!1;for(var _=[];w;){for(var E=0;E<w.children.length;E++){var T=w.children[E],P=w.leaf?this.toBBox(T):T;if(g(m,P)){if(w.leaf||d(m,P))return!0;_.push(T)}}w=_.pop()}return!1},r.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var w=0;w<m.length;w++)this.insert(m[w]);return this}var _=this._build(m.slice(),0,m.length-1,0);if(this.data.children.length)if(this.data.height===_.height)this._splitRoot(this.data,_);else{if(this.data.height<_.height){var E=this.data;this.data=_,_=E}this._insert(_,this.data.height-_.height-1,!0)}else this.data=_;return this},r.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(m,w){if(!m)return this;for(var _,E,T,P=this.data,F=this.toBBox(m),D=[],B=[];P||D.length;){if(P||(P=D.pop(),E=D[D.length-1],_=B.pop(),T=!0),P.leaf){var S=s(m,P.children,w);if(S!==-1)return P.children.splice(S,1),D.push(P),this._condense(D),this}T||P.leaf||!d(P,F)?E?(_++,P=E.children[_],T=!1):P=null:(D.push(P),B.push(_),_=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(m){return m},r.prototype.compareMinX=function(m,w){return m.minX-w.minX},r.prototype.compareMinY=function(m,w){return m.minY-w.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(m){return this.data=m,this},r.prototype._all=function(m,w){for(var _=[];m;)m.leaf?w.push.apply(w,m.children):_.push.apply(_,m.children),m=_.pop();return w},r.prototype._build=function(m,w,_,E){var T,P=_-w+1,F=this._maxEntries;if(P<=F)return a(T=v(m.slice(w,_+1)),this.toBBox),T;E||(E=Math.ceil(Math.log(P)/Math.log(F)),F=Math.ceil(P/Math.pow(F,E-1))),(T=v([])).leaf=!1,T.height=E;var D=Math.ceil(P/F),B=D*Math.ceil(Math.sqrt(F));y(m,w,_,B,this.compareMinX);for(var S=w;S<=_;S+=B){var I=Math.min(S+B-1,_);y(m,S,I,D,this.compareMinY);for(var b=S;b<=I;b+=D){var x=Math.min(b+D-1,I);T.children.push(this._build(m,b,x,E-1))}}return a(T,this.toBBox),T},r.prototype._chooseSubtree=function(m,w,_,E){for(;E.push(w),!w.leaf&&E.length-1!==_;){for(var T=1/0,P=1/0,F=void 0,D=0;D<w.children.length;D++){var B=w.children[D],S=A(B),I=(b=m,x=B,(Math.max(x.maxX,b.maxX)-Math.min(x.minX,b.minX))*(Math.max(x.maxY,b.maxY)-Math.min(x.minY,b.minY))-S);I<P?(P=I,T=S<T?S:T,F=B):I===P&&S<T&&(T=S,F=B)}w=F||w.children[0]}var b,x;return w},r.prototype._insert=function(m,w,_){var E=_?m:this.toBBox(m),T=[],P=this._chooseSubtree(E,this.data,w,T);for(P.children.push(m),c(P,E);w>=0&&T[w].children.length>this._maxEntries;)this._split(T,w),w--;this._adjustParentBBoxes(E,T,w)},r.prototype._split=function(m,w){var _=m[w],E=_.children.length,T=this._minEntries;this._chooseSplitAxis(_,T,E);var P=this._chooseSplitIndex(_,T,E),F=v(_.children.splice(P,_.children.length-P));F.height=_.height,F.leaf=_.leaf,a(_,this.toBBox),a(F,this.toBBox),w?m[w-1].children.push(F):this._splitRoot(_,F)},r.prototype._splitRoot=function(m,w){this.data=v([m,w]),this.data.height=m.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(m,w,_){for(var E,T,P,F,D,B,S,I=1/0,b=1/0,x=w;x<=_-w;x++){var U=l(m,0,x,this.toBBox),k=l(m,x,_,this.toBBox),M=(T=U,P=k,F=void 0,D=void 0,B=void 0,S=void 0,F=Math.max(T.minX,P.minX),D=Math.max(T.minY,P.minY),B=Math.min(T.maxX,P.maxX),S=Math.min(T.maxY,P.maxY),Math.max(0,B-F)*Math.max(0,S-D)),R=A(U)+A(k);M<I?(I=M,E=x,b=R<b?R:b):M===I&&R<b&&(b=R,E=x)}return E||_-w},r.prototype._chooseSplitAxis=function(m,w,_){var E=m.leaf?this.compareMinX:h,T=m.leaf?this.compareMinY:u;this._allDistMargin(m,w,_,E)<this._allDistMargin(m,w,_,T)&&m.children.sort(E)},r.prototype._allDistMargin=function(m,w,_,E){m.children.sort(E);for(var T=this.toBBox,P=l(m,0,w,T),F=l(m,_-w,_,T),D=f(P)+f(F),B=w;B<_-w;B++){var S=m.children[B];c(P,m.leaf?T(S):S),D+=f(P)}for(var I=_-w-1;I>=w;I--){var b=m.children[I];c(F,m.leaf?T(b):b),D+=f(F)}return D},r.prototype._adjustParentBBoxes=function(m,w,_){for(var E=_;E>=0;E--)c(w[E],m)},r.prototype._condense=function(m){for(var w=m.length-1,_=void 0;w>=0;w--)m[w].children.length===0?w>0?(_=m[w-1].children).splice(_.indexOf(m[w]),1):this.clear():a(m[w],this.toBBox)},r})}(af)),af.exports}function ln(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=tf(t),o=Ei(n),r=o.type,s=n.bbox,a=o.coordinates;if(s&&NL(i,s)===!1)return!1;r==="Polygon"&&(a=[a]);for(var l=!1,c=0;c<a.length&&!l;c++)if(OC(i,a[c][0],e.ignoreBoundary)){for(var h=!1,u=1;u<a[c].length&&!h;)OC(i,a[c][u],!e.ignoreBoundary)&&(h=!0),u++;h||(l=!0)}return l}function OC(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var s=n[o][0],a=n[o][1],l=n[r][0],c=n[r][1],h=t[1]*(s-l)+a*(l-t[0])+c*(t[0]-s)===0&&(s-t[0])*(l-t[0])<=0&&(a-t[1])*(c-t[1])<=0;if(h)return!e;var u=a>t[1]!=c>t[1]&&t[0]<(l-s)*(t[1]-a)/(c-a)+s;u&&(i=!i)}return i}function NL(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function GL(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return LC(t);case"FeatureCollection":return WL(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Fg(t);default:throw new Error("unknown GeoJSON type")}}function LC(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=zC(t.properties),n.geometry=Fg(t.geometry),n}function zC(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=zC(i):n[e]=i}),n}function WL(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return LC(e)}),n}function Fg(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return Fg(e)}),n):(n.coordinates=QC(t.coordinates),n)}function QC(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return QC(e)})}function VC(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=pL(t),o=[];switch(i){case"LineString":o=Bg(t);break;case"MultiLineString":case"Polygon":Si(t).forEach(function(s){o.push(Bg(s))});break;case"MultiPolygon":Si(t).forEach(function(s){var a=[];s.forEach(function(l){a.push(Bg(l))}),o.push(a)});break;case"Point":return t;case"MultiPoint":var r={};Si(t).forEach(function(s){var a=s.join("-");Object.prototype.hasOwnProperty.call(r,a)||(o.push(s),r[a]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Ci({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function Bg(t){var n=Si(t);if(n.length===2&&!HC(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var s=e[e.length-1];n[r][0]===s[0]&&n[r][1]===s[1]||(e.push(n[r]),o=e.length,o>2&&NC(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,HC(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return NC(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function HC(t,n){return t[0]===n[0]&&t[1]===n[1]}function NC(t,n,e){var i=e[0],o=e[1],r=t[0],s=t[1],a=n[0],l=n[1],c=i-r,h=o-s,u=a-r,A=l-s,f=c*A-h*u;return f!==0?!1:Math.abs(u)>=Math.abs(A)?u>0?r<=i&&i<=a:a<=i&&i<=r:A>0?s<=o&&o<=l:l<=o&&o<=s}function qL(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return nf(t,function(r){e+=r[0],i+=r[1],o++},!0),eo([e/o,i/o],n.properties)}function GC(t){if(!t)throw new Error("geojson is required");var n=[];return ms(t,function(e){KL(e,n)}),xi(n)}function KL(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Si(i);break;case"LineString":e=[Si(i)]}e.forEach(function(o){var r=ZL(o,t.properties);r.forEach(function(s){s.id=n.length,n.push(s)})})}}function ZL(t,n){var e=[];return t.reduce(function(i,o){var r=jA([i,o],n);return r.bbox=XL(i,o),e.push(r),o}),e}function XL(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],s=e<o?e:o,a=i<r?i:r,l=e>o?e:o,c=i>r?i:r;return[s,a,l,c]}var sf={exports:{}},Mg={},WC;function qC(){return WC||(WC=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function n(S,I,b){b===void 0&&(b={});var x={type:"Feature"};return(b.id===0||b.id)&&(x.id=b.id),b.bbox&&(x.bbox=b.bbox),x.properties=I||{},x.geometry=S,x}t.feature=n;function e(S,I,b){switch(S){case"Point":return i(I).geometry;case"LineString":return a(I).geometry;case"Polygon":return r(I).geometry;case"MultiPoint":return u(I).geometry;case"MultiLineString":return h(I).geometry;case"MultiPolygon":return A(I).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,I,b){if(b===void 0&&(b={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var x={type:"Point",coordinates:S};return n(x,I,b)}t.point=i;function o(S,I,b){return b===void 0&&(b={}),c(S.map(function(x){return i(x,I)}),b)}t.points=o;function r(S,I,b){b===void 0&&(b={});for(var x=0,U=S;x<U.length;x++){var k=U[x];if(k.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var M=0;M<k[k.length-1].length;M++)if(k[k.length-1][M]!==k[0][M])throw new Error("First and last Position are not equivalent.")}var R={type:"Polygon",coordinates:S};return n(R,I,b)}t.polygon=r;function s(S,I,b){return b===void 0&&(b={}),c(S.map(function(x){return r(x,I)}),b)}t.polygons=s;function a(S,I,b){if(b===void 0&&(b={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var x={type:"LineString",coordinates:S};return n(x,I,b)}t.lineString=a;function l(S,I,b){return b===void 0&&(b={}),c(S.map(function(x){return a(x,I)}),b)}t.lineStrings=l;function c(S,I){I===void 0&&(I={});var b={type:"FeatureCollection"};return I.id&&(b.id=I.id),I.bbox&&(b.bbox=I.bbox),b.features=S,b}t.featureCollection=c;function h(S,I,b){b===void 0&&(b={});var x={type:"MultiLineString",coordinates:S};return n(x,I,b)}t.multiLineString=h;function u(S,I,b){b===void 0&&(b={});var x={type:"MultiPoint",coordinates:S};return n(x,I,b)}t.multiPoint=u;function A(S,I,b){b===void 0&&(b={});var x={type:"MultiPolygon",coordinates:S};return n(x,I,b)}t.multiPolygon=A;function f(S,I,b){b===void 0&&(b={});var x={type:"GeometryCollection",geometries:S};return n(x,I,b)}t.geometryCollection=f;function d(S,I){if(I===void 0&&(I=0),I&&!(I>=0))throw new Error("precision must be a positive number");var b=Math.pow(10,I||0);return Math.round(S*b)/b}t.round=d;function g(S,I){I===void 0&&(I="kilometers");var b=t.factors[I];if(!b)throw new Error(I+" units is invalid");return S*b}t.radiansToLength=g;function v(S,I){I===void 0&&(I="kilometers");var b=t.factors[I];if(!b)throw new Error(I+" units is invalid");return S/b}t.lengthToRadians=v;function y(S,I){return w(v(S,I))}t.lengthToDegrees=y;function m(S){var I=S%360;return I<0&&(I+=360),I}t.bearingToAzimuth=m;function w(S){var I=S%(2*Math.PI);return I*180/Math.PI}t.radiansToDegrees=w;function _(S){var I=S%360;return I*Math.PI/180}t.degreesToRadians=_;function E(S,I,b){if(I===void 0&&(I="kilometers"),b===void 0&&(b="kilometers"),!(S>=0))throw new Error("length must be a positive number");return g(v(S,I),b)}t.convertLength=E;function T(S,I,b){if(I===void 0&&(I="meters"),b===void 0&&(b="kilometers"),!(S>=0))throw new Error("area must be a positive number");var x=t.areaFactors[I];if(!x)throw new Error("invalid original units");var U=t.areaFactors[b];if(!U)throw new Error("invalid final units");return S/x*U}t.convertArea=T;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function F(S){return!!S&&S.constructor===Object}t.isObject=F;function D(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(I){if(!P(I))throw new Error("bbox must only contain numbers")})}t.validateBBox=D;function B(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=B}(Mg)),Mg}var Bt={},KC;function ZC(){if(KC)return Bt;KC=1,Object.defineProperty(Bt,"__esModule",{value:!0});var t=qC();function n(m,w,_){if(m!==null)for(var E,T,P,F,D,B,S,I=0,b=0,x,U=m.type,k=U==="FeatureCollection",M=U==="Feature",R=k?m.features.length:1,O=0;O<R;O++){S=k?m.features[O].geometry:M?m.geometry:m,x=S?S.type==="GeometryCollection":!1,D=x?S.geometries.length:1;for(var z=0;z<D;z++){var V=0,H=0;if(F=x?S.geometries[z]:S,F!==null){B=F.coordinates;var q=F.type;switch(I=_&&(q==="Polygon"||q==="MultiPolygon")?1:0,q){case null:break;case"Point":if(w(B,b,O,V,H)===!1)return!1;b++,V++;break;case"LineString":case"MultiPoint":for(E=0;E<B.length;E++){if(w(B[E],b,O,V,H)===!1)return!1;b++,q==="MultiPoint"&&V++}q==="LineString"&&V++;break;case"Polygon":case"MultiLineString":for(E=0;E<B.length;E++){for(T=0;T<B[E].length-I;T++){if(w(B[E][T],b,O,V,H)===!1)return!1;b++}q==="MultiLineString"&&V++,q==="Polygon"&&H++}q==="Polygon"&&V++;break;case"MultiPolygon":for(E=0;E<B.length;E++){for(H=0,T=0;T<B[E].length;T++){for(P=0;P<B[E][T].length-I;P++){if(w(B[E][T][P],b,O,V,H)===!1)return!1;b++}H++}V++}break;case"GeometryCollection":for(E=0;E<F.geometries.length;E++)if(n(F.geometries[E],w,_)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function e(m,w,_,E){var T=_;return n(m,function(P,F,D,B,S){F===0&&_===void 0?T=P:T=w(T,P,F,D,B,S)},E),T}function i(m,w){var _;switch(m.type){case"FeatureCollection":for(_=0;_<m.features.length&&w(m.features[_].properties,_)!==!1;_++);break;case"Feature":w(m.properties,0);break}}function o(m,w,_){var E=_;return i(m,function(T,P){P===0&&_===void 0?E=T:E=w(E,T,P)}),E}function r(m,w){if(m.type==="Feature")w(m,0);else if(m.type==="FeatureCollection")for(var _=0;_<m.features.length&&w(m.features[_],_)!==!1;_++);}function s(m,w,_){var E=_;return r(m,function(T,P){P===0&&_===void 0?E=T:E=w(E,T,P)}),E}function a(m){var w=[];return n(m,function(_){w.push(_)}),w}function l(m,w){var _,E,T,P,F,D,B,S,I,b,x=0,U=m.type==="FeatureCollection",k=m.type==="Feature",M=U?m.features.length:1;for(_=0;_<M;_++){for(D=U?m.features[_].geometry:k?m.geometry:m,S=U?m.features[_].properties:k?m.properties:{},I=U?m.features[_].bbox:k?m.bbox:void 0,b=U?m.features[_].id:k?m.id:void 0,B=D?D.type==="GeometryCollection":!1,F=B?D.geometries.length:1,T=0;T<F;T++){if(P=B?D.geometries[T]:D,P===null){if(w(null,x,S,I,b)===!1)return!1;continue}switch(P.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(w(P,x,S,I,b)===!1)return!1;break}case"GeometryCollection":{for(E=0;E<P.geometries.length;E++)if(w(P.geometries[E],x,S,I,b)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}x++}}function c(m,w,_){var E=_;return l(m,function(T,P,F,D,B){P===0&&_===void 0?E=T:E=w(E,T,P,F,D,B)}),E}function h(m,w){l(m,function(_,E,T,P,F){var D=_===null?null:_.type;switch(D){case null:case"Point":case"LineString":case"Polygon":return w(t.feature(_,T,{bbox:P,id:F}),E,0)===!1?!1:void 0}var B;switch(D){case"MultiPoint":B="Point";break;case"MultiLineString":B="LineString";break;case"MultiPolygon":B="Polygon";break}for(var S=0;S<_.coordinates.length;S++){var I=_.coordinates[S],b={type:B,coordinates:I};if(w(t.feature(b,T),E,S)===!1)return!1}})}function u(m,w,_){var E=_;return h(m,function(T,P,F){P===0&&F===0&&_===void 0?E=T:E=w(E,T,P,F)}),E}function A(m,w){h(m,function(_,E,T){var P=0;if(_.geometry){var F=_.geometry.type;if(!(F==="Point"||F==="MultiPoint")){var D,B=0,S=0,I=0;if(n(_,function(b,x,U,k,M){if(D===void 0||E>B||k>S||M>I){D=b,B=E,S=k,I=M,P=0;return}var R=t.lineString([D,b],_.properties);if(w(R,E,T,M,P)===!1)return!1;P++,D=b})===!1)return!1}}})}function f(m,w,_){var E=_,T=!1;return A(m,function(P,F,D,B,S){T===!1&&_===void 0?E=P:E=w(E,P,F,D,B,S),T=!0}),E}function d(m,w){if(!m)throw new Error("geojson is required");h(m,function(_,E,T){if(_.geometry!==null){var P=_.geometry.type,F=_.geometry.coordinates;switch(P){case"LineString":if(w(_,E,T,0,0)===!1)return!1;break;case"Polygon":for(var D=0;D<F.length;D++)if(w(t.lineString(F[D],_.properties),E,T,D)===!1)return!1;break}}})}function g(m,w,_){var E=_;return d(m,function(T,P,F,D){P===0&&_===void 0?E=T:E=w(E,T,P,F,D)}),E}function v(m,w){if(w=w||{},!t.isObject(w))throw new Error("options is invalid");var _=w.featureIndex||0,E=w.multiFeatureIndex||0,T=w.geometryIndex||0,P=w.segmentIndex||0,F=w.properties,D;switch(m.type){case"FeatureCollection":_<0&&(_=m.features.length+_),F=F||m.features[_].properties,D=m.features[_].geometry;break;case"Feature":F=F||m.properties,D=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=m;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var B=D.coordinates;switch(D.type){case"Point":case"MultiPoint":return null;case"LineString":return P<0&&(P=B.length+P-1),t.lineString([B[P],B[P+1]],F,w);case"Polygon":return T<0&&(T=B.length+T),P<0&&(P=B[T].length+P-1),t.lineString([B[T][P],B[T][P+1]],F,w);case"MultiLineString":return E<0&&(E=B.length+E),P<0&&(P=B[E].length+P-1),t.lineString([B[E][P],B[E][P+1]],F,w);case"MultiPolygon":return E<0&&(E=B.length+E),T<0&&(T=B[E].length+T),P<0&&(P=B[E][T].length-P-1),t.lineString([B[E][T][P],B[E][T][P+1]],F,w)}throw new Error("geojson is invalid")}function y(m,w){if(w=w||{},!t.isObject(w))throw new Error("options is invalid");var _=w.featureIndex||0,E=w.multiFeatureIndex||0,T=w.geometryIndex||0,P=w.coordIndex||0,F=w.properties,D;switch(m.type){case"FeatureCollection":_<0&&(_=m.features.length+_),F=F||m.features[_].properties,D=m.features[_].geometry;break;case"Feature":F=F||m.properties,D=m.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":D=m;break;default:throw new Error("geojson is invalid")}if(D===null)return null;var B=D.coordinates;switch(D.type){case"Point":return t.point(B,F,w);case"MultiPoint":return E<0&&(E=B.length+E),t.point(B[E],F,w);case"LineString":return P<0&&(P=B.length+P),t.point(B[P],F,w);case"Polygon":return T<0&&(T=B.length+T),P<0&&(P=B[T].length+P),t.point(B[T][P],F,w);case"MultiLineString":return E<0&&(E=B.length+E),P<0&&(P=B[E].length+P),t.point(B[E][P],F,w);case"MultiPolygon":return E<0&&(E=B.length+E),T<0&&(T=B[E].length+T),P<0&&(P=B[E][T].length-P),t.point(B[E][T][P],F,w)}throw new Error("geojson is invalid")}return Bt.coordAll=a,Bt.coordEach=n,Bt.coordReduce=e,Bt.featureEach=r,Bt.featureReduce=s,Bt.findPoint=y,Bt.findSegment=v,Bt.flattenEach=h,Bt.flattenReduce=u,Bt.geomEach=l,Bt.geomReduce=c,Bt.lineEach=d,Bt.lineReduce=g,Bt.propEach=i,Bt.propReduce=o,Bt.segmentEach=A,Bt.segmentReduce=f,Bt}var lf={},XC;function $L(){if(XC)return lf;XC=1,Object.defineProperty(lf,"__esModule",{value:!0});var t=ZC();function n(e){var i=[1/0,1/0,-1/0,-1/0];return t.coordEach(e,function(o){i[0]>o[0]&&(i[0]=o[0]),i[1]>o[1]&&(i[1]=o[1]),i[2]<o[0]&&(i[2]=o[0]),i[3]<o[1]&&(i[3]=o[1])}),i}return n.default=n,lf.default=n,lf}var $C;function YL(){if($C)return sf.exports;$C=1;var t=HL(),n=qC(),e=ZC(),i=$L().default,o=e.featureEach;e.coordEach,n.polygon;var r=n.featureCollection;function s(a){var l=new t(a);return l.insert=function(c){if(c.type!=="Feature")throw new Error("invalid feature");return c.bbox=c.bbox?c.bbox:i(c),t.prototype.insert.call(this,c)},l.load=function(c){var h=[];return Array.isArray(c)?c.forEach(function(u){if(u.type!=="Feature")throw new Error("invalid features");u.bbox=u.bbox?u.bbox:i(u),h.push(u)}):o(c,function(u){if(u.type!=="Feature")throw new Error("invalid features");u.bbox=u.bbox?u.bbox:i(u),h.push(u)}),t.prototype.load.call(this,h)},l.remove=function(c,h){if(c.type!=="Feature")throw new Error("invalid feature");return c.bbox=c.bbox?c.bbox:i(c),t.prototype.remove.call(this,c,h)},l.clear=function(){return t.prototype.clear.call(this)},l.search=function(c){var h=t.prototype.search.call(this,this.toBBox(c));return r(h)},l.collides=function(c){return t.prototype.collides.call(this,this.toBBox(c))},l.all=function(){var c=t.prototype.all.call(this);return r(c)},l.toJSON=function(){return t.prototype.toJSON.call(this)},l.fromJSON=function(c){return t.prototype.fromJSON.call(this,c)},l.toBBox=function(c){var h;if(c.bbox)h=c.bbox;else if(Array.isArray(c)&&c.length===4)h=c;else if(Array.isArray(c)&&c.length===6)h=[c[0],c[1],c[3],c[4]];else if(c.type==="Feature")h=i(c);else if(c.type==="FeatureCollection")h=i(c);else throw new Error("invalid geojson");return{minX:h[0],minY:h[1],maxX:h[2],maxY:h[3]}},l}return sf.exports=s,sf.exports.default=s,sf.exports}var JL=YL();const jL=Va(JL);function Dg(t,n){var e={},i=[];if(t.type==="LineString"&&(t=Ci(t)),n.type==="LineString"&&(n=Ci(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=YC(t,n);return o&&i.push(o),xi(i)}var r=jL();return r.load(GC(n)),rf(GC(t),function(s){rf(r.search(s),function(a){var l=YC(s,a);if(l){var c=Si(l).join(",");e[c]||(e[c]=!0,i.push(l))}})}),xi(i)}function YC(t,n){var e=Si(t),i=Si(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],s=e[1][0],a=e[1][1],l=i[0][0],c=i[0][1],h=i[1][0],u=i[1][1],A=(u-c)*(s-o)-(h-l)*(a-r),f=(h-l)*(r-c)-(u-c)*(o-l),d=(s-o)*(r-c)-(a-r)*(o-l);if(A===0)return null;var g=f/A,v=d/A;if(g>=0&&g<=1&&v>=0&&v<=1){var y=o+g*(s-o),m=r+g*(a-r);return eo([y,m])}return null}function uf(t,n,e){e===void 0&&(e={});for(var i=tf(t),o=Si(n),r=0;r<o.length-1;r++){var s=!1;if(e.ignoreEndVertices&&(r===0&&(s="start"),r===o.length-2&&(s="end"),r===0&&r+1===o.length-1&&(s="both")),ez(o[r],o[r+1],i,s,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function ez(t,n,e,i,o){var r=e[0],s=e[1],a=t[0],l=t[1],c=n[0],h=n[1],u=e[0]-a,A=e[1]-l,f=c-a,d=h-l,g=u*d-A*f;if(o!==null){if(Math.abs(g)>o)return!1}else if(g!==0)return!1;if(i){if(i==="start")return Math.abs(f)>=Math.abs(d)?f>0?a<r&&r<=c:c<=r&&r<a:d>0?l<s&&s<=h:h<=s&&s<l;if(i==="end")return Math.abs(f)>=Math.abs(d)?f>0?a<=r&&r<c:c<r&&r<=a:d>0?l<=s&&s<h:h<s&&s<=l;if(i==="both")return Math.abs(f)>=Math.abs(d)?f>0?a<r&&r<c:c<r&&r<a:d>0?l<s&&s<h:h<s&&s<l}else return Math.abs(f)>=Math.abs(d)?f>0?a<=r&&r<=c:c<=r&&r<=a:d>0?l<=s&&s<=h:h<=s&&s<=l;return!1}function tz(t,n){var e=Ei(t),i=Ei(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return nz(e,i);case"LineString":return uf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return ln(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return iz(e,i);case"LineString":return rz(e,i);case"Polygon":case"MultiPolygon":return oz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return az(e,i);case"Polygon":case"MultiPolygon":return sz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return lz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function nz(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(jC(n.coordinates[e],t.coordinates)){i=!0;break}return i}function iz(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)jC(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function rz(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!uf(t.coordinates[i],n))return!1;e||(e=uf(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function oz(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=ln(t.coordinates[1],n),!i){e=!1;break}i=ln(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function az(t,n){for(var e=0;e<t.coordinates.length;e++)if(!uf(t.coordinates[e],n))return!1;return!0}function sz(t,n){var e=$o(n),i=$o(t);if(!JC(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!ln(t.coordinates[r],n))return!1;if(o||(o=ln(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var s=uz(t.coordinates[r],t.coordinates[r+1]);o=ln(s,n,{ignoreBoundary:!0})}}return o}function lz(t,n){var e=$o(t),i=$o(n);if(!JC(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!ln(t.coordinates[0][o],n))return!1;return!0}function JC(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function jC(t,n){return t[0]===n[0]&&t[1]===n[1]}function uz(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function ex(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],s=t[2],a=t[3],l=n/Pi([o,r],[s,r],e),c=l*(s-o),h=n/Pi([o,r],[o,a],e),u=h*(a-r),A=s-o,f=a-r,d=Math.floor(A/c),g=Math.floor(f/u),v=(A-d*c)/2,y=(f-g*u)/2,m=o+v;m<=s;){for(var w=r+y;w<=a;){var _=eo([m,w],e.properties);e.mask?tz(_,e.mask)&&i.push(_):i.push(_),w+=u}m+=c}return xi(i)}function Rg(t,n){n===void 0&&(n={});var e=Ei(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return cz(e,n);case"MultiPolygon":return hz(e,n);default:throw new Error("invalid poly")}}function cz(t,n){n===void 0&&(n={});var e=Ei(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return tx(i,o)}function hz(t,n){n===void 0&&(n={});var e=Ei(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(s){r.push(tx(s,o))}),xi(r)}function tx(t,n){return t.length>1?hL(t,n):jA(t[0],n)}var Ug,nx;function ix(){if(nx)return Ug;nx=1;var t=Object.prototype.toString;return Ug=function(e){var i=t.call(e),o=i==="[object Arguments]";return o||(o=i!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&t.call(e.callee)==="[object Function]"),o},Ug}var Og,rx;function Az(){if(rx)return Og;rx=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=ix(),o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),s=o.call(function(){},"prototype"),a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(A){var f=A.constructor;return f&&f.prototype===A},c={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if(typeof window>"u")return!1;for(var A in window)try{if(!c["$"+A]&&n.call(window,A)&&window[A]!==null&&typeof window[A]=="object")try{l(window[A])}catch{return!0}}catch{return!0}return!1}(),u=function(A){if(typeof window>"u"||!h)return l(A);try{return l(A)}catch{return!1}};t=function(f){var d=f!==null&&typeof f=="object",g=e.call(f)==="[object Function]",v=i(f),y=d&&e.call(f)==="[object String]",m=[];if(!d&&!g&&!v)throw new TypeError("Object.keys called on a non-object");var w=s&&g;if(y&&f.length>0&&!n.call(f,0))for(var _=0;_<f.length;++_)m.push(String(_));if(v&&f.length>0)for(var E=0;E<f.length;++E)m.push(String(E));else for(var T in f)!(w&&T==="prototype")&&n.call(f,T)&&m.push(String(T));if(r)for(var P=u(f),F=0;F<a.length;++F)!(P&&a[F]==="constructor")&&n.call(f,a[F])&&m.push(a[F]);return m}}return Og=t,Og}var Lg,ox;function ax(){if(ox)return Lg;ox=1;var t=Array.prototype.slice,n=ix(),e=Object.keys,i=e?function(s){return e(s)}:Az(),o=Object.keys;return i.shim=function(){if(Object.keys){var s=function(){var a=Object.keys(arguments);return a&&a.length===arguments.length}(1,2);s||(Object.keys=function(l){return n(l)?o(t.call(l)):o(l)})}else Object.keys=i;return Object.keys||i},Lg=i,Lg}var zg,sx;function lx(){return sx||(sx=1,zg=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var s=Object.getOwnPropertySymbols(n);if(s.length!==1||s[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(n,e);if(a.value!==o||a.enumerable!==!0)return!1}return!0}),zg}var Qg,ux;function Vg(){if(ux)return Qg;ux=1;var t=lx();return Qg=function(){return t()&&!!Symbol.toStringTag},Qg}var Hg,cx;function hx(){return cx||(cx=1,Hg=Object),Hg}var Ng,Ax;function fx(){return Ax||(Ax=1,Ng=Error),Ng}var Gg,dx;function fz(){return dx||(dx=1,Gg=EvalError),Gg}var Wg,px;function dz(){return px||(px=1,Wg=RangeError),Wg}var qg,mx;function pz(){return mx||(mx=1,qg=ReferenceError),qg}var Kg,gx;function yx(){return gx||(gx=1,Kg=SyntaxError),Kg}var Zg,vx;function bs(){return vx||(vx=1,Zg=TypeError),Zg}var Xg,wx;function mz(){return wx||(wx=1,Xg=URIError),Xg}var $g,bx;function gz(){return bx||(bx=1,$g=Math.abs),$g}var Yg,_x;function yz(){return _x||(_x=1,Yg=Math.floor),Yg}var Jg,Cx;function vz(){return Cx||(Cx=1,Jg=Math.max),Jg}var jg,xx;function wz(){return xx||(xx=1,jg=Math.min),jg}var ey,Sx;function bz(){return Sx||(Sx=1,ey=Math.pow),ey}var ty,Ex;function _z(){return Ex||(Ex=1,ty=Math.round),ty}var ny,Px;function Cz(){return Px||(Px=1,ny=Number.isNaN||function(n){return n!==n}),ny}var iy,Tx;function xz(){if(Tx)return iy;Tx=1;var t=Cz();return iy=function(e){return t(e)||e===0?e:e<0?-1:1},iy}var ry,Ix;function Sz(){return Ix||(Ix=1,ry=Object.getOwnPropertyDescriptor),ry}var oy,kx;function _s(){if(kx)return oy;kx=1;var t=Sz();if(t)try{t([],"length")}catch{t=null}return oy=t,oy}var ay,Fx;function cf(){if(Fx)return ay;Fx=1;var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return ay=t,ay}var sy,Bx;function Ez(){if(Bx)return sy;Bx=1;var t=typeof Symbol<"u"&&Symbol,n=lx();return sy=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},sy}var ly,Mx;function Dx(){return Mx||(Mx=1,ly=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),ly}var uy,Rx;function Ux(){if(Rx)return uy;Rx=1;var t=hx();return uy=t.getPrototypeOf||null,uy}var cy,Ox;function Pz(){if(Ox)return cy;Ox=1;var t="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,e=Math.max,i="[object Function]",o=function(l,c){for(var h=[],u=0;u<l.length;u+=1)h[u]=l[u];for(var A=0;A<c.length;A+=1)h[A+l.length]=c[A];return h},r=function(l,c){for(var h=[],u=c,A=0;u<l.length;u+=1,A+=1)h[A]=l[u];return h},s=function(a,l){for(var c="",h=0;h<a.length;h+=1)c+=a[h],h+1<a.length&&(c+=l);return c};return cy=function(l){var c=this;if(typeof c!="function"||n.apply(c)!==i)throw new TypeError(t+c);for(var h=r(arguments,1),u,A=function(){if(this instanceof u){var y=c.apply(this,o(h,arguments));return Object(y)===y?y:this}return c.apply(l,o(h,arguments))},f=e(0,c.length-h.length),d=[],g=0;g<f;g++)d[g]="$"+g;if(u=Function("binder","return function ("+s(d,",")+"){ return binder.apply(this,arguments); }")(A),c.prototype){var v=function(){};v.prototype=c.prototype,u.prototype=new v,v.prototype=null}return u},cy}var hy,Lx;function ql(){if(Lx)return hy;Lx=1;var t=Pz();return hy=Function.prototype.bind||t,hy}var Ay,zx;function fy(){return zx||(zx=1,Ay=Function.prototype.call),Ay}var dy,Qx;function py(){return Qx||(Qx=1,dy=Function.prototype.apply),dy}var my,Vx;function Tz(){return Vx||(Vx=1,my=typeof Reflect<"u"&&Reflect&&Reflect.apply),my}var gy,Hx;function Nx(){if(Hx)return gy;Hx=1;var t=ql(),n=py(),e=fy(),i=Tz();return gy=i||t.call(e,n),gy}var yy,Gx;function vy(){if(Gx)return yy;Gx=1;var t=ql(),n=bs(),e=fy(),i=Nx();return yy=function(r){if(r.length<1||typeof r[0]!="function")throw new n("a function is required");return i(t,e,r)},yy}var wy,Wx;function Iz(){if(Wx)return wy;Wx=1;var t=vy(),n=_s(),e;try{e=[].__proto__===Array.prototype}catch(s){if(!s||typeof s!="object"||!("code"in s)||s.code!=="ERR_PROTO_ACCESS")throw s}var i=!!e&&n&&n(Object.prototype,"__proto__"),o=Object,r=o.getPrototypeOf;return wy=i&&typeof i.get=="function"?t([i.get]):typeof r=="function"?function(a){return r(a==null?a:o(a))}:!1,wy}var by,qx;function Kx(){if(qx)return by;qx=1;var t=Dx(),n=Ux(),e=Iz();return by=t?function(o){return t(o)}:n?function(o){if(!o||typeof o!="object"&&typeof o!="function")throw new TypeError("getProto: not an object");return n(o)}:e?function(o){return e(o)}:null,by}var _y,Zx;function Xx(){if(Zx)return _y;Zx=1;var t=Function.prototype.call,n=Object.prototype.hasOwnProperty,e=ql();return _y=e.call(t,n),_y}var Cy,$x;function Yx(){if($x)return Cy;$x=1;var t,n=hx(),e=fx(),i=fz(),o=dz(),r=pz(),s=yx(),a=bs(),l=mz(),c=gz(),h=yz(),u=vz(),A=wz(),f=bz(),d=_z(),g=xz(),v=Function,y=function(ce){try{return v('"use strict"; return ('+ce+").constructor;")()}catch{}},m=_s(),w=cf(),_=function(){throw new a},E=m?function(){try{return arguments.callee,_}catch{try{return m(arguments,"callee").get}catch{return _}}}():_,T=Ez()(),P=Kx(),F=Ux(),D=Dx(),B=py(),S=fy(),I={},b=typeof Uint8Array>"u"||!P?t:P(Uint8Array),x={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?t:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?t:ArrayBuffer,"%ArrayIteratorPrototype%":T&&P?P([][Symbol.iterator]()):t,"%AsyncFromSyncIteratorPrototype%":t,"%AsyncFunction%":I,"%AsyncGenerator%":I,"%AsyncGeneratorFunction%":I,"%AsyncIteratorPrototype%":I,"%Atomics%":typeof Atomics>"u"?t:Atomics,"%BigInt%":typeof BigInt>"u"?t:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?t:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?t:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?t:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":i,"%Float16Array%":typeof Float16Array>"u"?t:Float16Array,"%Float32Array%":typeof Float32Array>"u"?t:Float32Array,"%Float64Array%":typeof Float64Array>"u"?t:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?t:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":I,"%Int8Array%":typeof Int8Array>"u"?t:Int8Array,"%Int16Array%":typeof Int16Array>"u"?t:Int16Array,"%Int32Array%":typeof Int32Array>"u"?t:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":T&&P?P(P([][Symbol.iterator]())):t,"%JSON%":typeof JSON=="object"?JSON:t,"%Map%":typeof Map>"u"?t:Map,"%MapIteratorPrototype%":typeof Map>"u"||!T||!P?t:P(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":m,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?t:Promise,"%Proxy%":typeof Proxy>"u"?t:Proxy,"%RangeError%":o,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?t:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?t:Set,"%SetIteratorPrototype%":typeof Set>"u"||!T||!P?t:P(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?t:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":T&&P?P(""[Symbol.iterator]()):t,"%Symbol%":T?Symbol:t,"%SyntaxError%":s,"%ThrowTypeError%":E,"%TypedArray%":b,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?t:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?t:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?t:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?t:Uint32Array,"%URIError%":l,"%WeakMap%":typeof WeakMap>"u"?t:WeakMap,"%WeakRef%":typeof WeakRef>"u"?t:WeakRef,"%WeakSet%":typeof WeakSet>"u"?t:WeakSet,"%Function.prototype.call%":S,"%Function.prototype.apply%":B,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":F,"%Math.abs%":c,"%Math.floor%":h,"%Math.max%":u,"%Math.min%":A,"%Math.pow%":f,"%Math.round%":d,"%Math.sign%":g,"%Reflect.getPrototypeOf%":D};if(P)try{null.error}catch(ce){var U=P(P(ce));x["%Error.prototype%"]=U}var k=function ce(ne){var he;if(ne==="%AsyncFunction%")he=y("async function () {}");else if(ne==="%GeneratorFunction%")he=y("function* () {}");else if(ne==="%AsyncGeneratorFunction%")he=y("async function* () {}");else if(ne==="%AsyncGenerator%"){var Y=ce("%AsyncGeneratorFunction%");Y&&(he=Y.prototype)}else if(ne==="%AsyncIteratorPrototype%"){var Z=ce("%AsyncGenerator%");Z&&P&&(he=P(Z.prototype))}return x[ne]=he,he},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},R=ql(),O=Xx(),z=R.call(S,Array.prototype.concat),V=R.call(B,Array.prototype.splice),H=R.call(S,String.prototype.replace),q=R.call(S,String.prototype.slice),J=R.call(S,RegExp.prototype.exec),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,re=/\\(\\)?/g,oe=function(ne){var he=q(ne,0,1),Y=q(ne,-1);if(he==="%"&&Y!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&he!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var Z=[];return H(ne,j,function(G,$,X,K){Z[Z.length]=X?H(K,re,"$1"):$||G}),Z},ue=function(ne,he){var Y=ne,Z;if(O(M,Y)&&(Z=M[Y],Y="%"+Z[0]+"%"),O(x,Y)){var G=x[Y];if(G===I&&(G=k(Y)),typeof G>"u"&&!he)throw new a("intrinsic "+ne+" exists, but is not available. Please file an issue!");return{alias:Z,name:Y,value:G}}throw new s("intrinsic "+ne+" does not exist!")};return Cy=function(ne,he){if(typeof ne!="string"||ne.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof he!="boolean")throw new a('"allowMissing" argument must be a boolean');if(J(/^%?[^%]*%?$/,ne)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=oe(ne),Z=Y.length>0?Y[0]:"",G=ue("%"+Z+"%",he),$=G.name,X=G.value,K=!1,W=G.alias;W&&(Z=W[0],V(Y,z([0,1],W)));for(var ee=1,te=!0;ee<Y.length;ee+=1){var se=Y[ee],fe=q(se,0,1),de=q(se,-1);if((fe==='"'||fe==="'"||fe==="`"||de==='"'||de==="'"||de==="`")&&fe!==de)throw new s("property names with quotes must have matching quotes");if((se==="constructor"||!te)&&(K=!0),Z+="."+se,$="%"+Z+"%",O(x,$))X=x[$];else if(X!=null){if(!(se in X)){if(!he)throw new a("base intrinsic for "+ne+" exists, but the property is not available.");return}if(m&&ee+1>=Y.length){var me=m(X,se);te=!!me,te&&"get"in me&&!("originalValue"in me.get)?X=me.get:X=X[se]}else te=O(X,se),X=X[se];te&&!K&&(x[$]=X)}}return X},Cy}var xy,Jx;function Sy(){if(Jx)return xy;Jx=1;var t=Yx(),n=vy(),e=n([t("%String.prototype.indexOf%")]);return xy=function(o,r){var s=t(o,!!r);return typeof s=="function"&&e(o,".prototype.")>-1?n([s]):s},xy}var Ey,jx;function kz(){if(jx)return Ey;jx=1;var t=Vg()(),n=Sy(),e=n("Object.prototype.toString"),i=function(a){return t&&a&&typeof a=="object"&&Symbol.toStringTag in a?!1:e(a)==="[object Arguments]"},o=function(a){return i(a)?!0:a!==null&&typeof a=="object"&&"length"in a&&typeof a.length=="number"&&a.length>=0&&e(a)!=="[object Array]"&&"callee"in a&&e(a.callee)==="[object Function]"},r=function(){return i(arguments)}();return i.isLegacyArguments=o,Ey=r?i:o,Ey}var Py,eS;function Ty(){if(eS)return Py;eS=1;var t=cf(),n=yx(),e=bs(),i=_s();return Py=function(r,s,a){if(!r||typeof r!="object"&&typeof r!="function")throw new e("`obj` must be an object or a function`");if(typeof s!="string"&&typeof s!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var l=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,h=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,A=!!i&&i(r,s);if(t)t(r,s,{configurable:h===null&&A?A.configurable:!h,enumerable:l===null&&A?A.enumerable:!l,value:a,writable:c===null&&A?A.writable:!c});else if(u||!l&&!c&&!h)r[s]=a;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Py}var Iy,tS;function ky(){if(tS)return Iy;tS=1;var t=cf(),n=function(){return!!t};return n.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},Iy=n,Iy}var Fy,nS;function Kl(){if(nS)return Fy;nS=1;var t=ax(),n=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,i=Array.prototype.concat,o=Ty(),r=function(c){return typeof c=="function"&&e.call(c)==="[object Function]"},s=ky()(),a=function(c,h,u,A){if(h in c){if(A===!0){if(c[h]===u)return}else if(!r(A)||!A())return}s?o(c,h,u,!0):o(c,h,u)},l=function(c,h){var u=arguments.length>2?arguments[2]:{},A=t(h);n&&(A=i.call(A,Object.getOwnPropertySymbols(h)));for(var f=0;f<A.length;f+=1)a(c,A[f],h[A[f]],u[A[f]])};return l.supportsDescriptors=!!s,Fy=l,Fy}var By={exports:{}},My,iS;function Fz(){if(iS)return My;iS=1;var t=Yx(),n=Ty(),e=ky()(),i=_s(),o=bs(),r=t("%Math.floor%");return My=function(a,l){if(typeof a!="function")throw new o("`fn` is not a function");if(typeof l!="number"||l<0||l>4294967295||r(l)!==l)throw new o("`length` must be a positive 32-bit integer");var c=arguments.length>2&&!!arguments[2],h=!0,u=!0;if("length"in a&&i){var A=i(a,"length");A&&!A.configurable&&(h=!1),A&&!A.writable&&(u=!1)}return(h||u||!c)&&(e?n(a,"length",l,!0,!0):n(a,"length",l)),a},My}var Dy,rS;function Bz(){if(rS)return Dy;rS=1;var t=ql(),n=py(),e=Nx();return Dy=function(){return e(t,n,arguments)},Dy}var oS;function aS(){return oS||(oS=1,function(t){var n=Fz(),e=cf(),i=vy(),o=Bz();t.exports=function(s){var a=i(arguments),l=s.length-(arguments.length-1);return n(a,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o}(By)),By.exports}var Ry,sS;function lS(){if(sS)return Ry;sS=1;var t=function(n){return n!==n};return Ry=function(e,i){return e===0&&i===0?1/e===1/i:!!(e===i||t(e)&&t(i))},Ry}var Uy,uS;function cS(){if(uS)return Uy;uS=1;var t=lS();return Uy=function(){return typeof Object.is=="function"?Object.is:t},Uy}var Oy,hS;function Mz(){if(hS)return Oy;hS=1;var t=cS(),n=Kl();return Oy=function(){var i=t();return n(Object,{is:i},{is:function(){return Object.is!==i}}),i},Oy}var Ly,AS;function Dz(){if(AS)return Ly;AS=1;var t=Kl(),n=aS(),e=lS(),i=cS(),o=Mz(),r=n(i(),Object);return t(r,{getPolyfill:i,implementation:e,shim:o}),Ly=r,Ly}var zy,fS;function Rz(){if(fS)return zy;fS=1;var t=Sy(),n=Vg()(),e=Xx(),i=_s(),o;if(n){var r=t("RegExp.prototype.exec"),s={},a=function(){throw s},l={toString:a,valueOf:a};typeof Symbol.toPrimitive=="symbol"&&(l[Symbol.toPrimitive]=a),o=function(A){if(!A||typeof A!="object")return!1;var f=i(A,"lastIndex"),d=f&&e(f,"value");if(!d)return!1;try{r(A,l)}catch(g){return g===s}}}else{var c=t("Object.prototype.toString"),h="[object RegExp]";o=function(A){return!A||typeof A!="object"&&typeof A!="function"?!1:c(A)===h}}return zy=o,zy}var Qy,dS;function Uz(){if(dS)return Qy;dS=1;var t=function(){return typeof(function(){}).name=="string"},n=Object.getOwnPropertyDescriptor;if(n)try{n([],"length")}catch{n=null}t.functionsHaveConfigurableNames=function(){if(!t()||!n)return!1;var o=n(function(){},"name");return!!o&&!!o.configurable};var e=Function.prototype.bind;return t.boundFunctionsHaveNames=function(){return t()&&typeof e=="function"&&(function(){}).bind().name!==""},Qy=t,Qy}var Vy,pS;function Oz(){if(pS)return Vy;pS=1;var t=Ty(),n=ky()(),e=Uz().functionsHaveConfigurableNames(),i=bs();return Vy=function(r,s){if(typeof r!="function")throw new i("`fn` is not a function");var a=arguments.length>2&&!!arguments[2];return(!a||e)&&(n?t(r,"name",s,!0,!0):t(r,"name",s)),r},Vy}var Hy,mS;function gS(){if(mS)return Hy;mS=1;var t=Oz(),n=bs(),e=Object;return Hy=t(function(){if(this==null||this!==e(this))throw new n("RegExp.prototype.flags getter called on non-object");var o="";return this.hasIndices&&(o+="d"),this.global&&(o+="g"),this.ignoreCase&&(o+="i"),this.multiline&&(o+="m"),this.dotAll&&(o+="s"),this.unicode&&(o+="u"),this.unicodeSets&&(o+="v"),this.sticky&&(o+="y"),o},"get flags",!0),Hy}var Ny,yS;function vS(){if(yS)return Ny;yS=1;var t=gS(),n=Kl().supportsDescriptors,e=Object.getOwnPropertyDescriptor;return Ny=function(){if(n&&/a/mig.flags==="gim"){var o=e(RegExp.prototype,"flags");if(o&&typeof o.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",s={};if(Object.defineProperty(s,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(s,"sticky",{get:function(){r+="y"}}),o.get.call(s),r==="dy")return o.get}}return t},Ny}var Gy,wS;function Lz(){if(wS)return Gy;wS=1;var t=Kl().supportsDescriptors,n=vS(),e=_s(),i=Object.defineProperty,o=fx(),r=Kx(),s=/a/;return Gy=function(){if(!t||!r)throw new o("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var l=n(),c=r(s),h=e(c,"flags");return(!h||h.get!==l)&&i(c,"flags",{configurable:!0,enumerable:!1,get:l}),l},Gy}var Wy,bS;function zz(){if(bS)return Wy;bS=1;var t=Kl(),n=aS(),e=gS(),i=vS(),o=Lz(),r=n(i());return t(r,{getPolyfill:i,implementation:e,shim:o}),Wy=r,Wy}var qy,_S;function Qz(){if(_S)return qy;_S=1;var t=Sy(),n=t("Date.prototype.getDay"),e=function(a){try{return n(a),!0}catch{return!1}},i=t("Object.prototype.toString"),o="[object Date]",r=Vg()();return qy=function(a){return typeof a!="object"||a===null?!1:r?e(a):i(a)===o},qy}var Ky,CS;function Vz(){if(CS)return Ky;CS=1;var t=ax(),n=kz(),e=Dz(),i=Rz(),o=zz(),r=Qz(),s=Date.prototype.getTime;function a(u,A,f){var d=f||{};return(d.strict?e(u,A):u===A)?!0:!u||!A||typeof u!="object"&&typeof A!="object"?d.strict?e(u,A):u==A:h(u,A,d)}function l(u){return u==null}function c(u){return!(!u||typeof u!="object"||typeof u.length!="number"||typeof u.copy!="function"||typeof u.slice!="function"||u.length>0&&typeof u[0]!="number")}function h(u,A,f){var d,g;if(typeof u!=typeof A||l(u)||l(A)||u.prototype!==A.prototype||n(u)!==n(A))return!1;var v=i(u),y=i(A);if(v!==y)return!1;if(v||y)return u.source===A.source&&o(u)===o(A);if(r(u)&&r(A))return s.call(u)===s.call(A);var m=c(u),w=c(A);if(m!==w)return!1;if(m||w){if(u.length!==A.length)return!1;for(d=0;d<u.length;d++)if(u[d]!==A[d])return!1;return!0}if(typeof u!=typeof A)return!1;try{var _=t(u),E=t(A)}catch{return!1}if(_.length!==E.length)return!1;for(_.sort(),E.sort(),d=_.length-1;d>=0;d--)if(_[d]!=E[d])return!1;for(d=_.length-1;d>=0;d--)if(g=_[d],!a(u[g],A[g],f))return!1;return!0}return Ky=a,Ky}function Hz(t,n){var e=!0;return ms(t,function(i){ms(n,function(o){if(e===!1)return!1;e=Nz(i.geometry,o.geometry)})}),e}function Nz(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!Kz(t.coordinates,n.coordinates);case"LineString":return!xS(n,t);case"Polygon":return!ln(t,n)}break;case"LineString":switch(n.type){case"Point":return!xS(t,n);case"LineString":return!Gz(t,n);case"Polygon":return!SS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!ln(n,t);case"LineString":return!SS(t,n);case"Polygon":return!Wz(n,t)}}return!1}function xS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(qz(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function Gz(t,n){var e=Dg(t,n);return e.features.length>0}function SS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(ln(o,t))return!0}var r=Dg(n,Rg(t));return r.features.length>0}function Wz(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(ln(o,n))return!0}for(var r=0,s=n.coordinates[0];r<s.length;r++){var a=s[r];if(ln(a,t))return!0}var l=Dg(Rg(t),Rg(n));return l.features.length>0}function qz(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],s=n[1]-t[1],a=i*s-o*r;return a!==0?!1:Math.abs(r)>=Math.abs(s)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:s>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function Kz(t,n){return t[0]===n[0]&&t[1]===n[1]}var Zy,ES;function Zz(){if(ES)return Zy;ES=1;var t=Vz(),n=function(r){this.precision=r&&r.precision?r.precision:17,this.direction=r&&r.direction?r.direction:!1,this.pseudoNode=r&&r.pseudoNode?r.pseudoNode:!1,this.objectComparator=r&&r.objectComparator?r.objectComparator:o};n.prototype.compare=function(r,s){if(r.type!==s.type||!i(r,s))return!1;switch(r.type){case"Point":return this.compareCoord(r.coordinates,s.coordinates);case"LineString":return this.compareLine(r.coordinates,s.coordinates,0,!1);case"Polygon":return this.comparePolygon(r,s);case"Feature":return this.compareFeature(r,s);default:if(r.type.indexOf("Multi")===0){var a=this,l=e(r),c=e(s);return l.every(function(h){return this.some(function(u){return a.compare(h,u)})},c)}}return!1};function e(r){return r.coordinates.map(function(s){return{type:r.type.replace("Multi",""),coordinates:s}})}function i(r,s){return r.hasOwnProperty("coordinates")?r.coordinates.length===s.coordinates.length:r.length===s.length}n.prototype.compareCoord=function(r,s){if(r.length!==s.length)return!1;for(var a=0;a<r.length;a++)if(r[a].toFixed(this.precision)!==s[a].toFixed(this.precision))return!1;return!0},n.prototype.compareLine=function(r,s,a,l){if(!i(r,s))return!1;var c=this.pseudoNode?r:this.removePseudo(r),h=this.pseudoNode?s:this.removePseudo(s);if(!(l&&!this.compareCoord(c[0],h[0])&&(h=this.fixStartIndex(h,c),!h))){var u=this.compareCoord(c[a],h[a]);return this.direction||u?this.comparePath(c,h):this.compareCoord(c[a],h[h.length-(1+a)])?this.comparePath(c.slice().reverse(),h):!1}},n.prototype.fixStartIndex=function(r,s){for(var a,l=-1,c=0;c<r.length;c++)if(this.compareCoord(r[c],s[0])){l=c;break}return l>=0&&(a=[].concat(r.slice(l,r.length),r.slice(1,l+1))),a},n.prototype.comparePath=function(r,s){var a=this;return r.every(function(l,c){return a.compareCoord(l,this[c])},s)},n.prototype.comparePolygon=function(r,s){if(this.compareLine(r.coordinates[0],s.coordinates[0],1,!0)){var a=r.coordinates.slice(1,r.coordinates.length),l=s.coordinates.slice(1,s.coordinates.length),c=this;return a.every(function(h){return this.some(function(u){return c.compareLine(h,u,1,!0)})},l)}else return!1},n.prototype.compareFeature=function(r,s){return r.id!==s.id||!this.objectComparator(r.properties,s.properties)||!this.compareBBox(r,s)?!1:this.compare(r.geometry,s.geometry)},n.prototype.compareBBox=function(r,s){return!!(!r.bbox&&!s.bbox||r.bbox&&s.bbox&&this.compareCoord(r.bbox,s.bbox))},n.prototype.removePseudo=function(r){return r};function o(r,s){return t(r,s,{strict:!0})}return Zy=n,Zy}var Xz=Zz();const $z=Va(Xz);function Yz(t,n){var e=Ei(t).type,i=Ei(n).type;if(e!==i)return!1;var o=new $z({precision:6});return o.compare(VC(t),VC(n))}function Jz(t,n){var e=!1;return ms(t,function(i){ms(n,function(o){if(e===!0)return!0;e=!Hz(i.geometry,o.geometry)})}),e}/**
|
|
4079
4079
|
* splaytree v3.1.2
|
|
4080
4080
|
* Fast Splay tree for Node and browser
|
|
4081
4081
|
*
|
|
@@ -4095,8 +4095,8 @@ function (result, this, instanceIndex, frameState) {
|
|
|
4095
4095
|
|
|
4096
4096
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
4097
4097
|
and limitations under the License.
|
|
4098
|
-
***************************************************************************** */function
|
|
4099
|
-
`);var r=n+(e?" ":"│ ");t.left&&$y(t.left,r,!1,i,o),t.right&&$y(t.right,r,!0,i,o)}}var Yy=function(){function t(n){n===void 0&&(n=jz),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=Xy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new to(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=no(n,this._root,o),s=o(n,r.key);return s===0?this._root=r:(s<0?(i.left=r.left,i.right=r,r.left=null):s>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=no(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=no(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=no(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=no(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],s=this._comparator,a=this._root,l;r.length!==0||a;)if(a)r.push(a),a=a.left;else{if(a=r.pop(),l=s(a.key,e),l>0)break;if(s(a.key,n)>=0&&i.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return n6(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&ev(n,e,0,o-1,r),this._root===null)this._root=Jy(n,e,0,o),this._size=o;else{var s=i6(this.toList(),t6(n,e),r);o=this._size+o,this._root=jy({head:s},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return $y(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=PS(n,this._root,o),s=r.left,a=r.right;o(n,e)<0?a=Xy(e,i,a,o):s=Xy(e,i,s,o),this._root=e6(s,a,o)},t.prototype.split=function(n){return PS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return Jz(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Jy(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),s=t[r],a=n[r],l=new to(s,a);return l.left=Jy(t,n,e,r),l.right=Jy(t,n,r+1,i),l}return null}function t6(t,n){for(var e=new to(null,null),i=e,o=0;o<t.length;o++)i=i.next=new to(t[o],n[o]);return i.next=null,e.next}function n6(t){for(var n=t,e=[],i=!1,o=new to(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function jy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=jy(t,n,o),s=t.head;return s.left=r,t.head=t.head.next,s.right=jy(t,o+1,e),s}return null}function i6(t,n,e){for(var i=new to(null,null),o=i,r=t,s=n;r!==null&&s!==null;)e(r.key,s.key)<0?(o.next=r,r=r.next):(o.next=s,s=s.next),o=o.next;return r!==null?o.next=r:s!==null&&(o.next=s),i.next}function ev(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],s=e-1,a=i+1;;){do s++;while(o(t[s],r)<0);do a--;while(o(t[a],r)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=n[s],n[s]=n[a],n[a]=l}ev(t,n,e,a,o),ev(t,n,a+1,i,o)}}const nr=11102230246251565e-32,nn=134217729,r6=(3+8*nr)*nr;function tv(t,n,e,i,o){let r,s,a,l,c=n[0],h=i[0],u=0,A=0;h>c==h>-c?(r=c,c=n[++u]):(r=h,h=i[++A]);let f=0;if(u<t&&A<e)for(h>c==h>-c?(s=c+r,a=r-(s-c),c=n[++u]):(s=h+r,a=r-(s-h),h=i[++A]),r=s,a!==0&&(o[f++]=a);u<t&&A<e;)h>c==h>-c?(s=r+c,l=s-r,a=r-(s-l)+(c-l),c=n[++u]):(s=r+h,l=s-r,a=r-(s-l)+(h-l),h=i[++A]),r=s,a!==0&&(o[f++]=a);for(;u<t;)s=r+c,l=s-r,a=r-(s-l)+(c-l),c=n[++u],r=s,a!==0&&(o[f++]=a);for(;A<e;)s=r+h,l=s-r,a=r-(s-l)+(h-l),h=i[++A],r=s,a!==0&&(o[f++]=a);return(r!==0||f===0)&&(o[f++]=r),f}function o6(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function Zl(t){return new Float64Array(t)}const a6=(3+16*nr)*nr,s6=(2+12*nr)*nr,l6=(9+64*nr)*nr*nr,Cs=Zl(4),TS=Zl(8),IS=Zl(12),kS=Zl(16),un=Zl(4);function u6(t,n,e,i,o,r,s){let a,l,c,h,u,A,f,d,g,v,y,m,w,_,E,T,P,F;const D=t-o,B=e-o,S=n-r,I=i-r;_=D*I,A=nn*D,f=A-(A-D),d=D-f,A=nn*I,g=A-(A-I),v=I-g,E=d*v-(_-f*g-d*g-f*v),T=S*B,A=nn*S,f=A-(A-S),d=S-f,A=nn*B,g=A-(A-B),v=B-g,P=d*v-(T-f*g-d*g-f*v),y=E-P,u=E-y,Cs[0]=E-(y+u)+(u-P),m=_+y,u=m-_,w=_-(m-u)+(y-u),y=w-T,u=w-y,Cs[1]=w-(y+u)+(u-T),F=m+y,u=F-m,Cs[2]=m-(F-u)+(y-u),Cs[3]=F;let b=o6(4,Cs),x=s6*s;if(b>=x||-b>=x||(u=t-D,a=t-(D+u)+(u-o),u=e-B,c=e-(B+u)+(u-o),u=n-S,l=n-(S+u)+(u-r),u=i-I,h=i-(I+u)+(u-r),a===0&&l===0&&c===0&&h===0)||(x=l6*s+r6*Math.abs(b),b+=D*h+I*a-(S*c+B*l),b>=x||-b>=x))return b;_=a*I,A=nn*a,f=A-(A-a),d=a-f,A=nn*I,g=A-(A-I),v=I-g,E=d*v-(_-f*g-d*g-f*v),T=l*B,A=nn*l,f=A-(A-l),d=l-f,A=nn*B,g=A-(A-B),v=B-g,P=d*v-(T-f*g-d*g-f*v),y=E-P,u=E-y,un[0]=E-(y+u)+(u-P),m=_+y,u=m-_,w=_-(m-u)+(y-u),y=w-T,u=w-y,un[1]=w-(y+u)+(u-T),F=m+y,u=F-m,un[2]=m-(F-u)+(y-u),un[3]=F;const U=tv(4,Cs,4,un,TS);_=D*h,A=nn*D,f=A-(A-D),d=D-f,A=nn*h,g=A-(A-h),v=h-g,E=d*v-(_-f*g-d*g-f*v),T=S*c,A=nn*S,f=A-(A-S),d=S-f,A=nn*c,g=A-(A-c),v=c-g,P=d*v-(T-f*g-d*g-f*v),y=E-P,u=E-y,un[0]=E-(y+u)+(u-P),m=_+y,u=m-_,w=_-(m-u)+(y-u),y=w-T,u=w-y,un[1]=w-(y+u)+(u-T),F=m+y,u=F-m,un[2]=m-(F-u)+(y-u),un[3]=F;const k=tv(U,TS,4,un,IS);_=a*h,A=nn*a,f=A-(A-a),d=a-f,A=nn*h,g=A-(A-h),v=h-g,E=d*v-(_-f*g-d*g-f*v),T=l*c,A=nn*l,f=A-(A-l),d=l-f,A=nn*c,g=A-(A-c),v=c-g,P=d*v-(T-f*g-d*g-f*v),y=E-P,u=E-y,un[0]=E-(y+u)+(u-P),m=_+y,u=m-_,w=_-(m-u)+(y-u),y=w-T,u=w-y,un[1]=w-(y+u)+(u-T),F=m+y,u=F-m,un[2]=m-(F-u)+(y-u),un[3]=F;const M=tv(k,IS,4,un,kS);return kS[M-1]}function Xl(t,n,e,i,o,r){const s=(n-r)*(e-o),a=(t-o)*(i-r),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=a6*c?l:-u6(t,n,e,i,o,r,c)}const $l=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,nv=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let io=Number.EPSILON;io===void 0&&(io=Math.pow(2,-52));const c6=io*io,FS=(t,n)=>{if(-io<t&&t<io&&-io<n&&n<io)return 0;const e=t-n;return e*e<c6*t*n?0:t<n?-1:1};class h6{constructor(){this.reset()}reset(){this.xRounder=new BS,this.yRounder=new BS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class BS{constructor(){this.tree=new Yy,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&FS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&FS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const Yl=new h6,hf=(t,n)=>t.x*n.y-t.y*n.x,MS=(t,n)=>t.x*n.x+t.y*n.y,DS=(t,n,e)=>{const i=Xl(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},Af=t=>Math.sqrt(MS(t,t)),A6=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return hf(o,i)/Af(o)/Af(i)},f6=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return MS(o,i)/Af(o)/Af(i)},RS=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},US=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},d6=(t,n,e,i)=>{if(n.x===0)return US(e,i,t.x);if(i.x===0)return US(t,n,e.x);if(n.y===0)return RS(e,i,t.y);if(i.y===0)return RS(t,n,e.y);const o=hf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},s=hf(r,n)/o,a=hf(r,i)/o,l=t.x+a*n.x,c=e.x+s*i.x,h=t.y+a*n.y,u=e.y+s*i.y,A=(l+c)/2,f=(h+u)/2;return{x:A,y:f}};class Gn{static compare(n,e){const i=Gn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:ro.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:A6(this.point,n.point,r.point),cosine:f6(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:s,cosine:a}=e.get(o),{sine:l,cosine:c}=e.get(r);return s>=0&&l>=0?a<c?1:a>c?-1:0:s<0&&l<0?a<c?-1:a>c?1:0:l<s?-1:l>s?1:0}}}let p6=0;class ro{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,s=e.rightSE.point.x;if(s<i)return 1;if(r<o)return-1;const a=n.leftSE.point.y,l=e.leftSE.point.y,c=n.rightSE.point.y,h=e.rightSE.point.y;if(i<o){if(l<a&&l<c)return 1;if(l>a&&l>c)return-1;const u=n.comparePoint(e.leftSE.point);if(u<0)return 1;if(u>0)return-1;const A=e.comparePoint(n.rightSE.point);return A!==0?A:-1}if(i>o){if(a<l&&a<h)return-1;if(a>l&&a>h)return 1;const u=e.comparePoint(n.leftSE.point);if(u!==0)return u;const A=n.comparePoint(e.rightSE.point);return A<0?1:A>0?-1:1}if(a<l)return-1;if(a>l)return 1;if(r<s){const u=e.comparePoint(n.rightSE.point);if(u!==0)return u}if(r>s){const u=n.comparePoint(e.rightSE.point);if(u<0)return 1;if(u>0)return-1}if(r!==s){const u=c-a,A=r-i,f=h-l,d=s-o;if(u>A&&f<d)return 1;if(u<A&&f>d)return-1}return r>s?1:r<s||c<h?-1:c>h?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++p6,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,s;const a=Gn.comparePoints(n,e);if(a<0)o=n,r=e,s=1;else if(a>0)o=e,r=n,s=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Gn(o,!0),c=new Gn(r,!1);return new ro(l,c,[i],[s])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,s=e.x+r*o.x;if(n.x===s)return 0;const a=(n.x-e.x)/o.x,l=e.y+a*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=nv(e,i);if(o===null)return null;const r=this.leftSE.point,s=this.rightSE.point,a=n.leftSE.point,l=n.rightSE.point,c=$l(e,a)&&this.comparePoint(a)===0,h=$l(i,r)&&n.comparePoint(r)===0,u=$l(e,l)&&this.comparePoint(l)===0,A=$l(i,s)&&n.comparePoint(s)===0;if(h&&c)return A&&!u?s:!A&&u?l:null;if(h)return u&&r.x===l.x&&r.y===l.y?null:r;if(c)return A&&s.x===a.x&&s.y===a.y?null:a;if(A&&u)return null;if(A)return s;if(u)return l;const f=d6(r,this.vector(),a,n.vector());return f===null||!$l(o,f)?null:Yl.round(f.x,f.y)}split(n){const e=[],i=n.events!==void 0,o=new Gn(n,!0),r=new Gn(n,!1),s=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const a=new ro(o,s,this.rings.slice(),this.windings.slice());return Gn.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Gn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=ro.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,s=i.rings.length;r<s;r++){const a=i.rings[r],l=i.windings[r],c=e.rings.indexOf(a);c===-1?(e.rings.push(a),e.windings.push(l)):e.windings[c]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let a=0,l=this.rings.length;a<l;a++){const c=this.rings[a],h=this.windings[a],u=e.indexOf(c);u===-1?(e.push(c),i.push(h)):i[u]+=h}const r=[],s=[];for(let a=0,l=e.length;a<l;a++){if(i[a]===0)continue;const c=e[a],h=c.poly;if(s.indexOf(h)===-1)if(c.isExterior)r.push(h);else{s.indexOf(h)===-1&&s.push(h);const u=r.indexOf(c.poly);u!==-1&&r.splice(u,1)}}for(let a=0,l=r.length;a<l;a++){const c=r[a].multiPoly;o.indexOf(c)===-1&&o.push(c)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(ni.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===ni.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${ni.type}`)}return this._isInResult}}class OS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Yl.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let s=1,a=n.length;s<a;s++){if(typeof n[s][0]!="number"||typeof n[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=Yl.round(n[s][0],n[s][1]);l.x===r.x&&l.y===r.y||(this.segments.push(ro.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(ro.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class m6{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new OS(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let i=1,o=n.length;i<o;i++){const r=new OS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,s=o.length;r<s;r++)n.push(o[r])}return n}}class LS{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,o=n.length;i<o;i++){const r=new m6(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,s=o.length;r<s;r++)n.push(o[r])}return n}}class ff{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let s=null,a=r.leftSE,l=r.rightSE;const c=[a],h=a.point,u=[];for(;s=a,a=l,c.push(a),a.point!==h;)for(;;){const A=a.getAvailableLinkedEvents();if(A.length===0){const g=c[0].point,v=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${g.x}, ${g.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(A.length===1){l=A[0].otherSE;break}let f=null;for(let g=0,v=u.length;g<v;g++)if(u[g].point===a.point){f=g;break}if(f!==null){const g=u.splice(f)[0],v=c.splice(g.index);v.unshift(v[0].otherSE),e.push(new ff(v.reverse()));continue}u.push({index:c.length,point:a.point});const d=a.getLeftmostComparator(s);l=A.sort(d)[0].otherSE;break}e.push(new ff(c))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let c=1,h=this.events.length-1;c<h;c++){const u=this.events[c].point,A=this.events[c+1].point;DS(u,n,A)!==0&&(e.push(u),n=u)}if(e.length===1)return null;const i=e[0],o=e[1];DS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,s=this.isExteriorRing()?0:e.length-1,a=this.isExteriorRing()?e.length:-1,l=[];for(let c=s;c!=a;c+=r)l.push([e[c].x,e[c].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const s=this.events[o];Gn.compare(n,s)>0&&(n=s)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class zS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class g6{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new zS(r));else{const s=r.enclosingRing();s.poly||e.push(new zS(s)),s.poly.addInterior(r)}}return e}}class y6{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ro.compare;this.queue=n,this.tree=new Yy(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r=o,s=o,a,l;for(;a===void 0;)r=this.tree.prev(r),r===null?a=null:r.key.consumedBy===void 0&&(a=r.key);for(;l===void 0;)s=this.tree.next(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);if(n.isLeft){let c=null;if(a){const u=a.getIntersection(e);if(u!==null&&(e.isAnEndpoint(u)||(c=u),!a.isAnEndpoint(u))){const A=this._splitSafely(a,u);for(let f=0,d=A.length;f<d;f++)i.push(A[f])}}let h=null;if(l){const u=l.getIntersection(e);if(u!==null&&(e.isAnEndpoint(u)||(h=u),!l.isAnEndpoint(u))){const A=this._splitSafely(l,u);for(let f=0,d=A.length;f<d;f++)i.push(A[f])}}if(c!==null||h!==null){let u=null;c===null?u=h:h===null?u=c:u=Gn.comparePoints(c,h)<=0?c:h,this.queue.remove(e.rightSE),i.push(e.rightSE);const A=e.split(u);for(let f=0,d=A.length;f<d;f++)i.push(A[f])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=a)}else{if(a&&l){const c=a.getIntersection(l);if(c!==null){if(!a.isAnEndpoint(c)){const h=this._splitSafely(a,c);for(let u=0,A=h.length;u<A;u++)i.push(h[u])}if(!l.isAnEndpoint(c)){const h=this._splitSafely(l,c);for(let u=0,A=h.length;u<A;u++)i.push(h[u])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const QS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,v6=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class w6{run(n,e,i){ni.type=n,Yl.reset();const o=[new LS(e,!0)];for(let u=0,A=i.length;u<A;u++)o.push(new LS(i[u],!1));if(ni.numMultiPolys=o.length,ni.type==="difference"){const u=o[0];let A=1;for(;A<o.length;)nv(o[A].bbox,u.bbox)!==null?A++:o.splice(A,1)}if(ni.type==="intersection")for(let u=0,A=o.length;u<A;u++){const f=o[u];for(let d=u+1,g=o.length;d<g;d++)if(nv(f.bbox,o[d].bbox)===null)return[]}const r=new Yy(Gn.compare);for(let u=0,A=o.length;u<A;u++){const f=o[u].getSweepEvents();for(let d=0,g=f.length;d<g;d++)if(r.insert(f[d]),r.size>QS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const s=new y6(r);let a=r.size,l=r.pop();for(;l;){const u=l.key;if(r.size===a){const f=u.segment;throw new Error(`Unable to pop() ${u.isLeft?"left":"right"} SweepEvent [${u.point.x}, ${u.point.y}] from segment #${f.id} [${f.leftSE.point.x}, ${f.leftSE.point.y}] -> [${f.rightSE.point.x}, ${f.rightSE.point.y}] from queue.`)}if(r.size>QS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(s.segments.length>v6)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const A=s.process(u);for(let f=0,d=A.length;f<d;f++){const g=A[f];g.consumedBy===void 0&&r.insert(g)}a=r.size,l=r.pop()}Yl.reset();const c=ff.factory(s.segments);return new g6(c).getGeom()}}const ni=new w6;var b6={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return ni.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return ni.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return ni.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return ni.run("difference",t,e)}};function df(t,n,e){e===void 0&&(e={});var i=Ei(t),o=Ei(n),r=b6.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?sn(r[0],e.properties):hL(r,e.properties)}function _6(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],s=t[2],a=t[3],l=(r+a)/2,c=(o+s)/2,h=n*2/Pi([o,l],[s,l],e),u=h*(s-o),A=n*2/Pi([c,r],[c,a],e),f=A*(a-r),d=u/2,g=d*2,v=Math.sqrt(3)/2*f,y=s-o,m=a-r,w=3/4*g,_=v,E=(y-g)/(g-d/2),T=Math.floor(E),P=(T*w-d/2-y)/2-d/2+w/2,F=Math.floor((m-v)/v),D=(m-F*v)/2,B=F*v-m>v/2;B&&(D-=v/4);for(var S=[],I=[],b=0;b<6;b++){var x=2*Math.PI/6*b;S.push(Math.cos(x)),I.push(Math.sin(x))}for(var U=[],k=0;k<=T;k++)for(var M=0;M<=F;M++){var R=k%2===1;if(!(M===0&&R)&&!(M===0&&B)){var O=k*w+o-P,z=M*_+r+D;if(R&&(z-=v/2),e.triangles===!0)x6([O,z],u/2,f/2,JSON.parse(i),S,I).forEach(function(H){e.mask?df(e.mask,H)&&U.push(H):U.push(H)});else{var V=C6([O,z],u/2,f/2,JSON.parse(i),S,I);e.mask?df(e.mask,V)&&U.push(V):U.push(V)}}}return xi(U)}function C6(t,n,e,i,o,r){for(var s=[],a=0;a<6;a++){var l=t[0]+n*o[a],c=t[1]+e*r[a];s.push([l,c])}return s.push(s[0].slice()),sn([s],i)}function x6(t,n,e,i,o,r){for(var s=[],a=0;a<6;a++){var l=[];l.push(t),l.push([t[0]+n*o[a],t[1]+e*r[a]]),l.push([t[0]+n*o[(a+1)%6],t[1]+e*r[(a+1)%6]]),l.push(t),s.push(sn([l],i))}return s}function S6(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],s=t[1],a=t[2],l=t[3],c=n/Pi([r,s],[a,s],i),h=c*(a-r),u=e/Pi([r,s],[r,l],i),A=u*(l-s),f=a-r,d=l-s,g=Math.floor(f/h),v=Math.floor(d/A),y=(f-g*h)/2,m=(d-v*A)/2,w=r+y,_=0;_<g;_++){for(var E=s+m,T=0;T<v;T++){var P=sn([[[w,E],[w,E+A],[w+h,E+A],[w+h,E],[w,E]]],i.properties);i.mask?Yz(i.mask,P)&&o.push(P):o.push(P),E+=A}w+=h}return xi(o)}function E6(t,n,e){return e===void 0&&(e={}),S6(t,n,n,e)}function P6(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Pi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),s=n/Pi([t[0],t[1]],[t[0],t[3]],e),a=s*(t[3]-t[1]),l=0,c=t[0];c<=t[2];){for(var h=0,u=t[1];u<=t[3];){var A=null,f=null;l%2===0&&h%2===0?(A=sn([[[c,u],[c,u+a],[c+r,u],[c,u]]],e.properties),f=sn([[[c,u+a],[c+r,u+a],[c+r,u],[c,u+a]]],e.properties)):l%2===0&&h%2===1?(A=sn([[[c,u],[c+r,u+a],[c+r,u],[c,u]]],e.properties),f=sn([[[c,u],[c,u+a],[c+r,u+a],[c,u]]],e.properties)):h%2===0&&l%2===1?(A=sn([[[c,u],[c,u+a],[c+r,u+a],[c,u]]],e.properties),f=sn([[[c,u],[c+r,u+a],[c+r,u],[c,u]]],e.properties)):h%2===1&&l%2===1&&(A=sn([[[c,u],[c,u+a],[c+r,u],[c,u]]],e.properties),f=sn([[[c,u+a],[c+r,u+a],[c+r,u],[c,u+a]]],e.properties)),e.mask?(df(e.mask,A)&&i.push(A),df(e.mask,f)&&i.push(f)):(i.push(A),i.push(f)),u+=a,h++}l++,c+=r}return xi(i)}function T6(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(fL(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var s=$o(t),a;switch(i){case"point":case"points":a=ex(s,n,e);break;case"square":case"squares":a=E6(s,n,e);break;case"hex":case"hexes":a=_6(s,n,e);break;case"triangle":case"triangles":a=P6(s,n,e);break;default:throw new Error("invalid gridType")}var l=[];return rf(a,function(c){var h=0,u=0;rf(t,function(f){var d=i==="point"?c:WL(c),g=Pi(d,f,e),v;if(o!==void 0&&(v=f.properties[o]),v===void 0&&(v=f.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");g===0&&(h=v);var y=1/Math.pow(g,r);u+=y,h+=y*v});var A=NL(c);A.properties[o]=h/u,l.push(A)}),xi(l)}function I6(t,n,e){const i=C.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=C.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=C.Cartesian3.subtract(o,i,new C.Cartesian3);C.Cartesian3.normalize(r,r);const s=new C.Ray(i,r),a=e.pickFromRay(s);return!!(e.globe.pick(s,e)||a)}const VS=(t=0)=>new Promise(n=>setTimeout(n,t));function k6(t,n){const e=xi(t.map(l=>eo(l))),i=sn([t]);return T6(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>ln(eo(l),i))}function F6(t){const n=C.JulianDate.fromDate(t),e=C.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ls(e)}function B6(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,s=t[3]+(n[3]-t[3])*e;return[i,o,r,s]}const bc=class bc extends Tn{constructor(e,i){super(e,i);L(this,"czmPointPrimitiveCollection");L(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new za(i,e.id));this.czmPointPrimitiveCollection=r,this.d(p.track([r,"show"],[e,"show"]));{const s=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const l=[...e.points,e.points[0]],c=e.sampleDistance,h=k6(l,c).map(w=>[...w,e.height]),u=Math.floor(e.extrudedHeight/c);if(u>0){const w=[...h];for(let _=1;_<=u;_++)h.push(...w.map(E=>[E[0],E[1],e.height+_*c]))}const{startTime:A,endTime:f,spanTime:d}=e,g=d*36e5,v=Math.floor((f-A)/g),y=Array(h.length).fill(0);e:for(let w=0;w<v;w++){if(await VS(),this._stopRun)break e;const _=new Date(A+w*g),E=F6(_);t:for(let T=0;T<h.length;T++){if(await VS(),this._stopRun)break t;I6(h[T],E,o.scene)||(y[T]=(y[T]*v+1)/v)}!this._stopRun&&(e.progress=Number(((w+1)/v*100).toFixed(2)))}const m=h.map((w,_)=>({position:[...w],color:B6(e.startColor,e.endColor,y[_]),pixelSize:10}));r.pointPrimitiveOptions=m},a=this.dv(p.createProcessingFromAsyncFunc(async l=>{await l.promise(s())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,a.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,a.isRunning&&a.cancel()}))}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;if(!s||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(s.positions){const a=[...s.positions];return s.positions.forEach(l=>{a.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,a,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;if(!s||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(s.positions){const a=[...s.positions];return s.positions.forEach(l=>{a.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,a,e),!0}return!1}};L(bc,"type",bc.register("ESCesiumViewer",Q.ESSunshineAnalysis.type,bc));let iv=bc;const HS=Math.pow(2,-52),pf=new Uint32Array(512);class rv{static from(n,e=O6,i=L6){const o=n.length,r=new Float64Array(o*2);for(let s=0;s<o;s++){const a=n[s];r[2*s]=e(a),r[2*s+1]=i(a)}return new rv(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,s=n.length>>1;let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let D=0;D<s;D++){const B=n[2*D],S=n[2*D+1];B<a&&(a=B),S<l&&(l=S),B>c&&(c=B),S>h&&(h=S),this._ids[D]=D}const u=(a+c)/2,A=(l+h)/2;let f,d,g;for(let D=0,B=1/0;D<s;D++){const S=ov(u,A,n[2*D],n[2*D+1]);S<B&&(f=D,B=S)}const v=n[2*f],y=n[2*f+1];for(let D=0,B=1/0;D<s;D++){if(D===f)continue;const S=ov(v,y,n[2*D],n[2*D+1]);S<B&&S>0&&(d=D,B=S)}let m=n[2*d],w=n[2*d+1],_=1/0;for(let D=0;D<s;D++){if(D===f||D===d)continue;const B=R6(v,y,m,w,n[2*D],n[2*D+1]);B<_&&(g=D,_=B)}let E=n[2*g],T=n[2*g+1];if(_===1/0){for(let S=0;S<s;S++)this._dists[S]=n[2*S]-n[0]||n[2*S+1]-n[1];xs(this._ids,this._dists,0,s-1);const D=new Uint32Array(s);let B=0;for(let S=0,I=-1/0;S<s;S++){const b=this._ids[S],x=this._dists[b];x>I&&(D[B++]=b,I=x)}this.hull=D.subarray(0,B),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Xl(v,y,m,w,E,T)<0){const D=d,B=m,S=w;d=g,m=E,w=T,g=D,E=B,T=S}const P=U6(v,y,m,w,E,T);this._cx=P.x,this._cy=P.y;for(let D=0;D<s;D++)this._dists[D]=ov(n[2*D],n[2*D+1],P.x,P.y);xs(this._ids,this._dists,0,s-1),this._hullStart=f;let F=3;i[f]=e[g]=d,i[d]=e[f]=g,i[g]=e[d]=f,o[f]=0,o[d]=1,o[g]=2,r.fill(-1),r[this._hashKey(v,y)]=f,r[this._hashKey(m,w)]=d,r[this._hashKey(E,T)]=g,this.trianglesLen=0,this._addTriangle(f,d,g,-1,-1,-1);for(let D=0,B,S;D<this._ids.length;D++){const I=this._ids[D],b=n[2*I],x=n[2*I+1];if(D>0&&Math.abs(b-B)<=HS&&Math.abs(x-S)<=HS||(B=b,S=x,I===f||I===d||I===g))continue;let U=0;for(let z=0,V=this._hashKey(b,x);z<this._hashSize&&(U=r[(V+z)%this._hashSize],!(U!==-1&&U!==i[U]));z++);U=e[U];let k=U,M;for(;M=i[k],Xl(b,x,n[2*k],n[2*k+1],n[2*M],n[2*M+1])>=0;)if(k=M,k===U){k=-1;break}if(k===-1)continue;let R=this._addTriangle(k,I,i[k],-1,-1,o[k]);o[I]=this._legalize(R+2),o[k]=R,F++;let O=i[k];for(;M=i[O],Xl(b,x,n[2*O],n[2*O+1],n[2*M],n[2*M+1])<0;)R=this._addTriangle(O,I,M,o[I],-1,o[O]),o[I]=this._legalize(R+2),i[O]=O,F--,O=M;if(k===U)for(;M=e[k],Xl(b,x,n[2*M],n[2*M+1],n[2*k],n[2*k+1])<0;)R=this._addTriangle(M,I,k,-1,o[k],o[M]),this._legalize(R+2),o[M]=R,i[k]=k,F--,k=M;this._hullStart=e[I]=k,i[k]=e[O]=I,i[I]=O,r[this._hashKey(b,x)]=I,r[this._hashKey(n[2*k],n[2*k+1])]=k}this.hull=new Uint32Array(F);for(let D=0,B=this._hullStart;D<F;D++)this.hull[D]=B,B=i[B];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(M6(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,s=0;for(;;){const a=i[n],l=n-n%3;if(s=l+(n+2)%3,a===-1){if(r===0)break;n=pf[--r];continue}const c=a-a%3,h=l+(n+1)%3,u=c+(a+2)%3,A=e[s],f=e[n],d=e[h],g=e[u];if(D6(o[2*A],o[2*A+1],o[2*f],o[2*f+1],o[2*d],o[2*d+1],o[2*g],o[2*g+1])){e[n]=g,e[a]=A;const y=i[u];if(y===-1){let w=this._hullStart;do{if(this._hullTri[w]===u){this._hullTri[w]=n;break}w=this._hullPrev[w]}while(w!==this._hullStart)}this._link(n,y),this._link(a,i[s]),this._link(s,u);const m=c+(a+1)%3;r<pf.length&&(pf[r++]=m)}else{if(r===0)break;n=pf[--r]}}return s}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,s){const a=this.trianglesLen;return this._triangles[a]=n,this._triangles[a+1]=e,this._triangles[a+2]=i,this._link(a,o),this._link(a+1,r),this._link(a+2,s),this.trianglesLen+=3,a}}function M6(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function ov(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function D6(t,n,e,i,o,r,s,a){const l=t-s,c=n-a,h=e-s,u=i-a,A=o-s,f=r-a,d=l*l+c*c,g=h*h+u*u,v=A*A+f*f;return l*(u*v-g*f)-c*(h*v-g*A)+d*(h*f-u*A)<0}function R6(t,n,e,i,o,r){const s=e-t,a=i-n,l=o-t,c=r-n,h=s*s+a*a,u=l*l+c*c,A=.5/(s*c-a*l),f=(c*h-a*u)*A,d=(s*u-l*h)*A;return f*f+d*d}function U6(t,n,e,i,o,r){const s=e-t,a=i-n,l=o-t,c=r-n,h=s*s+a*a,u=l*l+c*c,A=.5/(s*c-a*l),f=t+(c*h-a*u)*A,d=n+(s*u-l*h)*A;return{x:f,y:d}}function xs(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],s=n[r];let a=o-1;for(;a>=e&&n[t[a]]>s;)t[a+1]=t[a--];t[a+1]=r}else{const o=e+i>>1;let r=e+1,s=i;Jl(t,o,r),n[t[e]]>n[t[i]]&&Jl(t,e,i),n[t[r]]>n[t[i]]&&Jl(t,r,i),n[t[e]]>n[t[r]]&&Jl(t,e,r);const a=t[r],l=n[a];for(;;){do r++;while(n[t[r]]<l);do s--;while(n[t[s]]>l);if(s<r)break;Jl(t,r,s)}t[e+1]=t[s],t[s]=a,i-r+1>=s-e?(xs(t,n,r,i),xs(t,n,e,s-1)):(xs(t,n,e,s-1),xs(t,n,r,i))}}function Jl(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function O6(t){return t[0]}function L6(t){return t[1]}const NS=(t=0)=>new Promise(n=>setTimeout(n,t)),ra=class ra extends p.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new p.Event));L(this,"_startEvent",this.disposeVar(new p.Event));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_geoPolyline");L(this,"_customPrimitive");L(this,"_geoDivPoi");L(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Je(e,i)),this._customPrimitive=this.disposeVar(new st(e,i)),this._geoDivPoi=this.disposeVar(new wt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Ui(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.dispose(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
4098
|
+
***************************************************************************** */function jz(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(h){return l([c,h])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=c[0]&2?o.return:c[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,c[1])).done)return r;switch(o=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++,o=c[1],c=[0];continue;case 7:c=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){e.label=c[1];break}if(c[0]===6&&e.label<r[1]){e.label=r[1],r=c;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(c);break}r[2]&&e.ops.pop(),e.trys.pop();continue}c=n.call(t,e)}catch(h){c=[6,h],o=0}finally{i=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var to=function(){function t(n,e){this.next=null,this.key=n,this.data=e,this.left=null,this.right=null}return t}();function e6(t,n){return t>n?1:t<n?-1:0}function no(t,n,e){for(var i=new to(null,null),o=i,r=i;;){var s=e(t,n.key);if(s<0){if(n.left===null)break;if(e(t,n.left.key)<0){var a=n.left;if(n.left=a.right,a.right=n,n=a,n.left===null)break}r.left=n,r=n,n=n.left}else if(s>0){if(n.right===null)break;if(e(t,n.right.key)>0){var a=n.right;if(n.right=a.left,a.left=n,n=a,n.right===null)break}o.right=n,o=n,n=n.right}else break}return o.right=n.left,r.left=n.right,n.left=i.right,n.right=i.left,n}function Xy(t,n,e,i){var o=new to(t,n);if(e===null)return o.left=o.right=null,o;e=no(t,e,i);var r=i(t,e.key);return r<0?(o.left=e.left,o.right=e,e.left=null):r>=0&&(o.right=e.right,o.left=e,e.right=null),o}function PS(t,n,e){var i=null,o=null;if(n){n=no(t,n,e);var r=e(n.key,t);r===0?(i=n.left,o=n.right):r<0?(o=n.right,n.right=null,i=n):(i=n.left,n.left=null,o=n)}return{left:i,right:o}}function t6(t,n,e){return n===null?t:(t===null||(n=no(t.key,n,e),n.left=t),n)}function $y(t,n,e,i,o){if(t){i(""+n+(e?"└── ":"├── ")+o(t)+`
|
|
4099
|
+
`);var r=n+(e?" ":"│ ");t.left&&$y(t.left,r,!1,i,o),t.right&&$y(t.right,r,!0,i,o)}}var Yy=function(){function t(n){n===void 0&&(n=e6),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=Xy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new to(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=no(n,this._root,o),s=o(n,r.key);return s===0?this._root=r:(s<0?(i.left=r.left,i.right=r,r.left=null):s>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=no(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=no(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=no(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=no(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],s=this._comparator,a=this._root,l;r.length!==0||a;)if(a)r.push(a),a=a.left;else{if(a=r.pop(),l=s(a.key,e),l>0)break;if(s(a.key,n)>=0&&i.call(o,a))return this;a=a.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return i6(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&ev(n,e,0,o-1,r),this._root===null)this._root=Jy(n,e,0,o),this._size=o;else{var s=r6(this.toList(),n6(n,e),r);o=this._size+o,this._root=jy({head:s},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return $y(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=PS(n,this._root,o),s=r.left,a=r.right;o(n,e)<0?a=Xy(e,i,a,o):s=Xy(e,i,s,o),this._root=t6(s,a,o)},t.prototype.split=function(n){return PS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return jz(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Jy(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),s=t[r],a=n[r],l=new to(s,a);return l.left=Jy(t,n,e,r),l.right=Jy(t,n,r+1,i),l}return null}function n6(t,n){for(var e=new to(null,null),i=e,o=0;o<t.length;o++)i=i.next=new to(t[o],n[o]);return i.next=null,e.next}function i6(t){for(var n=t,e=[],i=!1,o=new to(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function jy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=jy(t,n,o),s=t.head;return s.left=r,t.head=t.head.next,s.right=jy(t,o+1,e),s}return null}function r6(t,n,e){for(var i=new to(null,null),o=i,r=t,s=n;r!==null&&s!==null;)e(r.key,s.key)<0?(o.next=r,r=r.next):(o.next=s,s=s.next),o=o.next;return r!==null?o.next=r:s!==null&&(o.next=s),i.next}function ev(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],s=e-1,a=i+1;;){do s++;while(o(t[s],r)<0);do a--;while(o(t[a],r)>0);if(s>=a)break;var l=t[s];t[s]=t[a],t[a]=l,l=n[s],n[s]=n[a],n[a]=l}ev(t,n,e,a,o),ev(t,n,a+1,i,o)}}const nr=11102230246251565e-32,nn=134217729,o6=(3+8*nr)*nr;function tv(t,n,e,i,o){let r,s,a,l,c=n[0],h=i[0],u=0,A=0;h>c==h>-c?(r=c,c=n[++u]):(r=h,h=i[++A]);let f=0;if(u<t&&A<e)for(h>c==h>-c?(s=c+r,a=r-(s-c),c=n[++u]):(s=h+r,a=r-(s-h),h=i[++A]),r=s,a!==0&&(o[f++]=a);u<t&&A<e;)h>c==h>-c?(s=r+c,l=s-r,a=r-(s-l)+(c-l),c=n[++u]):(s=r+h,l=s-r,a=r-(s-l)+(h-l),h=i[++A]),r=s,a!==0&&(o[f++]=a);for(;u<t;)s=r+c,l=s-r,a=r-(s-l)+(c-l),c=n[++u],r=s,a!==0&&(o[f++]=a);for(;A<e;)s=r+h,l=s-r,a=r-(s-l)+(h-l),h=i[++A],r=s,a!==0&&(o[f++]=a);return(r!==0||f===0)&&(o[f++]=r),f}function a6(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function Zl(t){return new Float64Array(t)}const s6=(3+16*nr)*nr,l6=(2+12*nr)*nr,u6=(9+64*nr)*nr*nr,Cs=Zl(4),TS=Zl(8),IS=Zl(12),kS=Zl(16),un=Zl(4);function c6(t,n,e,i,o,r,s){let a,l,c,h,u,A,f,d,g,v,y,m,w,_,E,T,P,F;const D=t-o,B=e-o,S=n-r,I=i-r;_=D*I,A=nn*D,f=A-(A-D),d=D-f,A=nn*I,g=A-(A-I),v=I-g,E=d*v-(_-f*g-d*g-f*v),T=S*B,A=nn*S,f=A-(A-S),d=S-f,A=nn*B,g=A-(A-B),v=B-g,P=d*v-(T-f*g-d*g-f*v),y=E-P,u=E-y,Cs[0]=E-(y+u)+(u-P),m=_+y,u=m-_,w=_-(m-u)+(y-u),y=w-T,u=w-y,Cs[1]=w-(y+u)+(u-T),F=m+y,u=F-m,Cs[2]=m-(F-u)+(y-u),Cs[3]=F;let b=a6(4,Cs),x=l6*s;if(b>=x||-b>=x||(u=t-D,a=t-(D+u)+(u-o),u=e-B,c=e-(B+u)+(u-o),u=n-S,l=n-(S+u)+(u-r),u=i-I,h=i-(I+u)+(u-r),a===0&&l===0&&c===0&&h===0)||(x=u6*s+o6*Math.abs(b),b+=D*h+I*a-(S*c+B*l),b>=x||-b>=x))return b;_=a*I,A=nn*a,f=A-(A-a),d=a-f,A=nn*I,g=A-(A-I),v=I-g,E=d*v-(_-f*g-d*g-f*v),T=l*B,A=nn*l,f=A-(A-l),d=l-f,A=nn*B,g=A-(A-B),v=B-g,P=d*v-(T-f*g-d*g-f*v),y=E-P,u=E-y,un[0]=E-(y+u)+(u-P),m=_+y,u=m-_,w=_-(m-u)+(y-u),y=w-T,u=w-y,un[1]=w-(y+u)+(u-T),F=m+y,u=F-m,un[2]=m-(F-u)+(y-u),un[3]=F;const U=tv(4,Cs,4,un,TS);_=D*h,A=nn*D,f=A-(A-D),d=D-f,A=nn*h,g=A-(A-h),v=h-g,E=d*v-(_-f*g-d*g-f*v),T=S*c,A=nn*S,f=A-(A-S),d=S-f,A=nn*c,g=A-(A-c),v=c-g,P=d*v-(T-f*g-d*g-f*v),y=E-P,u=E-y,un[0]=E-(y+u)+(u-P),m=_+y,u=m-_,w=_-(m-u)+(y-u),y=w-T,u=w-y,un[1]=w-(y+u)+(u-T),F=m+y,u=F-m,un[2]=m-(F-u)+(y-u),un[3]=F;const k=tv(U,TS,4,un,IS);_=a*h,A=nn*a,f=A-(A-a),d=a-f,A=nn*h,g=A-(A-h),v=h-g,E=d*v-(_-f*g-d*g-f*v),T=l*c,A=nn*l,f=A-(A-l),d=l-f,A=nn*c,g=A-(A-c),v=c-g,P=d*v-(T-f*g-d*g-f*v),y=E-P,u=E-y,un[0]=E-(y+u)+(u-P),m=_+y,u=m-_,w=_-(m-u)+(y-u),y=w-T,u=w-y,un[1]=w-(y+u)+(u-T),F=m+y,u=F-m,un[2]=m-(F-u)+(y-u),un[3]=F;const M=tv(k,IS,4,un,kS);return kS[M-1]}function Xl(t,n,e,i,o,r){const s=(n-r)*(e-o),a=(t-o)*(i-r),l=s-a,c=Math.abs(s+a);return Math.abs(l)>=s6*c?l:-c6(t,n,e,i,o,r,c)}const $l=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,nv=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let io=Number.EPSILON;io===void 0&&(io=Math.pow(2,-52));const h6=io*io,FS=(t,n)=>{if(-io<t&&t<io&&-io<n&&n<io)return 0;const e=t-n;return e*e<h6*t*n?0:t<n?-1:1};class A6{constructor(){this.reset()}reset(){this.xRounder=new BS,this.yRounder=new BS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class BS{constructor(){this.tree=new Yy,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&FS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&FS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const Yl=new A6,hf=(t,n)=>t.x*n.y-t.y*n.x,MS=(t,n)=>t.x*n.x+t.y*n.y,DS=(t,n,e)=>{const i=Xl(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},Af=t=>Math.sqrt(MS(t,t)),f6=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return hf(o,i)/Af(o)/Af(i)},d6=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return MS(o,i)/Af(o)/Af(i)},RS=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},US=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},p6=(t,n,e,i)=>{if(n.x===0)return US(e,i,t.x);if(i.x===0)return US(t,n,e.x);if(n.y===0)return RS(e,i,t.y);if(i.y===0)return RS(t,n,e.y);const o=hf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},s=hf(r,n)/o,a=hf(r,i)/o,l=t.x+a*n.x,c=e.x+s*i.x,h=t.y+a*n.y,u=e.y+s*i.y,A=(l+c)/2,f=(h+u)/2;return{x:A,y:f}};class Gn{static compare(n,e){const i=Gn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:ro.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:f6(this.point,n.point,r.point),cosine:d6(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:s,cosine:a}=e.get(o),{sine:l,cosine:c}=e.get(r);return s>=0&&l>=0?a<c?1:a>c?-1:0:s<0&&l<0?a<c?-1:a>c?1:0:l<s?-1:l>s?1:0}}}let m6=0;class ro{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,s=e.rightSE.point.x;if(s<i)return 1;if(r<o)return-1;const a=n.leftSE.point.y,l=e.leftSE.point.y,c=n.rightSE.point.y,h=e.rightSE.point.y;if(i<o){if(l<a&&l<c)return 1;if(l>a&&l>c)return-1;const u=n.comparePoint(e.leftSE.point);if(u<0)return 1;if(u>0)return-1;const A=e.comparePoint(n.rightSE.point);return A!==0?A:-1}if(i>o){if(a<l&&a<h)return-1;if(a>l&&a>h)return 1;const u=e.comparePoint(n.leftSE.point);if(u!==0)return u;const A=n.comparePoint(e.rightSE.point);return A<0?1:A>0?-1:1}if(a<l)return-1;if(a>l)return 1;if(r<s){const u=e.comparePoint(n.rightSE.point);if(u!==0)return u}if(r>s){const u=n.comparePoint(e.rightSE.point);if(u<0)return 1;if(u>0)return-1}if(r!==s){const u=c-a,A=r-i,f=h-l,d=s-o;if(u>A&&f<d)return 1;if(u<A&&f>d)return-1}return r>s?1:r<s||c<h?-1:c>h?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++m6,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,s;const a=Gn.comparePoints(n,e);if(a<0)o=n,r=e,s=1;else if(a>0)o=e,r=n,s=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Gn(o,!0),c=new Gn(r,!1);return new ro(l,c,[i],[s])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,s=e.x+r*o.x;if(n.x===s)return 0;const a=(n.x-e.x)/o.x,l=e.y+a*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=nv(e,i);if(o===null)return null;const r=this.leftSE.point,s=this.rightSE.point,a=n.leftSE.point,l=n.rightSE.point,c=$l(e,a)&&this.comparePoint(a)===0,h=$l(i,r)&&n.comparePoint(r)===0,u=$l(e,l)&&this.comparePoint(l)===0,A=$l(i,s)&&n.comparePoint(s)===0;if(h&&c)return A&&!u?s:!A&&u?l:null;if(h)return u&&r.x===l.x&&r.y===l.y?null:r;if(c)return A&&s.x===a.x&&s.y===a.y?null:a;if(A&&u)return null;if(A)return s;if(u)return l;const f=p6(r,this.vector(),a,n.vector());return f===null||!$l(o,f)?null:Yl.round(f.x,f.y)}split(n){const e=[],i=n.events!==void 0,o=new Gn(n,!0),r=new Gn(n,!1),s=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const a=new ro(o,s,this.rings.slice(),this.windings.slice());return Gn.comparePoints(a.leftSE.point,a.rightSE.point)>0&&a.swapEvents(),Gn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=ro.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,s=i.rings.length;r<s;r++){const a=i.rings[r],l=i.windings[r],c=e.rings.indexOf(a);c===-1?(e.rings.push(a),e.windings.push(l)):e.windings[c]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let a=0,l=this.rings.length;a<l;a++){const c=this.rings[a],h=this.windings[a],u=e.indexOf(c);u===-1?(e.push(c),i.push(h)):i[u]+=h}const r=[],s=[];for(let a=0,l=e.length;a<l;a++){if(i[a]===0)continue;const c=e[a],h=c.poly;if(s.indexOf(h)===-1)if(c.isExterior)r.push(h);else{s.indexOf(h)===-1&&s.push(h);const u=r.indexOf(c.poly);u!==-1&&r.splice(u,1)}}for(let a=0,l=r.length;a<l;a++){const c=r[a].multiPoly;o.indexOf(c)===-1&&o.push(c)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(ni.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===ni.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${ni.type}`)}return this._isInResult}}class OS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=Yl.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let s=1,a=n.length;s<a;s++){if(typeof n[s][0]!="number"||typeof n[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=Yl.round(n[s][0],n[s][1]);l.x===r.x&&l.y===r.y||(this.segments.push(ro.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(ro.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class g6{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new OS(n[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let i=1,o=n.length;i<o;i++){const r=new OS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,s=o.length;r<s;r++)n.push(o[r])}return n}}class LS{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let i=0,o=n.length;i<o;i++){const r=new g6(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,s=o.length;r<s;r++)n.push(o[r])}return n}}class ff{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let s=null,a=r.leftSE,l=r.rightSE;const c=[a],h=a.point,u=[];for(;s=a,a=l,c.push(a),a.point!==h;)for(;;){const A=a.getAvailableLinkedEvents();if(A.length===0){const g=c[0].point,v=c[c.length-1].point;throw new Error(`Unable to complete output ring starting at [${g.x}, ${g.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(A.length===1){l=A[0].otherSE;break}let f=null;for(let g=0,v=u.length;g<v;g++)if(u[g].point===a.point){f=g;break}if(f!==null){const g=u.splice(f)[0],v=c.splice(g.index);v.unshift(v[0].otherSE),e.push(new ff(v.reverse()));continue}u.push({index:c.length,point:a.point});const d=a.getLeftmostComparator(s);l=A.sort(d)[0].otherSE;break}e.push(new ff(c))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let c=1,h=this.events.length-1;c<h;c++){const u=this.events[c].point,A=this.events[c+1].point;DS(u,n,A)!==0&&(e.push(u),n=u)}if(e.length===1)return null;const i=e[0],o=e[1];DS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,s=this.isExteriorRing()?0:e.length-1,a=this.isExteriorRing()?e.length:-1,l=[];for(let c=s;c!=a;c+=r)l.push([e[c].x,e[c].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const s=this.events[o];Gn.compare(n,s)>0&&(n=s)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class zS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class y6{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new zS(r));else{const s=r.enclosingRing();s.poly||e.push(new zS(s)),s.poly.addInterior(r)}}return e}}class v6{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ro.compare;this.queue=n,this.tree=new Yy(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let r=o,s=o,a,l;for(;a===void 0;)r=this.tree.prev(r),r===null?a=null:r.key.consumedBy===void 0&&(a=r.key);for(;l===void 0;)s=this.tree.next(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);if(n.isLeft){let c=null;if(a){const u=a.getIntersection(e);if(u!==null&&(e.isAnEndpoint(u)||(c=u),!a.isAnEndpoint(u))){const A=this._splitSafely(a,u);for(let f=0,d=A.length;f<d;f++)i.push(A[f])}}let h=null;if(l){const u=l.getIntersection(e);if(u!==null&&(e.isAnEndpoint(u)||(h=u),!l.isAnEndpoint(u))){const A=this._splitSafely(l,u);for(let f=0,d=A.length;f<d;f++)i.push(A[f])}}if(c!==null||h!==null){let u=null;c===null?u=h:h===null?u=c:u=Gn.comparePoints(c,h)<=0?c:h,this.queue.remove(e.rightSE),i.push(e.rightSE);const A=e.split(u);for(let f=0,d=A.length;f<d;f++)i.push(A[f])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=a)}else{if(a&&l){const c=a.getIntersection(l);if(c!==null){if(!a.isAnEndpoint(c)){const h=this._splitSafely(a,c);for(let u=0,A=h.length;u<A;u++)i.push(h[u])}if(!l.isAnEndpoint(c)){const h=this._splitSafely(l,c);for(let u=0,A=h.length;u<A;u++)i.push(h[u])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const QS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,w6=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class b6{run(n,e,i){ni.type=n,Yl.reset();const o=[new LS(e,!0)];for(let u=0,A=i.length;u<A;u++)o.push(new LS(i[u],!1));if(ni.numMultiPolys=o.length,ni.type==="difference"){const u=o[0];let A=1;for(;A<o.length;)nv(o[A].bbox,u.bbox)!==null?A++:o.splice(A,1)}if(ni.type==="intersection")for(let u=0,A=o.length;u<A;u++){const f=o[u];for(let d=u+1,g=o.length;d<g;d++)if(nv(f.bbox,o[d].bbox)===null)return[]}const r=new Yy(Gn.compare);for(let u=0,A=o.length;u<A;u++){const f=o[u].getSweepEvents();for(let d=0,g=f.length;d<g;d++)if(r.insert(f[d]),r.size>QS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const s=new v6(r);let a=r.size,l=r.pop();for(;l;){const u=l.key;if(r.size===a){const f=u.segment;throw new Error(`Unable to pop() ${u.isLeft?"left":"right"} SweepEvent [${u.point.x}, ${u.point.y}] from segment #${f.id} [${f.leftSE.point.x}, ${f.leftSE.point.y}] -> [${f.rightSE.point.x}, ${f.rightSE.point.y}] from queue.`)}if(r.size>QS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(s.segments.length>w6)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const A=s.process(u);for(let f=0,d=A.length;f<d;f++){const g=A[f];g.consumedBy===void 0&&r.insert(g)}a=r.size,l=r.pop()}Yl.reset();const c=ff.factory(s.segments);return new y6(c).getGeom()}}const ni=new b6;var _6={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return ni.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return ni.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return ni.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return ni.run("difference",t,e)}};function df(t,n,e){e===void 0&&(e={});var i=Ei(t),o=Ei(n),r=_6.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?sn(r[0],e.properties):AL(r,e.properties)}function C6(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],s=t[2],a=t[3],l=(r+a)/2,c=(o+s)/2,h=n*2/Pi([o,l],[s,l],e),u=h*(s-o),A=n*2/Pi([c,r],[c,a],e),f=A*(a-r),d=u/2,g=d*2,v=Math.sqrt(3)/2*f,y=s-o,m=a-r,w=3/4*g,_=v,E=(y-g)/(g-d/2),T=Math.floor(E),P=(T*w-d/2-y)/2-d/2+w/2,F=Math.floor((m-v)/v),D=(m-F*v)/2,B=F*v-m>v/2;B&&(D-=v/4);for(var S=[],I=[],b=0;b<6;b++){var x=2*Math.PI/6*b;S.push(Math.cos(x)),I.push(Math.sin(x))}for(var U=[],k=0;k<=T;k++)for(var M=0;M<=F;M++){var R=k%2===1;if(!(M===0&&R)&&!(M===0&&B)){var O=k*w+o-P,z=M*_+r+D;if(R&&(z-=v/2),e.triangles===!0)S6([O,z],u/2,f/2,JSON.parse(i),S,I).forEach(function(H){e.mask?df(e.mask,H)&&U.push(H):U.push(H)});else{var V=x6([O,z],u/2,f/2,JSON.parse(i),S,I);e.mask?df(e.mask,V)&&U.push(V):U.push(V)}}}return xi(U)}function x6(t,n,e,i,o,r){for(var s=[],a=0;a<6;a++){var l=t[0]+n*o[a],c=t[1]+e*r[a];s.push([l,c])}return s.push(s[0].slice()),sn([s],i)}function S6(t,n,e,i,o,r){for(var s=[],a=0;a<6;a++){var l=[];l.push(t),l.push([t[0]+n*o[a],t[1]+e*r[a]]),l.push([t[0]+n*o[(a+1)%6],t[1]+e*r[(a+1)%6]]),l.push(t),s.push(sn([l],i))}return s}function E6(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],s=t[1],a=t[2],l=t[3],c=n/Pi([r,s],[a,s],i),h=c*(a-r),u=e/Pi([r,s],[r,l],i),A=u*(l-s),f=a-r,d=l-s,g=Math.floor(f/h),v=Math.floor(d/A),y=(f-g*h)/2,m=(d-v*A)/2,w=r+y,_=0;_<g;_++){for(var E=s+m,T=0;T<v;T++){var P=sn([[[w,E],[w,E+A],[w+h,E+A],[w+h,E],[w,E]]],i.properties);i.mask?Jz(i.mask,P)&&o.push(P):o.push(P),E+=A}w+=h}return xi(o)}function P6(t,n,e){return e===void 0&&(e={}),E6(t,n,n,e)}function T6(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Pi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),s=n/Pi([t[0],t[1]],[t[0],t[3]],e),a=s*(t[3]-t[1]),l=0,c=t[0];c<=t[2];){for(var h=0,u=t[1];u<=t[3];){var A=null,f=null;l%2===0&&h%2===0?(A=sn([[[c,u],[c,u+a],[c+r,u],[c,u]]],e.properties),f=sn([[[c,u+a],[c+r,u+a],[c+r,u],[c,u+a]]],e.properties)):l%2===0&&h%2===1?(A=sn([[[c,u],[c+r,u+a],[c+r,u],[c,u]]],e.properties),f=sn([[[c,u],[c,u+a],[c+r,u+a],[c,u]]],e.properties)):h%2===0&&l%2===1?(A=sn([[[c,u],[c,u+a],[c+r,u+a],[c,u]]],e.properties),f=sn([[[c,u],[c+r,u+a],[c+r,u],[c,u]]],e.properties)):h%2===1&&l%2===1&&(A=sn([[[c,u],[c,u+a],[c+r,u],[c,u]]],e.properties),f=sn([[[c,u+a],[c+r,u+a],[c+r,u],[c,u+a]]],e.properties)),e.mask?(df(e.mask,A)&&i.push(A),df(e.mask,f)&&i.push(f)):(i.push(A),i.push(f)),u+=a,h++}l++,c+=r}return xi(i)}function I6(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(dL(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var s=$o(t),a;switch(i){case"point":case"points":a=ex(s,n,e);break;case"square":case"squares":a=P6(s,n,e);break;case"hex":case"hexes":a=C6(s,n,e);break;case"triangle":case"triangles":a=T6(s,n,e);break;default:throw new Error("invalid gridType")}var l=[];return rf(a,function(c){var h=0,u=0;rf(t,function(f){var d=i==="point"?c:qL(c),g=Pi(d,f,e),v;if(o!==void 0&&(v=f.properties[o]),v===void 0&&(v=f.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");g===0&&(h=v);var y=1/Math.pow(g,r);u+=y,h+=y*v});var A=GL(c);A.properties[o]=h/u,l.push(A)}),xi(l)}function k6(t,n,e){const i=C.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=C.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=C.Cartesian3.subtract(o,i,new C.Cartesian3);C.Cartesian3.normalize(r,r);const s=new C.Ray(i,r),a=e.pickFromRay(s);return!!(e.globe.pick(s,e)||a)}const VS=(t=0)=>new Promise(n=>setTimeout(n,t));function F6(t,n){const e=xi(t.map(l=>eo(l))),i=sn([t]);return I6(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>ln(eo(l),i))}function B6(t){const n=C.JulianDate.fromDate(t),e=C.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ls(e)}function M6(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,s=t[3]+(n[3]-t[3])*e;return[i,o,r,s]}const bc=class bc extends Tn{constructor(e,i){super(e,i);L(this,"czmPointPrimitiveCollection");L(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new za(i,e.id));this.czmPointPrimitiveCollection=r,this.d(p.track([r,"show"],[e,"show"]));{const s=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const l=[...e.points,e.points[0]],c=e.sampleDistance,h=F6(l,c).map(w=>[...w,e.height]),u=Math.floor(e.extrudedHeight/c);if(u>0){const w=[...h];for(let _=1;_<=u;_++)h.push(...w.map(E=>[E[0],E[1],e.height+_*c]))}const{startTime:A,endTime:f,spanTime:d}=e,g=d*36e5,v=Math.floor((f-A)/g),y=Array(h.length).fill(0);e:for(let w=0;w<v;w++){if(await VS(),this._stopRun)break e;const _=new Date(A+w*g),E=B6(_);t:for(let T=0;T<h.length;T++){if(await VS(),this._stopRun)break t;k6(h[T],E,o.scene)||(y[T]=(y[T]*v+1)/v)}!this._stopRun&&(e.progress=Number(((w+1)/v*100).toFixed(2)))}const m=h.map((w,_)=>({position:[...w],color:M6(e.startColor,e.endColor,y[_]),pixelSize:10}));r.pointPrimitiveOptions=m},a=this.dv(p.createProcessingFromAsyncFunc(async l=>{await l.promise(s())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,a.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,a.isRunning&&a.cancel()}))}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;if(!s||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(s.positions){const a=[...s.positions];return s.positions.forEach(l=>{a.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,a,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:s}=this;if(!s||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(s.positions){const a=[...s.positions];return s.positions.forEach(l=>{a.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,a,e),!0}return!1}};L(bc,"type",bc.register("ESCesiumViewer",Q.ESSunshineAnalysis.type,bc));let iv=bc;const HS=Math.pow(2,-52),pf=new Uint32Array(512);class rv{static from(n,e=L6,i=z6){const o=n.length,r=new Float64Array(o*2);for(let s=0;s<o;s++){const a=n[s];r[2*s]=e(a),r[2*s+1]=i(a)}return new rv(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,s=n.length>>1;let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let D=0;D<s;D++){const B=n[2*D],S=n[2*D+1];B<a&&(a=B),S<l&&(l=S),B>c&&(c=B),S>h&&(h=S),this._ids[D]=D}const u=(a+c)/2,A=(l+h)/2;let f,d,g;for(let D=0,B=1/0;D<s;D++){const S=ov(u,A,n[2*D],n[2*D+1]);S<B&&(f=D,B=S)}const v=n[2*f],y=n[2*f+1];for(let D=0,B=1/0;D<s;D++){if(D===f)continue;const S=ov(v,y,n[2*D],n[2*D+1]);S<B&&S>0&&(d=D,B=S)}let m=n[2*d],w=n[2*d+1],_=1/0;for(let D=0;D<s;D++){if(D===f||D===d)continue;const B=U6(v,y,m,w,n[2*D],n[2*D+1]);B<_&&(g=D,_=B)}let E=n[2*g],T=n[2*g+1];if(_===1/0){for(let S=0;S<s;S++)this._dists[S]=n[2*S]-n[0]||n[2*S+1]-n[1];xs(this._ids,this._dists,0,s-1);const D=new Uint32Array(s);let B=0;for(let S=0,I=-1/0;S<s;S++){const b=this._ids[S],x=this._dists[b];x>I&&(D[B++]=b,I=x)}this.hull=D.subarray(0,B),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(Xl(v,y,m,w,E,T)<0){const D=d,B=m,S=w;d=g,m=E,w=T,g=D,E=B,T=S}const P=O6(v,y,m,w,E,T);this._cx=P.x,this._cy=P.y;for(let D=0;D<s;D++)this._dists[D]=ov(n[2*D],n[2*D+1],P.x,P.y);xs(this._ids,this._dists,0,s-1),this._hullStart=f;let F=3;i[f]=e[g]=d,i[d]=e[f]=g,i[g]=e[d]=f,o[f]=0,o[d]=1,o[g]=2,r.fill(-1),r[this._hashKey(v,y)]=f,r[this._hashKey(m,w)]=d,r[this._hashKey(E,T)]=g,this.trianglesLen=0,this._addTriangle(f,d,g,-1,-1,-1);for(let D=0,B,S;D<this._ids.length;D++){const I=this._ids[D],b=n[2*I],x=n[2*I+1];if(D>0&&Math.abs(b-B)<=HS&&Math.abs(x-S)<=HS||(B=b,S=x,I===f||I===d||I===g))continue;let U=0;for(let z=0,V=this._hashKey(b,x);z<this._hashSize&&(U=r[(V+z)%this._hashSize],!(U!==-1&&U!==i[U]));z++);U=e[U];let k=U,M;for(;M=i[k],Xl(b,x,n[2*k],n[2*k+1],n[2*M],n[2*M+1])>=0;)if(k=M,k===U){k=-1;break}if(k===-1)continue;let R=this._addTriangle(k,I,i[k],-1,-1,o[k]);o[I]=this._legalize(R+2),o[k]=R,F++;let O=i[k];for(;M=i[O],Xl(b,x,n[2*O],n[2*O+1],n[2*M],n[2*M+1])<0;)R=this._addTriangle(O,I,M,o[I],-1,o[O]),o[I]=this._legalize(R+2),i[O]=O,F--,O=M;if(k===U)for(;M=e[k],Xl(b,x,n[2*M],n[2*M+1],n[2*k],n[2*k+1])<0;)R=this._addTriangle(M,I,k,-1,o[k],o[M]),this._legalize(R+2),o[M]=R,i[k]=k,F--,k=M;this._hullStart=e[I]=k,i[k]=e[O]=I,i[I]=O,r[this._hashKey(b,x)]=I,r[this._hashKey(n[2*k],n[2*k+1])]=k}this.hull=new Uint32Array(F);for(let D=0,B=this._hullStart;D<F;D++)this.hull[D]=B,B=i[B];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(D6(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,s=0;for(;;){const a=i[n],l=n-n%3;if(s=l+(n+2)%3,a===-1){if(r===0)break;n=pf[--r];continue}const c=a-a%3,h=l+(n+1)%3,u=c+(a+2)%3,A=e[s],f=e[n],d=e[h],g=e[u];if(R6(o[2*A],o[2*A+1],o[2*f],o[2*f+1],o[2*d],o[2*d+1],o[2*g],o[2*g+1])){e[n]=g,e[a]=A;const y=i[u];if(y===-1){let w=this._hullStart;do{if(this._hullTri[w]===u){this._hullTri[w]=n;break}w=this._hullPrev[w]}while(w!==this._hullStart)}this._link(n,y),this._link(a,i[s]),this._link(s,u);const m=c+(a+1)%3;r<pf.length&&(pf[r++]=m)}else{if(r===0)break;n=pf[--r]}}return s}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,s){const a=this.trianglesLen;return this._triangles[a]=n,this._triangles[a+1]=e,this._triangles[a+2]=i,this._link(a,o),this._link(a+1,r),this._link(a+2,s),this.trianglesLen+=3,a}}function D6(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function ov(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function R6(t,n,e,i,o,r,s,a){const l=t-s,c=n-a,h=e-s,u=i-a,A=o-s,f=r-a,d=l*l+c*c,g=h*h+u*u,v=A*A+f*f;return l*(u*v-g*f)-c*(h*v-g*A)+d*(h*f-u*A)<0}function U6(t,n,e,i,o,r){const s=e-t,a=i-n,l=o-t,c=r-n,h=s*s+a*a,u=l*l+c*c,A=.5/(s*c-a*l),f=(c*h-a*u)*A,d=(s*u-l*h)*A;return f*f+d*d}function O6(t,n,e,i,o,r){const s=e-t,a=i-n,l=o-t,c=r-n,h=s*s+a*a,u=l*l+c*c,A=.5/(s*c-a*l),f=t+(c*h-a*u)*A,d=n+(s*u-l*h)*A;return{x:f,y:d}}function xs(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],s=n[r];let a=o-1;for(;a>=e&&n[t[a]]>s;)t[a+1]=t[a--];t[a+1]=r}else{const o=e+i>>1;let r=e+1,s=i;Jl(t,o,r),n[t[e]]>n[t[i]]&&Jl(t,e,i),n[t[r]]>n[t[i]]&&Jl(t,r,i),n[t[e]]>n[t[r]]&&Jl(t,e,r);const a=t[r],l=n[a];for(;;){do r++;while(n[t[r]]<l);do s--;while(n[t[s]]>l);if(s<r)break;Jl(t,r,s)}t[e+1]=t[s],t[s]=a,i-r+1>=s-e?(xs(t,n,r,i),xs(t,n,e,s-1)):(xs(t,n,e,s-1),xs(t,n,r,i))}}function Jl(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function L6(t){return t[0]}function z6(t){return t[1]}const NS=(t=0)=>new Promise(n=>setTimeout(n,t)),ra=class ra extends p.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new p.Event));L(this,"_startEvent",this.disposeVar(new p.Event));L(this,"_flyToEvent",this.disposeVar(new p.Event));L(this,"_geoPolyline");L(this,"_customPrimitive");L(this,"_geoDivPoi");L(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Je(e,i)),this._customPrimitive=this.disposeVar(new st(e,i)),this._geoDivPoi=this.disposeVar(new wt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Ui(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.dispose(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
4100
4100
|
uniform vec4 u_color;
|
|
4101
4101
|
void main()
|
|
4102
4102
|
{
|
|
@@ -4108,7 +4108,7 @@ void main()
|
|
|
4108
4108
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
4109
4109
|
}
|
|
4110
4110
|
`,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.dispose(p.track([this._customPrimitive,"show"],[this,"show"])),this.dispose(p.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(p.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(p.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.dispose(p.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let r=function(c,h){const u=[];for(const A of h)switch(A){case"SquareMeter":u.push(`面积:${c.toFixed(2)} m²`);break;case"SquareKilometer":u.push(`面积:${(c/1e6).toFixed(2)} km²`);break;case"MU":u.push(`面积:${(c*.0014999250037498124).toFixed(2)} 亩`);break;case"Hectare":u.push(`面积:${(c*1e-4).toFixed(2)} 公顷`);break}return u};const s=()=>{let c=[];this.totalArea?this._starting?c=["分析计算中..."]:c=[...r(this.totalArea,this.units)]:this._starting?c=["分析计算中..."]:c=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=bo([...c].join(`
|
|
4111
|
-
`),24))};s(),this.dispose(this.totalAreaChanged.don(s)),this.dispose(this.unitsChanged.don(s)),this.dispose(p.track([this._geoDivPoi,"show"],[this,"show"])),this.dispose(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=eC(this.positions):this._geoDivPoi.position=void 0)}));const a=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const c=this.interpolationDistance??ra.defaults.interpolationDistance,h=this.interpolation??ra.defaults.interpolation,u=this.offsetHeight??ra.defaults.offsetHeight;this.drillDepth??ra.defaults.drillDepth;const A=[];if(this.positions)for(let k=0;k<this.positions.length;++k){const M=C.Cartesian3.fromDegrees(this.positions[k][0],this.positions[k][1],this.positions[k][2]);A.push(M)}var f=Q6(A);if(isNaN(f.x)||isNaN(f.y)||isNaN(f.z)){console.warn("法向量计算错误!");return}var d=V6(A),g=C.Cartesian3.normalize(d,new C.Cartesian3),v=C.Cartesian3.dot(g,f);v<0&&(f=GS(f),A.reverse());let y=C.Transforms.eastNorthUpToFixedFrame(d),m=C.Matrix4.inverseTransformation(y,new C.Matrix4);if(Math.abs(v)<.999){const k=H6(f,g);var w=GS(d),_=C.Matrix4.fromTranslation(w,new C.Matrix4);m=C.Matrix4.multiply(k,_,_),y=C.Matrix4.inverse(m,new C.Matrix4)}var E=Ss(A,m),T=[],P=[],F=G6(E);if(h&&c>0){var D=N6(E),B=Z6(F,D,c);const k=await av(B,y,m,f,o.scene,u);var S=X6(E,c);const M=await av(S,y,m,f,o.scene,u);P.push(...k.world_cartesian),T.push(...k.local),P.push(...M.world_cartesian),T.push(...M.local),E.forEach(async R=>{var O=await av([R],y,m,f,o.scene,u);if(O.local.length>0)T.push(...O.local),P.push(...O.world_cartesian);else{const V=[R.x,R.y,R.z+u];T.push(V);var z=Ss([C.Cartesian3.fromArray(V)],y);for(let H=0;H<z.length;++H)P.push(z[H])}})}else{const k=E.map(M=>C.Cartesian3.fromArray([M.x,M.y,M.z+k]));T=k,P=Ss(k,y)}var I=W6(T,F);const b=q6(P,I);this.totalArea=b;const x=[];T.forEach(k=>{const M=[k.x,k.y,k.z];M&&x.push(...M)});const U={position:{typedArray:new Float32Array(x),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=C.Matrix4.toArray(y),this.customPrimitive.attributes=U;const k=await z6([...I]);this.customPrimitive.indexTypedArray=new Uint32Array(k),this.customPrimitive.show=!0;const M=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!M)return;const{min:R,max:O}=M;this.customPrimitive.setLocalAxisedBoundingBox(R,O)}},l=this.dv(p.createProcessingFromAsyncFunc(async c=>{await c.promise(a()),this._starting=!1,s()}));this.dispose(this._startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,s(),l.restart()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};L(ra,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Yo=ra;(t=>{t.createDefaultProps=()=>({positions:p.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:p.reactArray([1,1,1,1]),units:p.reactArray(["SquareMeter"])})})(Yo||(Yo={})),p.extendClassProps(Yo.prototype,Yo.createDefaultProps);async function z6(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await NS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function Q6(t){var n=new C.Cartesian3(0,0,0),e=new C.Cartesian3(0,0,0),i=new C.Cartesian3(0,0,0),o=new C.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let c=0;c<r;++c){var s=t[c],a;c==0?a=t[t.length-1]:a=t[c-1];var l;c==t.length-1?l=t[0]:l=t[c+1],n=C.Cartesian3.subtract(s,a,n),e=C.Cartesian3.subtract(s,l,e),i=C.Cartesian3.cross(n,e,i),!i.equalsEpsilon(C.Cartesian3.ZERO,C.Math.EPSILON6)&&(i=C.Cartesian3.normalize(i,i),o=C.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function V6(t){var n=new C.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=C.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function GS(t){return new C.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function H6(t,n){var e=C.Cartesian3.cross(t,n,new C.Cartesian3);e=C.Cartesian3.normalize(e,e);var i=C.Cartesian3.cross(t,e,new C.Cartesian3);i=C.Cartesian3.normalize(i,i);var o=t,r=new C.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function Ss(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=C.Matrix4.multiplyByPoint(n,i,new C.Cartesian3);e.push(o)}return e}function N6(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function G6(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function W6(t,n){var e=[];t.forEach(s=>{const a=[s.x,s.y];e.push(a)});var i=rv.from(e).triangles;const o=[],r=sn([n]);for(let s=0;s<i.length;s+=3){const a=i[s],l=i[s+1],c=i[s+2],h=(t[a].x+t[l].x+t[c].x)/3,u=(t[a].y+t[l].y+t[c].y)/3;ln([h,u],r)&&o.push(a,l,c)}return new Uint32Array(o.reverse())}function q6(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=K6(o)}return e}function K6(t){var n=C.Cartesian3.distance(t[0],t[1]),e=C.Cartesian3.distance(t[1],t[2]),i=C.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r??0}function Z6(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)Y6([o,r],t)&&i.push(new C.Cartesian3(o,r,0));return i}function X6(t,n){var e=[];for(let s=0;s<t.length;++s){var i=t[s],o;s==t.length-1?o=t[0]:o=t[s+1];var r=$6(i,o,n);e.push(...r)}return e}function $6(t,n,e){var i=[],o=C.Cartesian3.distance(t,n),r=C.Cartesian3.subtract(n,t,new C.Cartesian3);if(r.equalsEpsilon(C.Cartesian3.ZERO,C.Math.EPSILON6))return[];r=C.Cartesian3.normalize(r,r);for(var s=e;s<o;){var a=new C.Cartesian3(r.x*s,r.y*s,r.z*s),l=C.Cartesian3.add(t,a,new C.Cartesian3);i.push(l),s+=e}return i}function Y6(t,n){var e=eo(t);if(!$z(eo(n[0]),eo(n[n.length-1])))return!1;var i=[];i.push(n);var o=sn(i);return ln(e,o)}async function av(t,n,e,i,o,r,s){var a=[];t.forEach(m=>{var w=m.clone();w.z=1e5,a.push(w)});var l=Ss(a,n),c=new C.Cartesian3(-1*i.x,-1*i.y,-1*i.z),h=[],u=[],A=[];for(let m=0;m<l.length;++m){await NS();var f=l[m],d=new C.Ray(f,c),g=void 0;try{g=o.pickFromRay(d)}catch{}if(!g){d=new C.Ray(f,i);try{g=o.pickFromRay(d)}catch{}}if(g){var v=g.position;if(!(!v||!v.x||isNaN(v.x))){var y=Ss([v],e);y.forEach(w=>{w.z+=r}),v=Ss(y,n)[0],A.push(v),v=C.Cartographic.fromCartesian(v),h.push([v.longitude,v.latitude,v.height]),u.push(y[0])}}}return{local:u,world:h,world_cartesian:A}}const _c=class _c extends Tn{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Yo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(p.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(p.track([r,"units"],[e,"units"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"positions"],[e,"points"])),this.dispose(p.track([r,"interpolationDistance"],[e,"interpolation"])),this.dispose(p.track([r,"offsetHeight"],[e,"offsetHeight"]));{const s=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(e.startEvent.don(()=>{this._czmAreaMeasurement.start()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.positions&&Me(r,o,i,s.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.positions&&Me(r,o,i,s.positions,e),!0):!1}};L(_c,"type",_c.register("ESCesiumViewer",Q.ESSurfaceAreaMeasurement.type,_c));let sv=_c;async function J6(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const Cc=class Cc extends Q.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new Q.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends p.Destroyable{constructor(a,l,c){if(super(),this._subContainer=a,!c||!(c instanceof Ye))return;c.extensions.cursorPositionInfo.enabled=!0;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h)),h.style.width="100%",h.style.position="absolute",h.style.height=`${Q.ESViewerStatusBar.defaults.height}px`,h.style.left="0",h.style.bottom="0",h.style.color="#fff",h.style.padding="0 20px 0 0",h.style.boxSizing="border-box",h.style.lineHeight=`${Q.ESViewerStatusBar.defaults.height}px`,h.style.zIndex="100",h.style.alignContent="center",h.style.justifyContent="space-between";const u=document.createElement("span");h.appendChild(u),this.dispose(()=>h.removeChild(u));const A=document.createElement("span");u.appendChild(A),this.dispose(()=>u.removeChild(A));const f=document.createElement("span");u.appendChild(f),f.addEventListener("dblclick",function(){let g=f.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),J6(g)}),f.style.cursor="pointer",this.dispose(()=>u.removeChild(f));const d=document.createElement("span");h.appendChild(d),this.dispose(()=>h.removeChild(d));{const g=()=>{h.style.height=(e.height??Q.ESViewerStatusBar.defaults.height)+"px",h.style.lineHeight=(e.height??Q.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{h.style.fontSize=(e.fontSize??Q.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?h.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:h.style.background=`rgba(${Q.ESViewerStatusBar.defaults.bgColor[0]},${Q.ESViewerStatusBar.defaults.bgColor[1]},${Q.ESViewerStatusBar.defaults.bgColor[2]},${Q.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{d.innerText=`Cesium 版本 : ${C.VERSION} `;let g;const v=()=>{e.show?(h.style.display="flex",g=this.disposeVar(p.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const w=c.getCameraInfo();if(w){const T=(F,D)=>w.position[F].toFixed(D),P=(F,D)=>w.rotation[F].toFixed(D);y=`帧率:${c.getFPS()}FPS 经度: ${T(0,5)}° 纬度: ${T(1,5)}° 高度: ${T(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}A.innerText=y;const _=(E=c.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(_){const T=(P,F)=>_[P].toFixed(F);m=`鼠标位置:${T(0,5)}° ${T(1,5)}° ${T(2,2)}m`}else m="暂时无法获取鼠标位置...";f.innerText=m})),g.start()):(h.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};L(Cc,"type",Cc.register("ESCesiumViewer",Q.ESViewerStatusBar.type,Cc));let lv=Cc;const xc=class xc extends Q.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new Q.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(p.track([r,"show"],[e,"show"])),r.instanceClass=class extends p.Destroyable{constructor(a,l,c){if(super(),this._subContainer=a,!c||!(c instanceof Ye))return;c.extensions.cursorPositionInfo.enabled=!0;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h));const u=document.createElement("div");h.appendChild(u),u.style.width="100%",u.className="ESViewerStatusBarScale",u.style.position="absolute",u.style.display="flex",u.style.height=`${Q.ESViewerStatusBarScale.defaults.height}px`,u.style.left="0",u.style.bottom="0",u.style.color="#fff",u.style.padding="0 20px 0 0",u.style.boxSizing="border-box",u.style.lineHeight=`${Q.ESViewerStatusBarScale.defaults.height}px`,u.style.zIndex="100",u.style.alignContent="center",u.style.justifyContent="space-between";const A=document.createElement("div");u.appendChild(A);const f=document.createElement("div");A.appendChild(f);const d=document.createElement("div");A.appendChild(d);const g=document.createElement("div");u.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const w=document.createElement("span");g.appendChild(w);{const F=()=>{u.style.height=(e.height??Q.ESViewerStatusBarScale.defaults.height)+"px",u.style.lineHeight=(e.height??Q.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(F)),F()}{const F=()=>{u.style.fontSize=(e.fontSize??Q.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(F)),F()}{const F=()=>{e.bgColor?u.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:u.style.background=`rgba(${Q.ESViewerStatusBarScale.defaults.bgColor[0]},${Q.ESViewerStatusBarScale.defaults.bgColor[1]},${Q.ESViewerStatusBarScale.defaults.bgColor[2]},${Q.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(F)),F()}A.style.display="flex",f.style.fontWeight="bold",f.style.padding="0 0 0 25px";let _="EarthSDK";f.innerText=_,d.style.fontWeight="";let E="——免费开源地球可视化开发包";d.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",w.style.display="flex",w.style.zIndex="101",w.style.justifyContent="flex-end",w.style.right="0";const T=()=>{const F=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||F&&F>1e6)v.style.display="none";else{v.style.display="block";const D=i.viewerLegend.legend.computedLengthInStr;D&&(y.innerHTML=D);const B=i.viewerLegend.legend.computedLengthInPixels;if(B){m.style.width=`${B}px`;const S=(135-B)/2;m.style.left=`${S}px`}}};T();const P=setInterval(()=>{T()},200);this.dispose(()=>clearInterval(P));{let F;const D=()=>{e.show?(h.style.display="block",F=this.disposeVar(p.createAnimateFrameWithStartValues(()=>{var b;let B="";const S=c.getCameraInfo();if(S){const x=(U,k)=>S.position[U].toFixed(k);B+=`帧率:${c.getFPS()}FPS 相机: ${x(2,2)}米 `}const I=(b=c.extensions)==null?void 0:b.cursorPositionInfo.cursorPosition;if(I){const x=(U,k)=>I[U].toFixed(k);B+=`位置:${x(0,5)}° ${x(1,5)}° ${x(2,2)}米`}else B+="暂时无法获取鼠标位置...";w.innerText=B})),F.start()):(h.style.display="none",F.destroy())};this.dispose(e.showChanged.disposableOn(D)),D()}}}}get customDiv(){return this._customDiv}};L(xc,"type",xc.register("ESCesiumViewer",Q.ESViewerStatusBarScale.type,xc));let uv=xc;const WS=C.Math.toDegrees,j6=new C.Cartographic;function qS(t,n,e){const i=C.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=C.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=C.Cartesian3.subtract(o,i,new C.Cartesian3);C.Cartesian3.normalize(r,r);const s=new C.Ray(i,r),a=e.pickFromRay(s),l=e.globe.pick(s,e);var c;if(a&&a.position&&l){const d=C.Cartesian3.distance(i,a.position),g=C.Cartesian3.distance(i,l);c=d<g?a.position:l}else a&&a.position?c=a.position:l&&(c=l);if(!c)return;const h=C.Cartesian3.distance(i,o),A=C.Cartesian3.distance(i,c)>h?o:c,f=C.Cartographic.fromCartesian(A,void 0,j6);return[WS(f.longitude),WS(f.latitude),f.height]}const Sc=class Sc extends an{constructor(e,i){super(e,i);L(this,"_hideGeoPolylines",this.disposeVar(new En(this.czmViewer,this.sceneObject.id)));L(this,"_visibleGeoPolylines",this.disposeVar(new En(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,s=this._visibleGeoPolylines;this.d(p.track([r,"show"],[e,"show"])),this.d(p.track([s,"show"],[e,"show"])),this.d(p.track([s,"color"],[e,"visibleColor"])),this.d(p.track([r,"color"],[e,"invisibleColor"]));{const a=()=>{const c=e.points,h=e.heightOffset;if(!c||c.length<2||c[0].toString()===c[1].toString()){r.positions=void 0,s.positions=void 0;return}const u=[],A=[],[f,d,g]=c[0],v=[f,d,g+h];try{c.forEach((y,m)=>{if(m===0)return;const w=qS(v,y,o.scene);w?(u.push([y,w]),A.push([v,w])):A.push([v,y])}),r.positions=u,s.positions=A}catch(y){console.warn(y)}};a();const l=this.dv(p.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(a))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,s,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,s,e),!0}}};L(Sc,"type",Sc.register("ESCesiumViewer",Q.ESVisibilityAnalysis.type,Sc));let cv=Sc;class jl extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.dv(new p.Event));L(this,"_enableEvent",this.dv(new p.Event));L(this,"_clearEvent",this.dv(new p.Event));L(this,"_gridPoints",this.dv(p.reactJson([])));L(this,"excavationPolylines");L(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new En(e,i)),s=this.dv(new En(e,i));this.excavationPolylines=r,this.fillPolylines=s;const a=r;a.color=[1,1,0,1],this.d(p.track([a,"show"],[this,"show"])),a.show=!1,a.depthTest=!0;const l=s;l.color=[0,0,1,1],this.d(p.track([l,"show"],[this,"show"])),l.show=!1;{const f=this.ad(new _i(e,i));this.d(p.track([f,"show"],[this,"show"])),this.d(p.bind([f,"allowPicking"],[this,"allowPicking"])),this.d(p.bind([f,"positions"],[this,"positions"])),this.d(p.bind([f,"depthTest"],[this,"depthTest"])),this.d(p.bind([f,"outlineWidth"],[this,"outlineWidth"])),this.d(p.bind([f,"outlineColor"],[this,"outlineColor"])),this.d(p.bind([f,"outline"],[this,"outline"])),this.d(p.bind([f,"color"],[this,"fillColor"])),this.d(p.bind([f,"fill"],[this,"filled"])),this.d(p.bind([f,"strokeGround"],[this,"strokeGround"])),this.d(p.bind([f,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{f.flyTo(v)}));const d=()=>{f.positions=this.positions};d();const g=this.dv(p.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(d))}const c=()=>{if(!this.positions||!this.positions.length)return;const{minPos:f,maxPos:d}=Q.getMinMaxCorner(this.positions),g=f[0],v=f[1],y=d[0],m=d[1],_={type:"Polygon",coordinates:[[...this.positions.map(I=>[I[0],I[1]])]]},E=[g,v,y,m],T=this.gridWidth,D=ex(E,T,{units:"meters",mask:_}).features.map(I=>I.geometry.coordinates),B=C.Math.toRadians;return D.map(I=>new C.Cartographic(B(I[0]),B(I[1])))},h=()=>{a.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,a.depthTest=!0},u=this.dv(p.createProcessingFromAsyncFunc(async f=>{const d=c();let g=0,v=300;const y=Math.ceil(d.length/v),m=[];do{let w=[];g===y-1?w=d.slice(g*v):w=d.slice(g*v,(g+1)*v);const _=o.scene.sampleHeightMostDetailed(w),E=await f.promise(_);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const T=C.Math.toDegrees,P=E.map(F=>[T(F.longitude),T(F.latitude),F.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let A=null;{const f=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let d=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const w=this.positions;m[2]>w[0][2]?(d+=this.gridWidth*this.gridWidth*(m[2]-w[0][2]),g.push([m,[m[0],m[1],w[0][2]]])):(v+=this.gridWidth*this.gridWidth*(w[0][2]-m[2]),y.push([m,[m[0],m[1],w[0][2]]]))}),a.positions=g,l.positions=y,a.show=!0,l.show=!0,this.area=j_(this.positions),this.cutVolume=d,this.fillVolume=v,this.cutAndFillVolume=v-d,A&&clearTimeout(A),A=setTimeout(()=>{a.depthTest=!1},200)};f(),this.d(this.gridPointsChanged.don(f)),this.d(()=>clearTimeout(A))}{const f=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};f(),this.d(this.positionsChanged.don(f))}{const f=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const d=JSON.parse(JSON.stringify(this.positions.slice(1)));d.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=d};f(),this.d(this.planeHeightChanged.don(f))}this.d(this.enableEvent.don(()=>{h(),this.gridPoints=[],this.progress=0,u.restart()})),this.d(this.clearEvent.don(()=>{h()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(void 0),planeHeight:p.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(jl||(jl={})),p.extendClassProps(jl.prototype,jl.createDefaultProps);const Ec=class Ec extends Tn{constructor(e,i){super(e,i);L(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new jl(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(p.track([r,"show"],[e,"show"])),this.d(p.bind([r,"positions"],[e,"points"])),this.d(p.track([r,"allowPicking"],[e,"allowPicking"])),this.d(p.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(p.track([r,"gridWidth"],[e,"gridWidth"])),this.d(p.track([e,"cutVolume"],[r,"cutVolume"])),this.d(p.track([e,"fillVolume"],[r,"fillVolume"])),this.d(p.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(p.bind([e,"progress"],[r,"progress"])),this.d(p.track([r,"depthTest"],[e,"depthTest"])),this.d(p.track([r,"outline"],[e,"stroked"])),this.d(p.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(p.track([r,"outlineColor"],[e,"strokeColor"])),this.d(p.track([r,"filled"],[e,"filled"])),this.d(p.track([r,"fillColor"],[e,"fillColor"])),this.d(p.track([r,"fillGround"],[e,"fillGround"])),this.d(p.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(p.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Ec,"type",Ec.register("ESCesiumViewer",Q.ESVolumeMeasurement.type,Ec));let hv=Ec;const Pc=class Pc extends Tn{constructor(e,i){super(e,i);L(this,"czmEntity");L(this,"czmPolyline",this.ad(new Q.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(p.bind([r,"show"],[e,"show"])),this.ad(p.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(p.bind([r,"stroked"],[e,"stroked"])),this.ad(p.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(p.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(p.bind([r,"strokeGround"],[e,"strokeGround"]));{const c=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const u=structuredClone(e.points);u.push(u[0]),e.perPositionHeight?r.points=u:r.points=u.map(A=>(A[2]=e.height??Q.ESGeoExtrudedPolygon.defaults.height,A))}};c();const h=this.ad(p.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(h.don(c))}const s=this.czmEntity=o.entities.add({polygon:{}});C.Entity.prototype&&(s.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(s));let a=new C.PolygonHierarchy;s.polygon&&(s.polygon.hierarchy=new C.CallbackProperty(()=>a,!1));const l=()=>{const c=Zt(e.points??Q.ESGeoExtrudedPolygon.defaults.points);if(c.length<2){a=new C.PolygonHierarchy;return}a=new C.PolygonHierarchy(c)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const c=()=>{s.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!s.show&&e.filled)};c();const h=this.ad(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(h.don(c))}{const c=()=>{s.polygon&&(s.polygon.perPositionHeight=new C.ConstantProperty(e.perPositionHeight),l())};c(),this.ad(e.perPositionHeightChanged.don(c))}{const c=()=>{s.polygon&&(s.polygon.height=new C.ConstantProperty(e.height??Q.ESGeoExtrudedPolygon.defaults.height))};c(),this.dispose(e.heightChanged.disposableOn(c))}{const c=()=>{s.polygon&&(s.polygon.extrudedHeight=new C.ConstantProperty(e.extrudedHeight??Q.ESGeoExtrudedPolygon.defaults.extrudedHeight))};c(),this.dispose(e.extrudedHeightChanged.disposableOn(c))}{const c=()=>{const h=C.Color.fromCartesian4(C.Cartesian4.fromArray(e.fillColor));s.polygon&&(s.polygon.material=h)};c(),this.dispose(e.fillColorChanged.disposableOn(c))}this.disposeVar(new p.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Ye.ObjectsToExcludeWrapper(i,s)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=Q.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};L(Pc,"type",Pc.register("ESCesiumViewer",Q.ESGeoExtrudedPolygon.type,Pc));let Av=Pc;const Tc=class Tc extends Q.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(p.bind([o,"position"],[n,"position"])),this.dispose(p.bind([o,"rotation"],[n,"rotation"])),this.ad(p.bind([o,"scale"],[n,"scale"])),this.ad(p.track([r,"scale"],[n,"scale"])),this.dispose(p.track([r,"rotation"],[n,"rotation"]));const s=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};s();const a=this.dv(p.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(a.don(s)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};L(Tc,"type",Tc.register("ESCesiumViewer",Q.ESHumanPoi.type,Tc));let fv=Tc;const Ic=class Ic extends Q.EngineObject{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=i.scene.postProcessStages,r=o.add(C.PostProcessStageLibrary.createSilhouetteStage());r.uniforms.color=C.Color.LIME,r.selected=[],this.d(()=>{r.selected=[],o.remove(r)}),this.d(n.highlightInner3DtilesetEvent.don(s=>{r.selected=[];const a=s.d(s.tilesetReady.donce(h=>{h.allTilesLoaded.addEventListener(()=>{var A,f,d,g;const u=(g=(d=(f=(A=h==null?void 0:h._root)==null?void 0:A._content)==null?void 0:f._model)==null?void 0:d._featureTables[0])==null?void 0:g._features[0];u?r.selected=[u]:console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",h),a()})})),l=s.url,c=Date.now();l.includes("?reload=")?s.url=l.replace(/\?reload=\d+/,`?reload=${c}`):s.url=l+`?reload=${c}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(s=>{r.selected=[]})),this.d(n.es3DTileset.tilesetReady.don(s=>{const a=()=>{const c=n.layerConfig;if(!c){s.style=void 0;return}const h=n.colorBlendMode,u=(d,g)=>{try{if(d.getPropertyIds().includes("materialName"))return C.Color.clone(C.Color.WHITE,g);const v=d.getProperty("layer"),y=d.getProperty("dataset"),m=v.toString(),w=y.toString(),_=c.find(T=>T.dataset.toString()===w&&T.layer.toString()===m);if(_&&_.value.color){const T=_.value.color;return C.Color.fromCssColorString(T,g)}const E=c.filter(T=>T.dataset.toString()===w);if(E.length==1&&E[0].value.color){const T=E[0].value.color;return C.Color.fromCssColorString(T,g)}else return C.Color.clone(C.Color.WHITE,g)}catch(v){return console.warn(v),C.Color.clone(C.Color.WHITE,g)}},A=d=>{try{if(d.getPropertyIds().includes("materialName"))return!0;const g=d.getProperty("layer"),v=d.getProperty("dataset"),y=g.toString(),m=v.toString(),w=c.find(E=>E.dataset.toString()===m&&E.layer.toString()===y);if(w&&w.value.visible===!1)return!1;if(w&&w.value.visible===!0)return!0;const _=c.filter(E=>E.dataset.toString()===m);return!(_.length==1&&_[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let f;h!=="HIGHLIGHT"?f=new C.Cesium3DTileStyle({color:{evaluateColor:function(d,g){return u(d,g)}},show:{evaluate:function(d){return A(d)}}}):f=new C.Cesium3DTileStyle({show:{evaluate:function(d){return A(d)}}}),s.style=f};a();const l=this.dv(p.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged));this.d(l.don(()=>{a()}))}))}};L(Ic,"type",Ic.register("ESCesiumViewer",Q.ESRtsTileset.type,Ic));let dv=Ic;const kc=class kc extends ss{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(kc,"type",kc.register("ESCesiumViewer",Q.ESRtsFeatureEditing.type,kc));let pv=kc;const Fc=class Fc extends ss{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Fc,"type",Fc.register("ESCesiumViewer",Q.ESMsTileset.type,Fc));let mv=Fc;const Bc=class Bc extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new On(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Bc,"type",Bc.register("ESCesiumViewer",Q.ESStaticMesh.type,Bc));let gv=Bc;const Mc=class Mc extends an{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new g0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),s=Number.isFinite(n.radius)?n.radius:Q.ESSkylineAnalysis.defaults.radius,{depths:a,windowPositions:l,positions:c}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,s),h=Ue(i.camera.position);c.push(h),n.depths=a,n.windowPositions=l,n.points=c}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};L(Mc,"type",Mc.register("ESCesiumViewer",Q.ESSkylineAnalysis.type,Mc));let yv=Mc;var mf={exports:{}},eQ=mf.exports,KS;function tQ(){return KS||(KS=1,function(t){(function(n,e,i){t.exports?t.exports=i():e[n]=i()})("h337",eQ,function(){var n={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},e=function(){var c=function(A){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=A.xField||A.defaultXField,this._yField=A.yField||A.defaultYField,this._valueField=A.valueField||A.defaultValueField,A.radius&&(this._cfgRadius=A.radius)},h=n.defaultRadius;return c.prototype={_organiseData:function(u,A){var f=u[this._xField],d=u[this._yField],g=this._radi,v=this._data,y=this._max,m=this._min,w=u[this._valueField]||1,_=u.radius||this._cfgRadius||h;return v[f]||(v[f]=[],g[f]=[]),v[f][d]?v[f][d]+=w:(v[f][d]=w,g[f][d]=_),v[f][d]>y?(A?this.setDataMax(v[f][d]):this._max=v[f][d],!1):{x:f,y:d,value:w,radius:_,min:m,max:y}},_unOrganizeData:function(){var u=[],A=this._data,f=this._radi;for(var d in A)for(var g in A[d])u.push({x:d,y:g,radius:f[d][g],value:A[d][g]});return{min:this._min,max:this._max,data:u}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var u=arguments[0],A=u.length;A--;)this.addData.call(this,u[A]);else{var f=this._organiseData(arguments[0],!0);f&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[f]})}return this},setData:function(u){var A=u.data,f=A.length;this._data=[],this._radi=[];for(var d=0;d<f;d++)this._organiseData(A[d],!1);return this._max=u.max,this._min=u.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(u){return this._max=u,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(u){return this._min=u,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(u){this._coordinator=u},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},c}(),i=function(){var c=function(f){var d=f.gradient||f.defaultGradient,g=document.createElement("canvas"),v=g.getContext("2d");g.width=256,g.height=1;var y=v.createLinearGradient(0,0,256,1);for(var m in d)y.addColorStop(m,d[m]);return v.fillStyle=y,v.fillRect(0,0,256,1),v.getImageData(0,0,256,1).data},h=function(f,d){var g=document.createElement("canvas"),v=g.getContext("2d"),y=f,m=f;if(g.width=g.height=f*2,d==1)v.beginPath(),v.arc(y,m,f,0,2*Math.PI,!1),v.fillStyle="rgba(0,0,0,1)",v.fill();else{var w=v.createRadialGradient(y,m,f*d,y,m,f);w.addColorStop(0,"rgba(0,0,0,1)"),w.addColorStop(1,"rgba(0,0,0,0)"),v.fillStyle=w,v.fillRect(0,0,2*f,2*f)}return g},u=function(m){for(var d=[],g=m.min,v=m.max,y=m.radi,m=m.data,w=Object.keys(m),_=w.length;_--;)for(var E=w[_],T=Object.keys(m[E]),P=T.length;P--;){var F=T[P],D=m[E][F],B=y[E][F];d.push({x:E,y:F,value:D,radius:B})}return{min:g,max:v,data:d}};function A(f){var d=f.container,g=this.shadowCanvas=document.createElement("canvas"),v=this.canvas=f.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var y=getComputedStyle(f.container)||{};v.className="heatmap-canvas",this._width=v.width=g.width=+y.width.replace(/px/,""),this._height=v.height=g.height=+y.height.replace(/px/,""),this.shadowCtx=g.getContext("2d"),this.ctx=v.getContext("2d"),v.style.cssText=g.style.cssText="position:absolute;left:0;top:0;",d.style.position="relative",d.appendChild(v),this._palette=c(f),this._templates={},this._setStyles(f)}return A.prototype={renderPartial:function(f){this._drawAlpha(f),this._colorize()},renderAll:function(f){this._clear(),this._drawAlpha(u(f)),this._colorize()},_updateGradient:function(f){this._palette=c(f)},updateConfig:function(f){f.gradient&&this._updateGradient(f),this._setStyles(f)},setDimensions:function(f,d){this._width=f,this._height=d,this.canvas.width=this.shadowCanvas.width=f,this.canvas.height=this.shadowCanvas.height=d},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(f){this._blur=f.blur==0?0:f.blur||f.defaultBlur,f.backgroundColor&&(this.canvas.style.backgroundColor=f.backgroundColor),this._opacity=(f.opacity||0)*255,this._maxOpacity=(f.maxOpacity||f.defaultMaxOpacity)*255,this._minOpacity=(f.minOpacity||f.defaultMinOpacity)*255,this._useGradientOpacity=!!f.useGradientOpacity},_drawAlpha:function(v){for(var d=this._min=v.min,g=this._max=v.max,v=v.data||[],y=v.length,m=1-this._blur;y--;){var w=v[y],_=w.x,E=w.y,T=w.radius,P=Math.min(w.value,g),F=_-T,D=E-T,B=this.shadowCtx,S;this._templates[T]=S=h(T,m),B.globalAlpha=(P-d)/(g-d),B.drawImage(S,F,D),F<this._renderBoundaries[0]&&(this._renderBoundaries[0]=F),D<this._renderBoundaries[1]&&(this._renderBoundaries[1]=D),F+2*T>this._renderBoundaries[2]&&(this._renderBoundaries[2]=F+2*T),D+2*T>this._renderBoundaries[3]&&(this._renderBoundaries[3]=D+2*T)}},_colorize:function(){var f=this._renderBoundaries[0],d=this._renderBoundaries[1],g=this._renderBoundaries[2]-f,v=this._renderBoundaries[3]-d,y=this._width,m=this._height,w=this._opacity,_=this._maxOpacity,E=this._minOpacity,T=this._useGradientOpacity;f<0&&(f=0),d<0&&(d=0),f+g>y&&(g=y-f),d+v>m&&(v=m-d);for(var P=this.shadowCtx.getImageData(f,d,g,v),F=P.data,D=F.length,B=this._palette,S=3;S<D;S+=4){var I=F[S],b=I*4;if(b){var x;w>0?x=w:I<_?I<E?x=E:x=I:x=_,F[S-3]=B[b],F[S-2]=B[b+1],F[S-1]=B[b+2],F[S]=T?B[b+3]:x}}this.ctx.putImageData(P,f,d),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(f){var d,g=this.shadowCtx,v=g.getImageData(f.x,f.y,1,1),y=v.data[3],m=this._max,w=this._min;return d=Math.abs(m-w)*(y/255)>>0,d},getDataURL:function(){return this.canvas.toDataURL()}},A}(),o=function(){var c=!1;return n.defaultRenderer==="canvas2d"&&(c=i),c}(),r={merge:function(){for(var l={},c=arguments.length,h=0;h<c;h++){var u=arguments[h];for(var A in u)l[A]=u[A]}return l}},s=function(){var c=function(){function f(){this.cStore={}}return f.prototype={on:function(d,g,v){var y=this.cStore;y[d]||(y[d]=[]),y[d].push(function(m){return g.call(v,m)})},emit:function(d,g){var v=this.cStore;if(v[d])for(var y=v[d].length,m=0;m<y;m++){var w=v[d][m];w(g)}}},f}(),h=function(A){var f=A._renderer,d=A._coordinator,g=A._store;d.on("renderpartial",f.renderPartial,f),d.on("renderall",f.renderAll,f),d.on("extremachange",function(v){A._config.onExtremaChange&&A._config.onExtremaChange({min:v.min,max:v.max,gradient:A._config.gradient||A._config.defaultGradient})}),g.setCoordinator(d)};function u(){var A=this._config=r.merge(n,arguments[0]||{});if(this._coordinator=new c,A.plugin){var f=A.plugin;if(n.plugins[f]){var d=n.plugins[f];this._renderer=new d.renderer(A),this._store=new d.store(A)}else throw new Error("Plugin '"+f+"' not found. Maybe it was not registered.")}else this._renderer=new o(A),this._store=new e(A);h(this)}return u.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(A){return this._config=r.merge(this._config,A),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(A){return this._store.getValueAt?this._store.getValueAt(A):this._renderer.getValueAt?this._renderer.getValueAt(A):null}},u}(),a={create:function(l){return new s(l)},register:function(l,c){n.plugins[l]=c}};return a})}(mf)),mf.exports}var nQ=tQ();const iQ=Va(nQ);class rQ extends p.Destroyable{constructor(e,i){super();L(this,"_rectangle");L(this,"_updateHeatMapEvent",this.disposeVar(new p.Event));const o=e.sceneObject;this._rectangle=this.ad(new pi(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(p.bind([this.rectangle,"show"],[o,"show"])),this.ad(p.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class oQ extends p.Destroyable{constructor(e,i){super();L(this,"_primitive");L(this,"_updateHeatMapEvent",this.disposeVar(new p.Event));L(this,"czmViewer");L(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,s=r.sceneObject,a=o.viewer;if(!a)return;let l,c;const h=this.ad(new p.Event),u=()=>{A(),!(!l||!c)&&(this._primitive=a.scene.primitives.add(new C.Primitive({geometryInstances:l,appearance:c,asynchronous:!1,allowPicking:s.allowPicking})))},A=()=>{this.primitive&&a.scene.primitives.remove(this.primitive)};this.ad(A);{const f=()=>{this.primitive&&(this.primitive.show=s.show)};f(),this.ad(s.showChanged.don(f))}{const f=this.ad(p.createNextAnimateFrameEvent(s.allowPickingChanged,h));this.ad(f.don(u))}{const f=()=>{r.rectangle&&(l=new C.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(d=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=Q.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;c=new C.MaterialAppearance({material:new C.Material({fabric:{type:"Image",uniforms:{image:d}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=d,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),f(),this.primitive||h.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
4111
|
+
`),24))};s(),this.dispose(this.totalAreaChanged.don(s)),this.dispose(this.unitsChanged.don(s)),this.dispose(p.track([this._geoDivPoi,"show"],[this,"show"])),this.dispose(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=eC(this.positions):this._geoDivPoi.position=void 0)}));const a=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const c=this.interpolationDistance??ra.defaults.interpolationDistance,h=this.interpolation??ra.defaults.interpolation,u=this.offsetHeight??ra.defaults.offsetHeight;this.drillDepth??ra.defaults.drillDepth;const A=[];if(this.positions)for(let k=0;k<this.positions.length;++k){const M=C.Cartesian3.fromDegrees(this.positions[k][0],this.positions[k][1],this.positions[k][2]);A.push(M)}var f=V6(A);if(isNaN(f.x)||isNaN(f.y)||isNaN(f.z)){console.warn("法向量计算错误!");return}var d=H6(A),g=C.Cartesian3.normalize(d,new C.Cartesian3),v=C.Cartesian3.dot(g,f);v<0&&(f=GS(f),A.reverse());let y=C.Transforms.eastNorthUpToFixedFrame(d),m=C.Matrix4.inverseTransformation(y,new C.Matrix4);if(Math.abs(v)<.999){const k=N6(f,g);var w=GS(d),_=C.Matrix4.fromTranslation(w,new C.Matrix4);m=C.Matrix4.multiply(k,_,_),y=C.Matrix4.inverse(m,new C.Matrix4)}var E=Ss(A,m),T=[],P=[],F=W6(E);if(h&&c>0){var D=G6(E),B=X6(F,D,c);const k=await av(B,y,m,f,o.scene,u);var S=$6(E,c);const M=await av(S,y,m,f,o.scene,u);P.push(...k.world_cartesian),T.push(...k.local),P.push(...M.world_cartesian),T.push(...M.local),E.forEach(async R=>{var O=await av([R],y,m,f,o.scene,u);if(O.local.length>0)T.push(...O.local),P.push(...O.world_cartesian);else{const V=[R.x,R.y,R.z+u];T.push(V);var z=Ss([C.Cartesian3.fromArray(V)],y);for(let H=0;H<z.length;++H)P.push(z[H])}})}else{const k=E.map(M=>C.Cartesian3.fromArray([M.x,M.y,M.z+k]));T=k,P=Ss(k,y)}var I=q6(T,F);const b=K6(P,I);this.totalArea=b;const x=[];T.forEach(k=>{const M=[k.x,k.y,k.z];M&&x.push(...M)});const U={position:{typedArray:new Float32Array(x),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=C.Matrix4.toArray(y),this.customPrimitive.attributes=U;const k=await Q6([...I]);this.customPrimitive.indexTypedArray=new Uint32Array(k),this.customPrimitive.show=!0;const M=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!M)return;const{min:R,max:O}=M;this.customPrimitive.setLocalAxisedBoundingBox(R,O)}},l=this.dv(p.createProcessingFromAsyncFunc(async c=>{await c.promise(a()),this._starting=!1,s()}));this.dispose(this._startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,s(),l.restart()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};L(ra,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Yo=ra;(t=>{t.createDefaultProps=()=>({positions:p.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:p.reactArray([1,1,1,1]),units:p.reactArray(["SquareMeter"])})})(Yo||(Yo={})),p.extendClassProps(Yo.prototype,Yo.createDefaultProps);async function Q6(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await NS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function V6(t){var n=new C.Cartesian3(0,0,0),e=new C.Cartesian3(0,0,0),i=new C.Cartesian3(0,0,0),o=new C.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let c=0;c<r;++c){var s=t[c],a;c==0?a=t[t.length-1]:a=t[c-1];var l;c==t.length-1?l=t[0]:l=t[c+1],n=C.Cartesian3.subtract(s,a,n),e=C.Cartesian3.subtract(s,l,e),i=C.Cartesian3.cross(n,e,i),!i.equalsEpsilon(C.Cartesian3.ZERO,C.Math.EPSILON6)&&(i=C.Cartesian3.normalize(i,i),o=C.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function H6(t){var n=new C.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=C.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function GS(t){return new C.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function N6(t,n){var e=C.Cartesian3.cross(t,n,new C.Cartesian3);e=C.Cartesian3.normalize(e,e);var i=C.Cartesian3.cross(t,e,new C.Cartesian3);i=C.Cartesian3.normalize(i,i);var o=t,r=new C.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function Ss(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=C.Matrix4.multiplyByPoint(n,i,new C.Cartesian3);e.push(o)}return e}function G6(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function W6(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function q6(t,n){var e=[];t.forEach(s=>{const a=[s.x,s.y];e.push(a)});var i=rv.from(e).triangles;const o=[],r=sn([n]);for(let s=0;s<i.length;s+=3){const a=i[s],l=i[s+1],c=i[s+2],h=(t[a].x+t[l].x+t[c].x)/3,u=(t[a].y+t[l].y+t[c].y)/3;ln([h,u],r)&&o.push(a,l,c)}return new Uint32Array(o.reverse())}function K6(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=Z6(o)}return e}function Z6(t){var n=C.Cartesian3.distance(t[0],t[1]),e=C.Cartesian3.distance(t[1],t[2]),i=C.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r??0}function X6(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)J6([o,r],t)&&i.push(new C.Cartesian3(o,r,0));return i}function $6(t,n){var e=[];for(let s=0;s<t.length;++s){var i=t[s],o;s==t.length-1?o=t[0]:o=t[s+1];var r=Y6(i,o,n);e.push(...r)}return e}function Y6(t,n,e){var i=[],o=C.Cartesian3.distance(t,n),r=C.Cartesian3.subtract(n,t,new C.Cartesian3);if(r.equalsEpsilon(C.Cartesian3.ZERO,C.Math.EPSILON6))return[];r=C.Cartesian3.normalize(r,r);for(var s=e;s<o;){var a=new C.Cartesian3(r.x*s,r.y*s,r.z*s),l=C.Cartesian3.add(t,a,new C.Cartesian3);i.push(l),s+=e}return i}function J6(t,n){var e=eo(t);if(!Yz(eo(n[0]),eo(n[n.length-1])))return!1;var i=[];i.push(n);var o=sn(i);return ln(e,o)}async function av(t,n,e,i,o,r,s){var a=[];t.forEach(m=>{var w=m.clone();w.z=1e5,a.push(w)});var l=Ss(a,n),c=new C.Cartesian3(-1*i.x,-1*i.y,-1*i.z),h=[],u=[],A=[];for(let m=0;m<l.length;++m){await NS();var f=l[m],d=new C.Ray(f,c),g=void 0;try{g=o.pickFromRay(d)}catch{}if(!g){d=new C.Ray(f,i);try{g=o.pickFromRay(d)}catch{}}if(g){var v=g.position;if(!(!v||!v.x||isNaN(v.x))){var y=Ss([v],e);y.forEach(w=>{w.z+=r}),v=Ss(y,n)[0],A.push(v),v=C.Cartographic.fromCartesian(v),h.push([v.longitude,v.latitude,v.height]),u.push(y[0])}}}return{local:u,world:h,world_cartesian:A}}const _c=class _c extends Tn{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Yo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(p.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(p.track([r,"units"],[e,"units"])),this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.track([r,"positions"],[e,"points"])),this.dispose(p.track([r,"interpolationDistance"],[e,"interpolation"])),this.dispose(p.track([r,"offsetHeight"],[e,"offsetHeight"]));{const s=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};s();const a=this.disposeVar(p.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(a.disposableOn(s))}this.dispose(e.startEvent.don(()=>{this._czmAreaMeasurement.start()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.positions&&Me(r,o,i,s.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:s}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(s.positions&&Me(r,o,i,s.positions,e),!0):!1}};L(_c,"type",_c.register("ESCesiumViewer",Q.ESSurfaceAreaMeasurement.type,_c));let sv=_c;async function j6(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const Cc=class Cc extends Q.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new Q.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends p.Destroyable{constructor(a,l,c){if(super(),this._subContainer=a,!c||!(c instanceof Ye))return;c.extensions.cursorPositionInfo.enabled=!0;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h)),h.style.width="100%",h.style.position="absolute",h.style.height=`${Q.ESViewerStatusBar.defaults.height}px`,h.style.left="0",h.style.bottom="0",h.style.color="#fff",h.style.padding="0 20px 0 0",h.style.boxSizing="border-box",h.style.lineHeight=`${Q.ESViewerStatusBar.defaults.height}px`,h.style.zIndex="100",h.style.alignContent="center",h.style.justifyContent="space-between";const u=document.createElement("span");h.appendChild(u),this.dispose(()=>h.removeChild(u));const A=document.createElement("span");u.appendChild(A),this.dispose(()=>u.removeChild(A));const f=document.createElement("span");u.appendChild(f),f.addEventListener("dblclick",function(){let g=f.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),j6(g)}),f.style.cursor="pointer",this.dispose(()=>u.removeChild(f));const d=document.createElement("span");h.appendChild(d),this.dispose(()=>h.removeChild(d));{const g=()=>{h.style.height=(e.height??Q.ESViewerStatusBar.defaults.height)+"px",h.style.lineHeight=(e.height??Q.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{h.style.fontSize=(e.fontSize??Q.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?h.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:h.style.background=`rgba(${Q.ESViewerStatusBar.defaults.bgColor[0]},${Q.ESViewerStatusBar.defaults.bgColor[1]},${Q.ESViewerStatusBar.defaults.bgColor[2]},${Q.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{d.innerText=`Cesium 版本 : ${C.VERSION} `;let g;const v=()=>{e.show?(h.style.display="flex",g=this.disposeVar(p.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const w=c.getCameraInfo();if(w){const T=(F,D)=>w.position[F].toFixed(D),P=(F,D)=>w.rotation[F].toFixed(D);y=`帧率:${c.getFPS()}FPS 经度: ${T(0,5)}° 纬度: ${T(1,5)}° 高度: ${T(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}A.innerText=y;const _=(E=c.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(_){const T=(P,F)=>_[P].toFixed(F);m=`鼠标位置:${T(0,5)}° ${T(1,5)}° ${T(2,2)}m`}else m="暂时无法获取鼠标位置...";f.innerText=m})),g.start()):(h.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};L(Cc,"type",Cc.register("ESCesiumViewer",Q.ESViewerStatusBar.type,Cc));let lv=Cc;const xc=class xc extends Q.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new Q.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(p.track([r,"show"],[e,"show"])),r.instanceClass=class extends p.Destroyable{constructor(a,l,c){if(super(),this._subContainer=a,!c||!(c instanceof Ye))return;c.extensions.cursorPositionInfo.enabled=!0;const h=document.createElement("div");this._subContainer.appendChild(h),this.dispose(()=>this._subContainer.removeChild(h));const u=document.createElement("div");h.appendChild(u),u.style.width="100%",u.className="ESViewerStatusBarScale",u.style.position="absolute",u.style.display="flex",u.style.height=`${Q.ESViewerStatusBarScale.defaults.height}px`,u.style.left="0",u.style.bottom="0",u.style.color="#fff",u.style.padding="0 20px 0 0",u.style.boxSizing="border-box",u.style.lineHeight=`${Q.ESViewerStatusBarScale.defaults.height}px`,u.style.zIndex="100",u.style.alignContent="center",u.style.justifyContent="space-between";const A=document.createElement("div");u.appendChild(A);const f=document.createElement("div");A.appendChild(f);const d=document.createElement("div");A.appendChild(d);const g=document.createElement("div");u.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const w=document.createElement("span");g.appendChild(w);{const F=()=>{u.style.height=(e.height??Q.ESViewerStatusBarScale.defaults.height)+"px",u.style.lineHeight=(e.height??Q.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(F)),F()}{const F=()=>{u.style.fontSize=(e.fontSize??Q.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(F)),F()}{const F=()=>{e.bgColor?u.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:u.style.background=`rgba(${Q.ESViewerStatusBarScale.defaults.bgColor[0]},${Q.ESViewerStatusBarScale.defaults.bgColor[1]},${Q.ESViewerStatusBarScale.defaults.bgColor[2]},${Q.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(F)),F()}A.style.display="flex",f.style.fontWeight="bold",f.style.padding="0 0 0 25px";let _="EarthSDK";f.innerText=_,d.style.fontWeight="";let E="——免费开源地球可视化开发包";d.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",w.style.display="flex",w.style.zIndex="101",w.style.justifyContent="flex-end",w.style.right="0";const T=()=>{const F=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||F&&F>1e6)v.style.display="none";else{v.style.display="block";const D=i.viewerLegend.legend.computedLengthInStr;D&&(y.innerHTML=D);const B=i.viewerLegend.legend.computedLengthInPixels;if(B){m.style.width=`${B}px`;const S=(135-B)/2;m.style.left=`${S}px`}}};T();const P=setInterval(()=>{T()},200);this.dispose(()=>clearInterval(P));{let F;const D=()=>{e.show?(h.style.display="block",F=this.disposeVar(p.createAnimateFrameWithStartValues(()=>{var b;let B="";const S=c.getCameraInfo();if(S){const x=(U,k)=>S.position[U].toFixed(k);B+=`帧率:${c.getFPS()}FPS 相机: ${x(2,2)}米 `}const I=(b=c.extensions)==null?void 0:b.cursorPositionInfo.cursorPosition;if(I){const x=(U,k)=>I[U].toFixed(k);B+=`位置:${x(0,5)}° ${x(1,5)}° ${x(2,2)}米`}else B+="暂时无法获取鼠标位置...";w.innerText=B})),F.start()):(h.style.display="none",F.destroy())};this.dispose(e.showChanged.disposableOn(D)),D()}}}}get customDiv(){return this._customDiv}};L(xc,"type",xc.register("ESCesiumViewer",Q.ESViewerStatusBarScale.type,xc));let uv=xc;const WS=C.Math.toDegrees,eQ=new C.Cartographic;function qS(t,n,e){const i=C.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=C.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=C.Cartesian3.subtract(o,i,new C.Cartesian3);C.Cartesian3.normalize(r,r);const s=new C.Ray(i,r),a=e.pickFromRay(s),l=e.globe.pick(s,e);var c;if(a&&a.position&&l){const d=C.Cartesian3.distance(i,a.position),g=C.Cartesian3.distance(i,l);c=d<g?a.position:l}else a&&a.position?c=a.position:l&&(c=l);if(!c)return;const h=C.Cartesian3.distance(i,o),A=C.Cartesian3.distance(i,c)>h?o:c,f=C.Cartographic.fromCartesian(A,void 0,eQ);return[WS(f.longitude),WS(f.latitude),f.height]}const Sc=class Sc extends an{constructor(e,i){super(e,i);L(this,"_hideGeoPolylines",this.disposeVar(new En(this.czmViewer,this.sceneObject.id)));L(this,"_visibleGeoPolylines",this.disposeVar(new En(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,s=this._visibleGeoPolylines;this.d(p.track([r,"show"],[e,"show"])),this.d(p.track([s,"show"],[e,"show"])),this.d(p.track([s,"color"],[e,"visibleColor"])),this.d(p.track([r,"color"],[e,"invisibleColor"]));{const a=()=>{const c=e.points,h=e.heightOffset;if(!c||c.length<2||c[0].toString()===c[1].toString()){r.positions=void 0,s.positions=void 0;return}const u=[],A=[],[f,d,g]=c[0],v=[f,d,g+h];try{c.forEach((y,m)=>{if(m===0)return;const w=qS(v,y,o.scene);w?(u.push([y,w]),A.push([v,w])):A.push([v,y])}),r.positions=u,s.positions=A}catch(y){console.warn(y)}};a();const l=this.dv(p.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(a))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,s,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let s=[];return this.visibleGeoPolylines.positions&&(s=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(s=[...s,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,s,e),!0}}};L(Sc,"type",Sc.register("ESCesiumViewer",Q.ESVisibilityAnalysis.type,Sc));let cv=Sc;class jl extends p.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.dv(new p.Event));L(this,"_enableEvent",this.dv(new p.Event));L(this,"_clearEvent",this.dv(new p.Event));L(this,"_gridPoints",this.dv(p.reactJson([])));L(this,"excavationPolylines");L(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new En(e,i)),s=this.dv(new En(e,i));this.excavationPolylines=r,this.fillPolylines=s;const a=r;a.color=[1,1,0,1],this.d(p.track([a,"show"],[this,"show"])),a.show=!1,a.depthTest=!0;const l=s;l.color=[0,0,1,1],this.d(p.track([l,"show"],[this,"show"])),l.show=!1;{const f=this.ad(new _i(e,i));this.d(p.track([f,"show"],[this,"show"])),this.d(p.bind([f,"allowPicking"],[this,"allowPicking"])),this.d(p.bind([f,"positions"],[this,"positions"])),this.d(p.bind([f,"depthTest"],[this,"depthTest"])),this.d(p.bind([f,"outlineWidth"],[this,"outlineWidth"])),this.d(p.bind([f,"outlineColor"],[this,"outlineColor"])),this.d(p.bind([f,"outline"],[this,"outline"])),this.d(p.bind([f,"color"],[this,"fillColor"])),this.d(p.bind([f,"fill"],[this,"filled"])),this.d(p.bind([f,"strokeGround"],[this,"strokeGround"])),this.d(p.bind([f,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{f.flyTo(v)}));const d=()=>{f.positions=this.positions};d();const g=this.dv(p.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(d))}const c=()=>{if(!this.positions||!this.positions.length)return;const{minPos:f,maxPos:d}=Q.getMinMaxCorner(this.positions),g=f[0],v=f[1],y=d[0],m=d[1],_={type:"Polygon",coordinates:[[...this.positions.map(I=>[I[0],I[1]])]]},E=[g,v,y,m],T=this.gridWidth,D=ex(E,T,{units:"meters",mask:_}).features.map(I=>I.geometry.coordinates),B=C.Math.toRadians;return D.map(I=>new C.Cartographic(B(I[0]),B(I[1])))},h=()=>{a.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,a.depthTest=!0},u=this.dv(p.createProcessingFromAsyncFunc(async f=>{const d=c();let g=0,v=300;const y=Math.ceil(d.length/v),m=[];do{let w=[];g===y-1?w=d.slice(g*v):w=d.slice(g*v,(g+1)*v);const _=o.scene.sampleHeightMostDetailed(w),E=await f.promise(_);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const T=C.Math.toDegrees,P=E.map(F=>[T(F.longitude),T(F.latitude),F.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let A=null;{const f=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let d=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const w=this.positions;m[2]>w[0][2]?(d+=this.gridWidth*this.gridWidth*(m[2]-w[0][2]),g.push([m,[m[0],m[1],w[0][2]]])):(v+=this.gridWidth*this.gridWidth*(w[0][2]-m[2]),y.push([m,[m[0],m[1],w[0][2]]]))}),a.positions=g,l.positions=y,a.show=!0,l.show=!0,this.area=j_(this.positions),this.cutVolume=d,this.fillVolume=v,this.cutAndFillVolume=v-d,A&&clearTimeout(A),A=setTimeout(()=>{a.depthTest=!1},200)};f(),this.d(this.gridPointsChanged.don(f)),this.d(()=>clearTimeout(A))}{const f=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};f(),this.d(this.positionsChanged.don(f))}{const f=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const d=JSON.parse(JSON.stringify(this.positions.slice(1)));d.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=d};f(),this.d(this.planeHeightChanged.don(f))}this.d(this.enableEvent.don(()=>{h(),this.gridPoints=[],this.progress=0,u.restart()})),this.d(this.clearEvent.don(()=>{h()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(void 0),planeHeight:p.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(jl||(jl={})),p.extendClassProps(jl.prototype,jl.createDefaultProps);const Ec=class Ec extends Tn{constructor(e,i){super(e,i);L(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new jl(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(p.track([r,"show"],[e,"show"])),this.d(p.bind([r,"positions"],[e,"points"])),this.d(p.track([r,"allowPicking"],[e,"allowPicking"])),this.d(p.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(p.track([r,"gridWidth"],[e,"gridWidth"])),this.d(p.track([e,"cutVolume"],[r,"cutVolume"])),this.d(p.track([e,"fillVolume"],[r,"fillVolume"])),this.d(p.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(p.bind([e,"progress"],[r,"progress"])),this.d(p.track([r,"depthTest"],[e,"depthTest"])),this.d(p.track([r,"outline"],[e,"stroked"])),this.d(p.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(p.track([r,"outlineColor"],[e,"strokeColor"])),this.d(p.track([r,"filled"],[e,"filled"])),this.d(p.track([r,"fillColor"],[e,"fillColor"])),this.d(p.track([r,"fillGround"],[e,"fillGround"])),this.d(p.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(p.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):s.positions?(Me(r,o,i,s.positions,e),!0):!1:!1}};L(Ec,"type",Ec.register("ESCesiumViewer",Q.ESVolumeMeasurement.type,Ec));let hv=Ec;const Pc=class Pc extends Tn{constructor(e,i){super(e,i);L(this,"czmEntity");L(this,"czmPolyline",this.ad(new Q.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(p.bind([r,"show"],[e,"show"])),this.ad(p.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(p.bind([r,"stroked"],[e,"stroked"])),this.ad(p.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(p.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(p.bind([r,"strokeGround"],[e,"strokeGround"]));{const c=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const u=structuredClone(e.points);u.push(u[0]),e.perPositionHeight?r.points=u:r.points=u.map(A=>(A[2]=e.height??Q.ESGeoExtrudedPolygon.defaults.height,A))}};c();const h=this.ad(p.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(h.don(c))}const s=this.czmEntity=o.entities.add({polygon:{}});C.Entity.prototype&&(s.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(s));let a=new C.PolygonHierarchy;s.polygon&&(s.polygon.hierarchy=new C.CallbackProperty(()=>a,!1));const l=()=>{const c=Zt(e.points??Q.ESGeoExtrudedPolygon.defaults.points);if(c.length<2){a=new C.PolygonHierarchy;return}a=new C.PolygonHierarchy(c)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const c=()=>{s.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!s.show&&e.filled)};c();const h=this.ad(p.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(h.don(c))}{const c=()=>{s.polygon&&(s.polygon.perPositionHeight=new C.ConstantProperty(e.perPositionHeight),l())};c(),this.ad(e.perPositionHeightChanged.don(c))}{const c=()=>{s.polygon&&(s.polygon.height=new C.ConstantProperty(e.height??Q.ESGeoExtrudedPolygon.defaults.height))};c(),this.dispose(e.heightChanged.disposableOn(c))}{const c=()=>{s.polygon&&(s.polygon.extrudedHeight=new C.ConstantProperty(e.extrudedHeight??Q.ESGeoExtrudedPolygon.defaults.extrudedHeight))};c(),this.dispose(e.extrudedHeightChanged.disposableOn(c))}{const c=()=>{const h=C.Color.fromCartesian4(C.Cartesian4.fromArray(e.fillColor));s.polygon&&(s.polygon.material=h)};c(),this.dispose(e.fillColorChanged.disposableOn(c))}this.disposeVar(new p.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Ye.ObjectsToExcludeWrapper(i,s)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=Q.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};L(Pc,"type",Pc.register("ESCesiumViewer",Q.ESGeoExtrudedPolygon.type,Pc));let Av=Pc;const Tc=class Tc extends Q.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(p.bind([o,"position"],[n,"position"])),this.dispose(p.bind([o,"rotation"],[n,"rotation"])),this.ad(p.bind([o,"scale"],[n,"scale"])),this.ad(p.track([r,"scale"],[n,"scale"])),this.dispose(p.track([r,"rotation"],[n,"rotation"]));const s=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};s();const a=this.dv(p.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(a.don(s)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};L(Tc,"type",Tc.register("ESCesiumViewer",Q.ESHumanPoi.type,Tc));let fv=Tc;const Ic=class Ic extends Q.EngineObject{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=i.scene.postProcessStages,r=o.add(C.PostProcessStageLibrary.createSilhouetteStage());r.uniforms.color=C.Color.LIME,r.selected=[],this.d(()=>{r.selected=[],o.remove(r)}),this.d(n.highlightInner3DtilesetEvent.don(s=>{r.selected=[];const a=s.d(s.tilesetReady.donce(h=>{h.allTilesLoaded.addEventListener(()=>{var A,f,d,g;const u=(g=(d=(f=(A=h==null?void 0:h._root)==null?void 0:A._content)==null?void 0:f._model)==null?void 0:d._featureTables[0])==null?void 0:g._features[0];u?r.selected=[u]:console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",h),a()})})),l=s.url,c=Date.now();l.includes("?reload=")?s.url=l.replace(/\?reload=\d+/,`?reload=${c}`):s.url=l+`?reload=${c}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(s=>{r.selected=[]})),this.d(n.es3DTileset.tilesetReady.don(s=>{const a=()=>{const c=n.layerConfig;if(!c){s.style=void 0;return}const h=n.colorBlendMode,u=(d,g)=>{try{if(d.getPropertyIds().includes("materialName"))return C.Color.clone(C.Color.WHITE,g);const v=d.getProperty("layer"),y=d.getProperty("dataset"),m=v.toString(),w=y.toString(),_=c.find(T=>T.dataset.toString()===w&&T.layer.toString()===m);if(_&&_.value.color){const T=_.value.color;return C.Color.fromCssColorString(T,g)}const E=c.filter(T=>T.dataset.toString()===w);if(E.length==1&&E[0].value.color){const T=E[0].value.color;return C.Color.fromCssColorString(T,g)}else return C.Color.clone(C.Color.WHITE,g)}catch(v){return console.warn(v),C.Color.clone(C.Color.WHITE,g)}},A=d=>{try{if(d.getPropertyIds().includes("materialName"))return!0;const g=d.getProperty("layer"),v=d.getProperty("dataset"),y=g.toString(),m=v.toString(),w=c.find(E=>E.dataset.toString()===m&&E.layer.toString()===y);if(w&&w.value.visible===!1)return!1;if(w&&w.value.visible===!0)return!0;const _=c.filter(E=>E.dataset.toString()===m);return!(_.length==1&&_[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let f;h!=="HIGHLIGHT"?f=new C.Cesium3DTileStyle({color:{evaluateColor:function(d,g){return u(d,g)}},show:{evaluate:function(d){return A(d)}}}):f=new C.Cesium3DTileStyle({show:{evaluate:function(d){return A(d)}}}),s.style=f};a();const l=this.dv(p.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged));this.d(l.don(()=>{a()}))}))}};L(Ic,"type",Ic.register("ESCesiumViewer",Q.ESRtsTileset.type,Ic));let dv=Ic;const kc=class kc extends ss{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(kc,"type",kc.register("ESCesiumViewer",Q.ESRtsFeatureEditing.type,kc));let pv=kc;const Fc=class Fc extends ss{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Fc,"type",Fc.register("ESCesiumViewer",Q.ESMsTileset.type,Fc));let mv=Fc;const Bc=class Bc extends Ge{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new On(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(p.track([r,"show"],[e,"show"])),this.dispose(p.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:s}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(s.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Bc,"type",Bc.register("ESCesiumViewer",Q.ESStaticMesh.type,Bc));let gv=Bc;const Mc=class Mc extends an{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new g0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),s=Number.isFinite(n.radius)?n.radius:Q.ESSkylineAnalysis.defaults.radius,{depths:a,windowPositions:l,positions:c}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,s),h=Ue(i.camera.position);c.push(h),n.depths=a,n.windowPositions=l,n.points=c}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};L(Mc,"type",Mc.register("ESCesiumViewer",Q.ESSkylineAnalysis.type,Mc));let yv=Mc;var mf={exports:{}},tQ=mf.exports,KS;function nQ(){return KS||(KS=1,function(t){(function(n,e,i){t.exports?t.exports=i():e[n]=i()})("h337",tQ,function(){var n={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},e=function(){var c=function(A){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=A.xField||A.defaultXField,this._yField=A.yField||A.defaultYField,this._valueField=A.valueField||A.defaultValueField,A.radius&&(this._cfgRadius=A.radius)},h=n.defaultRadius;return c.prototype={_organiseData:function(u,A){var f=u[this._xField],d=u[this._yField],g=this._radi,v=this._data,y=this._max,m=this._min,w=u[this._valueField]||1,_=u.radius||this._cfgRadius||h;return v[f]||(v[f]=[],g[f]=[]),v[f][d]?v[f][d]+=w:(v[f][d]=w,g[f][d]=_),v[f][d]>y?(A?this.setDataMax(v[f][d]):this._max=v[f][d],!1):{x:f,y:d,value:w,radius:_,min:m,max:y}},_unOrganizeData:function(){var u=[],A=this._data,f=this._radi;for(var d in A)for(var g in A[d])u.push({x:d,y:g,radius:f[d][g],value:A[d][g]});return{min:this._min,max:this._max,data:u}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var u=arguments[0],A=u.length;A--;)this.addData.call(this,u[A]);else{var f=this._organiseData(arguments[0],!0);f&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[f]})}return this},setData:function(u){var A=u.data,f=A.length;this._data=[],this._radi=[];for(var d=0;d<f;d++)this._organiseData(A[d],!1);return this._max=u.max,this._min=u.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(u){return this._max=u,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(u){return this._min=u,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(u){this._coordinator=u},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},c}(),i=function(){var c=function(f){var d=f.gradient||f.defaultGradient,g=document.createElement("canvas"),v=g.getContext("2d");g.width=256,g.height=1;var y=v.createLinearGradient(0,0,256,1);for(var m in d)y.addColorStop(m,d[m]);return v.fillStyle=y,v.fillRect(0,0,256,1),v.getImageData(0,0,256,1).data},h=function(f,d){var g=document.createElement("canvas"),v=g.getContext("2d"),y=f,m=f;if(g.width=g.height=f*2,d==1)v.beginPath(),v.arc(y,m,f,0,2*Math.PI,!1),v.fillStyle="rgba(0,0,0,1)",v.fill();else{var w=v.createRadialGradient(y,m,f*d,y,m,f);w.addColorStop(0,"rgba(0,0,0,1)"),w.addColorStop(1,"rgba(0,0,0,0)"),v.fillStyle=w,v.fillRect(0,0,2*f,2*f)}return g},u=function(m){for(var d=[],g=m.min,v=m.max,y=m.radi,m=m.data,w=Object.keys(m),_=w.length;_--;)for(var E=w[_],T=Object.keys(m[E]),P=T.length;P--;){var F=T[P],D=m[E][F],B=y[E][F];d.push({x:E,y:F,value:D,radius:B})}return{min:g,max:v,data:d}};function A(f){var d=f.container,g=this.shadowCanvas=document.createElement("canvas"),v=this.canvas=f.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var y=getComputedStyle(f.container)||{};v.className="heatmap-canvas",this._width=v.width=g.width=+y.width.replace(/px/,""),this._height=v.height=g.height=+y.height.replace(/px/,""),this.shadowCtx=g.getContext("2d"),this.ctx=v.getContext("2d"),v.style.cssText=g.style.cssText="position:absolute;left:0;top:0;",d.style.position="relative",d.appendChild(v),this._palette=c(f),this._templates={},this._setStyles(f)}return A.prototype={renderPartial:function(f){this._drawAlpha(f),this._colorize()},renderAll:function(f){this._clear(),this._drawAlpha(u(f)),this._colorize()},_updateGradient:function(f){this._palette=c(f)},updateConfig:function(f){f.gradient&&this._updateGradient(f),this._setStyles(f)},setDimensions:function(f,d){this._width=f,this._height=d,this.canvas.width=this.shadowCanvas.width=f,this.canvas.height=this.shadowCanvas.height=d},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(f){this._blur=f.blur==0?0:f.blur||f.defaultBlur,f.backgroundColor&&(this.canvas.style.backgroundColor=f.backgroundColor),this._opacity=(f.opacity||0)*255,this._maxOpacity=(f.maxOpacity||f.defaultMaxOpacity)*255,this._minOpacity=(f.minOpacity||f.defaultMinOpacity)*255,this._useGradientOpacity=!!f.useGradientOpacity},_drawAlpha:function(v){for(var d=this._min=v.min,g=this._max=v.max,v=v.data||[],y=v.length,m=1-this._blur;y--;){var w=v[y],_=w.x,E=w.y,T=w.radius,P=Math.min(w.value,g),F=_-T,D=E-T,B=this.shadowCtx,S;this._templates[T]=S=h(T,m),B.globalAlpha=(P-d)/(g-d),B.drawImage(S,F,D),F<this._renderBoundaries[0]&&(this._renderBoundaries[0]=F),D<this._renderBoundaries[1]&&(this._renderBoundaries[1]=D),F+2*T>this._renderBoundaries[2]&&(this._renderBoundaries[2]=F+2*T),D+2*T>this._renderBoundaries[3]&&(this._renderBoundaries[3]=D+2*T)}},_colorize:function(){var f=this._renderBoundaries[0],d=this._renderBoundaries[1],g=this._renderBoundaries[2]-f,v=this._renderBoundaries[3]-d,y=this._width,m=this._height,w=this._opacity,_=this._maxOpacity,E=this._minOpacity,T=this._useGradientOpacity;f<0&&(f=0),d<0&&(d=0),f+g>y&&(g=y-f),d+v>m&&(v=m-d);for(var P=this.shadowCtx.getImageData(f,d,g,v),F=P.data,D=F.length,B=this._palette,S=3;S<D;S+=4){var I=F[S],b=I*4;if(b){var x;w>0?x=w:I<_?I<E?x=E:x=I:x=_,F[S-3]=B[b],F[S-2]=B[b+1],F[S-1]=B[b+2],F[S]=T?B[b+3]:x}}this.ctx.putImageData(P,f,d),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(f){var d,g=this.shadowCtx,v=g.getImageData(f.x,f.y,1,1),y=v.data[3],m=this._max,w=this._min;return d=Math.abs(m-w)*(y/255)>>0,d},getDataURL:function(){return this.canvas.toDataURL()}},A}(),o=function(){var c=!1;return n.defaultRenderer==="canvas2d"&&(c=i),c}(),r={merge:function(){for(var l={},c=arguments.length,h=0;h<c;h++){var u=arguments[h];for(var A in u)l[A]=u[A]}return l}},s=function(){var c=function(){function f(){this.cStore={}}return f.prototype={on:function(d,g,v){var y=this.cStore;y[d]||(y[d]=[]),y[d].push(function(m){return g.call(v,m)})},emit:function(d,g){var v=this.cStore;if(v[d])for(var y=v[d].length,m=0;m<y;m++){var w=v[d][m];w(g)}}},f}(),h=function(A){var f=A._renderer,d=A._coordinator,g=A._store;d.on("renderpartial",f.renderPartial,f),d.on("renderall",f.renderAll,f),d.on("extremachange",function(v){A._config.onExtremaChange&&A._config.onExtremaChange({min:v.min,max:v.max,gradient:A._config.gradient||A._config.defaultGradient})}),g.setCoordinator(d)};function u(){var A=this._config=r.merge(n,arguments[0]||{});if(this._coordinator=new c,A.plugin){var f=A.plugin;if(n.plugins[f]){var d=n.plugins[f];this._renderer=new d.renderer(A),this._store=new d.store(A)}else throw new Error("Plugin '"+f+"' not found. Maybe it was not registered.")}else this._renderer=new o(A),this._store=new e(A);h(this)}return u.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(A){return this._config=r.merge(this._config,A),this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(A){return this._store.getValueAt?this._store.getValueAt(A):this._renderer.getValueAt?this._renderer.getValueAt(A):null}},u}(),a={create:function(l){return new s(l)},register:function(l,c){n.plugins[l]=c}};return a})}(mf)),mf.exports}var iQ=nQ();const rQ=Va(iQ);class oQ extends p.Destroyable{constructor(e,i){super();L(this,"_rectangle");L(this,"_updateHeatMapEvent",this.disposeVar(new p.Event));const o=e.sceneObject;this._rectangle=this.ad(new pi(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(p.bind([this.rectangle,"show"],[o,"show"])),this.ad(p.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class aQ extends p.Destroyable{constructor(e,i){super();L(this,"_primitive");L(this,"_updateHeatMapEvent",this.disposeVar(new p.Event));L(this,"czmViewer");L(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,s=r.sceneObject,a=o.viewer;if(!a)return;let l,c;const h=this.ad(new p.Event),u=()=>{A(),!(!l||!c)&&(this._primitive=a.scene.primitives.add(new C.Primitive({geometryInstances:l,appearance:c,asynchronous:!1,allowPicking:s.allowPicking})))},A=()=>{this.primitive&&a.scene.primitives.remove(this.primitive)};this.ad(A);{const f=()=>{this.primitive&&(this.primitive.show=s.show)};f(),this.ad(s.showChanged.don(f))}{const f=this.ad(p.createNextAnimateFrameEvent(s.allowPickingChanged,h));this.ad(f.don(u))}{const f=()=>{r.rectangle&&(l=new C.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(d=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=Q.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;c=new C.MaterialAppearance({material:new C.Material({fabric:{type:"Image",uniforms:{image:d}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=d,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),f(),this.primitive||h.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
4112
4112
|
in vec3 position3DHigh;
|
|
4113
4113
|
in vec3 position3DLow;
|
|
4114
4114
|
in vec3 normal;
|
|
@@ -4131,7 +4131,7 @@ void main()
|
|
|
4131
4131
|
p += vec4(color.a * upDir * ${e??1e3}, 0.0);
|
|
4132
4132
|
|
|
4133
4133
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
4134
|
-
}`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,s=Math.ceil(i||256),[a,l,c,h]=o.rectangle,u=(c-a)/(r-1),A=(h-l)/(s-1),f=[],d=[],g=[],v=[];for(let y=0;y<r;y++){const m=a+u*y;for(let w=0;w<s;w++){const _=l+A*w;o.heatmap.getValueAt({x:y,y:w});const E=C.Cartesian3.fromDegrees(m,_,o.heatmap._renderer._min);f.push(E.x,E.y,E.z),d.push(y/(r-1),w/(s-1)),w!==s-1&&y!==r-1&&(g.push((y+1)*s+w+1,y*s+w+1,y*s+w),g.push(y*s+w,(y+1)*s+w,(y+1)*s+w+1))}}return this.createGeometry(f,d,g,v)}createGeometry(e,i,o,r){return new C.Geometry({attributes:new C.GeometryAttributes({position:new C.GeometryAttribute({componentDatatype:C.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new C.GeometryAttribute({componentDatatype:C.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:C.BoundingSphere.fromVertices(e,new C.Cartesian3,3),primitiveType:C.PrimitiveType.TRIANGLES})}}const Dc=class Dc extends Bn{constructor(e,i){super(e,i);L(this,"_heatmap");L(this,"_div");L(this,"_primitiveObj");L(this,"_rectangle",this.disposeVar(p.react(void 0)));L(this,"onePixelRadius",1e-4);if(!i.viewer){console.warn("viewer is undefined!");return}const r=256;this._primitiveObj=this.ad(new p.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new oQ(this,i):new rQ(this,i))),this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${r}px`,this.div.style.height=`${r}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=iQ.create({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const s=this.ad(new p.Event);let a=[],l={max:100,min:0};{const c=()=>{const u={radius:e.radius??Q.ESHeatMap.defaults.radius,gradient:e.gradient??Q.ESHeatMap.defaults.gradient,blur:e.blur??Q.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(u),this.heatmap._store._cfgRadius=u.radius,s.emit()};c();const h=this.ad(p.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(h.don(c))}{const c=()=>{if(e.data&&e.data.length>2){const{maxPos:u,minPos:A}=Q.getMinMaxCorner(e.data),f=u[0]-A[0],d=u[1]-A[1];if(l={max:u[2]??100,min:A[2]??0},!Number.isFinite(f)||!Number.isFinite(d)||f<=0||d<=0)return;const g=1/Math.cos((A[1]+d*.5)*Math.PI/180);if(g==1/0)return;const v=r*d/f*g;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=f/r*(e.radius??Q.ESHeatMap.defaults.radius)*2,m=d/v*(e.radius??Q.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,m),this.rectangle=[A[0]-y,A[1]-m,u[0]+y,u[1]+m],a=aQ(e.data,this.rectangle,r,v),s.emit()}};c();const h=this.ad(p.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(h.don(c))}{const c=()=>{const h={max:l.max,min:l.min,data:a};this.heatmap.setData(h),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};c(),this.ad(s.don(c))}this.ad(this._primitiveObj.objChanged.don(()=>{s.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.rectangle?(Me(r,o,i,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};L(Dc,"type",Dc.register("ESCesiumViewer",Q.ESHeatMap.type,Dc));let vv=Dc;function aQ(t,n,e,i,o){return t.map(r=>({x:(r[0]-n[0])*e/(n[2]-n[0])|0,y:(1-(r[1]-n[1])/(n[3]-n[1]))*i|0,value:r[2]}))}const oa=class oa extends hn{constructor(e){super();L(this,"_config",this.disposeVar(p.react(oa.defaultConfig)));L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_pointerEventFilterFunc",this.disposeVar(p.react(oa.defaultPointerEventFilterFunc)));if(!!e.viewer){{const i=()=>{const{config:o}=this;o.clickEnabled!==void 0&&(this.clickEnabled=o.clickEnabled),o.dblClickEnabled!==void 0&&(this.dblClickEnabled=o.dblClickEnabled)};i(),this.dispose(this.configChanged.disposableOn(i))}{const i=this.ad(new On(e));i.pixelSize=4,i.outlineColor=[0,0,.8,1],i.outlineWidth=2,i.allowPicking=!1;{const o=()=>{if(!this.position)return;const r=[...this.position];e.editingHeightOffset&&(r[2]-=e.editingHeightOffset),i.position=r,i.show=!!this.position};o(),this.dispose(this.positionChanged.disposableOn(o))}}this.ad(new p.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new sQ(e,this):void 0))}}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}};L(oa,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!1}),L(oa,"defaultPointerEventFilterFunc",e=>e.button===0),L(oa,"defaults",{...hn.defaults,position:[116.39,39.9,0]});let ii=oa;(t=>{t.createDefaultProps=()=>({...hn.createDefaultProps(),position:p.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(ii||(ii={})),p.extendClassProps(ii.prototype,ii.createDefaultProps);class sQ extends p.Destroyable{constructor(e,i){super();L(this,"_doings",[]);L(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=i;{const o=(r,s)=>{s=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||s=="dblclick"&&(!i.dblClickEnabled||!i.pointerEventFilterFunc(r))||(i.over(),i.enabled=!1)};this.ad(e.clickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"dblclick")}))}this.ad(e.pointerMoveEvent.don(o=>{if(!o.pointerEvent)return;const r=new lQ(this,o.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const a=[...s];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),i.position=a,this._doings.splice(0,this._doings.indexOf(r)+1).forEach(c=>c.destroy())});this._doings.push(r)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class lQ extends p.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=Kv(o,e,this._owner.placeEditing.virtualHeight),[s]=p.getEventFromPromise(r);this.dispose(s.disposableOn(i))}}class kn extends hn{constructor(){super()}}L(kn,"defaults",{...hn.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...hn.createDefaultProps(),position:p.reactArrayWithUndefined(void 0)})})(kn||(kn={})),p.extendClassProps(kn.prototype,kn.createDefaultProps);function wv(t,n){const e=new Je(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const Kn=class Kn extends p.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(wv(n,Kn.defaults.xAxisColor)),i=this.disposeVar(wv(n,Kn.defaults.yAxisColor)),o=this.disposeVar(wv(n,Kn.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const s=this.ad(p.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(s.disposableOn(r))}{const r=()=>{const{position:a=Kn.defaults.position,heading:l=Kn.defaults.heading}=this,[c,h,u]=a,{dimensions:A=Kn.defaults.dimensions}=this;o.positions=[a,[c,h,u+A[2]]];const f=Q.geoRhumbDestination(a,A[0],90+l);f&&(e.positions=[a,f]);const d=Q.geoRhumbDestination(a,A[1],0+l);d&&(i.positions=[a,d])};r();const s=this.disposeVar(p.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(s.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??Kn.defaults.xAxisColor,i.color=this.yAxisColor??Kn.defaults.yAxisColor,o.color=this.zAxisColor??Kn.defaults.zAxisColor};r();const s=this.disposeVar(p.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(s.disposableOn(r))}}};L(Kn,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let oo=Kn;(t=>{t.createDefaultProps=()=>({show:!0,position:p.reactArrayWithUndefined(void 0),heading:0,dimensions:p.reactArray([1e3,1e3,1e3]),xAxisColor:p.reactArray([1,0,0,1]),yAxisColor:p.reactArray([0,1,0,1]),zAxisColor:p.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(oo||(oo={})),p.extendClassProps(oo.prototype,oo.createDefaultProps);const co=class co extends kn{constructor(e){super();L(this,"_opInfo",{step:this.ad(p.react(!1)),moved:this.ad(p.react(!1)),constraintMode:this.ad(p.react("none")),originPosition:this.disposeVar(p.reactArray(kn.defaults.position)),originHeading:this.disposeVar(p.react(0)),originDimensions:this.disposeVar(p.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(p.reactArray([0,0,0])),movingPosition:this.disposeVar(p.reactArray([0,0,0])),targetPosition:this.disposeVar(p.reactArray([0,0,0])),targetHeading:this.disposeVar(p.react(0))});L(this,"_createCoordinates",e=>{const i=this.ad(new oo(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{ZS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const s=[...this.position??co.defaults.position];e.editingHeightOffset&&(s[2]-=e.editingHeightOffset),i.position=s};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{i.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{i.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return i});L(this,"_createOriginCoordinates",e=>{const i=this.ad(new oo(e));i.xAxisColor=[1,0,0,.5],i.yAxisColor=[0,1,0,.5],i.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:r,originDimensions:s}=this._opInfo;{const a=()=>{i.position=o.value};a(),this.dispose(o.changed.disposableOn(a))}{const a=()=>{i.heading=r.value??0};a(),this.dispose(r.changed.disposableOn(a))}{const a=()=>{i.dimensions=s.value};a(),this.dispose(s.changed.disposableOn(a))}return i});L(this,"_createGrid",e=>{const i=this.ad(new $n(e));{const o=()=>{const s=this._opInfo.originPosition.value,a=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],c=[];for(let h=-4;h<5;++h){const u=Q.geoRhumbDestination(s,l*.2*h,a+90);if(u){const A=Q.geoRhumbDestination(u,l,a+180),f=Q.geoRhumbDestination(u,l,a);A&&f&&c.push([A,u,f])}}for(let h=-4;h<5;++h){const u=Q.geoRhumbDestination(s,l*.2*h,a);if(u){const A=Q.geoRhumbDestination(u,l,a-90),f=Q.geoRhumbDestination(u,l,a+90);A&&f&&c.push([A,u,f])}}i.positions=c};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(r.disposableOn(o))}return i});L(this,"_createHelpLine",e=>{const i=this.ad(new Je(e));i.hasDash=!0,i.arcType="RHUMB",i.color=[1,1,0,.99];{const o=()=>{i.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},r=this.ad(p.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(r.don(o))}return i});L(this,"_createCircle",e=>{const i=this.ad(new $n(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(p.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const s=this._opInfo.originPosition.value,a=this._opInfo.originDimensions.value[0],l=[],c=32;for(let h=0;h<=c;++h){const u=Q.geoRhumbDestination(s,a,h*360/c);u&&l.push(u)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});L(this,"_pickingXYProcessing",e=>this.ad(new p.Processing((i,o,r)=>{const s=[0,0,0],a=new C.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const c=Zn(p.getDomEventCurrentTargetPos(l.pointerEvent));if(!ha(e.viewer.scene,c,this._opInfo.originPosition.value[2],a))return;ua(a,s),this._opInfo.constraintMode.value==="x"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,s,s):this._opInfo.constraintMode.value==="y"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,s,s):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=s;const h=[0,0,0];Q.geoRhumbDestination(s,r,o,h),this._opInfo.targetPosition.value=h})})));L(this,"_pickingZProcessing",e=>this.ad(new p.Processing(()=>{const i=new C.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const s=Zn(p.getDomEventCurrentTargetPos(r.pointerEvent));if(!jc(e.viewer.scene,vt(this._opInfo.originPosition.value),s,i))return;const a=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+a]}})})));L(this,"_pickingZAxisProcessing",e=>this.ad(new p.Processing(()=>{const i=[0,0,0],o=new C.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const s=Zn(p.getDomEventCurrentTargetPos(r.pointerEvent));if(!ha(e.viewer.scene,s,this._opInfo.originPosition.value[2],o))return;ua(o,i);const a=Q.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),c=Q.geoRhumbHeading(this._opInfo.originPosition.value,i)-a;let h=this._opInfo.originHeading.value+c;h=C.Math.toDegrees(C.Math.negativePiToPi(C.Math.toRadians(h))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=h})})));if(!e.viewer)return;const i=this.ad(p.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new Vf(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const s=[...r];e.editingHeightOffset&&(s[2]+=e.editingHeightOffset),this.position=s}})),this.ad(this._opInfo.targetHeading.changed.don(r=>this._opInfo.moved&&(this.heading=r)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,s)=>r===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),r=this._createOriginCoordinates(e),s=this._createGrid(e),a=this._createHelpLine(e),l=this._createCircle(e);{const d=()=>{l.show=s.show=this.enabled&&this.showCircle,a.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,r.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};d();const g=this.ad(p.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(g.don(d))}{const d=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};d();const g=this.ad(p.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(g.don(d))}{const d=()=>{s.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],l.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],ZS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};d(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(d))}const c=this._pickingXYProcessing(e),h=this._pickingZProcessing(e),u=this._pickingZAxisProcessing(e),A=this.ad(p.createProcessingFromAsyncFunc(async d=>{do this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",d.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await p.step(d,async g=>{const v=()=>{const E=[...this.position??co.defaults.position];e.editingHeightOffset&&(E[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=E},y=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,m=()=>this._opInfo.originDimensions.value=i.value;g.disposer.dispose((v(),this.positionChanged.don(v))),g.disposer.dispose((y(),this.headingChanged.don(y))),g.disposer.dispose((m(),i.changed.don(m)));const w={constraintMode:"none",startDragPos:[0,0,0]},_=E=>{const T={position:o.position??co.defaults.position,heading:o.heading??co.defaults.heading,dimensions:o.dimensions??co.defaults.dimensions};e.viewer&&If(E,e.viewer.scene,T,this.axisSnapPixelSize,w,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=w.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=w.startDragPos};g.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&_(E.pointerEvent)})),await p.step(g,E=>new Promise((T,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(F=>{F.pointerEvent&&_(F.pointerEvent),F.pointerEvent&&F.pointerEvent.button===0&&w.constraintMode!=="none"&&T()}))}))}),this._opInfo.step.value=!1,await p.step(d,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const v=Q.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=Q.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);c.restart(void 0,v,y),g.disposer.dispose(()=>c.cancel())}else this._opInfo.constraintMode.value==="z"?(h.restart(),g.disposer.dispose(()=>h.cancel())):this._opInfo.constraintMode.value==="zAxis"?(u.restart(),g.disposer.dispose(()=>u.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await p.step(g,v=>new Promise((y,m)=>{v.disposer.dispose(m),v.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),v.disposer.dispose(e.pointerOutEvent.don(()=>y()))}))});while(!0)})),f=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};f(),this.ad(this.enabledChanged.don(f))}}};L(co,"defaults",{...kn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let ir=co;(t=>{t.createDefaultProps=()=>({...kn.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(ir||(ir={})),p.extendClassProps(ir.prototype,ir.createDefaultProps);function ZS(t,n,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],n==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class bv extends p.HasOwner{constructor(e){super(e);L(this,"_valid",!1);L(this,"_normal",new C.Cartesian3(0,0,0));L(this,"_origin",new C.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const i=this.owner.cartesian,o=Zn(e);return Zv(this.scene,i,this.normal,o)}}class uQ extends bv{constructor(n){super(n);{const e=()=>{const o=at({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const i=this.ad(p.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class cQ extends bv{constructor(n){super(n);const e=()=>{const i=at({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=at({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:C.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[0],r.y=-o[1],r.z=-o[2]}{const r=this._origin;r.x=o[4],r.y=o[5],r.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class hQ extends bv{constructor(n){super(n);const e=()=>{const i=at({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=at({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:C.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[4],r.y=-o[5],r.z=-o[6]}{const r=this._origin;r.x=o[8],r.y=o[9],r.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class Es extends p.Destroyable{constructor(e){super();L(this,"_czmTexture");L(this,"_customPrimitiveForCircle");L(this,"_circleCanvas");L(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new At(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let i=this.disposeVar(p.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const s=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},c=this._circleCanvas,h=this.color,u=`rgba(${h[0]*255|0}, ${h[1]*255|0}, ${h[2]*255|0}, ${h[3]})`;c.clearRect(0,0,256,256),c.lineWidth=6,c.beginPath(),c.arc(128,128,64,0,Math.PI*2,!1),c.strokeStyle=`rgba(0,0,0,${h[3]})`,c.stroke(),c.lineWidth=4,c.beginPath(),c.arc(128,128,64,0,Math.PI*2,!1),c.strokeStyle=u,c.stroke();{c.lineWidth=1,c.beginPath();let d=C.Math.zeroToTwoPi(l.startRotation),g=C.Math.zeroToTwoPi(l.endRotation);g<d&&(g+=C.Math.TWO_PI),(d!==g||d!==0)&&(c.moveTo(128,128),c.arc(128,128,64,d,g,g-d>Math.PI),c.lineTo(128,128),c.strokeStyle="rgba(255, 255, 0, 1.0)",c.stroke())}let A=C.Math.negativePiToPi(l.rotation);c.lineWidth=3,c.beginPath(),c.moveTo(128,128),c.arc(128,128,64,0,A,C.Math.negativePiToPi(A-0)<0),c.lineTo(128,128),c.fillStyle=`rgba(${h[0]*255|0}, ${h[1]*255|0}, ${h[2]*255|0}, 0.5)`,c.fill();{c.save(),c.font="16px console",c.textBaseline="middle";const v=`${(C.Math.negativePiToPi(A-0)*180/Math.PI*10|0)/10}°`;var f=c.measureText(v).width;c.translate(128,128),c.rotate(Math.PI*.5),A=C.Math.negativePiToPi(A-0)+0,c.rotate((A+0)*.5),c.scale(i.value?-1:1,1),c.translate(-128,-128),c.fillStyle="white",c.fillText(v,128-f*.5,54),c.lineWidth=1,c.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};s();const a=this.ad(p.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(a.don(s)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(s))}{const r=()=>{const a=at({rotation:this.selfRotation});if(!a)return;const l=at({position:this.position,rotation:this.rotation,localModelMatrix:C.Matrix4.toArray(a)});if(!l)return;const{viewer:c}=e;if(!c)return;const h=C.Cartesian3.dot(c.scene.camera.directionWC,new C.Cartesian3(l[8],l[9],l[10]));i.value=h>0};r();const s=this.ad(p.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(s.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(AQ(e)),this.dispose(p.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(p.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(p.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(p.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=at({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&C.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}_createDebugAxis(e){this._debugAxis=this.ad(fQ(e)),this.dispose(p.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(p.track([this._debugAxis,"position"],[this,"position"])),this.dispose(p.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(p.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=at({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&C.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}}L(Es,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),selfRotation:p.reactArray([0,0,0]),pixelSize:300,color:p.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(Es||(Es={})),p.extendClassProps(Es.prototype,Es.createDefaultProps);function AQ(t){return Kf({type:"CzmCustomPrimitive",allowPicking:!0,positionEditing:!1,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},st,t)}function fQ(t){return Kf({type:"CzmCustomPrimitive",allowPicking:!0,positionEditing:!1,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
|
|
4134
|
+
}`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,s=Math.ceil(i||256),[a,l,c,h]=o.rectangle,u=(c-a)/(r-1),A=(h-l)/(s-1),f=[],d=[],g=[],v=[];for(let y=0;y<r;y++){const m=a+u*y;for(let w=0;w<s;w++){const _=l+A*w;o.heatmap.getValueAt({x:y,y:w});const E=C.Cartesian3.fromDegrees(m,_,o.heatmap._renderer._min);f.push(E.x,E.y,E.z),d.push(y/(r-1),w/(s-1)),w!==s-1&&y!==r-1&&(g.push((y+1)*s+w+1,y*s+w+1,y*s+w),g.push(y*s+w,(y+1)*s+w,(y+1)*s+w+1))}}return this.createGeometry(f,d,g,v)}createGeometry(e,i,o,r){return new C.Geometry({attributes:new C.GeometryAttributes({position:new C.GeometryAttribute({componentDatatype:C.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new C.GeometryAttribute({componentDatatype:C.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:C.BoundingSphere.fromVertices(e,new C.Cartesian3,3),primitiveType:C.PrimitiveType.TRIANGLES})}}const Dc=class Dc extends Bn{constructor(e,i){super(e,i);L(this,"_heatmap");L(this,"_div");L(this,"_primitiveObj");L(this,"_rectangle",this.disposeVar(p.react(void 0)));L(this,"onePixelRadius",1e-4);if(!i.viewer){console.warn("viewer is undefined!");return}const r=256;this._primitiveObj=this.ad(new p.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new aQ(this,i):new oQ(this,i))),this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${r}px`,this.div.style.height=`${r}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=rQ.create({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const s=this.ad(new p.Event);let a=[],l={max:100,min:0};{const c=()=>{const u={radius:e.radius??Q.ESHeatMap.defaults.radius,gradient:e.gradient??Q.ESHeatMap.defaults.gradient,blur:e.blur??Q.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(u),this.heatmap._store._cfgRadius=u.radius,s.emit()};c();const h=this.ad(p.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(h.don(c))}{const c=()=>{if(e.data&&e.data.length>2){const{maxPos:u,minPos:A}=Q.getMinMaxCorner(e.data),f=u[0]-A[0],d=u[1]-A[1];if(l={max:u[2]??100,min:A[2]??0},!Number.isFinite(f)||!Number.isFinite(d)||f<=0||d<=0)return;const g=1/Math.cos((A[1]+d*.5)*Math.PI/180);if(g==1/0)return;const v=r*d/f*g;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=f/r*(e.radius??Q.ESHeatMap.defaults.radius)*2,m=d/v*(e.radius??Q.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,m),this.rectangle=[A[0]-y,A[1]-m,u[0]+y,u[1]+m],a=sQ(e.data,this.rectangle,r,v),s.emit()}};c();const h=this.ad(p.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(h.don(c))}{const c=()=>{const h={max:l.max,min:l.min,data:a};this.heatmap.setData(h),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};c(),this.ad(s.don(c))}this.ad(this._primitiveObj.objChanged.don(()=>{s.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.rectangle?(Me(r,o,i,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};L(Dc,"type",Dc.register("ESCesiumViewer",Q.ESHeatMap.type,Dc));let vv=Dc;function sQ(t,n,e,i,o){return t.map(r=>({x:(r[0]-n[0])*e/(n[2]-n[0])|0,y:(1-(r[1]-n[1])/(n[3]-n[1]))*i|0,value:r[2]}))}const oa=class oa extends hn{constructor(e){super();L(this,"_config",this.disposeVar(p.react(oa.defaultConfig)));L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_pointerEventFilterFunc",this.disposeVar(p.react(oa.defaultPointerEventFilterFunc)));if(!!e.viewer){{const i=()=>{const{config:o}=this;o.clickEnabled!==void 0&&(this.clickEnabled=o.clickEnabled),o.dblClickEnabled!==void 0&&(this.dblClickEnabled=o.dblClickEnabled)};i(),this.dispose(this.configChanged.disposableOn(i))}{const i=this.ad(new On(e));i.pixelSize=4,i.outlineColor=[0,0,.8,1],i.outlineWidth=2,i.allowPicking=!1;{const o=()=>{if(!this.position)return;const r=[...this.position];e.editingHeightOffset&&(r[2]-=e.editingHeightOffset),i.position=r,i.show=!!this.position};o(),this.dispose(this.positionChanged.disposableOn(o))}}this.ad(new p.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new lQ(e,this):void 0))}}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}};L(oa,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!1}),L(oa,"defaultPointerEventFilterFunc",e=>e.button===0),L(oa,"defaults",{...hn.defaults,position:[116.39,39.9,0]});let ii=oa;(t=>{t.createDefaultProps=()=>({...hn.createDefaultProps(),position:p.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(ii||(ii={})),p.extendClassProps(ii.prototype,ii.createDefaultProps);class lQ extends p.Destroyable{constructor(e,i){super();L(this,"_doings",[]);L(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=i;{const o=(r,s)=>{s=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||s=="dblclick"&&(!i.dblClickEnabled||!i.pointerEventFilterFunc(r))||(i.over(),i.enabled=!1)};this.ad(e.clickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"dblclick")}))}this.ad(e.pointerMoveEvent.don(o=>{if(!o.pointerEvent)return;const r=new uQ(this,o.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const a=[...s];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),i.position=a,this._doings.splice(0,this._doings.indexOf(r)+1).forEach(c=>c.destroy())});this._doings.push(r)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class uQ extends p.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=Kv(o,e,this._owner.placeEditing.virtualHeight),[s]=p.getEventFromPromise(r);this.dispose(s.disposableOn(i))}}class kn extends hn{constructor(){super()}}L(kn,"defaults",{...hn.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...hn.createDefaultProps(),position:p.reactArrayWithUndefined(void 0)})})(kn||(kn={})),p.extendClassProps(kn.prototype,kn.createDefaultProps);function wv(t,n){const e=new Je(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const Kn=class Kn extends p.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(wv(n,Kn.defaults.xAxisColor)),i=this.disposeVar(wv(n,Kn.defaults.yAxisColor)),o=this.disposeVar(wv(n,Kn.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const s=this.ad(p.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(s.disposableOn(r))}{const r=()=>{const{position:a=Kn.defaults.position,heading:l=Kn.defaults.heading}=this,[c,h,u]=a,{dimensions:A=Kn.defaults.dimensions}=this;o.positions=[a,[c,h,u+A[2]]];const f=Q.geoRhumbDestination(a,A[0],90+l);f&&(e.positions=[a,f]);const d=Q.geoRhumbDestination(a,A[1],0+l);d&&(i.positions=[a,d])};r();const s=this.disposeVar(p.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(s.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??Kn.defaults.xAxisColor,i.color=this.yAxisColor??Kn.defaults.yAxisColor,o.color=this.zAxisColor??Kn.defaults.zAxisColor};r();const s=this.disposeVar(p.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(s.disposableOn(r))}}};L(Kn,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let oo=Kn;(t=>{t.createDefaultProps=()=>({show:!0,position:p.reactArrayWithUndefined(void 0),heading:0,dimensions:p.reactArray([1e3,1e3,1e3]),xAxisColor:p.reactArray([1,0,0,1]),yAxisColor:p.reactArray([0,1,0,1]),zAxisColor:p.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(oo||(oo={})),p.extendClassProps(oo.prototype,oo.createDefaultProps);const co=class co extends kn{constructor(e){super();L(this,"_opInfo",{step:this.ad(p.react(!1)),moved:this.ad(p.react(!1)),constraintMode:this.ad(p.react("none")),originPosition:this.disposeVar(p.reactArray(kn.defaults.position)),originHeading:this.disposeVar(p.react(0)),originDimensions:this.disposeVar(p.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(p.reactArray([0,0,0])),movingPosition:this.disposeVar(p.reactArray([0,0,0])),targetPosition:this.disposeVar(p.reactArray([0,0,0])),targetHeading:this.disposeVar(p.react(0))});L(this,"_createCoordinates",e=>{const i=this.ad(new oo(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{ZS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const s=[...this.position??co.defaults.position];e.editingHeightOffset&&(s[2]-=e.editingHeightOffset),i.position=s};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{i.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{i.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return i});L(this,"_createOriginCoordinates",e=>{const i=this.ad(new oo(e));i.xAxisColor=[1,0,0,.5],i.yAxisColor=[0,1,0,.5],i.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:r,originDimensions:s}=this._opInfo;{const a=()=>{i.position=o.value};a(),this.dispose(o.changed.disposableOn(a))}{const a=()=>{i.heading=r.value??0};a(),this.dispose(r.changed.disposableOn(a))}{const a=()=>{i.dimensions=s.value};a(),this.dispose(s.changed.disposableOn(a))}return i});L(this,"_createGrid",e=>{const i=this.ad(new $n(e));{const o=()=>{const s=this._opInfo.originPosition.value,a=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],c=[];for(let h=-4;h<5;++h){const u=Q.geoRhumbDestination(s,l*.2*h,a+90);if(u){const A=Q.geoRhumbDestination(u,l,a+180),f=Q.geoRhumbDestination(u,l,a);A&&f&&c.push([A,u,f])}}for(let h=-4;h<5;++h){const u=Q.geoRhumbDestination(s,l*.2*h,a);if(u){const A=Q.geoRhumbDestination(u,l,a-90),f=Q.geoRhumbDestination(u,l,a+90);A&&f&&c.push([A,u,f])}}i.positions=c};o();const r=this.disposeVar(p.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(r.disposableOn(o))}return i});L(this,"_createHelpLine",e=>{const i=this.ad(new Je(e));i.hasDash=!0,i.arcType="RHUMB",i.color=[1,1,0,.99];{const o=()=>{i.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},r=this.ad(p.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(r.don(o))}return i});L(this,"_createCircle",e=>{const i=this.ad(new $n(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(p.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const s=this._opInfo.originPosition.value,a=this._opInfo.originDimensions.value[0],l=[],c=32;for(let h=0;h<=c;++h){const u=Q.geoRhumbDestination(s,a,h*360/c);u&&l.push(u)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});L(this,"_pickingXYProcessing",e=>this.ad(new p.Processing((i,o,r)=>{const s=[0,0,0],a=new C.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const c=Zn(p.getDomEventCurrentTargetPos(l.pointerEvent));if(!ha(e.viewer.scene,c,this._opInfo.originPosition.value[2],a))return;ua(a,s),this._opInfo.constraintMode.value==="x"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,s,s):this._opInfo.constraintMode.value==="y"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,s,s):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=s;const h=[0,0,0];Q.geoRhumbDestination(s,r,o,h),this._opInfo.targetPosition.value=h})})));L(this,"_pickingZProcessing",e=>this.ad(new p.Processing(()=>{const i=new C.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const s=Zn(p.getDomEventCurrentTargetPos(r.pointerEvent));if(!jc(e.viewer.scene,vt(this._opInfo.originPosition.value),s,i))return;const a=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+a]}})})));L(this,"_pickingZAxisProcessing",e=>this.ad(new p.Processing(()=>{const i=[0,0,0],o=new C.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const s=Zn(p.getDomEventCurrentTargetPos(r.pointerEvent));if(!ha(e.viewer.scene,s,this._opInfo.originPosition.value[2],o))return;ua(o,i);const a=Q.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),c=Q.geoRhumbHeading(this._opInfo.originPosition.value,i)-a;let h=this._opInfo.originHeading.value+c;h=C.Math.toDegrees(C.Math.negativePiToPi(C.Math.toRadians(h))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=h})})));if(!e.viewer)return;const i=this.ad(p.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new Vf(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const s=[...r];e.editingHeightOffset&&(s[2]+=e.editingHeightOffset),this.position=s}})),this.ad(this._opInfo.targetHeading.changed.don(r=>this._opInfo.moved&&(this.heading=r)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,s)=>r===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),r=this._createOriginCoordinates(e),s=this._createGrid(e),a=this._createHelpLine(e),l=this._createCircle(e);{const d=()=>{l.show=s.show=this.enabled&&this.showCircle,a.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,r.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};d();const g=this.ad(p.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(g.don(d))}{const d=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};d();const g=this.ad(p.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(g.don(d))}{const d=()=>{s.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],l.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],ZS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};d(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(d))}const c=this._pickingXYProcessing(e),h=this._pickingZProcessing(e),u=this._pickingZAxisProcessing(e),A=this.ad(p.createProcessingFromAsyncFunc(async d=>{do this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",d.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await p.step(d,async g=>{const v=()=>{const E=[...this.position??co.defaults.position];e.editingHeightOffset&&(E[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=E},y=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,m=()=>this._opInfo.originDimensions.value=i.value;g.disposer.dispose((v(),this.positionChanged.don(v))),g.disposer.dispose((y(),this.headingChanged.don(y))),g.disposer.dispose((m(),i.changed.don(m)));const w={constraintMode:"none",startDragPos:[0,0,0]},_=E=>{const T={position:o.position??co.defaults.position,heading:o.heading??co.defaults.heading,dimensions:o.dimensions??co.defaults.dimensions};e.viewer&&If(E,e.viewer.scene,T,this.axisSnapPixelSize,w,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=w.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=w.startDragPos};g.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&_(E.pointerEvent)})),await p.step(g,E=>new Promise((T,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(F=>{F.pointerEvent&&_(F.pointerEvent),F.pointerEvent&&F.pointerEvent.button===0&&w.constraintMode!=="none"&&T()}))}))}),this._opInfo.step.value=!1,await p.step(d,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const v=Q.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=Q.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);c.restart(void 0,v,y),g.disposer.dispose(()=>c.cancel())}else this._opInfo.constraintMode.value==="z"?(h.restart(),g.disposer.dispose(()=>h.cancel())):this._opInfo.constraintMode.value==="zAxis"?(u.restart(),g.disposer.dispose(()=>u.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await p.step(g,v=>new Promise((y,m)=>{v.disposer.dispose(m),v.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),v.disposer.dispose(e.pointerOutEvent.don(()=>y()))}))});while(!0)})),f=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};f(),this.ad(this.enabledChanged.don(f))}}};L(co,"defaults",{...kn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let ir=co;(t=>{t.createDefaultProps=()=>({...kn.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(ir||(ir={})),p.extendClassProps(ir.prototype,ir.createDefaultProps);function ZS(t,n,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],n==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class bv extends p.HasOwner{constructor(e){super(e);L(this,"_valid",!1);L(this,"_normal",new C.Cartesian3(0,0,0));L(this,"_origin",new C.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const i=this.owner.cartesian,o=Zn(e);return Zv(this.scene,i,this.normal,o)}}class cQ extends bv{constructor(n){super(n);{const e=()=>{const o=at({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const i=this.ad(p.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class hQ extends bv{constructor(n){super(n);const e=()=>{const i=at({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=at({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:C.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[0],r.y=-o[1],r.z=-o[2]}{const r=this._origin;r.x=o[4],r.y=o[5],r.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class AQ extends bv{constructor(n){super(n);const e=()=>{const i=at({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=at({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:C.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[4],r.y=-o[5],r.z=-o[6]}{const r=this._origin;r.x=o[8],r.y=o[9],r.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class Es extends p.Destroyable{constructor(e){super();L(this,"_czmTexture");L(this,"_customPrimitiveForCircle");L(this,"_circleCanvas");L(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new At(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let i=this.disposeVar(p.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const s=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},c=this._circleCanvas,h=this.color,u=`rgba(${h[0]*255|0}, ${h[1]*255|0}, ${h[2]*255|0}, ${h[3]})`;c.clearRect(0,0,256,256),c.lineWidth=6,c.beginPath(),c.arc(128,128,64,0,Math.PI*2,!1),c.strokeStyle=`rgba(0,0,0,${h[3]})`,c.stroke(),c.lineWidth=4,c.beginPath(),c.arc(128,128,64,0,Math.PI*2,!1),c.strokeStyle=u,c.stroke();{c.lineWidth=1,c.beginPath();let d=C.Math.zeroToTwoPi(l.startRotation),g=C.Math.zeroToTwoPi(l.endRotation);g<d&&(g+=C.Math.TWO_PI),(d!==g||d!==0)&&(c.moveTo(128,128),c.arc(128,128,64,d,g,g-d>Math.PI),c.lineTo(128,128),c.strokeStyle="rgba(255, 255, 0, 1.0)",c.stroke())}let A=C.Math.negativePiToPi(l.rotation);c.lineWidth=3,c.beginPath(),c.moveTo(128,128),c.arc(128,128,64,0,A,C.Math.negativePiToPi(A-0)<0),c.lineTo(128,128),c.fillStyle=`rgba(${h[0]*255|0}, ${h[1]*255|0}, ${h[2]*255|0}, 0.5)`,c.fill();{c.save(),c.font="16px console",c.textBaseline="middle";const v=`${(C.Math.negativePiToPi(A-0)*180/Math.PI*10|0)/10}°`;var f=c.measureText(v).width;c.translate(128,128),c.rotate(Math.PI*.5),A=C.Math.negativePiToPi(A-0)+0,c.rotate((A+0)*.5),c.scale(i.value?-1:1,1),c.translate(-128,-128),c.fillStyle="white",c.fillText(v,128-f*.5,54),c.lineWidth=1,c.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};s();const a=this.ad(p.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(a.don(s)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(s))}{const r=()=>{const a=at({rotation:this.selfRotation});if(!a)return;const l=at({position:this.position,rotation:this.rotation,localModelMatrix:C.Matrix4.toArray(a)});if(!l)return;const{viewer:c}=e;if(!c)return;const h=C.Cartesian3.dot(c.scene.camera.directionWC,new C.Cartesian3(l[8],l[9],l[10]));i.value=h>0};r();const s=this.ad(p.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(s.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(fQ(e)),this.dispose(p.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(p.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(p.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(p.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=at({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&C.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}_createDebugAxis(e){this._debugAxis=this.ad(dQ(e)),this.dispose(p.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(p.track([this._debugAxis,"position"],[this,"position"])),this.dispose(p.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(p.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=at({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&C.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}}L(Es,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),selfRotation:p.reactArray([0,0,0]),pixelSize:300,color:p.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(Es||(Es={})),p.extendClassProps(Es.prototype,Es.createDefaultProps);function fQ(t){return Kf({type:"CzmCustomPrimitive",allowPicking:!0,positionEditing:!1,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},st,t)}function dQ(t){return Kf({type:"CzmCustomPrimitive",allowPicking:!0,positionEditing:!1,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
|
|
4135
4135
|
void main()
|
|
4136
4136
|
{
|
|
4137
4137
|
// 如果这一句注释,要相应地注释掉attribute中的normal,也就是说顶点属性要和shader中的一一匹配!
|
|
@@ -4142,10 +4142,10 @@ void main()
|
|
|
4142
4142
|
{
|
|
4143
4143
|
out_FragColor = u_color;
|
|
4144
4144
|
}
|
|
4145
|
-
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},st,t)}class dQ extends p.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const s=i=this._getStartInfo(r.pointerEvent);s&&(this.owner.hoveredPlaneType=s.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{do{const s=this._getStartInfo(r.pointerEvent);if(!s||s.currentPlaneType==="none")break;const{currentPlaneType:a}=s,l=[...this.owner.selfRotation];l[ri.rotationNum[a]]=0,this.owner.selfRotation=l;return}while(!1);this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(p.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:s,offsetY:a}=r.pointerEvent,l=[s,a],{currentPlaneType:c}=i;if(c==="none")return;const h=this.owner.getPlane(c);if(!i.currentV)return;const u=h.pick(l);if(!u||!this.owner.cartesian)return;const A=C.Cartesian3.subtract(i.currentV,this.owner.cartesian,new C.Cartesian3);C.Cartesian3.normalize(A,A);const f=C.Cartesian3.subtract(u,this.owner.cartesian,new C.Cartesian3);if(C.Cartesian3.normalize(f,f),!h.normal||!h.origin)return;const d=_v(A,f,h.normal),g=_v(h.origin,A,h.normal),v=_v(h.origin,f,h.normal);{const y=[...this.owner.selfRotation];y[ri.rotationNum[c]]=i.startRotation+d,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await p.step(n,r=>new Promise((s,a)=>{r.disposer.dispose(a),r.disposer.dispose(e.pointerUpEvent.don(()=>{s()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{s()}))}))}))}_pickPlane(n,e,i,o,r){const s=this.owner.cartesian;if(!s)return;const{selfRotation:a}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const c=C.Cartesian3.distance(s,l),h=r/4,u=h*3/128;if(!(c>=h-u&&c<=h+u))return;const f=C.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=f||(n.currentPlaneType=i,n.currentD2c=f,n.currentV=l,n.startRotation=a[ri.rotationNum[i]])}_getStartInfo(n){var h;const{czmViewer:e}=this.owner,i=(h=e.viewer)==null?void 0:h.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Di(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:s}=n,a=[r,s],l=n.pointerId,c={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(c,i,"heading",a,o),this._pickPlane(c,i,"pitch",a,o),this._pickPlane(c,i,"roll",a,o),c}}function _v(t,n,e){const i=C.Cartesian3.cross(n,t,new C.Cartesian3);if(i.equals(C.Cartesian3.ZERO))return 0;C.Cartesian3.normalize(i,i);const o=C.Cartesian3.dot(i,e);let r=Math.acos(C.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const aa=class aa extends kn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(p.react("none")));L(this,"_movingPlaneType",this.disposeVar(p.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new uQ(this)),pitch:this.disposeVar(new cQ(this)),roll:this.disposeVar(new hQ(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new p.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new dQ(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&vt(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new Ht(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(p.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(p.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(p.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=at({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=C.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new Es(e));this.dispose(p.track([o,"position"],[this,"position"])),this.dispose(p.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(p.track([o,"debug"],[this,"debug"])),this.dispose(p.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=aa.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[aa.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const s=this.movingPlaneType===i,a=this.hoveredPlaneType===i,c=[0,0,0,s||a?1:.8];c[aa.rotationNum[i]]=1,o.color=c};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(aa,"rotationNum",{heading:0,pitch:1,roll:2}),L(aa,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let ri=aa;(t=>{t.createDefaultProps=()=>({...kn.createDefaultProps(),rotation:p.reactArray([0,0,0]),selfRotation:p.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(ri||(ri={})),p.extendClassProps(ri.prototype,ri.createDefaultProps);const sa=class sa extends p.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??sa.defaults.positions[0],this.stopPosition??sa.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??sa.defaults.positions[0],n??sa.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Je(n,e));o.arcType="RHUMB";const r=this.ad(new On(n,e));this.ad(p.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(p.track([r,"allowPicking"],[this,"allowPicking"]));{const s=()=>{o.show=r.show=this.show};s(),this.ad(this.showChanged.don(s))}{const s=()=>{o.width=this.width/2,r.pixelSize=this.width};s(),this.ad(this.widthChanged.don(s))}{const s=()=>{o.color=r.color=this.color};s(),this.ad(this.colorChanged.don(s))}{const s=()=>{o.positions=this.positions,r.position=this.stopPosition};s(),this.dispose(this.startPositionChanged.disposableOn(s)),this.dispose(this.stopPositionChanged.disposableOn(s))}}};L(sa,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Jo=sa;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(t.defaults.positions),width:10,color:p.reactArray([1,0,0,1])})})(Jo||(Jo={})),p.extendClassProps(Jo.prototype,Jo.createDefaultProps);class rr extends kn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(p.react(!1)),moved:this.ad(p.react(!1)),constraintMode:this.disposeVar(p.react("none")),originPosition:this.disposeVar(p.reactArray([0,0,0])),originHeading:this.disposeVar(p.react(0)),originDimensions:this.disposeVar(p.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(p.reactArray([0,0,0])),movingPosition:this.disposeVar(p.reactArray([0,0,0])),targetPosition:this.disposeVar(p.reactArray([0,0,0])),targetHeading:this.disposeVar(p.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new p.Processing((i,o,r)=>{const s=[0,0,0],a=new C.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const c=Zn(p.getDomEventCurrentTargetPos(l.pointerEvent));if(!ha(e.viewer.scene,c,this._opInfo.originPosition.value[2],a))return;ua(a,s),this._opInfo.constraintMode.value==="x"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,s,s):this._opInfo.constraintMode.value==="y"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,s,s):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=s,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const h=[0,0,0];Q.geoRhumbDestination(s,r,o,h),this._opInfo.targetPosition.value=h;let u=this.scale[0],A=this.scale[1];const f=Q.geoDistance(h,this._opInfo.originPosition.value)-Q.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...h];const d=this._opInfo.originDimensions.value[0]/100;f!=0&&this._opInfo.constraintMode.value==="y"&&(f>0?u+=d:u-=d),f!=0&&this._opInfo.constraintMode.value==="x"&&(f>0?A+=d:A-=d),u<=0&&(u+=d),A<=0&&(A+=d),this.scale=[u??1,A??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new p.Processing(()=>{const i=new C.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const s=Zn(p.getDomEventCurrentTargetPos(r.pointerEvent));if(!jc(e.viewer.scene,vt(this._opInfo.originPosition.value),s,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const a=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+a];let c=this.scale[2];const h=o[2]-this._lastPosition[2];this._lastPosition=[...o];const u=this._opInfo.originDimensions.value[0]/100;h!=0&&(h>0?c+=u:c-=u),c<=0&&(c+=u),this.scale=[this.scale[0]??1,this.scale[1]??1,c??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Vf(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const c=()=>{if(!this._scaleAxis)return;const{zAxis:h,yAxis:u,xAxis:A}=this._scaleAxis,f=this._opInfo.constraintMode.value,d=this._opInfo.step;h.color=[0,0,1,.99],u.color=[0,1,0,.99],A.color=[1,0,0,.99],f==="x"?A.color=d?[1,1,0,.8]:[1,1,0,.99]:f==="y"?u.color=d?[1,1,0,.8]:[1,1,0,.99]:f==="z"&&(h.color=d?[1,1,0,.8]:[1,1,0,.99])};c(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(c)),this.dispose(this._opInfo.step.changed.disposableOn(c))}{const c=()=>{if(!this._scaleAxis)return;const{position:u=rr.defaults.position}=this,{zAxis:A,yAxis:f,xAxis:d}=this._scaleAxis;A.startPosition=f.startPosition=d.startPosition=u;const[g,v,y]=u;A.stopPosition=[g,v,y+this._opInfo.originDimensions.value[2]];const m=Q.geoRhumbDestination(u,this._opInfo.originDimensions.value[0],90);m&&(d.stopPosition=m);const w=Q.geoRhumbDestination(u,this._opInfo.originDimensions.value[1],0);w&&(f.stopPosition=w)};c();const h=this.ad(p.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(h.don(c))}{const c=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((h,u)=>h===this._opInfo.targetPosition.value[u])){this._opInfo.moved.value=!0;return}};c(),this.dispose(this._opInfo.originHeading.changed.disposableOn(c)),this.dispose(this._opInfo.originPosition.changed.disposableOn(c)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(c)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(c))}const r=this._pickingXYProcessing(e),s=this._pickingZProcessing(e),a=this.disposeVar(p.createProcessingFromAsyncFunc(async c=>{do this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",c.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await p.step(c,async h=>{const u=()=>{const d=[...this.position??rr.defaults.position];e.editingHeightOffset&&(d[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=d};h.disposer.dispose((u(),this.positionChanged.disposableOn(u)));const A={constraintMode:"none",startDragPos:[0,0,0]},f=d=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};If(d,o,g,this.axisSnapPixelSize,A),this._opInfo.constraintMode.value=A.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=A.startDragPos};h.disposer.dispose(e.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&f(d.pointerEvent)})),await p.step(h,d=>new Promise((g,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&f(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&A.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await p.step(c,async h=>{if(e.incrementDisabledInputStack(),h.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const u=Q.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),A=Q.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,u,A),h.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(s.restart(),h.disposer.dispose(()=>s.cancel()));await p.step(h,u=>new Promise((A,f)=>{u.disposer.dispose(f),u.disposer.dispose(e.pointerUpEvent.don(()=>{A()})),u.disposer.dispose(e.pointerOutEvent.don(()=>{A()}))})),this._lastPosition=void 0});while(!0)})),l=()=>{this.enabled?a.restart():a.isRunning&&a.cancel()};l(),this.dispose(this.enabledChanged.disposableOn(l))}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new Jo(e));return o.width=10,this.ad(p.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...kn.createDefaultProps(),scale:p.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(rr||(rr={})),p.extendClassProps(rr.prototype,rr.createDefaultProps);const ho=class ho extends hn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new p.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new p.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(p.react(!1)));L(this,"_status",this.disposeVar(p.react("None")));L(this,"_positionsChanged",this.ad(new p.Event));L(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:s}of i){for(const a of s)a.menuPoi.enabled=this.menuPoiEnabled??!1;for(let a=o;a<o+r;++a)this.editingPoints.get(a).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(p.nextAnimateFrame(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()}))})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??ho.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((s,a)=>{const l=this.editingPoints.get(r);return l.position&&l.position[a]===s})))}forceResetPositions(e){(this.enabled??ho.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Je(e));this.ad(p.track([i,"color"],[this,"polylineColor"])),this.ad(p.track([i,"width"],[this,"polylineWidth"])),this.ad(p.track([i,"show"],[this,"polylineShow"])),this.ad(p.track([i,"arcType"],[this,"polylineArcType"])),this.ad(p.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const s of this.getPositions())s[2]-=e.editingHeightOffset??0,r.push(s);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new p.CursorInfo(e.container,p.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(ho,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(ho,"defaults",{...hn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:ho.baseImageUrl+"point-green.png",otherControlPointImageUrl:ho.baseImageUrl+"point-yellow.png"});let Wn=ho;(t=>{t.createDefaultProps=()=>({...hn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:p.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(Wn||(Wn={})),p.extendClassProps(Wn.prototype,Wn.createDefaultProps);let pQ=0;class XS extends p.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_id",pQ++);L(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new _a(e.czmViewer));o.enabled=!1,this.ad(p.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const s=[...this.position];s[2]-=e.czmViewer.editingHeightOffset??0,o.position=s,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const s=e.editingPoints.indexOf(this)+1;s!==0&&(o.title=`控制点${s}`,s===1?o.imageUri=e.firstControlPointImageUrl??Wn.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??Wn.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class $S extends XS{constructor(n,e){super(n,e)}}class Pt extends Wn{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new p.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new ii(e));i.enabled=!1,this.currentProcess=this.disposeVar(p.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Pt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Pt.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(p.step(o,async r=>{const s=r.disposer,a=s.ad(this._addingEditingProcessing());s.dispose(()=>"adding canceled!"),s.dispose(this.cancelEvent.disposableOn(()=>a.cancel())),await r.promise(new Promise(l=>{s.dispose(a.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new $S(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Pt.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=p.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1;do if(!await o.promise(p.step(o,async a=>{let l;!e()&&(l=a.disposer.disposeVar(new mQ(this,r)));const h=a.disposer.disposeVar(new yQ(this,r));return a.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>h.do())),await a.promise(new Promise(u=>{l&&a.disposer.dispose(l.overEvent.disposableOnce(A=>{A?(r++,u(!0)):u(!1)})),a.disposer.dispose(h.overEvent.disposableOnce(A=>{A?(r--,u(!0)):u(!1)})),a.disposer.dispose(this.cancelEvent.disposableOn(()=>u(!1)))}))})))break;while(!0)});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...Wn.createDefaultProps()})})(Pt||(Pt={})),p.extendClassProps(Pt.prototype,Pt.createDefaultProps);class mQ extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));const{placeEditing:o}=e;let r=new $S(e,void 0);e.editingPoints.splice(i,0,r);const s=()=>{(e.debug??Pt.defaults.debug)&&console.log("delete currentPosEditor");const c=e.editingPoints.indexOf(r);if(c===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(c,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(p.track([r,"position"],[o,"position"])),o.enabled=!0;let a=!1;const l=()=>{s(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!a&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{a=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Pt.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Pt.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function gQ(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class yQ extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_doEvent",this.disposeVar(new p.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(gQ(e,i)))),(e.debug??Pt.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Pt.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class YS extends Pt{constructor(n){super(n),this.loop=!1}}class JS extends Pt{constructor(n){super(n),this.loop=!0}}class gf extends XS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new ui(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??tt.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{if(!(n.enabled??tt.defaults.enabled)){i.enabled=!1,i.show=!1;return}do{const s=n.editingPoints.indexOf(this);if(s===-1)break;const a=n.editingPoints.length;if(a===0){console.error("impl.positionEditors.length === 0!");break}if(!(n.loop??tt.defaults.loop)&&s+1>=a)break;const c=this.position;if(!c)break;let h=(s+1)%a;const A=n.editingPoints.get(h).position;if(!A)break;const f=Mf(c,A);if(!f)break;f[2]-=n.czmViewer.editingHeightOffset??0,i.position=f;const d=n.editingPoints.length<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=d,i.show=d;return}while(!1);i.enabled=!1,i.show=!1};o(),this.dispose(n.positionsChanged.disposableOn(o)),this.dispose(n.loopChanged.disposableOn(o)),this.dispose(n.enabledChanged.disposableOn(o))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??tt.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const s=i.position?[...i.position]:void 0;s&&(s[2]+=n.czmViewer.editingHeightOffset??0);let a=new gf(n,s);n.editingPoints.splice(r+1,0,a),n.modify(a)}))}}}}class tt extends Wn{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new p.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new p.Event));L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"translationEditing");{const o=this.ad(p.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new p.ObjResettingWithEvent(o,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new vQ(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new ir(e));i.enabled=!1,this.currentProcess=this.disposeVar(p.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1});let r=-1;do if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await o.promise(p.step(o,async s=>{const a=s.disposer,l=a.ad(new wQ(this));return a.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&l.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),a.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),a.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>l.modify(h))),await s.promise(new Promise(h=>{a.dispose(l.overEvent.disposableOnce(u=>{h(u)}))}))})),r===-1){(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");break}else{if(this.editingPoints.length>=(this.maxPointsNum??tt.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??tt.defaults.loop;const a=this.editingPoints.get(r-1).position;if(!a)return;let l=r%this.editingPoints.length;const h=this.editingPoints.get(l).position;if(!h)return;const u=Mf(a,h);if(!u)return;u&&(u[2]+=this.czmViewer.editingHeightOffset??0);let A=new gf(this,u);this.editingPoints.splice(r,0,A)}while(!0);this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new gf(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...Wn.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),p.extendClassProps(tt.prototype,tt.createDefaultProps);class vQ extends p.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const s=this.multiPointsModifyEditing.editingPoints.length;for(let a=1;a<s;a++){const l=this.multiPointsModifyEditing.editingPoints.get(a),c=l.position;c!==void 0&&(l.position=[c[0]+r[0],c[1]+r[1],c[2]+r[2]])}})}}class wQ extends p.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_cancelEvent",this.disposeVar(new p.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new p.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=s=>{o(),e.status="Modifying_Point",i=new bQ(e,s),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((s,a)=>{if(a==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(s);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(a==="modify")r(s);else if(a==="add"){const l=e.editingPoints.indexOf(s);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else a==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${a})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class bQ extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(p.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class jS extends tt{constructor(n){super(n),this.loop=!1}}class eE extends tt{constructor(n){super(n),this.loop=!0}}class Ps extends Pt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=Q.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const s=e*Math.sin(i[1]*Math.PI/180);r[2]+=s,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=Q.geoHeading(this.startPosition,this.endPosition),o=Q.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],s=Math.atan(r/o)*180/Math.PI,a=Math.sqrt(o*o+r*r);this.rotation=[i,s,0],this.distance=a};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),startPosition:p.reactArrayWithUndefined(void 0),endPosition:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([90,0,0]),distance:p.react(1)})})(Ps||(Ps={})),p.extendClassProps(Ps.prototype,Ps.createDefaultProps);class jo extends tt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=Q.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const s=e*Math.sin(i[1]*Math.PI/180);r[2]+=s,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{do{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];break}if(this.startPosition=this.positions[0],this.positions.length==1){this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;break}this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]];const i=Q.geoHeading(this.startPosition,this.endPosition),o=Q.geoDistance(this.startPosition,this.endPosition);if(Math.abs(o)<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],s=Math.atan(r/o)*180/Math.PI,a=Math.sqrt(o*o+r*r);this.rotation=[i,s,0],this.distance=a}while(!1)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:p.reactArrayWithUndefined(void 0),endPosition:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),distance:p.react(0)})})(jo||(jo={})),p.extendClassProps(jo.prototype,jo.createDefaultProps);class tE extends Pt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class nE extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class Ts extends Pt{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new $n(n));e.topOrBottom="bottom",this.ad(p.track([e,"color"],[this,"polylineColor"])),this.ad(p.track([e,"width"],[this,"polylineWidth"])),this.ad(p.track([e,"show"],[this,"polylineShow"])),this.ad(p.track([e,"arcType"],[this,"polylineArcType"])),this.ad(p.track([e,"loop"],[this,"loop"])),this.ad(p.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),visibilityPositions:p.reactPositionsSet(void 0)})})(Ts||(Ts={})),p.extendClassProps(Ts.prototype,Ts.createDefaultProps);class Is extends tt{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new $n(n));e.topOrBottom="bottom",this.ad(p.track([e,"color"],[this,"polylineColor"])),this.ad(p.track([e,"width"],[this,"polylineWidth"])),this.ad(p.track([e,"show"],[this,"polylineShow"])),this.ad(p.track([e,"arcType"],[this,"polylineArcType"])),this.ad(p.track([e,"loop"],[this,"loop"])),this.ad(p.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:p.reactPositionsSet(void 0)})})(Is||(Is={})),p.extendClassProps(Is.prototype,Is.createDefaultProps);class iE extends jo{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class rn extends Q.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_supportEditing",this.disposeVar(p.react(!0)));L(this,"_currentEditing",this.disposeVar(p.react(void 0)));this.ad(this.supportEditingChanged.don(()=>{this.destroy()})),this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing){if(this.currentEditing instanceof Pt&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;this.currentEditing instanceof ii&&this.currentEditing.enabled&&(e.position=[0,0,0])}}))}get supportEditing(){return this._supportEditing.value}set supportEditing(e){this._supportEditing.value=e}get supportEditingChanged(){return this._supportEditing.changed}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Rc=class Rc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ii(e));this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)}));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"position"],[n,"position"])),i.enabled=!i.position||Q.equalsN3(i.position,[0,0,0]);break}this.supportEditing=!1}while(!1)}};L(Rc,"type",Rc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Place,Rc));let Cv=Rc;const Uc=class Uc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ri(e));i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(n instanceof Q.ES3DTileset){Q.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(p.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(p.bind([i,"selfRotation"],[n,"rotation"])))});break}if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){this.ad(p.bind([i,"position"],[n,"position"])),this.ad(p.bind([i,"selfRotation"],[n,"rotation"]));break}this.supportEditing=!1}while(!1)}};L(Uc,"type",Uc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Rotation,Uc));let xv=Uc;const Oc=class Oc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new rr(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")&&Reflect.has(n,"scale")){this.ad(p.bind([i,"position"],[n,"position"])),this.ad(p.bind([i,"scale"],[n,"scale"]));break}this.supportEditing=!1}while(!1)}};L(Oc,"type",Oc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Scale,Oc));let Sv=Oc;const Lc=class Lc extends rn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new ir(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const s=n[r];Reflect.has(s,"position")?o.push(s.position):s.points&&o.push(...s.points)}i.position=Q.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,s)=>{if(!(!r||!s)){var a=fn({originPosition:s},[r])[0][0];n.forEach(l=>{if(Reflect.has(l,"position")){const c=fn({originPosition:s},[l.position])[0][0];l.position=pr({originPosition:s},[[c[0]+a[0],c[1]+a[1],c[2]+a[2]]])[0][0]}else if(Reflect.has(l,"points")&&l.points){const c=fn({originPosition:s},l.points)[0];l.points=pr({originPosition:s},c.map(h=>[h[0]+a[0],h[1]+a[1],h[2]+a[2]]))[0]}})}}));break}if(Reflect.has(n,"position")){this.ad(p.bind([i,"position"],[n,"position"]));break}if(n instanceof Q.ES3DTileset){Q.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(p.bind([i,"position"],[o.czm3DTiles,"position"]))});break}if(Reflect.has(n,"points")){if(n.points===void 0||n.points.length===0){this.destroy();break}i.position=Q.getMinMaxCorner(n.points).center,this.ad(i.positionChanged.disposableOn((o,r)=>{if(o===void 0||r===void 0||n.points===void 0||n.points.length===0){this.destroy();return}var s=fn({originPosition:r},[o])[0][0];const a=fn({originPosition:r},n.points)[0];n.points=pr({originPosition:r},a.map(l=>[l[0]+s[0],l[1]+s[1],l[2]+s[2]]))[0]}));break}this.supportEditing=!1}while(!1)}};L(Lc,"type",Lc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Translation,Lc));let yf=Lc;const zc=class zc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ps(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"startPosition"],[n,"position"])),this.ad(Dt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(p.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(p.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(p.bind([i,"distance"],[n,"distance"]));break}const o=vt(n.position);if(C.Cartesian3.ZERO.equals(o)||!e.viewer)return;i.distance=Di(e.viewer.scene,o,100)??1}while(!1);break}if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1);i.startPosition&&!Q.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(zc,"type",zc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.DoublePointsAppend,zc));let Ev=zc;const Qc=class Qc extends rn{constructor(n,e){var r;if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new jo(e));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"startPosition"],[n,"position"])),this.ad(Dt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(p.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(p.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(p.bind([i,"distance"],[n,"distance"]));break}const s=vt(n.position);if(C.Cartesian3.ZERO.equals(s)||!e.viewer)return;i.distance=Di(e.viewer.scene,s,100)??1}while(!1);break}if(Reflect.has(n,"points")&&((r=n.points)==null?void 0:r.length)==2){i.moveWithFirstPosition=!1;const s=()=>i.positions=n.points??[];s(),this.ad(n.pointsChanged.don(()=>!i.enabled&&s())),this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(p.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||Q.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(Qc,"type",Qc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.DoublePointsModify,Qc));let Pv=Qc;const Vc=class Vc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new JS(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Vc,"type",Vc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.CircularAppend,Vc));let Tv=Vc;const Hc=class Hc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new eE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Hc,"type",Hc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.CircularInsert,Hc));let Iv=Hc;const Nc=class Nc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new YS(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Nc,"type",Nc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.LineStringAppend,Nc));let kv=Nc;const Gc=class Gc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new jS(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Gc,"type",Gc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.LineStringInsert,Gc));let Fv=Gc;const Wc=class Wc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new tE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Wc,"type",Wc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.ScatterAppend,Wc));let Bv=Wc;const qc=class qc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new nE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(qc,"type",qc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.ScatterModify,qc));let Mv=qc;const Kc=class Kc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ts(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Kc,"type",Kc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.VisibilityAppend,Kc));let Dv=Kc;const Zc=class Zc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Is(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Zc,"type",Zc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.VisibilityModify,Zc));let Rv=Zc;const Xc=class Xc extends rn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new iE(e));do{if(Reflect.has(n,"points")){const r=Reflect.has(n,"extrudedHeight"),s=Reflect.has(n,"height"),a=Reflect.has(n,"perPositionHeight")?n.perPositionHeight:!r,l=n instanceof Q.ESClassification||n instanceof Q.ESPolygonFence;let c=Q.getMinMaxCorner(n.points).center,h=[...c],u=l?n.points[0][2]:0;a?r?h[2]=n.extrudedHeight:h[2]=n.height+u:(s&&(c[2]=n.height),r&&(h[2]=n.extrudedHeight)),i.startPosition=c,i.distance=h[2]-c[2],i.moveWithFirstPosition=!1;let A=[...c];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(a?(n.points=n.points.map(f=>[f[0],f[1],f[2]+i.positions[0][2]-A[2]]),r?n.extrudedHeight=i.positions[1][2]:s&&(n.height=i.positions[1][2]-(l?i.positions[0][2]:0))):(s&&(n.height=i.positions[0][2]),r&&(n.extrudedHeight=i.positions[1][2])),A=[...i.positions[0]])}));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(p.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||Q.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(Xc,"type",Xc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.HeightModify,Xc));let Uv=Xc;function rE(){const t=p.createProcessingFromAsyncFunc(async(n,e,i,o,r=!0)=>{const s=Array.isArray(o)?[...o]:[o],a=i.editingID;e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"start",add:{modes:s}});const l=()=>{e.notSupportEditingCount=0,e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"end",add:{modes:s}}),t.isRunning&&t.cancel()};n.disposer.ad(l),n.disposer.ad(i.toDestroyEvent.don(l));const c=u=>{u.code=="Escape"&&l()};document.body.addEventListener("keydown",c),n.disposer.ad(()=>document.body.removeEventListener("keydown",c));let h=0;do{const u=s[h%s.length],A=await p.step(n,async f=>{const d=f.disposer,g=Q.EngineObject.contextEditing.getEngineObjConstructor(u,e.typeName);if(!g||!i.supportEditingModes().includes(u))return console.log(`未找到编辑模式或不支持当前编辑模式${u},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changedFailed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount++,!1;const v=new g(i,e);if(d.ad(()=>{!v.isDestroyed()&&v.destroy()}),v.supportEditing)e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount=0;else return console.log(`未找到编辑模式或不支持当前编辑模式${u},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changedFailed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount++,!1;return await f.promise(new Promise(m=>{if(v.isDestroyed()&&m(!1),d.ad(v.toDestroyEvent.don(()=>{console.log(`编辑模式${u}结束`),m(!1)})),r){const w=_=>{_.code=="Space"&&(console.log(`编辑模式${u}结束`),m(!1))};document.body.addEventListener("keydown",w),d.ad(()=>document.body.removeEventListener("keydown",w)),d.ad(e.dblclickEvent.don(()=>m(!0)))}}))});if(r&&A||!r&&h==s.length-1||e.notSupportEditingCount==s.length)break;h++}while(!0)});return t}function oE(){const t=p.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID??l.id),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID??l.id),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const s=l=>{l.code=="Escape"&&r()};document.body.addEventListener("keydown",s),n.disposer.ad(()=>document.body.removeEventListener("keydown",s));const a=new yf(i,e);n.disposer.ad(()=>{!a.isDestroyed()&&a.destroy()}),await n.promise(new Promise(l=>{a.isDestroyed()&&l(),n.disposer.ad(a.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}ae.copyright=void 0;try{const t="earthsdk3-cesium",n="3.2.0-beta.9",e="2025-07-09T00:49:51.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="86cd78d39a95619b7116ef4bdb191f0d2e005181",a=((Date.now()-1752022191e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
4145
|
+
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},st,t)}class pQ extends p.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const s=i=this._getStartInfo(r.pointerEvent);s&&(this.owner.hoveredPlaneType=s.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{do{const s=this._getStartInfo(r.pointerEvent);if(!s||s.currentPlaneType==="none")break;const{currentPlaneType:a}=s,l=[...this.owner.selfRotation];l[ri.rotationNum[a]]=0,this.owner.selfRotation=l;return}while(!1);this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(p.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:s,offsetY:a}=r.pointerEvent,l=[s,a],{currentPlaneType:c}=i;if(c==="none")return;const h=this.owner.getPlane(c);if(!i.currentV)return;const u=h.pick(l);if(!u||!this.owner.cartesian)return;const A=C.Cartesian3.subtract(i.currentV,this.owner.cartesian,new C.Cartesian3);C.Cartesian3.normalize(A,A);const f=C.Cartesian3.subtract(u,this.owner.cartesian,new C.Cartesian3);if(C.Cartesian3.normalize(f,f),!h.normal||!h.origin)return;const d=_v(A,f,h.normal),g=_v(h.origin,A,h.normal),v=_v(h.origin,f,h.normal);{const y=[...this.owner.selfRotation];y[ri.rotationNum[c]]=i.startRotation+d,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await p.step(n,r=>new Promise((s,a)=>{r.disposer.dispose(a),r.disposer.dispose(e.pointerUpEvent.don(()=>{s()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{s()}))}))}))}_pickPlane(n,e,i,o,r){const s=this.owner.cartesian;if(!s)return;const{selfRotation:a}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const c=C.Cartesian3.distance(s,l),h=r/4,u=h*3/128;if(!(c>=h-u&&c<=h+u))return;const f=C.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=f||(n.currentPlaneType=i,n.currentD2c=f,n.currentV=l,n.startRotation=a[ri.rotationNum[i]])}_getStartInfo(n){var h;const{czmViewer:e}=this.owner,i=(h=e.viewer)==null?void 0:h.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Di(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:s}=n,a=[r,s],l=n.pointerId,c={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(c,i,"heading",a,o),this._pickPlane(c,i,"pitch",a,o),this._pickPlane(c,i,"roll",a,o),c}}function _v(t,n,e){const i=C.Cartesian3.cross(n,t,new C.Cartesian3);if(i.equals(C.Cartesian3.ZERO))return 0;C.Cartesian3.normalize(i,i);const o=C.Cartesian3.dot(i,e);let r=Math.acos(C.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const aa=class aa extends kn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(p.react("none")));L(this,"_movingPlaneType",this.disposeVar(p.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new cQ(this)),pitch:this.disposeVar(new hQ(this)),roll:this.disposeVar(new AQ(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new p.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new pQ(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&vt(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new Ht(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(p.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(p.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(p.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=at({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=C.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new Es(e));this.dispose(p.track([o,"position"],[this,"position"])),this.dispose(p.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(p.track([o,"debug"],[this,"debug"])),this.dispose(p.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=aa.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[aa.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const s=this.movingPlaneType===i,a=this.hoveredPlaneType===i,c=[0,0,0,s||a?1:.8];c[aa.rotationNum[i]]=1,o.color=c};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(aa,"rotationNum",{heading:0,pitch:1,roll:2}),L(aa,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let ri=aa;(t=>{t.createDefaultProps=()=>({...kn.createDefaultProps(),rotation:p.reactArray([0,0,0]),selfRotation:p.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(ri||(ri={})),p.extendClassProps(ri.prototype,ri.createDefaultProps);const sa=class sa extends p.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??sa.defaults.positions[0],this.stopPosition??sa.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??sa.defaults.positions[0],n??sa.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Je(n,e));o.arcType="RHUMB";const r=this.ad(new On(n,e));this.ad(p.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(p.track([r,"allowPicking"],[this,"allowPicking"]));{const s=()=>{o.show=r.show=this.show};s(),this.ad(this.showChanged.don(s))}{const s=()=>{o.width=this.width/2,r.pixelSize=this.width};s(),this.ad(this.widthChanged.don(s))}{const s=()=>{o.color=r.color=this.color};s(),this.ad(this.colorChanged.don(s))}{const s=()=>{o.positions=this.positions,r.position=this.stopPosition};s(),this.dispose(this.startPositionChanged.disposableOn(s)),this.dispose(this.stopPositionChanged.disposableOn(s))}}};L(sa,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Jo=sa;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:p.reactPositions(t.defaults.positions),width:10,color:p.reactArray([1,0,0,1])})})(Jo||(Jo={})),p.extendClassProps(Jo.prototype,Jo.createDefaultProps);class rr extends kn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(p.react(!1)),moved:this.ad(p.react(!1)),constraintMode:this.disposeVar(p.react("none")),originPosition:this.disposeVar(p.reactArray([0,0,0])),originHeading:this.disposeVar(p.react(0)),originDimensions:this.disposeVar(p.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(p.reactArray([0,0,0])),movingPosition:this.disposeVar(p.reactArray([0,0,0])),targetPosition:this.disposeVar(p.reactArray([0,0,0])),targetHeading:this.disposeVar(p.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new p.Processing((i,o,r)=>{const s=[0,0,0],a=new C.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const c=Zn(p.getDomEventCurrentTargetPos(l.pointerEvent));if(!ha(e.viewer.scene,c,this._opInfo.originPosition.value[2],a))return;ua(a,s),this._opInfo.constraintMode.value==="x"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,s,s):this._opInfo.constraintMode.value==="y"?fo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,s,s):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=s,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const h=[0,0,0];Q.geoRhumbDestination(s,r,o,h),this._opInfo.targetPosition.value=h;let u=this.scale[0],A=this.scale[1];const f=Q.geoDistance(h,this._opInfo.originPosition.value)-Q.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...h];const d=this._opInfo.originDimensions.value[0]/100;f!=0&&this._opInfo.constraintMode.value==="y"&&(f>0?u+=d:u-=d),f!=0&&this._opInfo.constraintMode.value==="x"&&(f>0?A+=d:A-=d),u<=0&&(u+=d),A<=0&&(A+=d),this.scale=[u??1,A??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new p.Processing(()=>{const i=new C.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const s=Zn(p.getDomEventCurrentTargetPos(r.pointerEvent));if(!jc(e.viewer.scene,vt(this._opInfo.originPosition.value),s,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const a=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+a];let c=this.scale[2];const h=o[2]-this._lastPosition[2];this._lastPosition=[...o];const u=this._opInfo.originDimensions.value[0]/100;h!=0&&(h>0?c+=u:c-=u),c<=0&&(c+=u),this.scale=[this.scale[0]??1,this.scale[1]??1,c??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Vf(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const c=()=>{if(!this._scaleAxis)return;const{zAxis:h,yAxis:u,xAxis:A}=this._scaleAxis,f=this._opInfo.constraintMode.value,d=this._opInfo.step;h.color=[0,0,1,.99],u.color=[0,1,0,.99],A.color=[1,0,0,.99],f==="x"?A.color=d?[1,1,0,.8]:[1,1,0,.99]:f==="y"?u.color=d?[1,1,0,.8]:[1,1,0,.99]:f==="z"&&(h.color=d?[1,1,0,.8]:[1,1,0,.99])};c(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(c)),this.dispose(this._opInfo.step.changed.disposableOn(c))}{const c=()=>{if(!this._scaleAxis)return;const{position:u=rr.defaults.position}=this,{zAxis:A,yAxis:f,xAxis:d}=this._scaleAxis;A.startPosition=f.startPosition=d.startPosition=u;const[g,v,y]=u;A.stopPosition=[g,v,y+this._opInfo.originDimensions.value[2]];const m=Q.geoRhumbDestination(u,this._opInfo.originDimensions.value[0],90);m&&(d.stopPosition=m);const w=Q.geoRhumbDestination(u,this._opInfo.originDimensions.value[1],0);w&&(f.stopPosition=w)};c();const h=this.ad(p.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(h.don(c))}{const c=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((h,u)=>h===this._opInfo.targetPosition.value[u])){this._opInfo.moved.value=!0;return}};c(),this.dispose(this._opInfo.originHeading.changed.disposableOn(c)),this.dispose(this._opInfo.originPosition.changed.disposableOn(c)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(c)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(c))}const r=this._pickingXYProcessing(e),s=this._pickingZProcessing(e),a=this.disposeVar(p.createProcessingFromAsyncFunc(async c=>{do this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",c.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await p.step(c,async h=>{const u=()=>{const d=[...this.position??rr.defaults.position];e.editingHeightOffset&&(d[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=d};h.disposer.dispose((u(),this.positionChanged.disposableOn(u)));const A={constraintMode:"none",startDragPos:[0,0,0]},f=d=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};If(d,o,g,this.axisSnapPixelSize,A),this._opInfo.constraintMode.value=A.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=A.startDragPos};h.disposer.dispose(e.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&f(d.pointerEvent)})),await p.step(h,d=>new Promise((g,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&f(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&A.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await p.step(c,async h=>{if(e.incrementDisabledInputStack(),h.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const u=Q.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),A=Q.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,u,A),h.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(s.restart(),h.disposer.dispose(()=>s.cancel()));await p.step(h,u=>new Promise((A,f)=>{u.disposer.dispose(f),u.disposer.dispose(e.pointerUpEvent.don(()=>{A()})),u.disposer.dispose(e.pointerOutEvent.don(()=>{A()}))})),this._lastPosition=void 0});while(!0)})),l=()=>{this.enabled?a.restart():a.isRunning&&a.cancel()};l(),this.dispose(this.enabledChanged.disposableOn(l))}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new Jo(e));return o.width=10,this.ad(p.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...kn.createDefaultProps(),scale:p.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(rr||(rr={})),p.extendClassProps(rr.prototype,rr.createDefaultProps);const ho=class ho extends hn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new p.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new p.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(p.react(!1)));L(this,"_status",this.disposeVar(p.react("None")));L(this,"_positionsChanged",this.ad(new p.Event));L(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(i=>{for(let{start:o,deleteCount:r,items:s}of i){for(const a of s)a.menuPoi.enabled=this.menuPoiEnabled??!1;for(let a=o;a<o+r;++a)this.editingPoints.get(a).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(p.nextAnimateFrame(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()}))})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??ho.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((s,a)=>{const l=this.editingPoints.get(r);return l.position&&l.position[a]===s})))}forceResetPositions(e){(this.enabled??ho.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const i=this.ad(new Je(e));this.ad(p.track([i,"color"],[this,"polylineColor"])),this.ad(p.track([i,"width"],[this,"polylineWidth"])),this.ad(p.track([i,"show"],[this,"polylineShow"])),this.ad(p.track([i,"arcType"],[this,"polylineArcType"])),this.ad(p.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const s of this.getPositions())s[2]-=e.editingHeightOffset??0,r.push(s);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new p.CursorInfo(e.container,p.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(ho,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(ho,"defaults",{...hn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:ho.baseImageUrl+"point-green.png",otherControlPointImageUrl:ho.baseImageUrl+"point-yellow.png"});let Wn=ho;(t=>{t.createDefaultProps=()=>({...hn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:p.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(Wn||(Wn={})),p.extendClassProps(Wn.prototype,Wn.createDefaultProps);let mQ=0;class XS extends p.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(p.reactArrayWithUndefined(void 0)));L(this,"_id",mQ++);L(this,"_menuPoi");i&&(this.position=i),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new _a(e.czmViewer));o.enabled=!1,this.ad(p.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const s=[...this.position];s[2]-=e.czmViewer.editingHeightOffset??0,o.position=s,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const s=e.editingPoints.indexOf(this)+1;s!==0&&(o.title=`控制点${s}`,s===1?o.imageUri=e.firstControlPointImageUrl??Wn.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??Wn.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class $S extends XS{constructor(n,e){super(n,e)}}class Pt extends Wn{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new p.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new ii(e));i.enabled=!1,this.currentProcess=this.disposeVar(p.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Pt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Pt.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(p.step(o,async r=>{const s=r.disposer,a=s.ad(this._addingEditingProcessing());s.dispose(()=>"adding canceled!"),s.dispose(this.cancelEvent.disposableOn(()=>a.cancel())),await r.promise(new Promise(l=>{s.dispose(a.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new $S(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Pt.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=p.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1;do if(!await o.promise(p.step(o,async a=>{let l;!e()&&(l=a.disposer.disposeVar(new gQ(this,r)));const h=a.disposer.disposeVar(new vQ(this,r));return a.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>h.do())),await a.promise(new Promise(u=>{l&&a.disposer.dispose(l.overEvent.disposableOnce(A=>{A?(r++,u(!0)):u(!1)})),a.disposer.dispose(h.overEvent.disposableOnce(A=>{A?(r--,u(!0)):u(!1)})),a.disposer.dispose(this.cancelEvent.disposableOn(()=>u(!1)))}))})))break;while(!0)});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...Wn.createDefaultProps()})})(Pt||(Pt={})),p.extendClassProps(Pt.prototype,Pt.createDefaultProps);class gQ extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));const{placeEditing:o}=e;let r=new $S(e,void 0);e.editingPoints.splice(i,0,r);const s=()=>{(e.debug??Pt.defaults.debug)&&console.log("delete currentPosEditor");const c=e.editingPoints.indexOf(r);if(c===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(c,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(p.track([r,"position"],[o,"position"])),o.enabled=!0;let a=!1;const l=()=>{s(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!a&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{a=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Pt.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Pt.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function yQ(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class vQ extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_doEvent",this.disposeVar(new p.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(yQ(e,i)))),(e.debug??Pt.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Pt.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class YS extends Pt{constructor(n){super(n),this.loop=!1}}class JS extends Pt{constructor(n){super(n),this.loop=!0}}class gf extends XS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new ui(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??tt.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{if(!(n.enabled??tt.defaults.enabled)){i.enabled=!1,i.show=!1;return}do{const s=n.editingPoints.indexOf(this);if(s===-1)break;const a=n.editingPoints.length;if(a===0){console.error("impl.positionEditors.length === 0!");break}if(!(n.loop??tt.defaults.loop)&&s+1>=a)break;const c=this.position;if(!c)break;let h=(s+1)%a;const A=n.editingPoints.get(h).position;if(!A)break;const f=Mf(c,A);if(!f)break;f[2]-=n.czmViewer.editingHeightOffset??0,i.position=f;const d=n.editingPoints.length<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=d,i.show=d;return}while(!1);i.enabled=!1,i.show=!1};o(),this.dispose(n.positionsChanged.disposableOn(o)),this.dispose(n.loopChanged.disposableOn(o)),this.dispose(n.enabledChanged.disposableOn(o))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??tt.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const s=i.position?[...i.position]:void 0;s&&(s[2]+=n.czmViewer.editingHeightOffset??0);let a=new gf(n,s);n.editingPoints.splice(r+1,0,a),n.modify(a)}))}}}}class tt extends Wn{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new p.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new p.Event));L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"translationEditing");{const o=this.ad(p.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new p.ObjResettingWithEvent(o,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new wQ(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new ir(e));i.enabled=!1,this.currentProcess=this.disposeVar(p.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1});let r=-1;do if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await o.promise(p.step(o,async s=>{const a=s.disposer,l=a.ad(new bQ(this));return a.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&l.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),a.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),a.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>l.modify(h))),await s.promise(new Promise(h=>{a.dispose(l.overEvent.disposableOnce(u=>{h(u)}))}))})),r===-1){(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");break}else{if(this.editingPoints.length>=(this.maxPointsNum??tt.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??tt.defaults.loop;const a=this.editingPoints.get(r-1).position;if(!a)return;let l=r%this.editingPoints.length;const h=this.editingPoints.get(l).position;if(!h)return;const u=Mf(a,h);if(!u)return;u&&(u[2]+=this.czmViewer.editingHeightOffset??0);let A=new gf(this,u);this.editingPoints.splice(r,0,A)}while(!0);this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new gf(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...Wn.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),p.extendClassProps(tt.prototype,tt.createDefaultProps);class wQ extends p.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const s=this.multiPointsModifyEditing.editingPoints.length;for(let a=1;a<s;a++){const l=this.multiPointsModifyEditing.editingPoints.get(a),c=l.position;c!==void 0&&(l.position=[c[0]+r[0],c[1]+r[1],c[2]+r[2]])}})}}class bQ extends p.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new p.Event));L(this,"_cancelEvent",this.disposeVar(new p.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new p.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=s=>{o(),e.status="Modifying_Point",i=new _Q(e,s),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((s,a)=>{if(a==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(s);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(a==="modify")r(s);else if(a==="add"){const l=e.editingPoints.indexOf(s);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else a==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${a})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class _Q extends p.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new p.Event));this._modifying=e,this._posEditor=i,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(p.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class jS extends tt{constructor(n){super(n),this.loop=!1}}class eE extends tt{constructor(n){super(n),this.loop=!0}}class Ps extends Pt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=Q.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const s=e*Math.sin(i[1]*Math.PI/180);r[2]+=s,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const i=Q.geoHeading(this.startPosition,this.endPosition),o=Q.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],s=Math.atan(r/o)*180/Math.PI,a=Math.sqrt(o*o+r*r);this.rotation=[i,s,0],this.distance=a};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),startPosition:p.reactArrayWithUndefined(void 0),endPosition:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([90,0,0]),distance:p.react(1)})})(Ps||(Ps={})),p.extendClassProps(Ps.prototype,Ps.createDefaultProps);class jo extends tt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=Q.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const s=e*Math.sin(i[1]*Math.PI/180);r[2]+=s,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{do{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];break}if(this.startPosition=this.positions[0],this.positions.length==1){this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;break}this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]];const i=Q.geoHeading(this.startPosition,this.endPosition),o=Q.geoDistance(this.startPosition,this.endPosition);if(Math.abs(o)<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],s=Math.atan(r/o)*180/Math.PI,a=Math.sqrt(o*o+r*r);this.rotation=[i,s,0],this.distance=a}while(!1)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:p.reactArrayWithUndefined(void 0),endPosition:p.reactArrayWithUndefined(void 0),rotation:p.reactArray([0,0,0]),distance:p.react(0)})})(jo||(jo={})),p.extendClassProps(jo.prototype,jo.createDefaultProps);class tE extends Pt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class nE extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class Ts extends Pt{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new $n(n));e.topOrBottom="bottom",this.ad(p.track([e,"color"],[this,"polylineColor"])),this.ad(p.track([e,"width"],[this,"polylineWidth"])),this.ad(p.track([e,"show"],[this,"polylineShow"])),this.ad(p.track([e,"arcType"],[this,"polylineArcType"])),this.ad(p.track([e,"loop"],[this,"loop"])),this.ad(p.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),visibilityPositions:p.reactPositionsSet(void 0)})})(Ts||(Ts={})),p.extendClassProps(Ts.prototype,Ts.createDefaultProps);class Is extends tt{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new $n(n));e.topOrBottom="bottom",this.ad(p.track([e,"color"],[this,"polylineColor"])),this.ad(p.track([e,"width"],[this,"polylineWidth"])),this.ad(p.track([e,"show"],[this,"polylineShow"])),this.ad(p.track([e,"arcType"],[this,"polylineArcType"])),this.ad(p.track([e,"loop"],[this,"loop"])),this.ad(p.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:p.reactPositionsSet(void 0)})})(Is||(Is={})),p.extendClassProps(Is.prototype,Is.createDefaultProps);class iE extends jo{constructor(n){super(n),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class rn extends Q.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_supportEditing",this.disposeVar(p.react(!0)));L(this,"_currentEditing",this.disposeVar(p.react(void 0)));this.ad(this.supportEditingChanged.don(()=>{this.destroy()})),this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing){if(this.currentEditing instanceof Pt&&((r=this.currentEditing.currentProcess)!=null&&r.isRunning))if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}else e.points=this.currentEditing.positions;this.currentEditing instanceof ii&&this.currentEditing.enabled&&(e.position=[0,0,0])}}))}get supportEditing(){return this._supportEditing.value}set supportEditing(e){this._supportEditing.value=e}get supportEditingChanged(){return this._supportEditing.changed}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Rc=class Rc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ii(e));this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)}));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"position"],[n,"position"])),i.enabled=!i.position||Q.equalsN3(i.position,[0,0,0]);break}this.supportEditing=!1}while(!1)}};L(Rc,"type",Rc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Place,Rc));let Cv=Rc;const Uc=class Uc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ri(e));i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(n instanceof Q.ES3DTileset){Q.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(p.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(p.bind([i,"selfRotation"],[n,"rotation"])))});break}if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){this.ad(p.bind([i,"position"],[n,"position"])),this.ad(p.bind([i,"selfRotation"],[n,"rotation"]));break}this.supportEditing=!1}while(!1)}};L(Uc,"type",Uc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Rotation,Uc));let xv=Uc;const Oc=class Oc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new rr(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")&&Reflect.has(n,"scale")){this.ad(p.bind([i,"position"],[n,"position"])),this.ad(p.bind([i,"scale"],[n,"scale"]));break}this.supportEditing=!1}while(!1)}};L(Oc,"type",Oc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Scale,Oc));let Sv=Oc;const Lc=class Lc extends rn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new ir(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const s=n[r];Reflect.has(s,"position")?o.push(s.position):s.points&&o.push(...s.points)}i.position=Q.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,s)=>{if(!(!r||!s)){var a=fn({originPosition:s},[r])[0][0];n.forEach(l=>{if(Reflect.has(l,"position")){const c=fn({originPosition:s},[l.position])[0][0];l.position=pr({originPosition:s},[[c[0]+a[0],c[1]+a[1],c[2]+a[2]]])[0][0]}else if(Reflect.has(l,"points")&&l.points){const c=fn({originPosition:s},l.points)[0];l.points=pr({originPosition:s},c.map(h=>[h[0]+a[0],h[1]+a[1],h[2]+a[2]]))[0]}})}}));break}if(Reflect.has(n,"position")){this.ad(p.bind([i,"position"],[n,"position"]));break}if(n instanceof Q.ES3DTileset){Q.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(p.bind([i,"position"],[o.czm3DTiles,"position"]))});break}if(Reflect.has(n,"points")){if(n.points===void 0||n.points.length===0){this.destroy();break}i.position=Q.getMinMaxCorner(n.points).center,this.ad(i.positionChanged.disposableOn((o,r)=>{if(o===void 0||r===void 0||n.points===void 0||n.points.length===0){this.destroy();return}var s=fn({originPosition:r},[o])[0][0];const a=fn({originPosition:r},n.points)[0];n.points=pr({originPosition:r},a.map(l=>[l[0]+s[0],l[1]+s[1],l[2]+s[2]]))[0]}));break}this.supportEditing=!1}while(!1)}};L(Lc,"type",Lc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.Translation,Lc));let yf=Lc;const zc=class zc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ps(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"startPosition"],[n,"position"])),this.ad(Dt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(p.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(p.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(p.bind([i,"distance"],[n,"distance"]));break}const o=vt(n.position);if(C.Cartesian3.ZERO.equals(o)||!e.viewer)return;i.distance=Di(e.viewer.scene,o,100)??1}while(!1);break}if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1);i.startPosition&&!Q.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(zc,"type",zc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.DoublePointsAppend,zc));let Ev=zc;const Qc=class Qc extends rn{constructor(n,e){var r;if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new jo(e));do{if(Reflect.has(n,"position")){this.ad(p.bind([i,"startPosition"],[n,"position"])),this.ad(Dt([i,"rotation"],[n,"rotation"]));do{if(Reflect.has(n,"far")){this.ad(p.bind([i,"distance"],[n,"far"]));break}if(Reflect.has(n,"radius")){this.ad(p.bind([i,"distance"],[n,"radius"]));break}if(Reflect.has(n,"distance")){this.ad(p.bind([i,"distance"],[n,"distance"]));break}const s=vt(n.position);if(C.Cartesian3.ZERO.equals(s)||!e.viewer)return;i.distance=Di(e.viewer.scene,s,100)??1}while(!1);break}if(Reflect.has(n,"points")&&((r=n.points)==null?void 0:r.length)==2){i.moveWithFirstPosition=!1;const s=()=>i.positions=n.points??[];s(),this.ad(n.pointsChanged.don(()=>!i.enabled&&s())),this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(p.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||Q.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(Qc,"type",Qc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.DoublePointsModify,Qc));let Pv=Qc;const Vc=class Vc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new JS(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Vc,"type",Vc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.CircularAppend,Vc));let Tv=Vc;const Hc=class Hc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new eE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Hc,"type",Hc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.CircularInsert,Hc));let Iv=Hc;const Nc=class Nc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new YS(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Nc,"type",Nc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.LineStringAppend,Nc));let kv=Nc;const Gc=class Gc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new jS(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Gc,"type",Gc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.LineStringInsert,Gc));let Fv=Gc;const Wc=class Wc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new tE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Wc,"type",Wc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.ScatterAppend,Wc));let Bv=Wc;const qc=class qc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new nE(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(qc,"type",qc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.ScatterModify,qc));let Mv=qc;const Kc=class Kc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ts(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Kc,"type",Kc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.VisibilityAppend,Kc));let Dv=Kc;const Zc=class Zc extends rn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Is(e));this.ad(i.enabledChanged.don(o=>{!o&&this.ad(p.nextAnimateFrame(()=>{this.destroy()}))}));do{if(Reflect.has(n,"points")){const o=()=>i.positions=n.points??[];o(),this.ad(n.pointsChanged.don(()=>!i.enabled&&o())),i.enabled=!0,this.ad(p.track([n,"points"],[i,"positions"]));break}this.supportEditing=!1}while(!1)}};L(Zc,"type",Zc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.VisibilityModify,Zc));let Rv=Zc;const Xc=class Xc extends rn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new iE(e));do{if(Reflect.has(n,"points")){const r=Reflect.has(n,"extrudedHeight"),s=Reflect.has(n,"height"),a=Reflect.has(n,"perPositionHeight")?n.perPositionHeight:!r,l=n instanceof Q.ESClassification||n instanceof Q.ESPolygonFence;let c=Q.getMinMaxCorner(n.points).center,h=[...c],u=l?n.points[0][2]:0;a?r?h[2]=n.extrudedHeight:h[2]=n.height+u:(s&&(c[2]=n.height),r&&(h[2]=n.extrudedHeight)),i.startPosition=c,i.distance=h[2]-c[2],i.moveWithFirstPosition=!1;let A=[...c];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(a?(n.points=n.points.map(f=>[f[0],f[1],f[2]+i.positions[0][2]-A[2]]),r?n.extrudedHeight=i.positions[1][2]:s&&(n.height=i.positions[1][2]-(l?i.positions[0][2]:0))):(s&&(n.height=i.positions[0][2]),r&&(n.extrudedHeight=i.positions[1][2])),A=[...i.positions[0]])}));break}this.supportEditing=!1;return}while(!1);i.init(),i.enabled=!0;const o=this.ad(p.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||Q.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(Xc,"type",Xc.registerEditing("ESCesiumViewer",Q.ESJEditingMode.HeightModify,Xc));let Uv=Xc;function rE(){const t=p.createProcessingFromAsyncFunc(async(n,e,i,o,r=!0)=>{const s=Array.isArray(o)?[...o]:[o],a=i.editingID;e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"start",add:{modes:s}});const l=()=>{e.notSupportEditingCount=0,e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"end",add:{modes:s}}),t.isRunning&&t.cancel()};n.disposer.ad(l),n.disposer.ad(i.toDestroyEvent.don(l));const c=u=>{u.code=="Escape"&&l()};document.body.addEventListener("keydown",c),n.disposer.ad(()=>document.body.removeEventListener("keydown",c));let h=0;do{const u=s[h%s.length],A=await p.step(n,async f=>{const d=f.disposer,g=Q.EngineObject.contextEditing.getEngineObjConstructor(u,e.typeName);if(!g||!i.supportEditingModes().includes(u))return console.log(`未找到编辑模式或不支持当前编辑模式${u},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changedFailed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount++,!1;const v=new g(i,e);if(d.ad(()=>{!v.isDestroyed()&&v.destroy()}),v.supportEditing)e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount=0;else return console.log(`未找到编辑模式或不支持当前编辑模式${u},已跳过当前编辑模式,请检查输入`),e.editingEvent.emit({objectIDs:[i.parentID??i.id],editingID:a,type:"changedFailed",add:{cMode:u,cIndex:h}}),e.notSupportEditingCount++,!1;return await f.promise(new Promise(m=>{if(v.isDestroyed()&&m(!1),d.ad(v.toDestroyEvent.don(()=>{console.log(`编辑模式${u}结束`),m(!1)})),r){const w=_=>{_.code=="Space"&&(console.log(`编辑模式${u}结束`),m(!1))};document.body.addEventListener("keydown",w),d.ad(()=>document.body.removeEventListener("keydown",w)),d.ad(e.dblclickEvent.don(()=>m(!0)))}}))});if(r&&A||!r&&h==s.length-1||e.notSupportEditingCount==s.length)break;h++}while(!0)});return t}function oE(){const t=p.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID??l.id),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID??l.id),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const s=l=>{l.code=="Escape"&&r()};document.body.addEventListener("keydown",s),n.disposer.ad(()=>document.body.removeEventListener("keydown",s));const a=new yf(i,e);n.disposer.ad(()=>{!a.isDestroyed()&&a.destroy()}),await n.promise(new Promise(l=>{a.isDestroyed()&&l(),n.disposer.ad(a.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}ae.copyright=void 0;try{const t="earthsdk3-cesium",n="3.3.0-beta.2",e="2025-07-14T10:21:51.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="287689aaef871c16fc805227f2acb20ac1a5f1ad",a=((Date.now()-1752488511e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${a}个小时)
|
|
4146
4146
|
%c${o?o+`
|
|
4147
4147
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4148
|
-
`;ae.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4148
|
+
`;ae.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","287689aaef871c16fc805227f2acb20ac1a5f1ad")},get info(){return l},get date(){return"2025-07-14T10:21:51.000Z"},get author(){return"suplyang"},get version(){return"3.3.0-beta.2"},get name(){return"earthsdk3-cesium"},get commitId(){return"287689aaef871c16fc805227f2acb20ac1a5f1ad"},print(){console.info(this.info,`
|
|
4149
4149
|
font-size: 18px;
|
|
4150
4150
|
font-weight: 1000;
|
|
4151
4151
|
line-height: 1;
|