earthsdk3-cesium 3.6.0-beta.119 → 3.6.0-beta.121
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 +27 -27
- package/dist/earthsdk3-cesium.js +1280 -1257
- package/dist/earthsdk3-cesium.umd.cjs +25 -25
- package/dist/types/CzmObjects/general/CzmESMVTLayer/VectorTilesManager/VectorTilesCache.d.ts +1 -0
- package/dist/types/CzmObjects/general/CzmESMVTLayer/VectorTilesManager/VectorTilesCache.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESMVTLayer/VectorTilesManager/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESMVTLayer/VectorTilesManager/utils.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESMVTLayer/index.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenLayer.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenObject.d.ts +3 -0
- package/dist/types/ESCesiumViewer/ViewerExtensions/ScreenManager/ScreenObject.d.ts.map +1 -1
- package/dist/types/ESObjects/ESMVTLayer.d.ts +5 -0
- package/dist/types/ESObjects/ESMVTLayer.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/types/CzmObjects/base/InnerClass/XbsjGroundPolylinePrimitive/GroundPolylinePrimitive.d.ts +0 -148
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/XbsjPolylineGeometry.d.ts +0 -3
- package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/xbsjCreateODLinesPrimitive.d.ts +0 -29
- package/dist/types/CzmObjects/general/CzmESVideoFusion/XbsjCameraVideo/XbsjCameraVideo.d.ts +0 -18
- package/dist/types/CzmObjects/general/CzmESViewShed/XbsjViewshed/XbsjViewshed.d.ts +0 -16
- package/dist/types/ESCesiumViewer/BackGroundImage/BackGroundImage.d.ts +0 -5
- package/dist/types/ESCesiumViewer/LocalSkyBox/SkyAtmosphere.d.ts +0 -14
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatPipelineStage.d.ts +0 -12
- package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatTexturePipelineStage.d.ts +0 -11
- package/dist/types/ESCesiumViewer/initCesiumViewer/fixGoogleEarth/cesiumFixGoogleEarth.d.ts +0 -1
- package/dist/types/__declares/cesium.d.ts +0 -427
- package/dist/types/utils/czmUtils/todo/generateCartesianArc/czm/generateCartesianArc.d.ts +0 -8
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/index.d.ts +0 -37
- package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/lib/spline.d.ts +0 -62
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var EarthSDK3_Cesium=function(ne,Xe,c){"use strict";var T7=Object.defineProperty;var I7=(ne,Xe,c)=>Xe in ne?T7(ne,Xe,{enumerable:!0,configurable:!0,writable:!0,value:c}):ne[Xe]=c;var L=(ne,Xe,c)=>I7(ne,typeof Xe!="symbol"?Xe+"":Xe,c);var ms=typeof document<"u"?document.currentScript:null;function UE(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 b=UE(Xe);window.Cesium=b;function OE(){Object.keys(b).forEach(t=>{b[t].prototype&&Object.defineProperty(b[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:c.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const n=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);n&&(b.Ion.defaultAccessToken=n[1],console.log("更新默认Cesium.Ion.Token成功"))});const Su=class Su extends c.Destroyable{};L(Su,"defaults",{enabled:!0}),L(Su,"createDefaultProps",()=>({...Su.defaults}));let Fn=Su;c.extendClassProps(Fn.prototype,Fn.createDefaultProps);class Hn extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r,a)=>this.flyTo(o,r,a))),this.d(n.flyInEvent.don((o,r,a)=>this.flyIn(o,r,a))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:a}=o;n.flyInParam={position:r,rotation:a,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(n,e,i,o,r,a,s,l="default"){const{sceneObject:u,czmViewer:A}=this,h=A.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:a??0,pDelta:s??0},e,l);h&&h.then(f=>{})}flyTo(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}flyIn(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}get czmViewer(){return this.viewer}}function rt(t,n){return b.Cartesian3.fromDegrees(...t,void 0,n)}const LE=new b.Cartographic;function De(t,n){const e=b.Cartographic.fromCartesian(t,void 0,LE);if(e)return n=n||[0,0,0],n[0]=b.Math.toDegrees(e.longitude),n[1]=b.Math.toDegrees(e.latitude),n[2]=e.height,n}function Ze(t,n){return n=n||new b.Cartesian2,n.x=t[0],n.y=t[1],n}function qv(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function ri(t,n){return n=n||new b.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function Ya(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function ad(t,n){return n=n||new b.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Kv(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}function oi(t,n){if(t.length===4)return ad(t,n);if(t.length===3)return ri(t,n);if(t.length===2)return Ze(t,n);throw new Error("toCartesian error: should not be here!")}function zE(t,n){if(t instanceof b.Cartesian2)return qv(t,n);if(t instanceof b.Cartesian3)return Ya(t,n);if(t instanceof b.Cartesian4)return Kv(t,n);throw new Error("fromCartesian error: should not be here!")}function kE(t,n){return n=n||new b.Cartographic,n.longitude=b.Math.toRadians(t[0]),n.latitude=b.Math.toRadians(t[1]),n.height=t[2],n}function fo(t,n){return n=n||[0,0,0],n[0]=b.Math.toDegrees(t.longitude),n[1]=b.Math.toDegrees(t.latitude),n[2]=t.height,n}function Be(t,n){return n=n||new b.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function QE(t,n){return n=n||[0,0,0,0],n[0]=t.red,n[1]=t.green,n[2]=t.blue,n[3]=t.alpha,n}function gr(t,n){return n=n||new b.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function VE(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 b.HeadingPitchRoll,n.heading=b.Math.toRadians(t[0]-90),n.pitch=b.Math.toRadians(t[1]),n.roll=b.Math.toRadians(t[2]),n}function NE(t,n){return n=n||[0,0,0],n[0]=b.Math.toDegrees(t.heading+b.Math.PI_OVER_TWO),n[1]=b.Math.toDegrees(t.pitch),n[2]=b.Math.toDegrees(t.roll),n}function Ja(t,n){return n=n||new b.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function HE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function GE(t,n){return n=n||new b.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function WE(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 jE=new b.HeadingPitchRoll,qE=new b.Cartesian3;function KE(t,n,e){const i=Zv(n,jE),o=rt(t,qE);return b.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function gt(t,n){return n=n||new b.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 ZE(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 b.Cartesian3;function qe(t,n){return n=n||new b.Ellipsoid,b.Ellipsoid.fromCartesian3(b.Cartesian3.fromArray(t,void 0,$E),n)}function XE(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 mi(t){if(t.type==="GeographicTilingScheme")return new b.GeographicTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),rectangle:t.rectangle&>(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new b.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new dx({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new px({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function el(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:a,edgeWidth:s}=t;let l=o&&b.Matrix4.fromArray(o);return n&&(l=l||b.Matrix4.clone(b.Matrix4.IDENTITY,new b.Matrix4),b.Matrix4.multiply(n,l,l)),new b.ClippingPlaneCollection({planes:e&&e.map(u=>new b.ClippingPlane(ri(u.normal),u.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:a&&Be(a),edgeWidth:s})}function bh(t,n,e){const i=n;if(!i){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),i.planes)for(let r of i.planes)t.add(new b.ClippingPlane(ri(r.normal),r.distance));let o=i.modelMatrix&&b.Matrix4.fromArray(i.modelMatrix)||b.Matrix4.clone(b.Matrix4.IDENTITY,new b.Matrix4);e&&b.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Be(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function xh(t){const{polygons:n,enabled:e,inverse:i}=t;return new b.ClippingPolygonCollection({polygons:n&&n.map(o=>new b.ClippingPolygon({positions:o.positions.map(r=>rt(r))})),enabled:e,inverse:i})}function _h(t,n){return ld(t,b.Cartesian3.UNIT_Y,b.Cartesian3.UNIT_Z,b.Cartesian3.UNIT_X,n)}function $v(t,n){return ld(t,b.Cartesian3.UNIT_X,b.Cartesian3.UNIT_Z,new b.Cartesian3(0,-1,0),n)}function ld(t,n,e,i,o){const[r,a,s]=t,l=b.Quaternion.fromAxisAngle(e,b.Math.toRadians(-r)),u=b.Quaternion.fromAxisAngle(i,b.Math.toRadians(a)),A=b.Quaternion.fromAxisAngle(n,b.Math.toRadians(s)),h=b.Quaternion.clone(b.Quaternion.IDENTITY,o);return b.Quaternion.multiply(A,h,h),b.Quaternion.multiply(u,h,h),b.Quaternion.multiply(l,h,h),h}function yr(t,n){return Array.isArray(t)?t.length!==n?(console.warn(`array.length !== ${n}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Xv(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function lt(t,n){if(!((!t.localScale||yr(t.localScale,3))&&(!t.localRotation||yr(t.localRotation,3))&&(!t.localPosition||yr(t.localPosition,3))&&(!t.localModelMatrix||yr(t.localModelMatrix,16))&&(!t.scale||yr(t.scale,3))&&(!t.rotation||yr(t.rotation,3))&&(!t.position||yr(t.position,3))&&(!t.modelMatrix||yr(t.modelMatrix,16)))||t.localScale&&!Xv(t.localScale)||t.scale&&!Xv(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const i=n??b.Matrix4.clone(b.Matrix4.IDENTITY);if(t.localScale){const[o,r,a]=t.localScale??[1,1,1],s=b.Matrix4.fromScale(b.Cartesian3.fromElements(o,r,a),new b.Matrix4);b.Matrix4.multiply(s,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=b.Quaternion.fromAxisAngle(b.Cartesian3.UNIT_Z,b.Math.toRadians(90)),r=b.Matrix3.fromQuaternion(o);b.Matrix4.multiply(b.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=_h(t.localRotation),r=b.Matrix3.fromQuaternion(o);b.Matrix4.multiply(b.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=b.Matrix4.fromTranslation(b.Cartesian3.fromArray(t.localPosition));b.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=b.Matrix4.fromArray(t.localModelMatrix);b.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=b.Matrix4.fromScale(b.Cartesian3.fromElements(o,o,o),new b.Matrix4);b.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,a]=t.scale??[1,1,1],s=b.Matrix4.fromScale(b.Cartesian3.fromElements(o,r,a),new b.Matrix4);b.Matrix4.multiply(s,i,i)}if(t.rotation){const o=_h(t.rotation),r=b.Matrix3.fromQuaternion(o);b.Matrix4.multiply(b.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=b.Cartesian3.fromDegrees(...t.position),r=b.Transforms.eastNorthUpToFixedFrame(o);b.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=b.Matrix4.fromArray(t.modelMatrix);b.Matrix4.multiply(o,i,i)}return i}const YE=new b.Cartesian3,tl=new b.HeadingPitchRoll,JE=new b.Matrix4,e2=new b.Cartesian3,t2=new b.Cartographic;function n2(t,n=[0,0,0],e=0,i){const[o,r,a]=t,s=b.Cartesian3.fromDegrees(o,r,a,void 0,YE),l=[...n];for(let A=0;A<3;++A)l[A]=b.Math.RADIANS_PER_DEGREE*l[A];if(e!==0){tl.heading=l[0],tl.pitch=l[1],tl.roll=l[2],tl.heading-=b.Math.PI_OVER_TWO;const A=b.Transforms.headingPitchRollToFixedFrame(s,tl,void 0,void 0,JE),h=b.Matrix4.multiplyByPointAsVector(A,b.Cartesian3.UNIT_X,e2);b.Cartesian3.multiplyByScalar(h,e,h),b.Cartesian3.subtract(s,h,s)}const u=b.Cartographic.fromCartesian(s,void 0,t2);if(u)return i=i||[0,0,0],i[0]=u.longitude*180/Math.PI,i[1]=u.latitude*180/Math.PI,i[2]=u.height,i}function Yv(t,n,e,i){return n2(t,n,e,i)}const vr=b.Math.toDegrees;function Mn(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=o,n):[vr(e),vr(i),o]}function gs(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=vr(o),n):[e,i,o].map(vr)}class Ch extends c.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new b.Matrix4);L(this,"_originProjMatrix",new b.Matrix4);L(this,"_changed",new c.Event);this._scene=e;const i=this._scene.camera;b.Matrix4.clone(i.viewMatrix,this._originViewMatrix),b.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){b.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(b.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),b.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(b.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class i2 extends c.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class r2 extends c.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new c.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new i2(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class po extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(c.react(1)));L(this,"_viewDistance",this.disposeVar(c.react(0)));L(this,"_debug",this.disposeVar(c.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new r2(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:a,czmViewer:s}=this,[l,u,A]=c.getReactFuncs(i),[h,f,p]=c.getReactFuncs(a),[d,m,v]=r?c.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let x=1,E=Number.NEGATIVE_INFINITY;const B=l(),P=h(),I=d?d():0,D=s.getCurrentCameraInfo();if(!B||!P||!D){this._viewDistance.value=E,this._visibleAlpha.value=x;return}E=c.cartesianDistance(D.position,P)-(I??0);const[F,S,T,w]=B;F>S||S>T||T>w?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):E>=S&&E<=T?x=1:E<=F||E>=w?x=0:E>F&&E<S?S-F<=0?x=0:x=(E-F)/(S-F):E>T&&E<w?(w<=T&&(x=0),x=(w-E)/(w-T)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=E,this._visibleAlpha.value=x};y();const g=[s.cameraChanged,A,p];v&&g.push(v);const _=this.disposeVar(c.createNextAnimateFrameEvent(...g));this.dispose(_.disposableOn(y))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const o2=new b.BoundingSphere(b.Cartesian3.ZERO,0);function Ni(t,n,e){var i=o2;b.Cartesian3.clone(n,i.center);const o=t.camera.getPixelSize(i,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function Yt(t,n=!1){const e=t.length;let i;const o=[];for(let r=0;r<e;++r){const[a,s,l]=t[r],u=n?b.Cartesian3.fromDegrees(a,s):b.Cartesian3.fromDegrees(a,s,l);if(!u)continue;const{x:A,y:h,z:f}=u;[A,h,f].every(Number.isFinite)&&(!i||!b.Cartesian3.equals(i,u))&&(i=u,o.push(i))}return o}function mo(t,n,e,i){const o=c.geoRhumbDistance(t,e),r=c.geoRhumbHeading(t,e),a=Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(n*Math.PI/180);return a>0?c.geoRhumbDestination(t,o,n,i):c.geoRhumbDestination(t,o,n+180,i),[a>0?o:-o,i]}function s2(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const a=c.geoRhumbDestination(t,i*r,n);a&&o.push(a)}return o}function a2(t,n){return c.geoNearestPointOnLine(t,n).geometry.coordinates}const Jv=new b.Cartesian3,l2=new b.Ray,u2=new b.Plane(b.Cartesian3.UNIT_X,0);function Sh(t,n,e,i){const o=b.Cartesian3.normalize(n,Jv),r=b.Cartesian3.cross(t.camera.right,o,Jv);b.Cartesian3.normalize(r,r);const a=b.Plane.fromPointNormal(n,r,u2),s=t.camera.getPickRay(e,l2);if(s)return b.IntersectionTests.rayPlane(s,a,i)}const ud=new b.Cartesian3,c2=new b.Ray,h2=new b.Cartographic,A2=new b.Ellipsoid;function ys(t,n,e,i){const o=t.camera.getPickRay(n,c2);if(!o)return;const r=b.Cartesian3.fromElements(e,e,e,ud),a=b.Cartesian3.add(r,b.Ellipsoid.WGS84.radii,ud),s=b.Ellipsoid.fromCartesian3(a,A2),l=b.IntersectionTests.rayEllipsoid(o,s);if(l){const u=l.start>0?l.start:l.stop;if(u){const A=b.Ray.getPoint(o,u,ud),h=b.Cartographic.fromCartesian(A,void 0,h2);return i=i||new b.Cartographic,i.longitude=h.longitude,i.latitude=h.latitude,i.height=e,i}else return}else return}function vs(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function e0(t){const n=b.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const t0=new b.Cartographic,n0=new b.Cartesian3,yn=[0,0,0],wr=[0,0,0],cd=new b.Cartesian2,hd=new b.Cartesian3;function Ad(t,n,e,i,o,r){o.constraintMode="none",vs([0,0,0],o.startDragPos),r=r||{},oi(c.getDomEventCurrentTargetPos(t),cd);const a=e.position;if(!rt(a,hd))return;const s=Ni(n,hd,i);if(s===void 0||!Sh(n,hd,cd,n0)||!De(n0,yn))return;const l=e0(yn[2])*c.geoDistance(a,yn);if(!r.z&&l<s&&Math.abs(a[2]-yn[2])<e.dimensions[0]&&yn[2]>a[2])return o.constraintMode="z",vs(yn,o.startDragPos),!0;if(!ys(n,cd,a[2],t0)||!fo(t0,yn))return;const u=e0(a[2])*c.geoDistance(a,yn),A=e.dimensions[0];if(!(u>1.05*A)){if(!r.zAxis&&u>.95*A&&u<=1.05*A){o.constraintMode="zAxis",vs(yn,o.startDragPos);return}{const[h,f]=mo(a,e.heading+90,yn,wr);if(!r.x&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,yn)<s)){o.constraintMode="x",vs(wr,o.startDragPos);return}}{const[h,f]=mo(a,e.heading,yn,wr);if(!r.y&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,yn)<s)){o.constraintMode="y",vs(wr,o.startDragPos);return}}r.xy||(o.constraintMode="xy",vs(yn,o.startDragPos))}}async function i0(t,n,e,i){var s;const o=(s=t.viewer)==null?void 0:s.scene;if(!o)throw new Error("!scene");const r=c.getDomEventCurrentTargetPos(n),a=oi(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=ys(o,a,e);return l?fo(l):void 0}}let fd,dd;function r0(t,n,e,i,o){o=o||new b.Cartesian3,fd=fd||new b.Ray,dd=dd||new b.Plane(b.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,fd),a=b.Plane.fromPointNormal(n,e,dd);return o=b.IntersectionTests.rayPlane(r,a,o),o}function o0(t){const n=b.Material.fromType(t.type);return pd(n,t),n}function vn(t){return t&&c.ESSceneObject.context.getStrFromEnv(t)||b.Material.DefaultImageId}function f2(t){return{x:t[0],y:t[1]}}function pd(t,n){n.type==="Color"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.gapColor=Be(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.outlineColor=Be(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.color=Be(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Be(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Ze(n.lineCount??[8,8]),t.uniforms.lineThickness=Ze(n.lineThickness??[1,1]),t.uniforms.lineOffset=Ze(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Be(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Be(n.oddColor??[0,0,1,.5]),t.uniforms.horizontal=n.horizontal??!0,t.uniforms.offset=n.offset??0,t.uniforms.repeat=n.repeat??5):n.type==="Checkerboard"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Be(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Be(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Be(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Be(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=vn(n.specularMap),t.uniforms.normalMap=vn(n.normalMap),t.uniforms.frequency=n.frequency??10,t.uniforms.animationSpeed=n.animationSpeed??.01,t.uniforms.amplitude=n.amplitude??1,t.uniforms.specularIntensity=n.specularIntensity??.5,t.uniforms.fadeFactor=n.fadeFactor??1):n.type==="RimLighting"?(t.uniforms.color=Be(n.color??[1,0,0,.7]),t.uniforms.rimColor=Be(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Be(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Be(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=f2(n.fadeDirection??[!0,!0]),t.uniforms.time=Ze(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Be(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=vn(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=vn(n.image):n.type==="ElevationBand"?(t.uniforms.color=vn(n.colors),t.uniforms.heights=vn(n.heights)):n.type==="XbsjPolylineArrow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.image=vn(n.image),t.uniforms.repeat=n.repeat??60,t.uniforms.speed=n.speed??1,t.uniforms.lineLength=n.lineLength??1):console.warn(`未知材质类型,无法更新 ${n.type}`)}function si(t,n){const e=c.react(void 0);let i="";const[o,r,a]=c.getReactFuncs(t),s=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=o0(l)):e.value&&pd(e.value,l):(i="",e.value=void 0)}catch{}};return s(),e.dispose(a.disposableOn(s)),e}function Hi(t,n=!1){const e=Yt(t.positions,n),i=t.holes&&t.holes.map(o=>Hi(o));return{positions:e,holes:i}}function md(t,n){const e=Math.PI/180,i=1/e,o=new b.Cartographic(t[0]*e,t[1]*e,t[2]),r=new b.Cartographic(n[0]*e,n[1]*e,n[2]),a=new b.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new b.Cartographic);if(a)return a.height=(o.height+r.height)*.5,[a.longitude*i,a.latitude*i,a.height]}const s0=new b.Cartesian4,d2=new b.Matrix4;function p2(){return{left:0,top:0,right:0,bottom:0,depth:0}}function a0(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function l0(t,n,e){if(t.scene.mode!==b.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,a=t.camera.frustum.projectionMatrix,s=b.Matrix4.multiply(a,r,d2),l=b.Matrix4.multiplyByVector(s,b.Cartesian4.fromElements(n.x,n.y,n.z,1,s0),s0);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const u=o*(l.x*.5+.5),A=i*(l.y*.5+.5),h=o-u,f=i-A,p=l.z;if(!(u<0||A<0||h<0||f<0||p<0||p>1))return e?(e.left=u,e.top=f,e.right=h,e.bottom=A,e.depth=p):e={left:u,top:f,right:h,bottom:A,depth:p},e}const go={left:0,top:0,right:0,bottom:0,depth:0};class Eh extends c.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new b.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new c.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new Ch(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=i}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const i=l0(this._viewer,this._cartesian,go);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?a0(this._winPos,go)||(e=!0,this._winPos.left=go.left,this._winPos.top=go.top,this._winPos.right=go.right,this._winPos.bottom=go.bottom,this._winPos.depth=go.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){b.Cartesian3.equals(this._cartesian,e)||(b.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function u0(t){const n=b.Math.toRadians(t[0]),e=b.Math.toRadians(t[1]),i=b.Math.toRadians(t[2]),o=b.Matrix3.fromHeadingPitchRoll(new b.HeadingPitchRoll(n,e,i)),r=new b.Cartesian3;return b.Matrix3.multiplyByVector(o,b.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const m2=b.Check,yo=b.defined,c0=b.Math.EPSILON10;function g2(t,n,e,i){if(m2.defined("equalsEpsilon",n),!yo(t))return;e=e??!1;const o=yo(i),r=t.length;if(r<2)return t;let a,s=t[0],l,u,A=0,h=-1;for(a=1;a<r;++a)l=t[a],n(s,l,c0)?(yo(u)||(u=t.slice(0,a),A=a-1,h=0),o&&i.push(a)):(yo(u)&&(u.push(l),A=a,o&&(h=i.length)),s=l);return e&&n(t[0],t[r-1],c0)&&(o&&(yo(u)?i.splice(h,0,A):i.push(r-1)),yo(u)?u.length-=1:u=t.slice(0,-1)),yo(u)?u:t}const Ne=b.Cartesian3,ws=b.Cartographic,vo=b.defined,h0=b.DeveloperError,A0=b.Ellipsoid,y2=b.EllipsoidGeodesic,f0=b.EllipsoidRhumbLine,v2=b.IntersectionTests,gd=b.Math,bs=b.Matrix4,wo=b.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 w2=new ws;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,w2).height}return i};const b2=new bs,x2=new Ne,d0=new Ne,_2=new wo(Ne.UNIT_X,0),p0=new Ne,C2=new wo(Ne.UNIT_X,0),S2=new Ne,E2=new Ne,yd=[];function m0(t,n,e){const i=yd;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const a=(e-n)/t;for(o=0;o<t;o++){const s=n+o*a;i[o]=s}return i}const Ph=new ws,Bh=new ws,br=new Ne,vd=new Ne,P2=new Ne,wd=new y2;let nl=new f0;function B2(t,n,e,i,o,r,a,s){const l=i.scaleToGeodeticSurface(t,vd),u=i.scaleToGeodeticSurface(n,P2),A=Mt.numberOfPoints(t,n,e),h=i.cartesianToCartographic(l,Ph),f=i.cartesianToCartographic(u,Bh),p=m0(A,o,r);wd.setEndPoints(h,f);const d=wd.surfaceDistance/A;let m=s;h.height=o;let v=i.cartographicToCartesian(h,br);Ne.pack(v,a,m),m+=3;for(let y=1;y<A;y++){const g=wd.interpolateUsingSurfaceDistance(y*d,Bh);g.height=p[y],v=i.cartographicToCartesian(g,br),Ne.pack(v,a,m),m+=3}return m}function T2(t,n,e,i,o,r,a,s){const l=i.cartesianToCartographic(t,Ph),u=i.cartesianToCartographic(n,Bh),A=Mt.numberOfPointsRhumbLine(l,u,e);l.height=0,u.height=0;const h=m0(A,o,r);nl.ellipsoid.equals(i)||(nl=new f0(void 0,void 0,i)),nl.setEndPoints(l,u);const f=nl.surfaceDistance/A;let p=s;l.height=o;let d=i.cartographicToCartesian(l,br);Ne.pack(d,a,p),p+=3;for(let m=1;m<A;m++){const v=nl.interpolateUsingSurfaceDistance(m*f,Bh);v.height=h[m],d=i.cartographicToCartesian(v,br),Ne.pack(d,a,p),p+=3}return p}Mt.wrapLongitude=function(t,n){const e=[],i=[];if(vo(t)&&t.length>0){n=n??bs.IDENTITY;const o=bs.inverseTransformation(n,b2),r=bs.multiplyByPoint(o,Ne.ZERO,x2),a=Ne.normalize(bs.multiplyByPointAsVector(o,Ne.UNIT_Y,d0),d0),s=wo.fromPointNormal(r,a,_2),l=Ne.normalize(bs.multiplyByPointAsVector(o,Ne.UNIT_X,p0),p0),u=wo.fromPointNormal(r,l,C2);let A=1;e.push(Ne.clone(t[0]));let h=e[0];const f=t.length;for(let p=1;p<f;++p){const d=t[p];if(wo.getPointDistance(u,h)<0||wo.getPointDistance(u,d)<0){const m=v2.lineSegmentPlane(h,d,s,S2);if(vo(m)){const v=Ne.multiplyByScalar(a,5e-9,E2);wo.getPointDistance(s,h)<0&&Ne.negate(v,v),e.push(Ne.add(m,v,new Ne)),i.push(A+1),Ne.negate(v,v),e.push(Ne.add(m,v,new Ne)),A=1}}e.push(Ne.clone(t[p])),A++,h=d}i.push(A)}return{positions:e,lengths:i}},Mt.generateArc=function(t){vo(t)||(t={});const n=t.positions;if(!vo(n))throw new h0("options.positions is required.");const e=n.length,i=t.ellipsoid??A0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const m=i.scaleToGeodeticSurface(n[0],vd);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(m,br);Ne.multiplyByScalar(v,o,v),Ne.add(m,v,m)}return[m.x,m.y,m.z]}let a=t.minDistance;if(!vo(a)){const m=t.granularity??gd.RADIANS_PER_DEGREE;a=gd.chordLength(m,i.maximumRadius)}let s=0,l;for(l=0;l<e-1;l++)s+=Mt.numberOfPoints(n[l],n[l+1],a);const u=(s+1)*3,A=new Array(u);let h=0;for(l=0;l<e-1;l++){const m=n[l],v=n[l+1],y=r?o[l]:o,g=r?o[l+1]:o;h=B2(m,v,a,i,y,g,A,h)}yd.length=0;const f=n[e-1],p=i.cartesianToCartographic(f,Ph);p.height=r?o[e-1]:o;const d=i.cartographicToCartesian(p,br);return Ne.pack(d,A,u-3),A};const g0=new ws,I2=new ws;Mt.generateRhumbArc=function(t){vo(t)||(t={});const n=t.positions;if(!vo(n))throw new h0("options.positions is required.");const e=n.length,i=t.ellipsoid??A0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],vd);if(o=r?o[0]:o,o!==0){const g=i.geodeticSurfaceNormal(y,br);Ne.multiplyByScalar(g,o,g),Ne.add(y,g,y)}return[y.x,y.y,y.z]}const a=t.granularity??gd.RADIANS_PER_DEGREE;let s=0,l,u=i.cartesianToCartographic(n[0],g0),A;for(l=0;l<e-1;l++)A=i.cartesianToCartographic(n[l+1],I2),s+=Mt.numberOfPointsRhumbLine(u,A,a),u=ws.clone(A,g0);const h=(s+1)*3,f=new Array(h);let p=0;for(l=0;l<e-1;l++){const y=n[l],g=n[l+1],_=r?o[l]:o,x=r?o[l+1]:o;p=T2(y,g,a,i,_,x,f,p)}yd.length=0;const d=n[e-1],m=i.cartesianToCartographic(d,Ph);m.height=r?o[e-1]:o;const v=i.cartographicToCartesian(m,br);return Ne.pack(v,f,h-3),f},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 Th=b.ArcType,F2=b.Cartesian3,M2=b.Math;function y0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=g2(t.positions,F2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===Th.GEODESIC||n===Th.RHUMB){let s;n===Th.GEODESIC?(s=M2.chordLength(e,i.maximumRadius),Mt.numberOfPoints):(s=e,Mt.numberOfPointsRhumbLine);const l=Mt.extractHeights(r,i);n===Th.GEODESIC?r=Mt.generateCartesianArc({positions:r,minDistance:s,ellipsoid:i,height:l}):r=Mt.generateCartesianRhumbArc({positions:r,granularity:s,ellipsoid:i,height:l})}return r}}function bd(t,n="GEODESIC",e){const o=t.map(c.lbhToXyz).map(h=>b.Cartesian3.fromArray(h));let r;if(e>0&&n!=="NONE"){if(r=y0({arcType:b.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:b.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let a=0;const s=[0],l=r.length;for(let h=1;h<l;++h)a+=b.Cartesian3.distance(r[h-1],r[h]),s.push(a);const u=r.map(h=>c.xyzToLbh([h.x,h.y,h.z]));return{timePosRots:s.map((h,f)=>[s[f],u[f],void 0]),distances:s}}function v0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function xd(t,n){const e=b.Matrix4.clone(b.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:a="YForwardZUp"}=t;if(i){const[s,l,u]=i;b.Transforms.eastNorthUpToFixedFrame(b.Cartesian3.fromDegrees(s,l,u),void 0,e)}if(o){const s=new b.Quaternion;a==="YForwardZUp"?_h(o,s):a==="XForwardZUp"&&$v(o,s);const l=b.Matrix3.fromQuaternion(s);b.Matrix4.multiply(e,b.Matrix4.fromRotationTranslation(l),e)}return r&&b.Matrix4.multiplyByScale(e,oi(r),e),v0(e,n)}const D2=new b.Matrix4;function w0(t,n){const e=b.Matrix4.fromArray(t,0,D2);return b.Matrix4.inverse(e,e),v0(e,n)}const R2=new b.Matrix4,U2=new b.Cartesian3;function b0(t,n,e){const[i,o,r]=n,a=b.Cartesian3.fromDegrees(i,o,r,void 0,U2),s=b.Matrix4.fromArray(t,0,R2),l=b.Matrix4.multiplyByPoint(s,a,a),{x:u,y:A,z:h}=l;return e=e||[0,0,0],e[0]=u,e[1]=A,e[2]=h,e}const O2=new b.Matrix4,L2=new b.Cartesian3,z2=new b.Cartographic;function xr(t,n,e){const[i,o,r]=n,a=b.Cartesian3.fromElements(i,o,r,L2),s=b.Matrix4.fromArray(t,0,O2),l=b.Matrix4.multiplyByPoint(s,a,a),u=b.Cartographic.fromCartesian(l,void 0,z2);return e=e||[0,0,0],e[0]=b.Math.toDegrees(u.longitude),e[1]=b.Math.toDegrees(u.latitude),e[2]=u.height,e}function wn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=xd({position:e,rotation:i,scale:o,initialRotationMode:r}),s=w0(a);return[n.map(u=>b0(s,u)),a,s]}function _r(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=xd({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>xr(a,l)),a]}function x0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=Xe.Cartesian3.fromDegrees(...t[e]),o=Xe.Cartesian3.fromDegrees(...t[e+1]),r=Xe.Cartesian3.fromDegrees(...t[e+2]),a=Xe.Cartesian3.angleBetween(Xe.Cartesian3.subtract(i,o,new Xe.Cartesian3),Xe.Cartesian3.subtract(r,o,new Xe.Cartesian3));n.push(isNaN(a)?0:Xe.Math.toDegrees(a))}return n}function _d(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>De(i)))),t.holes&&t.holes.forEach(i=>{e=_d(i,e)}),e}function Dn(t){return typeof t=="string"?c.ESSceneObject.context.getStrFromEnv(t):new b.Resource({url:c.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class Cd extends c.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[a,s,l]=c.getReactFuncs(e),[u,A,h]=c.getReactFuncs(i),f=new b.Cartesian3,p=()=>{let d=a();d&&(d=[...d],n.editingHeightOffset&&(d[2]-=n.editingHeightOffset),b.Cartesian3.fromDegrees(...d,void 0,f))};p(),this.dispose(l.disposableOn(p)),this.dispose(r.preUpdate.addEventListener(()=>{if(b.Cartesian3.ZERO.equals(f))return;const d=Ni(r,f,o);d!==void 0?A([d,d,d]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${d??"undefined"}`)}))}}function k2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:b.Matrix4.toArray(b.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=b.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=b.Cartesian3.add(r,b.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new b.Cartesian3),i=b.Cartesian3.add(r,b.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new b.Cartesian3),o=b.Cartesian3.add(r,b.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new b.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];r=b.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=b.Cartesian3.add(r,b.Cartesian3.fromArray([f,0,0]),new b.Cartesian3),i=b.Cartesian3.add(r,b.Cartesian3.fromArray([0,f,0]),new b.Cartesian3),o=b.Cartesian3.add(r,b.Cartesian3.fromArray([0,0,f]),new b.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let a,s,l,u,A,h;return b.Matrix4.IDENTITY.equals(b.Matrix4.fromArray(n))?(a=De(e),u=De(b.Cartesian3.add(r,b.Cartesian3.subtract(r,e,new b.Cartesian3),new b.Cartesian3)),s=De(i),A=De(b.Cartesian3.add(r,b.Cartesian3.subtract(r,i,new b.Cartesian3),new b.Cartesian3)),l=De(o),h=De(b.Cartesian3.add(r,b.Cartesian3.subtract(r,o,new b.Cartesian3),new b.Cartesian3))):(a=xr(n,[e.x,e.y,e.z]),u=xr(n,[-e.x,-e.y,-e.z]),s=xr(n,[i.x,i.y,i.z]),A=xr(n,[-i.x,-i.y,-i.z]),l=xr(n,[o.x,o.y,o.z]),h=xr(n,[-o.x,-o.y,-o.z])),!a||!u||!s||!A||!l||!h?"无法生成包围盒,请检查包围盒是否正确":[b.Math.toRadians(Math.min(a[0],u[0],s[0],A[0],l[0],h[0])),b.Math.toRadians(Math.min(a[1],u[1],s[1],A[1],l[1],h[1])),b.Math.toRadians(Math.max(a[0],u[0],s[0],A[0],l[0],h[0])),b.Math.toRadians(Math.max(a[1],u[1],s[1],A[1],l[1],h[1])),Math.min(a[2],u[2],s[2],A[2],l[2],h[2]),Math.max(a[2],u[2],s[2],A[2],l[2],h[2])]}const _0=c.createProcessingFromAsyncFunc(async(t,n)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},i={},o=[];if(await c.step(t,async l=>new Promise(async(u,A)=>{for(let h=0;h<n.length;h++){const f=n[h];await fetch(f).then(p=>p.json()).then(p=>{p&&!Reflect.has(p,"success")?i[f]=p:o.push({index:h,url:f,message:p.message}),h==n.length-1&&u()}).catch(p=>{o.push({index:h,url:f,message:p}),h==n.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],a=[],s=[];for(const l in i){const u=i[l];a.push(u.geometricError??u.root.geometricError??0);const A=k2(u);r.push(A),s.push({content:{uri:l},boundingVolume:{region:A},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...a),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(l=>l[0])),Math.min(...r.map(l=>l[1])),Math.max(...r.map(l=>l[2])),Math.max(...r.map(l=>l[3])),Math.min(...r.map(l=>l[4])),Math.max(...r.map(l=>l[5]))],e.tilesUrl.root.children=s),e});function Q2(t){return new Promise((n,e)=>{_0.restart(void 0,t),_0.completeEvent.don(i=>{n(i)})})}class Sd extends c.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(c.react(0)));const[i,o,r]=c.getReactFuncs(e);{const a=()=>{const s=i();if(s){const{center:l,minPos:u,maxPos:A}=c.getMinMaxCorner(s);this._center.value=l,this._radius.value=c.geoDistance(u,A)/2}else this._center.value=void 0};a(),this.dispose(r.disposableOn(a))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function C0(t){return new b.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new b.Color(.2,.3,.6,1),blendColor:new b.Color(0,1,.699,1),specularMap:b.Material.DefaultImageId,normalMap:b.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
1
|
+
var EarthSDK3_Cesium=function(ne,Xe,c){"use strict";var I7=Object.defineProperty;var F7=(ne,Xe,c)=>Xe in ne?I7(ne,Xe,{enumerable:!0,configurable:!0,writable:!0,value:c}):ne[Xe]=c;var L=(ne,Xe,c)=>F7(ne,typeof Xe!="symbol"?Xe+"":Xe,c);var ms=typeof document<"u"?document.currentScript:null;function UE(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 b=UE(Xe);window.Cesium=b;function OE(){Object.keys(b).forEach(t=>{b[t].prototype&&Object.defineProperty(b[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:c.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const n=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);n&&(b.Ion.defaultAccessToken=n[1],console.log("更新默认Cesium.Ion.Token成功"))});const Su=class Su extends c.Destroyable{};L(Su,"defaults",{enabled:!0}),L(Su,"createDefaultProps",()=>({...Su.defaults}));let Fn=Su;c.extendClassProps(Fn.prototype,Fn.createDefaultProps);class Hn extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r,a)=>this.flyTo(o,r,a))),this.d(n.flyInEvent.don((o,r,a)=>this.flyIn(o,r,a))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:a}=o;n.flyInParam={position:r,rotation:a,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(n,e,i,o,r,a,s,l="default"){const{sceneObject:u,czmViewer:A}=this,h=A.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:a??0,pDelta:s??0},e,l);h&&h.then(f=>{})}flyTo(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}flyIn(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}get czmViewer(){return this.viewer}}function rt(t,n){return b.Cartesian3.fromDegrees(...t,void 0,n)}const LE=new b.Cartographic;function De(t,n){const e=b.Cartographic.fromCartesian(t,void 0,LE);if(e)return n=n||[0,0,0],n[0]=b.Math.toDegrees(e.longitude),n[1]=b.Math.toDegrees(e.latitude),n[2]=e.height,n}function Ze(t,n){return n=n||new b.Cartesian2,n.x=t[0],n.y=t[1],n}function qv(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function ri(t,n){return n=n||new b.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function Ya(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function ad(t,n){return n=n||new b.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Kv(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}function oi(t,n){if(t.length===4)return ad(t,n);if(t.length===3)return ri(t,n);if(t.length===2)return Ze(t,n);throw new Error("toCartesian error: should not be here!")}function zE(t,n){if(t instanceof b.Cartesian2)return qv(t,n);if(t instanceof b.Cartesian3)return Ya(t,n);if(t instanceof b.Cartesian4)return Kv(t,n);throw new Error("fromCartesian error: should not be here!")}function kE(t,n){return n=n||new b.Cartographic,n.longitude=b.Math.toRadians(t[0]),n.latitude=b.Math.toRadians(t[1]),n.height=t[2],n}function fo(t,n){return n=n||[0,0,0],n[0]=b.Math.toDegrees(t.longitude),n[1]=b.Math.toDegrees(t.latitude),n[2]=t.height,n}function Be(t,n){return n=n||new b.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function QE(t,n){return n=n||[0,0,0,0],n[0]=t.red,n[1]=t.green,n[2]=t.blue,n[3]=t.alpha,n}function gr(t,n){return n=n||new b.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function VE(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 b.HeadingPitchRoll,n.heading=b.Math.toRadians(t[0]-90),n.pitch=b.Math.toRadians(t[1]),n.roll=b.Math.toRadians(t[2]),n}function NE(t,n){return n=n||[0,0,0],n[0]=b.Math.toDegrees(t.heading+b.Math.PI_OVER_TWO),n[1]=b.Math.toDegrees(t.pitch),n[2]=b.Math.toDegrees(t.roll),n}function Ja(t,n){return n=n||new b.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function HE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function GE(t,n){return n=n||new b.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function WE(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 jE=new b.HeadingPitchRoll,qE=new b.Cartesian3;function KE(t,n,e){const i=Zv(n,jE),o=rt(t,qE);return b.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function gt(t,n){return n=n||new b.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 ZE(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 b.Cartesian3;function qe(t,n){return n=n||new b.Ellipsoid,b.Ellipsoid.fromCartesian3(b.Cartesian3.fromArray(t,void 0,$E),n)}function XE(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 mi(t){if(t.type==="GeographicTilingScheme")return new b.GeographicTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),rectangle:t.rectangle&>(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new b.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new dx({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new px({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function el(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:a,edgeWidth:s}=t;let l=o&&b.Matrix4.fromArray(o);return n&&(l=l||b.Matrix4.clone(b.Matrix4.IDENTITY,new b.Matrix4),b.Matrix4.multiply(n,l,l)),new b.ClippingPlaneCollection({planes:e&&e.map(u=>new b.ClippingPlane(ri(u.normal),u.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:a&&Be(a),edgeWidth:s})}function bh(t,n,e){const i=n;if(!i){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),i.planes)for(let r of i.planes)t.add(new b.ClippingPlane(ri(r.normal),r.distance));let o=i.modelMatrix&&b.Matrix4.fromArray(i.modelMatrix)||b.Matrix4.clone(b.Matrix4.IDENTITY,new b.Matrix4);e&&b.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Be(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function xh(t){const{polygons:n,enabled:e,inverse:i}=t;return new b.ClippingPolygonCollection({polygons:n&&n.map(o=>new b.ClippingPolygon({positions:o.positions.map(r=>rt(r))})),enabled:e,inverse:i})}function _h(t,n){return ld(t,b.Cartesian3.UNIT_Y,b.Cartesian3.UNIT_Z,b.Cartesian3.UNIT_X,n)}function $v(t,n){return ld(t,b.Cartesian3.UNIT_X,b.Cartesian3.UNIT_Z,new b.Cartesian3(0,-1,0),n)}function ld(t,n,e,i,o){const[r,a,s]=t,l=b.Quaternion.fromAxisAngle(e,b.Math.toRadians(-r)),u=b.Quaternion.fromAxisAngle(i,b.Math.toRadians(a)),A=b.Quaternion.fromAxisAngle(n,b.Math.toRadians(s)),h=b.Quaternion.clone(b.Quaternion.IDENTITY,o);return b.Quaternion.multiply(A,h,h),b.Quaternion.multiply(u,h,h),b.Quaternion.multiply(l,h,h),h}function yr(t,n){return Array.isArray(t)?t.length!==n?(console.warn(`array.length !== ${n}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Xv(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function lt(t,n){if(!((!t.localScale||yr(t.localScale,3))&&(!t.localRotation||yr(t.localRotation,3))&&(!t.localPosition||yr(t.localPosition,3))&&(!t.localModelMatrix||yr(t.localModelMatrix,16))&&(!t.scale||yr(t.scale,3))&&(!t.rotation||yr(t.rotation,3))&&(!t.position||yr(t.position,3))&&(!t.modelMatrix||yr(t.modelMatrix,16)))||t.localScale&&!Xv(t.localScale)||t.scale&&!Xv(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const i=n??b.Matrix4.clone(b.Matrix4.IDENTITY);if(t.localScale){const[o,r,a]=t.localScale??[1,1,1],s=b.Matrix4.fromScale(b.Cartesian3.fromElements(o,r,a),new b.Matrix4);b.Matrix4.multiply(s,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=b.Quaternion.fromAxisAngle(b.Cartesian3.UNIT_Z,b.Math.toRadians(90)),r=b.Matrix3.fromQuaternion(o);b.Matrix4.multiply(b.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=_h(t.localRotation),r=b.Matrix3.fromQuaternion(o);b.Matrix4.multiply(b.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=b.Matrix4.fromTranslation(b.Cartesian3.fromArray(t.localPosition));b.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=b.Matrix4.fromArray(t.localModelMatrix);b.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=b.Matrix4.fromScale(b.Cartesian3.fromElements(o,o,o),new b.Matrix4);b.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,a]=t.scale??[1,1,1],s=b.Matrix4.fromScale(b.Cartesian3.fromElements(o,r,a),new b.Matrix4);b.Matrix4.multiply(s,i,i)}if(t.rotation){const o=_h(t.rotation),r=b.Matrix3.fromQuaternion(o);b.Matrix4.multiply(b.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=b.Cartesian3.fromDegrees(...t.position),r=b.Transforms.eastNorthUpToFixedFrame(o);b.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=b.Matrix4.fromArray(t.modelMatrix);b.Matrix4.multiply(o,i,i)}return i}const YE=new b.Cartesian3,tl=new b.HeadingPitchRoll,JE=new b.Matrix4,e2=new b.Cartesian3,t2=new b.Cartographic;function n2(t,n=[0,0,0],e=0,i){const[o,r,a]=t,s=b.Cartesian3.fromDegrees(o,r,a,void 0,YE),l=[...n];for(let A=0;A<3;++A)l[A]=b.Math.RADIANS_PER_DEGREE*l[A];if(e!==0){tl.heading=l[0],tl.pitch=l[1],tl.roll=l[2],tl.heading-=b.Math.PI_OVER_TWO;const A=b.Transforms.headingPitchRollToFixedFrame(s,tl,void 0,void 0,JE),h=b.Matrix4.multiplyByPointAsVector(A,b.Cartesian3.UNIT_X,e2);b.Cartesian3.multiplyByScalar(h,e,h),b.Cartesian3.subtract(s,h,s)}const u=b.Cartographic.fromCartesian(s,void 0,t2);if(u)return i=i||[0,0,0],i[0]=u.longitude*180/Math.PI,i[1]=u.latitude*180/Math.PI,i[2]=u.height,i}function Yv(t,n,e,i){return n2(t,n,e,i)}const vr=b.Math.toDegrees;function Mn(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=o,n):[vr(e),vr(i),o]}function gs(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=vr(o),n):[e,i,o].map(vr)}class Ch extends c.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new b.Matrix4);L(this,"_originProjMatrix",new b.Matrix4);L(this,"_changed",new c.Event);this._scene=e;const i=this._scene.camera;b.Matrix4.clone(i.viewMatrix,this._originViewMatrix),b.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){b.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(b.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),b.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(b.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class i2 extends c.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class r2 extends c.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new c.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new i2(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class po extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(c.react(1)));L(this,"_viewDistance",this.disposeVar(c.react(0)));L(this,"_debug",this.disposeVar(c.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new r2(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:a,czmViewer:s}=this,[l,u,A]=c.getReactFuncs(i),[h,f,p]=c.getReactFuncs(a),[d,m,v]=r?c.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let x=1,E=Number.NEGATIVE_INFINITY;const B=l(),P=h(),I=d?d():0,D=s.getCurrentCameraInfo();if(!B||!P||!D){this._viewDistance.value=E,this._visibleAlpha.value=x;return}E=c.cartesianDistance(D.position,P)-(I??0);const[F,S,T,w]=B;F>S||S>T||T>w?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):E>=S&&E<=T?x=1:E<=F||E>=w?x=0:E>F&&E<S?S-F<=0?x=0:x=(E-F)/(S-F):E>T&&E<w?(w<=T&&(x=0),x=(w-E)/(w-T)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=E,this._visibleAlpha.value=x};y();const g=[s.cameraChanged,A,p];v&&g.push(v);const _=this.disposeVar(c.createNextAnimateFrameEvent(...g));this.dispose(_.disposableOn(y))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const o2=new b.BoundingSphere(b.Cartesian3.ZERO,0);function Ni(t,n,e){var i=o2;b.Cartesian3.clone(n,i.center);const o=t.camera.getPixelSize(i,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function Yt(t,n=!1){const e=t.length;let i;const o=[];for(let r=0;r<e;++r){const[a,s,l]=t[r],u=n?b.Cartesian3.fromDegrees(a,s):b.Cartesian3.fromDegrees(a,s,l);if(!u)continue;const{x:A,y:h,z:f}=u;[A,h,f].every(Number.isFinite)&&(!i||!b.Cartesian3.equals(i,u))&&(i=u,o.push(i))}return o}function mo(t,n,e,i){const o=c.geoRhumbDistance(t,e),r=c.geoRhumbHeading(t,e),a=Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(n*Math.PI/180);return a>0?c.geoRhumbDestination(t,o,n,i):c.geoRhumbDestination(t,o,n+180,i),[a>0?o:-o,i]}function s2(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const a=c.geoRhumbDestination(t,i*r,n);a&&o.push(a)}return o}function a2(t,n){return c.geoNearestPointOnLine(t,n).geometry.coordinates}const Jv=new b.Cartesian3,l2=new b.Ray,u2=new b.Plane(b.Cartesian3.UNIT_X,0);function Sh(t,n,e,i){const o=b.Cartesian3.normalize(n,Jv),r=b.Cartesian3.cross(t.camera.right,o,Jv);b.Cartesian3.normalize(r,r);const a=b.Plane.fromPointNormal(n,r,u2),s=t.camera.getPickRay(e,l2);if(s)return b.IntersectionTests.rayPlane(s,a,i)}const ud=new b.Cartesian3,c2=new b.Ray,h2=new b.Cartographic,A2=new b.Ellipsoid;function ys(t,n,e,i){const o=t.camera.getPickRay(n,c2);if(!o)return;const r=b.Cartesian3.fromElements(e,e,e,ud),a=b.Cartesian3.add(r,b.Ellipsoid.WGS84.radii,ud),s=b.Ellipsoid.fromCartesian3(a,A2),l=b.IntersectionTests.rayEllipsoid(o,s);if(l){const u=l.start>0?l.start:l.stop;if(u){const A=b.Ray.getPoint(o,u,ud),h=b.Cartographic.fromCartesian(A,void 0,h2);return i=i||new b.Cartographic,i.longitude=h.longitude,i.latitude=h.latitude,i.height=e,i}else return}else return}function vs(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function e0(t){const n=b.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const t0=new b.Cartographic,n0=new b.Cartesian3,yn=[0,0,0],wr=[0,0,0],cd=new b.Cartesian2,hd=new b.Cartesian3;function Ad(t,n,e,i,o,r){o.constraintMode="none",vs([0,0,0],o.startDragPos),r=r||{},oi(c.getDomEventCurrentTargetPos(t),cd);const a=e.position;if(!rt(a,hd))return;const s=Ni(n,hd,i);if(s===void 0||!Sh(n,hd,cd,n0)||!De(n0,yn))return;const l=e0(yn[2])*c.geoDistance(a,yn);if(!r.z&&l<s&&Math.abs(a[2]-yn[2])<e.dimensions[0]&&yn[2]>a[2])return o.constraintMode="z",vs(yn,o.startDragPos),!0;if(!ys(n,cd,a[2],t0)||!fo(t0,yn))return;const u=e0(a[2])*c.geoDistance(a,yn),A=e.dimensions[0];if(!(u>1.05*A)){if(!r.zAxis&&u>.95*A&&u<=1.05*A){o.constraintMode="zAxis",vs(yn,o.startDragPos);return}{const[h,f]=mo(a,e.heading+90,yn,wr);if(!r.x&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,yn)<s)){o.constraintMode="x",vs(wr,o.startDragPos);return}}{const[h,f]=mo(a,e.heading,yn,wr);if(!r.y&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,yn)<s)){o.constraintMode="y",vs(wr,o.startDragPos);return}}r.xy||(o.constraintMode="xy",vs(yn,o.startDragPos))}}async function i0(t,n,e,i){var s;const o=(s=t.viewer)==null?void 0:s.scene;if(!o)throw new Error("!scene");const r=c.getDomEventCurrentTargetPos(n),a=oi(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=ys(o,a,e);return l?fo(l):void 0}}let fd,dd;function r0(t,n,e,i,o){o=o||new b.Cartesian3,fd=fd||new b.Ray,dd=dd||new b.Plane(b.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,fd),a=b.Plane.fromPointNormal(n,e,dd);return o=b.IntersectionTests.rayPlane(r,a,o),o}function o0(t){const n=b.Material.fromType(t.type);return pd(n,t),n}function vn(t){return t&&c.ESSceneObject.context.getStrFromEnv(t)||b.Material.DefaultImageId}function f2(t){return{x:t[0],y:t[1]}}function pd(t,n){n.type==="Color"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.gapColor=Be(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.outlineColor=Be(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.color=Be(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=vn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Be(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Ze(n.lineCount??[8,8]),t.uniforms.lineThickness=Ze(n.lineThickness??[1,1]),t.uniforms.lineOffset=Ze(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Be(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Be(n.oddColor??[0,0,1,.5]),t.uniforms.horizontal=n.horizontal??!0,t.uniforms.offset=n.offset??0,t.uniforms.repeat=n.repeat??5):n.type==="Checkerboard"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Be(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Be(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Be(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Be(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=vn(n.specularMap),t.uniforms.normalMap=vn(n.normalMap),t.uniforms.frequency=n.frequency??10,t.uniforms.animationSpeed=n.animationSpeed??.01,t.uniforms.amplitude=n.amplitude??1,t.uniforms.specularIntensity=n.specularIntensity??.5,t.uniforms.fadeFactor=n.fadeFactor??1):n.type==="RimLighting"?(t.uniforms.color=Be(n.color??[1,0,0,.7]),t.uniforms.rimColor=Be(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Be(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Be(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=f2(n.fadeDirection??[!0,!0]),t.uniforms.time=Ze(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Be(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=vn(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=vn(n.image):n.type==="ElevationBand"?(t.uniforms.color=vn(n.colors),t.uniforms.heights=vn(n.heights)):n.type==="XbsjPolylineArrow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.image=vn(n.image),t.uniforms.repeat=n.repeat??60,t.uniforms.speed=n.speed??1,t.uniforms.lineLength=n.lineLength??1):console.warn(`未知材质类型,无法更新 ${n.type}`)}function si(t,n){const e=c.react(void 0);let i="";const[o,r,a]=c.getReactFuncs(t),s=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=o0(l)):e.value&&pd(e.value,l):(i="",e.value=void 0)}catch{}};return s(),e.dispose(a.disposableOn(s)),e}function Hi(t,n=!1){const e=Yt(t.positions,n),i=t.holes&&t.holes.map(o=>Hi(o));return{positions:e,holes:i}}function md(t,n){const e=Math.PI/180,i=1/e,o=new b.Cartographic(t[0]*e,t[1]*e,t[2]),r=new b.Cartographic(n[0]*e,n[1]*e,n[2]),a=new b.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new b.Cartographic);if(a)return a.height=(o.height+r.height)*.5,[a.longitude*i,a.latitude*i,a.height]}const s0=new b.Cartesian4,d2=new b.Matrix4;function p2(){return{left:0,top:0,right:0,bottom:0,depth:0}}function a0(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function l0(t,n,e){if(t.scene.mode!==b.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,a=t.camera.frustum.projectionMatrix,s=b.Matrix4.multiply(a,r,d2),l=b.Matrix4.multiplyByVector(s,b.Cartesian4.fromElements(n.x,n.y,n.z,1,s0),s0);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const u=o*(l.x*.5+.5),A=i*(l.y*.5+.5),h=o-u,f=i-A,p=l.z;if(!(u<0||A<0||h<0||f<0||p<0||p>1))return e?(e.left=u,e.top=f,e.right=h,e.bottom=A,e.depth=p):e={left:u,top:f,right:h,bottom:A,depth:p},e}const go={left:0,top:0,right:0,bottom:0,depth:0};class Eh extends c.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new b.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new c.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new Ch(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=i}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const i=l0(this._viewer,this._cartesian,go);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?a0(this._winPos,go)||(e=!0,this._winPos.left=go.left,this._winPos.top=go.top,this._winPos.right=go.right,this._winPos.bottom=go.bottom,this._winPos.depth=go.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){b.Cartesian3.equals(this._cartesian,e)||(b.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function u0(t){const n=b.Math.toRadians(t[0]),e=b.Math.toRadians(t[1]),i=b.Math.toRadians(t[2]),o=b.Matrix3.fromHeadingPitchRoll(new b.HeadingPitchRoll(n,e,i)),r=new b.Cartesian3;return b.Matrix3.multiplyByVector(o,b.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const m2=b.Check,yo=b.defined,c0=b.Math.EPSILON10;function g2(t,n,e,i){if(m2.defined("equalsEpsilon",n),!yo(t))return;e=e??!1;const o=yo(i),r=t.length;if(r<2)return t;let a,s=t[0],l,u,A=0,h=-1;for(a=1;a<r;++a)l=t[a],n(s,l,c0)?(yo(u)||(u=t.slice(0,a),A=a-1,h=0),o&&i.push(a)):(yo(u)&&(u.push(l),A=a,o&&(h=i.length)),s=l);return e&&n(t[0],t[r-1],c0)&&(o&&(yo(u)?i.splice(h,0,A):i.push(r-1)),yo(u)?u.length-=1:u=t.slice(0,-1)),yo(u)?u:t}const Ne=b.Cartesian3,ws=b.Cartographic,vo=b.defined,h0=b.DeveloperError,A0=b.Ellipsoid,y2=b.EllipsoidGeodesic,f0=b.EllipsoidRhumbLine,v2=b.IntersectionTests,gd=b.Math,bs=b.Matrix4,wo=b.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 w2=new ws;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,w2).height}return i};const b2=new bs,x2=new Ne,d0=new Ne,_2=new wo(Ne.UNIT_X,0),p0=new Ne,C2=new wo(Ne.UNIT_X,0),S2=new Ne,E2=new Ne,yd=[];function m0(t,n,e){const i=yd;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const a=(e-n)/t;for(o=0;o<t;o++){const s=n+o*a;i[o]=s}return i}const Ph=new ws,Bh=new ws,br=new Ne,vd=new Ne,P2=new Ne,wd=new y2;let nl=new f0;function B2(t,n,e,i,o,r,a,s){const l=i.scaleToGeodeticSurface(t,vd),u=i.scaleToGeodeticSurface(n,P2),A=Mt.numberOfPoints(t,n,e),h=i.cartesianToCartographic(l,Ph),f=i.cartesianToCartographic(u,Bh),p=m0(A,o,r);wd.setEndPoints(h,f);const d=wd.surfaceDistance/A;let m=s;h.height=o;let v=i.cartographicToCartesian(h,br);Ne.pack(v,a,m),m+=3;for(let y=1;y<A;y++){const g=wd.interpolateUsingSurfaceDistance(y*d,Bh);g.height=p[y],v=i.cartographicToCartesian(g,br),Ne.pack(v,a,m),m+=3}return m}function T2(t,n,e,i,o,r,a,s){const l=i.cartesianToCartographic(t,Ph),u=i.cartesianToCartographic(n,Bh),A=Mt.numberOfPointsRhumbLine(l,u,e);l.height=0,u.height=0;const h=m0(A,o,r);nl.ellipsoid.equals(i)||(nl=new f0(void 0,void 0,i)),nl.setEndPoints(l,u);const f=nl.surfaceDistance/A;let p=s;l.height=o;let d=i.cartographicToCartesian(l,br);Ne.pack(d,a,p),p+=3;for(let m=1;m<A;m++){const v=nl.interpolateUsingSurfaceDistance(m*f,Bh);v.height=h[m],d=i.cartographicToCartesian(v,br),Ne.pack(d,a,p),p+=3}return p}Mt.wrapLongitude=function(t,n){const e=[],i=[];if(vo(t)&&t.length>0){n=n??bs.IDENTITY;const o=bs.inverseTransformation(n,b2),r=bs.multiplyByPoint(o,Ne.ZERO,x2),a=Ne.normalize(bs.multiplyByPointAsVector(o,Ne.UNIT_Y,d0),d0),s=wo.fromPointNormal(r,a,_2),l=Ne.normalize(bs.multiplyByPointAsVector(o,Ne.UNIT_X,p0),p0),u=wo.fromPointNormal(r,l,C2);let A=1;e.push(Ne.clone(t[0]));let h=e[0];const f=t.length;for(let p=1;p<f;++p){const d=t[p];if(wo.getPointDistance(u,h)<0||wo.getPointDistance(u,d)<0){const m=v2.lineSegmentPlane(h,d,s,S2);if(vo(m)){const v=Ne.multiplyByScalar(a,5e-9,E2);wo.getPointDistance(s,h)<0&&Ne.negate(v,v),e.push(Ne.add(m,v,new Ne)),i.push(A+1),Ne.negate(v,v),e.push(Ne.add(m,v,new Ne)),A=1}}e.push(Ne.clone(t[p])),A++,h=d}i.push(A)}return{positions:e,lengths:i}},Mt.generateArc=function(t){vo(t)||(t={});const n=t.positions;if(!vo(n))throw new h0("options.positions is required.");const e=n.length,i=t.ellipsoid??A0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const m=i.scaleToGeodeticSurface(n[0],vd);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(m,br);Ne.multiplyByScalar(v,o,v),Ne.add(m,v,m)}return[m.x,m.y,m.z]}let a=t.minDistance;if(!vo(a)){const m=t.granularity??gd.RADIANS_PER_DEGREE;a=gd.chordLength(m,i.maximumRadius)}let s=0,l;for(l=0;l<e-1;l++)s+=Mt.numberOfPoints(n[l],n[l+1],a);const u=(s+1)*3,A=new Array(u);let h=0;for(l=0;l<e-1;l++){const m=n[l],v=n[l+1],y=r?o[l]:o,g=r?o[l+1]:o;h=B2(m,v,a,i,y,g,A,h)}yd.length=0;const f=n[e-1],p=i.cartesianToCartographic(f,Ph);p.height=r?o[e-1]:o;const d=i.cartographicToCartesian(p,br);return Ne.pack(d,A,u-3),A};const g0=new ws,I2=new ws;Mt.generateRhumbArc=function(t){vo(t)||(t={});const n=t.positions;if(!vo(n))throw new h0("options.positions is required.");const e=n.length,i=t.ellipsoid??A0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],vd);if(o=r?o[0]:o,o!==0){const g=i.geodeticSurfaceNormal(y,br);Ne.multiplyByScalar(g,o,g),Ne.add(y,g,y)}return[y.x,y.y,y.z]}const a=t.granularity??gd.RADIANS_PER_DEGREE;let s=0,l,u=i.cartesianToCartographic(n[0],g0),A;for(l=0;l<e-1;l++)A=i.cartesianToCartographic(n[l+1],I2),s+=Mt.numberOfPointsRhumbLine(u,A,a),u=ws.clone(A,g0);const h=(s+1)*3,f=new Array(h);let p=0;for(l=0;l<e-1;l++){const y=n[l],g=n[l+1],_=r?o[l]:o,x=r?o[l+1]:o;p=T2(y,g,a,i,_,x,f,p)}yd.length=0;const d=n[e-1],m=i.cartesianToCartographic(d,Ph);m.height=r?o[e-1]:o;const v=i.cartographicToCartesian(m,br);return Ne.pack(v,f,h-3),f},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 Th=b.ArcType,F2=b.Cartesian3,M2=b.Math;function y0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=g2(t.positions,F2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===Th.GEODESIC||n===Th.RHUMB){let s;n===Th.GEODESIC?(s=M2.chordLength(e,i.maximumRadius),Mt.numberOfPoints):(s=e,Mt.numberOfPointsRhumbLine);const l=Mt.extractHeights(r,i);n===Th.GEODESIC?r=Mt.generateCartesianArc({positions:r,minDistance:s,ellipsoid:i,height:l}):r=Mt.generateCartesianRhumbArc({positions:r,granularity:s,ellipsoid:i,height:l})}return r}}function bd(t,n="GEODESIC",e){const o=t.map(c.lbhToXyz).map(h=>b.Cartesian3.fromArray(h));let r;if(e>0&&n!=="NONE"){if(r=y0({arcType:b.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:b.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let a=0;const s=[0],l=r.length;for(let h=1;h<l;++h)a+=b.Cartesian3.distance(r[h-1],r[h]),s.push(a);const u=r.map(h=>c.xyzToLbh([h.x,h.y,h.z]));return{timePosRots:s.map((h,f)=>[s[f],u[f],void 0]),distances:s}}function v0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function xd(t,n){const e=b.Matrix4.clone(b.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:a="YForwardZUp"}=t;if(i){const[s,l,u]=i;b.Transforms.eastNorthUpToFixedFrame(b.Cartesian3.fromDegrees(s,l,u),void 0,e)}if(o){const s=new b.Quaternion;a==="YForwardZUp"?_h(o,s):a==="XForwardZUp"&&$v(o,s);const l=b.Matrix3.fromQuaternion(s);b.Matrix4.multiply(e,b.Matrix4.fromRotationTranslation(l),e)}return r&&b.Matrix4.multiplyByScale(e,oi(r),e),v0(e,n)}const D2=new b.Matrix4;function w0(t,n){const e=b.Matrix4.fromArray(t,0,D2);return b.Matrix4.inverse(e,e),v0(e,n)}const R2=new b.Matrix4,U2=new b.Cartesian3;function b0(t,n,e){const[i,o,r]=n,a=b.Cartesian3.fromDegrees(i,o,r,void 0,U2),s=b.Matrix4.fromArray(t,0,R2),l=b.Matrix4.multiplyByPoint(s,a,a),{x:u,y:A,z:h}=l;return e=e||[0,0,0],e[0]=u,e[1]=A,e[2]=h,e}const O2=new b.Matrix4,L2=new b.Cartesian3,z2=new b.Cartographic;function xr(t,n,e){const[i,o,r]=n,a=b.Cartesian3.fromElements(i,o,r,L2),s=b.Matrix4.fromArray(t,0,O2),l=b.Matrix4.multiplyByPoint(s,a,a),u=b.Cartographic.fromCartesian(l,void 0,z2);return e=e||[0,0,0],e[0]=b.Math.toDegrees(u.longitude),e[1]=b.Math.toDegrees(u.latitude),e[2]=u.height,e}function wn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=xd({position:e,rotation:i,scale:o,initialRotationMode:r}),s=w0(a);return[n.map(u=>b0(s,u)),a,s]}function _r(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=xd({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>xr(a,l)),a]}function x0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=Xe.Cartesian3.fromDegrees(...t[e]),o=Xe.Cartesian3.fromDegrees(...t[e+1]),r=Xe.Cartesian3.fromDegrees(...t[e+2]),a=Xe.Cartesian3.angleBetween(Xe.Cartesian3.subtract(i,o,new Xe.Cartesian3),Xe.Cartesian3.subtract(r,o,new Xe.Cartesian3));n.push(isNaN(a)?0:Xe.Math.toDegrees(a))}return n}function _d(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>De(i)))),t.holes&&t.holes.forEach(i=>{e=_d(i,e)}),e}function Dn(t){return typeof t=="string"?c.ESSceneObject.context.getStrFromEnv(t):new b.Resource({url:c.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class Cd extends c.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[a,s,l]=c.getReactFuncs(e),[u,A,h]=c.getReactFuncs(i),f=new b.Cartesian3,p=()=>{let d=a();d&&(d=[...d],n.editingHeightOffset&&(d[2]-=n.editingHeightOffset),b.Cartesian3.fromDegrees(...d,void 0,f))};p(),this.dispose(l.disposableOn(p)),this.dispose(r.preUpdate.addEventListener(()=>{if(b.Cartesian3.ZERO.equals(f))return;const d=Ni(r,f,o);d!==void 0?A([d,d,d]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${d??"undefined"}`)}))}}function k2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:b.Matrix4.toArray(b.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=b.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=b.Cartesian3.add(r,b.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new b.Cartesian3),i=b.Cartesian3.add(r,b.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new b.Cartesian3),o=b.Cartesian3.add(r,b.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new b.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];r=b.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=b.Cartesian3.add(r,b.Cartesian3.fromArray([f,0,0]),new b.Cartesian3),i=b.Cartesian3.add(r,b.Cartesian3.fromArray([0,f,0]),new b.Cartesian3),o=b.Cartesian3.add(r,b.Cartesian3.fromArray([0,0,f]),new b.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let a,s,l,u,A,h;return b.Matrix4.IDENTITY.equals(b.Matrix4.fromArray(n))?(a=De(e),u=De(b.Cartesian3.add(r,b.Cartesian3.subtract(r,e,new b.Cartesian3),new b.Cartesian3)),s=De(i),A=De(b.Cartesian3.add(r,b.Cartesian3.subtract(r,i,new b.Cartesian3),new b.Cartesian3)),l=De(o),h=De(b.Cartesian3.add(r,b.Cartesian3.subtract(r,o,new b.Cartesian3),new b.Cartesian3))):(a=xr(n,[e.x,e.y,e.z]),u=xr(n,[-e.x,-e.y,-e.z]),s=xr(n,[i.x,i.y,i.z]),A=xr(n,[-i.x,-i.y,-i.z]),l=xr(n,[o.x,o.y,o.z]),h=xr(n,[-o.x,-o.y,-o.z])),!a||!u||!s||!A||!l||!h?"无法生成包围盒,请检查包围盒是否正确":[b.Math.toRadians(Math.min(a[0],u[0],s[0],A[0],l[0],h[0])),b.Math.toRadians(Math.min(a[1],u[1],s[1],A[1],l[1],h[1])),b.Math.toRadians(Math.max(a[0],u[0],s[0],A[0],l[0],h[0])),b.Math.toRadians(Math.max(a[1],u[1],s[1],A[1],l[1],h[1])),Math.min(a[2],u[2],s[2],A[2],l[2],h[2]),Math.max(a[2],u[2],s[2],A[2],l[2],h[2])]}const _0=c.createProcessingFromAsyncFunc(async(t,n)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},i={},o=[];if(await c.step(t,async l=>new Promise(async(u,A)=>{for(let h=0;h<n.length;h++){const f=n[h];await fetch(f).then(p=>p.json()).then(p=>{p&&!Reflect.has(p,"success")?i[f]=p:o.push({index:h,url:f,message:p.message}),h==n.length-1&&u()}).catch(p=>{o.push({index:h,url:f,message:p}),h==n.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],a=[],s=[];for(const l in i){const u=i[l];a.push(u.geometricError??u.root.geometricError??0);const A=k2(u);r.push(A),s.push({content:{uri:l},boundingVolume:{region:A},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...a),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(l=>l[0])),Math.min(...r.map(l=>l[1])),Math.max(...r.map(l=>l[2])),Math.max(...r.map(l=>l[3])),Math.min(...r.map(l=>l[4])),Math.max(...r.map(l=>l[5]))],e.tilesUrl.root.children=s),e});function Q2(t){return new Promise((n,e)=>{_0.restart(void 0,t),_0.completeEvent.don(i=>{n(i)})})}class Sd extends c.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(c.react(0)));const[i,o,r]=c.getReactFuncs(e);{const a=()=>{const s=i();if(s){const{center:l,minPos:u,maxPos:A}=c.getMinMaxCorner(s);this._center.value=l,this._radius.value=c.geoDistance(u,A)/2}else this._center.value=void 0};a(),this.dispose(r.disposableOn(a))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function C0(t){return new b.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new b.Color(.2,.3,.6,1),blendColor:new b.Color(0,1,.699,1),specularMap:b.Material.DefaultImageId,normalMap:b.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
|
|
2
2
|
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
|
|
3
3
|
|
|
4
4
|
uniform sampler2D specularMap;
|
|
@@ -401,7 +401,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
401
401
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var w,C=!0,M=!1;return{s:function(){F=F.call(I)},n:function(){var R=F.next();return C=R.done,R},e:function(R){M=!0,w=R},f:function(){try{C||F.return==null||F.return()}finally{if(M)throw w}}}}function u(I,D){(D==null||D>I.length)&&(D=I.length);for(var F=0,S=new Array(D);F<D;F++)S[F]=I[F];return S}function A(I,D){for(var F=0;F<D.length;F++){var S=D[F];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}var h=s(4832).FillLayoutArray,f=s(8669).members,p=s(8500).SegmentVector,d=s(9063).ProgramConfigurationSet,m=s(9631),v=m.LineIndexArray,y=m.TriangleIndexArray,g=s(1438),_=s(9187),x=s(937),E=s(8583),B=s(1786).register,P=function(){function I(S){(function(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")})(this,I),this.zoom=S.zoom,this.overscaling=S.overscaling,this.layers=S.layers,this.layerIds=this.layers.map(function(T){return T.id}),this.index=S.index,this.layoutVertexArray=new h,this.indexArray=new y,this.indexArray2=new v,this.programConfigurations=new d(f,S.layers,S.zoom),this.segments=new p,this.segments2=new p}var D,F;return D=I,(F=[{key:"populate",value:function(S,T){var w,C=l(S);try{for(C.s();!(w=C.n()).done;){var M=w.value,R=M.feature,U=M.index,O=M.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},R)){var z=g(R);this.addFeature(R,z),T.featureIndex.insert(R,z,U,O,this.index)}}}catch(k){C.e(k)}finally{C.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(S){this.layoutVertexBuffer=S.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=S.createIndexBuffer(this.indexArray),this.indexBuffer2=S.createIndexBuffer(this.indexArray2),this.programConfigurations.upload(S)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}},{key:"addFeature",value:function(S,T){var w,C=l(x(T,500));try{for(C.s();!(w=C.n()).done;){var M,R=w.value,U=0,O=l(R);try{for(O.s();!(M=O.n()).done;)U+=M.value.length}catch(ce){O.e(ce)}finally{O.f()}var z,k=this.segments.prepareSegment(U,this.layoutVertexArray,this.indexArray),Q=k.vertexLength,V=[],j=[],J=l(R);try{for(J.s();!(z=J.n()).done;){var ee=z.value;if(ee.length!==0){ee!==R[0]&&j.push(V.length/2);var ie=this.segments2.prepareSegment(ee.length,this.layoutVertexArray,this.indexArray2),oe=ie.vertexLength;this.layoutVertexArray.emplaceBack(ee[0].x,ee[0].y),this.indexArray2.emplaceBack(oe+ee.length-1,oe),V.push(ee[0].x),V.push(ee[0].y);for(var le=1;le<ee.length;le++)this.layoutVertexArray.emplaceBack(ee[le].x,ee[le].y),this.indexArray2.emplaceBack(oe+le-1,oe+le),V.push(ee[le].x),V.push(ee[le].y);ie.vertexLength+=ee.length,ie.primitiveLength+=ee.length}}}catch(ce){J.e(ce)}finally{J.f()}var ue=_(V,j);E(ue.length%3==0);for(var re=0;re<ue.length;re+=3)this.indexArray.emplaceBack(Q+ue[re],Q+ue[re+1],Q+ue[re+2]);k.vertexLength+=U,k.primitiveLength+=ue.length/3}}catch(ce){C.e(ce)}finally{C.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,S)}}])&&A(D.prototype,F),Object.defineProperty(D,"prototype",{writable:!1}),I}();B("FillBucket",P,{omit:["layers"]}),r.exports=P},163:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4)},8294:function(r,a,s){function l(T,w){var C=typeof Symbol<"u"&&T[Symbol.iterator]||T["@@iterator"];if(!C){if(Array.isArray(T)||(C=function(k,Q){if(k){if(typeof k=="string")return u(k,Q);var V=Object.prototype.toString.call(k).slice(8,-1);return V==="Object"&&k.constructor&&(V=k.constructor.name),V==="Map"||V==="Set"?Array.from(k):V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V)?u(k,Q):void 0}}(T))||w){C&&(T=C);var M=0,R=function(){};return{s:R,n:function(){return M>=T.length?{done:!0}:{done:!1,value:T[M++]}},e:function(k){throw k},f:R}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
402
402
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U,O=!0,z=!1;return{s:function(){C=C.call(T)},n:function(){var k=C.next();return O=k.done,k},e:function(k){z=!0,U=k},f:function(){try{O||C.return==null||C.return()}finally{if(z)throw U}}}}function u(T,w){(w==null||w>T.length)&&(w=T.length);for(var C=0,M=new Array(w);C<w;C++)M[C]=T[C];return M}function A(T,w){for(var C=0;C<w.length;C++){var M=w[C];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(T,M.key,M)}}var h=s(4832).FillExtrusionLayoutArray,f=s(163).members,p=s(8500),d=p.SegmentVector,m=p.MAX_VERTEX_ARRAY_LENGTH,v=s(9063).ProgramConfigurationSet,y=s(9631).TriangleIndexArray,g=s(1438),_=s(900),x=s(9187),E=s(937),B=s(8583),P=s(1786).register,I=Math.pow(2,13);function D(T,w,C,M,R,U,O,z){T.emplaceBack(w,C,2*Math.floor(M*I)+O,R*I*2,U*I*2,Math.round(z))}var F=function(){function T(M){(function(R,U){if(!(R instanceof U))throw new TypeError("Cannot call a class as a function")})(this,T),this.zoom=M.zoom,this.overscaling=M.overscaling,this.layers=M.layers,this.layerIds=this.layers.map(function(R){return R.id}),this.index=M.index,this.layoutVertexArray=new h,this.indexArray=new y,this.programConfigurations=new v(f,M.layers,M.zoom),this.segments=new d}var w,C;return w=T,(C=[{key:"populate",value:function(M,R){var U,O=l(M);try{for(O.s();!(U=O.n()).done;){var z=U.value,k=z.feature,Q=z.index,V=z.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},k)){var j=g(k);this.addFeature(k,j),R.featureIndex.insert(k,j,Q,V,this.index)}}}catch(J){O.e(J)}finally{O.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(M){this.layoutVertexBuffer=M.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=M.createIndexBuffer(this.indexArray),this.programConfigurations.upload(M)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(M,R){var U,O,z=l(E(R,500));try{for(z.s();!(U=z.n()).done;){var k,Q=U.value,V=0,j=l(Q);try{for(j.s();!(k=j.n()).done;)V+=k.value.length}catch(ye){j.e(ye)}finally{j.f()}var J,ee=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),ie=l(Q);try{for(ie.s();!(J=ie.n()).done;){var oe=J.value;if(oe.length!==0&&!((O=oe).every(function(ye){return ye.x<0})||O.every(function(ye){return ye.x>_})||O.every(function(ye){return ye.y<0})||O.every(function(ye){return ye.y>_})))for(var le=0,ue=0;ue<oe.length;ue++){var re=oe[ue];if(ue>=1){var ce=oe[ue-1];if(!S(re,ce)){ee.vertexLength+4>m&&(ee=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var $=re.sub(ce)._perp()._unit(),q=ce.dist(re);le+q>32768&&(le=0),D(this.layoutVertexArray,re.x,re.y,$.x,$.y,0,0,le),D(this.layoutVertexArray,re.x,re.y,$.x,$.y,0,1,le),le+=q,D(this.layoutVertexArray,ce.x,ce.y,$.x,$.y,0,0,le),D(this.layoutVertexArray,ce.x,ce.y,$.x,$.y,0,1,le);var G=ee.vertexLength;this.indexArray.emplaceBack(G,G+1,G+2),this.indexArray.emplaceBack(G+1,G+2,G+3),ee.vertexLength+=4,ee.primitiveLength+=2}}}}}catch(ye){ie.e(ye)}finally{ie.f()}ee.vertexLength+V>m&&(ee=this.segments.prepareSegment(V,this.layoutVertexArray,this.indexArray));var Z,K=[],W=[],H=ee.vertexLength,X=l(Q);try{for(X.s();!(Z=X.n()).done;){var Y=Z.value;if(Y.length!==0){Y!==Q[0]&&W.push(K.length/2);for(var se=0;se<Y.length;se++){var Ae=Y[se];D(this.layoutVertexArray,Ae.x,Ae.y,0,0,1,1,0),K.push(Ae.x),K.push(Ae.y)}}}}catch(ye){X.e(ye)}finally{X.f()}var fe=x(K,W);B(fe.length%3==0);for(var pe=0;pe<fe.length;pe+=3)this.indexArray.emplaceBack(H+fe[pe],H+fe[pe+1],H+fe[pe+2]);ee.primitiveLength+=fe.length/3,ee.vertexLength+=V}}catch(ye){z.e(ye)}finally{z.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,M)}}])&&A(w.prototype,C),Object.defineProperty(w,"prototype",{writable:!1}),T}();function S(T,w){return T.x===w.x&&(T.x<0||T.x>_)||T.y===w.y&&(T.y<0||T.y>_)}P("FillExtrusionBucket",F,{omit:["layers"]}),r.exports=F},7832:function(r,a,s){function l(v){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},l(v)}function u(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function A(v,y){return A=Object.setPrototypeOf||function(g,_){return g.__proto__=_,g},A(v,y)}function h(v,y){if(y&&(l(y)==="object"||typeof y=="function"))return y;if(y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(v)}function f(v){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},f(v)}var p=s(6677),d=s(1786).register,m=function(v){(function(B,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(P&&P.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),Object.defineProperty(B,"prototype",{writable:!1}),P&&A(B,P)})(E,v);var y,g,_,x=(g=E,_=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var B,P=f(g);if(_){var I=f(this).constructor;B=Reflect.construct(P,arguments,I)}else B=P.apply(this,arguments);return h(this,B)});function E(){return u(this,E),x.apply(this,arguments)}return y=E,Object.defineProperty(y,"prototype",{writable:!1}),y}(p);d("HeatmapBucket",m,{omit:["layers"]}),r.exports=m},9379:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4)},6905:function(r,a,s){function l(I,D){var F=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!F){if(Array.isArray(I)||(F=function(R,U){if(R){if(typeof R=="string")return u(R,U);var O=Object.prototype.toString.call(R).slice(8,-1);return O==="Object"&&R.constructor&&(O=R.constructor.name),O==="Map"||O==="Set"?Array.from(R):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?u(R,U):void 0}}(I))||D){F&&(I=F);var S=0,T=function(){};return{s:T,n:function(){return S>=I.length?{done:!0}:{done:!1,value:I[S++]}},e:function(R){throw R},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
403
403
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var w,C=!0,M=!1;return{s:function(){F=F.call(I)},n:function(){var R=F.next();return C=R.done,R},e:function(R){M=!0,w=R},f:function(){try{C||F.return==null||F.return()}finally{if(M)throw w}}}}function u(I,D){(D==null||D>I.length)&&(D=I.length);for(var F=0,S=new Array(D);F<D;F++)S[F]=I[F];return S}function A(I,D){for(var F=0;F<D.length;F++){var S=D[F];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}var h=s(4832).LineLayoutArray,f=s(9379).members,p=s(8500).SegmentVector,d=s(9063).ProgramConfigurationSet,m=s(9631).TriangleIndexArray,v=s(1438),y=s(900),g=s(8929).VectorTileFeature.types,_=s(1786).register,x=Math.cos(Math.PI/180*37.5),E=Math.pow(2,14)/.5;function B(I,D,F,S,T,w,C){I.emplaceBack(D.x,D.y,S?1:0,T?1:-1,Math.round(63*F.x)+128,Math.round(63*F.y)+128,1+(w===0?0:w<0?-1:1)|(.5*C&63)<<2,.5*C>>6)}var P=function(){function I(S){(function(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")})(this,I),this.zoom=S.zoom,this.overscaling=S.overscaling,this.layers=S.layers,this.layerIds=this.layers.map(function(T){return T.id}),this.index=S.index,this.layoutVertexArray=new h,this.indexArray=new m,this.programConfigurations=new d(f,S.layers,S.zoom),this.segments=new p}var D,F;return D=I,(F=[{key:"populate",value:function(S,T){var w,C=l(S);try{for(C.s();!(w=C.n()).done;){var M=w.value,R=M.feature,U=M.index,O=M.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},R)){var z=v(R);this.addFeature(R,z),T.featureIndex.insert(R,z,U,O,this.index)}}}catch(k){C.e(k)}finally{C.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(S){this.layoutVertexBuffer=S.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=S.createIndexBuffer(this.indexArray),this.programConfigurations.upload(S)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(S,T){var w,C=this.layers[0].layout,M=C.get("line-join").evaluate(S),R=C.get("line-cap"),U=C.get("line-miter-limit"),O=C.get("line-round-limit"),z=l(T);try{for(z.s();!(w=z.n()).done;){var k=w.value;this.addLine(k,S,M,R,U,O)}}catch(Q){z.e(Q)}finally{z.f()}}},{key:"addLine",value:function(S,T,w,C,M,R){for(var U=g[T.type]==="Polygon",O=S.length;O>=2&&S[O-1].equals(S[O-2]);)O--;for(var z=0;z<O-1&&S[z].equals(S[z+1]);)z++;if(!(O<(U?3:2))){w==="bevel"&&(M=1.05);var k=y/(512*this.overscaling)*15,Q=S[z],V=this.segments.prepareSegment(10*O,this.layoutVertexArray,this.indexArray);this.distance=0;var j,J,ee,ie=C,oe=U?"butt":C,le=!0,ue=void 0,re=void 0,ce=void 0,$=void 0;this.e1=this.e2=this.e3=-1,U&&(j=S[O-2],$=Q.sub(j)._unit()._perp());for(var q=z;q<O;q++)if(!(re=U&&q===O-1?S[z+1]:S[q+1])||!S[q].equals(re)){$&&(ce=$),j&&(ue=j),j=S[q],$=re?re.sub(j)._unit()._perp():ce;var G=(ce=ce||$).add($);G.x===0&&G.y===0||G._unit();var Z=G.x*$.x+G.y*$.y,K=Z!==0?1/Z:1/0,W=Z<x&&ue&&re;if(W&&q>z){var H=j.dist(ue);if(H>2*k){var X=j.sub(j.sub(ue)._mult(k/H)._round());this.distance+=X.dist(ue),this.addCurrentVertex(X,this.distance,ce.mult(1),0,0,!1,V),ue=X}}var Y=ue&&re,se=Y?w:re?ie:oe;if(Y&&se==="round"&&(K<R?se="miter":K<=2&&(se="fakeround")),se==="miter"&&K>M&&(se="bevel"),se==="bevel"&&(K>2&&(se="flipbevel"),K<M&&(se="miter")),ue&&(this.distance+=j.dist(ue)),se==="miter")G._mult(K),this.addCurrentVertex(j,this.distance,G,0,0,!1,V);else if(se==="flipbevel"){if(K>100)G=$.clone().mult(-1);else{var Ae=ce.x*$.y-ce.y*$.x>0?-1:1,fe=K*ce.add($).mag()/ce.sub($).mag();G._perp()._mult(fe*Ae)}this.addCurrentVertex(j,this.distance,G,0,0,!1,V),this.addCurrentVertex(j,this.distance,G.mult(-1),0,0,!1,V)}else if(se==="bevel"||se==="fakeround"){var pe=ce.x*$.y-ce.y*$.x>0,ye=-Math.sqrt(K*K-1);if(pe?(ee=0,J=ye):(J=0,ee=ye),le||this.addCurrentVertex(j,this.distance,ce,J,ee,!1,V),se==="fakeround"){for(var Ce=Math.floor(8*(.5-(Z-.5))),Se=void 0,Ue=0;Ue<Ce;Ue++)Se=$.mult((Ue+1)/(Ce+1))._add(ce)._unit(),this.addPieSliceVertex(j,this.distance,Se,pe,V);this.addPieSliceVertex(j,this.distance,G,pe,V);for(var Ie=Ce-1;Ie>=0;Ie--)Se=ce.mult((Ie+1)/(Ce+1))._add($)._unit(),this.addPieSliceVertex(j,this.distance,Se,pe,V)}re&&this.addCurrentVertex(j,this.distance,$,-J,-ee,!1,V)}else se==="butt"?(le||this.addCurrentVertex(j,this.distance,ce,0,0,!1,V),re&&this.addCurrentVertex(j,this.distance,$,0,0,!1,V)):se==="square"?(le||(this.addCurrentVertex(j,this.distance,ce,1,1,!1,V),this.e1=this.e2=-1),re&&this.addCurrentVertex(j,this.distance,$,-1,-1,!1,V)):se==="round"&&(le||(this.addCurrentVertex(j,this.distance,ce,0,0,!1,V),this.addCurrentVertex(j,this.distance,ce,1,1,!0,V),this.e1=this.e2=-1),re&&(this.addCurrentVertex(j,this.distance,$,-1,-1,!0,V),this.addCurrentVertex(j,this.distance,$,0,0,!1,V)));if(W&&q<O-1){var Le=j.dist(re);if(Le>2*k){var je=j.add(re.sub(j)._mult(k/Le)._round());this.distance+=je.dist(j),this.addCurrentVertex(je,this.distance,$.mult(1),0,0,!1,V),j=je}}le=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,T)}}},{key:"addCurrentVertex",value:function(S,T,w,C,M,R,U){var O,z=this.layoutVertexArray,k=this.indexArray;O=w.clone(),C&&O._sub(w.perp()._mult(C)),B(z,S,O,R,!1,C,T),this.e3=U.vertexLength++,this.e1>=0&&this.e2>=0&&(k.emplaceBack(this.e1,this.e2,this.e3),U.primitiveLength++),this.e1=this.e2,this.e2=this.e3,O=w.mult(-1),M&&O._sub(w.perp()._mult(M)),B(z,S,O,R,!0,-M,T),this.e3=U.vertexLength++,this.e1>=0&&this.e2>=0&&(k.emplaceBack(this.e1,this.e2,this.e3),U.primitiveLength++),this.e1=this.e2,this.e2=this.e3,T>E/2&&(this.distance=0,this.addCurrentVertex(S,this.distance,w,C,M,R,U))}},{key:"addPieSliceVertex",value:function(S,T,w,C,M){w=w.mult(C?-1:1);var R=this.layoutVertexArray,U=this.indexArray;B(R,S,w,!1,C,0,T),this.e3=M.vertexLength++,this.e1>=0&&this.e2>=0&&(U.emplaceBack(this.e1,this.e2,this.e3),M.primitiveLength++),C?this.e2=this.e3:this.e1=this.e3}}])&&A(D.prototype,F),Object.defineProperty(D,"prototype",{writable:!1}),I}();_("LineBucket",P,{omit:["layers"]}),r.exports=P},1203:function(r,a,s){var l=s(6693).createLayout,u={symbolLayoutAttributes:l([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),dynamicLayoutAttributes:l([{name:"a_projected_pos",components:3,type:"Float32"}],4),placementOpacityAttributes:l([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),collisionVertexAttributes:l([{name:"a_placed",components:2,type:"Uint8"}],4),collisionBox:l([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),collisionBoxLayout:l([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),collisionCircleLayout:l([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),placement:l([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),glyphOffset:l([{type:"Float32",name:"offsetX"}]),lineVertex:l([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}])};r.exports=u},5571:function(r,a,s){function l(q,G){var Z=typeof Symbol<"u"&&q[Symbol.iterator]||q["@@iterator"];if(!Z){if(Array.isArray(q)||(Z=function(se,Ae){if(se){if(typeof se=="string")return u(se,Ae);var fe=Object.prototype.toString.call(se).slice(8,-1);return fe==="Object"&&se.constructor&&(fe=se.constructor.name),fe==="Map"||fe==="Set"?Array.from(se):fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe)?u(se,Ae):void 0}}(q))||G){Z&&(q=Z);var K=0,W=function(){};return{s:W,n:function(){return K>=q.length?{done:!0}:{done:!1,value:q[K++]}},e:function(se){throw se},f:W}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
404
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,X=!0,Y=!1;return{s:function(){Z=Z.call(q)},n:function(){var se=Z.next();return X=se.done,se},e:function(se){Y=!0,H=se},f:function(){try{X||Z.return==null||Z.return()}finally{if(Y)throw H}}}}function u(q,G){(G==null||G>q.length)&&(G=q.length);for(var Z=0,K=new Array(G);Z<G;Z++)K[Z]=q[Z];return K}function A(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function h(q,G){for(var Z=0;Z<G.length;Z++){var K=G[Z];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(q,K.key,K)}}function f(q,G,Z){return G&&h(q.prototype,G),Object.defineProperty(q,"prototype",{writable:!1}),q}var p=s(1203),d=p.symbolLayoutAttributes,m=p.collisionVertexAttributes,v=p.collisionBoxLayout,y=p.collisionCircleLayout,g=p.dynamicLayoutAttributes,_=s(4832),x=_.SymbolLayoutArray,E=_.SymbolDynamicLayoutArray,B=_.SymbolOpacityArray,P=_.CollisionBoxLayoutArray,I=_.CollisionCircleLayoutArray,D=_.CollisionVertexArray,F=_.PlacedSymbolArray,S=_.GlyphOffsetArray,T=_.SymbolLineVertexArray,w=s(5550),C=s(8500).SegmentVector,M=s(9063).ProgramConfigurationSet,R=s(9631),U=R.TriangleIndexArray,O=R.LineIndexArray,z=s(1447),k=s(8376),Q=s(6584),V=s(1438),j=s(8929).VectorTileFeature.types,J=s(7899),ee=(s(1397),s(724).getSizeData),ie=s(1786).register,oe=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function le(q,G,Z,K,W,H,X,Y){q.emplaceBack(G,Z,Math.round(64*K),Math.round(64*W),H,X,Y?Y[0]:0,Y?Y[1]:0)}function ue(q,G,Z){q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z)}var re=function(){function q(G){A(this,q),this.layoutVertexArray=new x,this.indexArray=new U,this.programConfigurations=G,this.segments=new C,this.dynamicLayoutVertexArray=new E,this.opacityVertexArray=new B,this.placedSymbolArray=new F}return f(q,[{key:"upload",value:function(G,Z){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,d.members),this.indexBuffer=G.createIndexBuffer(this.indexArray,Z),this.programConfigurations.upload(G),this.dynamicLayoutVertexBuffer=G.createVertexBuffer(this.dynamicLayoutVertexArray,g.members,!0),this.opacityVertexBuffer=G.createVertexBuffer(this.opacityVertexArray,oe,!0),this.opacityVertexBuffer.itemSize=1}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}]),q}();ie("SymbolBuffers",re);var ce=function(){function q(G,Z,K){A(this,q),this.layoutVertexArray=new G,this.layoutAttributes=Z,this.indexArray=new K,this.segments=new C,this.collisionVertexArray=new D}return f(q,[{key:"upload",value:function(G){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=G.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=G.createVertexBuffer(this.collisionVertexArray,m.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),q}();ie("CollisionBuffers",ce);var $=function(){function q(G){A(this,q),this.collisionBoxArray=G.collisionBoxArray,this.zoom=G.zoom,this.overscaling=G.overscaling,this.layers=G.layers,this.layerIds=this.layers.map(function(W){return W.id}),this.index=G.index,this.pixelRatio=G.pixelRatio;var Z=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ee(this.zoom,Z["text-size"]),this.iconSizeData=ee(this.zoom,Z["icon-size"]);var K=this.layers[0].layout;this.sortFeaturesByY=K.get("text-allow-overlap")||K.get("icon-allow-overlap")||K.get("text-ignore-placement")||K.get("icon-ignore-placement")}return f(q,[{key:"createArrays",value:function(){this.text=new re(new M(d.members,this.layers,this.zoom,function(G){return/^text/.test(G)})),this.icon=new re(new M(d.members,this.layers,this.zoom,function(G){return/^icon/.test(G)})),this.collisionBox=new ce(P,v.members,O),this.collisionCircle=new ce(I,y.members,U),this.glyphOffsetArray=new S,this.lineVertexArray=new T}},{key:"populate",value:function(G,Z){var K=this.layers[0],W=K.layout,H=W.get("text-font"),X=W.get("text-field"),Y=W.get("icon-image"),se=(X.value.kind!=="constant"||X.value.value.length>0)&&(H.value.kind!=="constant"||H.value.value.length>0),Ae=Y.value.kind!=="constant"||Y.value.value&&Y.value.value.length>0;if(this.features=[],se||Ae){var fe,pe=Z.iconDependencies,ye=Z.glyphDependencies,Ce={zoom:this.zoom},Se=l(G);try{for(Se.s();!(fe=Se.n()).done;){var Ue=fe.value,Ie=Ue.feature,Le=Ue.index,je=Ue.sourceLayerIndex;if(K._featureFilter(Ce,Ie)){var Oe=void 0;se&&(Oe=K.getValueAndResolveTokens("text-field",Ie),Oe=z(Oe,K,Ie));var dt=void 0;if(Ae&&(dt=K.getValueAndResolveTokens("icon-image",Ie)),Oe||dt){var Tt={text:Oe,icon:dt,index:Le,sourceLayerIndex:je,geometry:V(Ie),properties:Ie.properties,type:j[Ie.type]};if(Ie.id!==void 0&&(Tt.id=Ie.id),this.features.push(Tt),dt&&(pe[dt]=!0),Oe){for(var nt=H.evaluate(Ie).join(","),gn=ye[nt]=ye[nt]||{},At=W.get("text-rotation-alignment")==="map"&&W.get("symbol-placement")==="line",Vi=Q.allowsVerticalWritingMode(Oe),pi=0;pi<Oe.length;pi++)if(gn[Oe.charCodeAt(pi)]=!0,At&&Vi){var mr=J.lookup[Oe.charAt(pi)];mr&&(gn[mr.charCodeAt(0)]=!0)}}}}}}catch(B7){Se.e(B7)}finally{Se.f()}W.get("symbol-placement")==="line"&&(this.features=k(this.features))}}},{key:"isEmpty",value:function(){return this.symbolInstances.length===0}},{key:"upload",value:function(G){this.text.upload(G,this.sortFeaturesByY),this.icon.upload(G,this.sortFeaturesByY),this.collisionBox.upload(G),this.collisionCircle.upload(G)}},{key:"destroy",value:function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()}},{key:"addToLineVertexArray",value:function(G,Z){var K=this.lineVertexArray.length;if(G.segment!==void 0){for(var W=G.dist(Z[G.segment+1]),H=G.dist(Z[G.segment]),X={},Y=G.segment+1;Y<Z.length;Y++)X[Y]={x:Z[Y].x,y:Z[Y].y,tileUnitDistanceFromAnchor:W},Y<Z.length-1&&(W+=Z[Y+1].dist(Z[Y]));for(var se=G.segment||0;se>=0;se--)X[se]={x:Z[se].x,y:Z[se].y,tileUnitDistanceFromAnchor:H},se>0&&(H+=Z[se-1].dist(Z[se]));for(var Ae=0;Ae<Z.length;Ae++){var fe=X[Ae];this.lineVertexArray.emplaceBack(fe.x,fe.y,fe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:K,lineLength:this.lineVertexArray.length-K}}},{key:"addSymbols",value:function(G,Z,K,W,H,X,Y,se,Ae,fe){var pe,ye=G.indexArray,Ce=G.layoutVertexArray,Se=G.dynamicLayoutVertexArray,Ue=G.segments.prepareSegment(4*Z.length,G.layoutVertexArray,G.indexArray),Ie=this.glyphOffsetArray.length,Le=Ue.vertexLength,je=l(Z);try{for(je.s();!(pe=je.n()).done;){var Oe=pe.value,dt=Oe.tl,Tt=Oe.tr,nt=Oe.bl,gn=Oe.br,At=Oe.tex,Vi=Ue.vertexLength,pi=Oe.glyphOffset[1];le(Ce,se.x,se.y,dt.x,pi+dt.y,At.x,At.y,K),le(Ce,se.x,se.y,Tt.x,pi+Tt.y,At.x+At.w,At.y,K),le(Ce,se.x,se.y,nt.x,pi+nt.y,At.x,At.y+At.h,K),le(Ce,se.x,se.y,gn.x,pi+gn.y,At.x+At.w,At.y+At.h,K),ue(Se,se,0),ye.emplaceBack(Vi,Vi+1,Vi+2),ye.emplaceBack(Vi+1,Vi+2,Vi+3),Ue.vertexLength+=4,Ue.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oe.glyphOffset[0])}}catch(mr){je.e(mr)}finally{je.f()}G.placedSymbolArray.emplaceBack(se.x,se.y,Ie,this.glyphOffsetArray.length-Ie,Le,Ae,fe,se.segment,K?K[0]:0,K?K[1]:0,W[0],W[1],Y,!1),G.programConfigurations.populatePaintArrays(G.layoutVertexArray.length,X)}},{key:"_addCollisionDebugVertex",value:function(G,Z,K,W,H){return Z.emplaceBack(0,0),G.emplaceBack(K.x,K.y,W.x,W.y,Math.round(H.x),Math.round(H.y))}},{key:"addCollisionDebugVertices",value:function(G,Z,K,W,H,X,Y,se){var Ae=H.segments.prepareSegment(4,H.layoutVertexArray,H.indexArray),fe=Ae.vertexLength,pe=H.layoutVertexArray,ye=H.collisionVertexArray;if(this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new w(G,Z)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new w(K,Z)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new w(K,W)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new w(G,W)),Ae.vertexLength+=4,se){var Ce=H.indexArray;Ce.emplaceBack(fe,fe+1,fe+2),Ce.emplaceBack(fe,fe+2,fe+3),Ae.primitiveLength+=2}else{var Se=H.indexArray;Se.emplaceBack(fe,fe+1),Se.emplaceBack(fe+1,fe+2),Se.emplaceBack(fe+2,fe+3),Se.emplaceBack(fe+3,fe),Ae.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var G,Z=l(this.symbolInstances);try{for(Z.s();!(G=Z.n()).done;){var K=G.value;K.textCollisionFeature={boxStartIndex:K.textBoxStartIndex,boxEndIndex:K.textBoxEndIndex},K.iconCollisionFeature={boxStartIndex:K.iconBoxStartIndex,boxEndIndex:K.iconBoxEndIndex};for(var W=0;W<2;W++){var H=K[W===0?"textCollisionFeature":"iconCollisionFeature"];if(H)for(var X=H.boxStartIndex;X<H.boxEndIndex;X++){var Y=this.collisionBoxArray.get(X),se=Y.x1,Ae=Y.y1,fe=Y.x2,pe=Y.y2,ye=Y.radius>0;this.addCollisionDebugVertices(se,Ae,fe,pe,ye?this.collisionCircle:this.collisionBox,Y.anchorPoint,K,ye)}}}}catch(Ce){Z.e(Ce)}finally{Z.f()}}},{key:"deserializeCollisionBoxes",value:function(G,Z,K,W,H){for(var X={},Y=Z;Y<K;Y++){var se=G.get(Y);if(se.radius===0){X.textBox={x1:se.x1,y1:se.y1,x2:se.x2,y2:se.y2,anchorPointX:se.anchorPointX,anchorPointY:se.anchorPointY};break}X.textCircles||(X.textCircles=[]),X.textCircles.push(se.anchorPointX,se.anchorPointY,se.radius,se.signedDistanceFromAnchor,1)}for(var Ae=W;Ae<H;Ae++){var fe=G.get(Ae);if(fe.radius===0){X.iconBox={x1:fe.x1,y1:fe.y1,x2:fe.x2,y2:fe.y2,anchorPointX:fe.anchorPointX,anchorPointY:fe.anchorPointY};break}}return X}},{key:"hasTextData",value:function(){return this.text.segments.get().length>0}},{key:"hasIconData",value:function(){return this.icon.segments.get().length>0}},{key:"hasCollisionBoxData",value:function(){return this.collisionBox.segments.get().length>0}},{key:"hasCollisionCircleData",value:function(){return this.collisionCircle.segments.get().length>0}},{key:"sortFeatures",value:function(G){var Z=this;if(this.sortFeaturesByY&&this.sortedAngle!==G&&(this.sortedAngle=G,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var K=[],W=0;W<this.symbolInstances.length;W++)K.push(W);var H=Math.sin(G),X=Math.cos(G);K.sort(function(je,Oe){var dt=Z.symbolInstances[je],Tt=Z.symbolInstances[Oe];return(H*dt.anchor.x+X*dt.anchor.y|0)-(H*Tt.anchor.x+X*Tt.anchor.y|0)||Tt.featureIndex-dt.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var Y=0,se=K;Y<se.length;Y++){var Ae,fe=se[Y],pe=l(this.symbolInstances[fe].placedTextSymbolIndices);try{for(pe.s();!(Ae=pe.n()).done;)for(var ye=Ae.value,Ce=this.text.placedSymbolArray.get(ye),Se=Ce.vertexStartIndex+4*Ce.numGlyphs,Ue=Ce.vertexStartIndex;Ue<Se;Ue+=4)this.text.indexArray.emplaceBack(Ue,Ue+1,Ue+2),this.text.indexArray.emplaceBack(Ue+1,Ue+2,Ue+3)}catch(je){pe.e(je)}finally{pe.f()}var Ie=this.icon.placedSymbolArray.get(fe);if(Ie.numGlyphs){var Le=Ie.vertexStartIndex;this.icon.indexArray.emplaceBack(Le,Le+1,Le+2),this.icon.indexArray.emplaceBack(Le+1,Le+2,Le+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),q}();ie("SymbolBucket",$,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),$.MAX_GLYPHS=65535,$.addDynamicAttributes=ue,r.exports=$},900:function(r){r.exports=8192},5346:function(r,a,s){function l(I,D){var F=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!F){if(Array.isArray(I)||(F=function(R,U){if(R){if(typeof R=="string")return u(R,U);var O=Object.prototype.toString.call(R).slice(8,-1);return O==="Object"&&R.constructor&&(O=R.constructor.name),O==="Map"||O==="Set"?Array.from(R):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?u(R,U):void 0}}(I))||D){F&&(I=F);var S=0,T=function(){};return{s:T,n:function(){return S>=I.length?{done:!0}:{done:!1,value:I[S++]}},e:function(R){throw R},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
404
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,X=!0,Y=!1;return{s:function(){Z=Z.call(q)},n:function(){var se=Z.next();return X=se.done,se},e:function(se){Y=!0,H=se},f:function(){try{X||Z.return==null||Z.return()}finally{if(Y)throw H}}}}function u(q,G){(G==null||G>q.length)&&(G=q.length);for(var Z=0,K=new Array(G);Z<G;Z++)K[Z]=q[Z];return K}function A(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function h(q,G){for(var Z=0;Z<G.length;Z++){var K=G[Z];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(q,K.key,K)}}function f(q,G,Z){return G&&h(q.prototype,G),Object.defineProperty(q,"prototype",{writable:!1}),q}var p=s(1203),d=p.symbolLayoutAttributes,m=p.collisionVertexAttributes,v=p.collisionBoxLayout,y=p.collisionCircleLayout,g=p.dynamicLayoutAttributes,_=s(4832),x=_.SymbolLayoutArray,E=_.SymbolDynamicLayoutArray,B=_.SymbolOpacityArray,P=_.CollisionBoxLayoutArray,I=_.CollisionCircleLayoutArray,D=_.CollisionVertexArray,F=_.PlacedSymbolArray,S=_.GlyphOffsetArray,T=_.SymbolLineVertexArray,w=s(5550),C=s(8500).SegmentVector,M=s(9063).ProgramConfigurationSet,R=s(9631),U=R.TriangleIndexArray,O=R.LineIndexArray,z=s(1447),k=s(8376),Q=s(6584),V=s(1438),j=s(8929).VectorTileFeature.types,J=s(7899),ee=(s(1397),s(724).getSizeData),ie=s(1786).register,oe=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function le(q,G,Z,K,W,H,X,Y){q.emplaceBack(G,Z,Math.round(64*K),Math.round(64*W),H,X,Y?Y[0]:0,Y?Y[1]:0)}function ue(q,G,Z){q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z)}var re=function(){function q(G){A(this,q),this.layoutVertexArray=new x,this.indexArray=new U,this.programConfigurations=G,this.segments=new C,this.dynamicLayoutVertexArray=new E,this.opacityVertexArray=new B,this.placedSymbolArray=new F}return f(q,[{key:"upload",value:function(G,Z){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,d.members),this.indexBuffer=G.createIndexBuffer(this.indexArray,Z),this.programConfigurations.upload(G),this.dynamicLayoutVertexBuffer=G.createVertexBuffer(this.dynamicLayoutVertexArray,g.members,!0),this.opacityVertexBuffer=G.createVertexBuffer(this.opacityVertexArray,oe,!0),this.opacityVertexBuffer.itemSize=1}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}]),q}();ie("SymbolBuffers",re);var ce=function(){function q(G,Z,K){A(this,q),this.layoutVertexArray=new G,this.layoutAttributes=Z,this.indexArray=new K,this.segments=new C,this.collisionVertexArray=new D}return f(q,[{key:"upload",value:function(G){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=G.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=G.createVertexBuffer(this.collisionVertexArray,m.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),q}();ie("CollisionBuffers",ce);var $=function(){function q(G){A(this,q),this.collisionBoxArray=G.collisionBoxArray,this.zoom=G.zoom,this.overscaling=G.overscaling,this.layers=G.layers,this.layerIds=this.layers.map(function(W){return W.id}),this.index=G.index,this.pixelRatio=G.pixelRatio;var Z=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ee(this.zoom,Z["text-size"]),this.iconSizeData=ee(this.zoom,Z["icon-size"]);var K=this.layers[0].layout;this.sortFeaturesByY=K.get("text-allow-overlap")||K.get("icon-allow-overlap")||K.get("text-ignore-placement")||K.get("icon-ignore-placement")}return f(q,[{key:"createArrays",value:function(){this.text=new re(new M(d.members,this.layers,this.zoom,function(G){return/^text/.test(G)})),this.icon=new re(new M(d.members,this.layers,this.zoom,function(G){return/^icon/.test(G)})),this.collisionBox=new ce(P,v.members,O),this.collisionCircle=new ce(I,y.members,U),this.glyphOffsetArray=new S,this.lineVertexArray=new T}},{key:"populate",value:function(G,Z){var K=this.layers[0],W=K.layout,H=W.get("text-font"),X=W.get("text-field"),Y=W.get("icon-image"),se=(X.value.kind!=="constant"||X.value.value.length>0)&&(H.value.kind!=="constant"||H.value.value.length>0),Ae=Y.value.kind!=="constant"||Y.value.value&&Y.value.value.length>0;if(this.features=[],se||Ae){var fe,pe=Z.iconDependencies,ye=Z.glyphDependencies,Ce={zoom:this.zoom},Se=l(G);try{for(Se.s();!(fe=Se.n()).done;){var Ue=fe.value,Ie=Ue.feature,Le=Ue.index,je=Ue.sourceLayerIndex;if(K._featureFilter(Ce,Ie)){var Oe=void 0;se&&(Oe=K.getValueAndResolveTokens("text-field",Ie),Oe=z(Oe,K,Ie));var dt=void 0;if(Ae&&(dt=K.getValueAndResolveTokens("icon-image",Ie)),Oe||dt){var Tt={text:Oe,icon:dt,index:Le,sourceLayerIndex:je,geometry:V(Ie),properties:Ie.properties,type:j[Ie.type]};if(Ie.id!==void 0&&(Tt.id=Ie.id),this.features.push(Tt),dt&&(pe[dt]=!0),Oe){for(var nt=H.evaluate(Ie).join(","),gn=ye[nt]=ye[nt]||{},At=W.get("text-rotation-alignment")==="map"&&W.get("symbol-placement")==="line",Vi=Q.allowsVerticalWritingMode(Oe),pi=0;pi<Oe.length;pi++)if(gn[Oe.charCodeAt(pi)]=!0,At&&Vi){var mr=J.lookup[Oe.charAt(pi)];mr&&(gn[mr.charCodeAt(0)]=!0)}}}}}}catch(T7){Se.e(T7)}finally{Se.f()}W.get("symbol-placement")==="line"&&(this.features=k(this.features))}}},{key:"isEmpty",value:function(){return this.symbolInstances.length===0}},{key:"upload",value:function(G){this.text.upload(G,this.sortFeaturesByY),this.icon.upload(G,this.sortFeaturesByY),this.collisionBox.upload(G),this.collisionCircle.upload(G)}},{key:"destroy",value:function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()}},{key:"addToLineVertexArray",value:function(G,Z){var K=this.lineVertexArray.length;if(G.segment!==void 0){for(var W=G.dist(Z[G.segment+1]),H=G.dist(Z[G.segment]),X={},Y=G.segment+1;Y<Z.length;Y++)X[Y]={x:Z[Y].x,y:Z[Y].y,tileUnitDistanceFromAnchor:W},Y<Z.length-1&&(W+=Z[Y+1].dist(Z[Y]));for(var se=G.segment||0;se>=0;se--)X[se]={x:Z[se].x,y:Z[se].y,tileUnitDistanceFromAnchor:H},se>0&&(H+=Z[se-1].dist(Z[se]));for(var Ae=0;Ae<Z.length;Ae++){var fe=X[Ae];this.lineVertexArray.emplaceBack(fe.x,fe.y,fe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:K,lineLength:this.lineVertexArray.length-K}}},{key:"addSymbols",value:function(G,Z,K,W,H,X,Y,se,Ae,fe){var pe,ye=G.indexArray,Ce=G.layoutVertexArray,Se=G.dynamicLayoutVertexArray,Ue=G.segments.prepareSegment(4*Z.length,G.layoutVertexArray,G.indexArray),Ie=this.glyphOffsetArray.length,Le=Ue.vertexLength,je=l(Z);try{for(je.s();!(pe=je.n()).done;){var Oe=pe.value,dt=Oe.tl,Tt=Oe.tr,nt=Oe.bl,gn=Oe.br,At=Oe.tex,Vi=Ue.vertexLength,pi=Oe.glyphOffset[1];le(Ce,se.x,se.y,dt.x,pi+dt.y,At.x,At.y,K),le(Ce,se.x,se.y,Tt.x,pi+Tt.y,At.x+At.w,At.y,K),le(Ce,se.x,se.y,nt.x,pi+nt.y,At.x,At.y+At.h,K),le(Ce,se.x,se.y,gn.x,pi+gn.y,At.x+At.w,At.y+At.h,K),ue(Se,se,0),ye.emplaceBack(Vi,Vi+1,Vi+2),ye.emplaceBack(Vi+1,Vi+2,Vi+3),Ue.vertexLength+=4,Ue.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oe.glyphOffset[0])}}catch(mr){je.e(mr)}finally{je.f()}G.placedSymbolArray.emplaceBack(se.x,se.y,Ie,this.glyphOffsetArray.length-Ie,Le,Ae,fe,se.segment,K?K[0]:0,K?K[1]:0,W[0],W[1],Y,!1),G.programConfigurations.populatePaintArrays(G.layoutVertexArray.length,X)}},{key:"_addCollisionDebugVertex",value:function(G,Z,K,W,H){return Z.emplaceBack(0,0),G.emplaceBack(K.x,K.y,W.x,W.y,Math.round(H.x),Math.round(H.y))}},{key:"addCollisionDebugVertices",value:function(G,Z,K,W,H,X,Y,se){var Ae=H.segments.prepareSegment(4,H.layoutVertexArray,H.indexArray),fe=Ae.vertexLength,pe=H.layoutVertexArray,ye=H.collisionVertexArray;if(this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new w(G,Z)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new w(K,Z)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new w(K,W)),this._addCollisionDebugVertex(pe,ye,X,Y.anchor,new w(G,W)),Ae.vertexLength+=4,se){var Ce=H.indexArray;Ce.emplaceBack(fe,fe+1,fe+2),Ce.emplaceBack(fe,fe+2,fe+3),Ae.primitiveLength+=2}else{var Se=H.indexArray;Se.emplaceBack(fe,fe+1),Se.emplaceBack(fe+1,fe+2),Se.emplaceBack(fe+2,fe+3),Se.emplaceBack(fe+3,fe),Ae.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var G,Z=l(this.symbolInstances);try{for(Z.s();!(G=Z.n()).done;){var K=G.value;K.textCollisionFeature={boxStartIndex:K.textBoxStartIndex,boxEndIndex:K.textBoxEndIndex},K.iconCollisionFeature={boxStartIndex:K.iconBoxStartIndex,boxEndIndex:K.iconBoxEndIndex};for(var W=0;W<2;W++){var H=K[W===0?"textCollisionFeature":"iconCollisionFeature"];if(H)for(var X=H.boxStartIndex;X<H.boxEndIndex;X++){var Y=this.collisionBoxArray.get(X),se=Y.x1,Ae=Y.y1,fe=Y.x2,pe=Y.y2,ye=Y.radius>0;this.addCollisionDebugVertices(se,Ae,fe,pe,ye?this.collisionCircle:this.collisionBox,Y.anchorPoint,K,ye)}}}}catch(Ce){Z.e(Ce)}finally{Z.f()}}},{key:"deserializeCollisionBoxes",value:function(G,Z,K,W,H){for(var X={},Y=Z;Y<K;Y++){var se=G.get(Y);if(se.radius===0){X.textBox={x1:se.x1,y1:se.y1,x2:se.x2,y2:se.y2,anchorPointX:se.anchorPointX,anchorPointY:se.anchorPointY};break}X.textCircles||(X.textCircles=[]),X.textCircles.push(se.anchorPointX,se.anchorPointY,se.radius,se.signedDistanceFromAnchor,1)}for(var Ae=W;Ae<H;Ae++){var fe=G.get(Ae);if(fe.radius===0){X.iconBox={x1:fe.x1,y1:fe.y1,x2:fe.x2,y2:fe.y2,anchorPointX:fe.anchorPointX,anchorPointY:fe.anchorPointY};break}}return X}},{key:"hasTextData",value:function(){return this.text.segments.get().length>0}},{key:"hasIconData",value:function(){return this.icon.segments.get().length>0}},{key:"hasCollisionBoxData",value:function(){return this.collisionBox.segments.get().length>0}},{key:"hasCollisionCircleData",value:function(){return this.collisionCircle.segments.get().length>0}},{key:"sortFeatures",value:function(G){var Z=this;if(this.sortFeaturesByY&&this.sortedAngle!==G&&(this.sortedAngle=G,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var K=[],W=0;W<this.symbolInstances.length;W++)K.push(W);var H=Math.sin(G),X=Math.cos(G);K.sort(function(je,Oe){var dt=Z.symbolInstances[je],Tt=Z.symbolInstances[Oe];return(H*dt.anchor.x+X*dt.anchor.y|0)-(H*Tt.anchor.x+X*Tt.anchor.y|0)||Tt.featureIndex-dt.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var Y=0,se=K;Y<se.length;Y++){var Ae,fe=se[Y],pe=l(this.symbolInstances[fe].placedTextSymbolIndices);try{for(pe.s();!(Ae=pe.n()).done;)for(var ye=Ae.value,Ce=this.text.placedSymbolArray.get(ye),Se=Ce.vertexStartIndex+4*Ce.numGlyphs,Ue=Ce.vertexStartIndex;Ue<Se;Ue+=4)this.text.indexArray.emplaceBack(Ue,Ue+1,Ue+2),this.text.indexArray.emplaceBack(Ue+1,Ue+2,Ue+3)}catch(je){pe.e(je)}finally{pe.f()}var Ie=this.icon.placedSymbolArray.get(fe);if(Ie.numGlyphs){var Le=Ie.vertexStartIndex;this.icon.indexArray.emplaceBack(Le,Le+1,Le+2),this.icon.indexArray.emplaceBack(Le+1,Le+2,Le+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),q}();ie("SymbolBucket",$,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),$.MAX_GLYPHS=65535,$.addDynamicAttributes=ue,r.exports=$},900:function(r){r.exports=8192},5346:function(r,a,s){function l(I,D){var F=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!F){if(Array.isArray(I)||(F=function(R,U){if(R){if(typeof R=="string")return u(R,U);var O=Object.prototype.toString.call(R).slice(8,-1);return O==="Object"&&R.constructor&&(O=R.constructor.name),O==="Map"||O==="Set"?Array.from(R):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?u(R,U):void 0}}(I))||D){F&&(I=F);var S=0,T=function(){};return{s:T,n:function(){return S>=I.length?{done:!0}:{done:!1,value:I[S++]}},e:function(R){throw R},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
405
405
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var w,C=!0,M=!1;return{s:function(){F=F.call(I)},n:function(){var R=F.next();return C=R.done,R},e:function(R){M=!0,w=R},f:function(){try{C||F.return==null||F.return()}finally{if(M)throw w}}}}function u(I,D){(D==null||D>I.length)&&(D=I.length);for(var F=0,S=new Array(D);F<D;F++)S[F]=I[F];return S}function A(I,D){for(var F=0;F<D.length;F++){var S=D[F];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}s(5550);var h=s(1438),f=s(900),p=s(1693),d=s(1412),m=s(621),v=s(8929),y=s(3614),g=s(3076),_=s(8316).arraysIntersect,x=(s(4792).OverscaledTileID,s(1786).register),E=s(4832).FeatureIndexArray,B=function(){function I(S,T,w,C){(function(M,R){if(!(M instanceof R))throw new TypeError("Cannot call a class as a function")})(this,I),this.tileID=S,this.overscaling=T,this.x=S.canonical.x,this.y=S.canonical.y,this.z=S.canonical.z,this.grid=w||new d(f,16,0),this.featureIndexArray=C||new E}var D,F;return D=I,(F=[{key:"insert",value:function(S,T,w,C,M){var R=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(w,C,M);for(var U=0;U<T.length;U++){for(var O=T[U],z=[1/0,1/0,-1/0,-1/0],k=0;k<O.length;k++){var Q=O[k];z[0]=Math.min(z[0],Q.x),z[1]=Math.min(z[1],Q.y),z[2]=Math.max(z[2],Q.x),z[3]=Math.max(z[3],Q.y)}this.grid.insert(R,z[0],z[1],z[2],z[3])}}},{key:"query",value:function(S,T){this.vtLayers||(this.vtLayers=new v.VectorTile(new y(this.rawTileData)).layers,this.sourceLayerCoder=new m(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));for(var w={},C=S.params||{},M=f/S.tileSize/S.scale,R=p(C.filter),U=S.queryGeometry,O=S.additionalRadius*M,z=1/0,k=1/0,Q=-1/0,V=-1/0,j=0;j<U.length;j++)for(var J=U[j],ee=0;ee<J.length;ee++){var ie=J[ee];z=Math.min(z,ie.x),k=Math.min(k,ie.y),Q=Math.max(Q,ie.x),V=Math.max(V,ie.y)}var oe=this.grid.query(z-O,k-O,Q+O,V+O);oe.sort(P),this.filterMatching(w,oe,this.featureIndexArray,U,R,C.layers,T,S.bearing,M);var le=S.collisionIndex?S.collisionIndex.queryRenderedSymbols(U,this.tileID,f/S.tileSize,S.collisionBoxArray,S.sourceID,S.bucketInstanceIds):[];return le.sort(),this.filterMatching(w,le,S.collisionBoxArray,U,R,C.layers,T,S.bearing,M),w}},{key:"filterMatching",value:function(S,T,w,C,M,R,U,O,z){for(var k,Q=0;Q<T.length;Q++){var V=T[Q];if(V!==k){k=V;var j=w.get(V),J=this.bucketLayerIDs[j.bucketIndex];if(!R||_(R,J)){var ee=this.sourceLayerCoder.decode(j.sourceLayerIndex),ie=this.vtLayers[ee].feature(j.featureIndex);if(M({zoom:this.tileID.overscaledZ},ie))for(var oe=null,le=0;le<J.length;le++){var ue=J[le];if(!(R&&R.indexOf(ue)<0)){var re=U[ue];if(re&&(re.type==="symbol"||(oe||(oe=h(ie)),re.queryIntersectsFeature(C,ie,oe,this.z,O,z)))){var ce=new g(ie,this.z,this.x,this.y);ce.layer=re.serialize();var $=S[ue];$===void 0&&($=S[ue]=[]),$.push({featureIndex:V,feature:ce})}}}}}}}},{key:"hasLayer",value:function(S){var T,w=l(this.bucketLayerIDs);try{for(w.s();!(T=w.n()).done;){var C,M=l(T.value);try{for(M.s();!(C=M.n()).done;)if(S===C.value)return!0}catch(R){M.e(R)}finally{M.f()}}}catch(R){w.e(R)}finally{w.f()}return!1}}])&&A(D.prototype,F),Object.defineProperty(D,"prototype",{writable:!1}),I}();function P(I,D){return D-I}x("FeatureIndex",B,{omit:["rawTileData","sourceLayerCoder","collisionIndex"]}),r.exports=B},9631:function(r,a,s){r.exports={LineIndexArray:s(4832).LineIndexArray,TriangleIndexArray:s(4832).TriangleIndexArray}},1438:function(r,a,s){var l=s(8316),u=s(900),A={min:-1*Math.pow(2,15),max:Math.pow(2,15)-1};r.exports=function(h){for(var f=u/h.extent,p=h.loadGeometry(),d=0;d<p.length;d++)for(var m=p[d],v=0;v<m.length;v++){var y=m[v];y.x=Math.round(y.x*f),y.y=Math.round(y.y*f),(y.x<A.min||y.x>A.max||y.y<A.min||y.y>A.max)&&l.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return p}},3326:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos",type:"Int16",components:2}])},9063:function(r,a,s){function l(S,T){var w=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!w){if(Array.isArray(S)||(w=function(z,k){if(z){if(typeof z=="string")return u(z,k);var Q=Object.prototype.toString.call(z).slice(8,-1);return Q==="Object"&&z.constructor&&(Q=z.constructor.name),Q==="Map"||Q==="Set"?Array.from(z):Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q)?u(z,k):void 0}}(S))||T){w&&(S=w);var C=0,M=function(){};return{s:M,n:function(){return C>=S.length?{done:!0}:{done:!1,value:S[C++]}},e:function(z){throw z},f:M}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
406
406
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var R,U=!0,O=!1;return{s:function(){w=w.call(S)},n:function(){var z=w.next();return U=z.done,z},e:function(z){O=!0,R=z},f:function(){try{U||w.return==null||w.return()}finally{if(O)throw R}}}}function u(S,T){(T==null||T>S.length)&&(T=S.length);for(var w=0,C=new Array(T);w<T;w++)C[w]=S[w];return C}function A(S,T){if(!(S instanceof T))throw new TypeError("Cannot call a class as a function")}function h(S,T){for(var w=0;w<T.length;w++){var C=T[w];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(S,C.key,C)}}function f(S,T,w){return T&&h(S.prototype,T),w&&h(S,w),Object.defineProperty(S,"prototype",{writable:!1}),S}var p=s(9207).j,d=(s(6016),s(1786).register),m=s(5615).PossiblyEvaluatedPropertyValue,v=s(4832),y=v.StructArrayLayout1f4,g=v.StructArrayLayout2f8,_=v.StructArrayLayout4f16;function x(S){return[p(255*S.r,255*S.g),p(255*S.b,255*S.a)]}var E=function(){function S(T,w,C){A(this,S),this.value=T,this.name=w,this.type=C,this.statistics={max:-1/0}}return f(S,[{key:"defines",value:function(){return["#define HAS_UNIFORM_u_".concat(this.name)]}},{key:"populatePaintArray",value:function(){}},{key:"upload",value:function(){}},{key:"destroy",value:function(){}},{key:"setUniforms",value:function(T,w,C,M){var R=M.constantOr(this.value),U=T.gl;this.type==="color"?U.uniform4f(w.uniforms["u_".concat(this.name)],R.r,R.g,R.b,R.a):U.uniform1f(w.uniforms["u_".concat(this.name)],R)}}]),S}(),B=function(){function S(T,w,C){A(this,S),this.expression=T,this.name=w,this.type=C,this.statistics={max:-1/0};var M=C==="color"?g:y;this.paintVertexAttributes=[{name:"a_".concat(w),type:"Float32",components:C==="color"?2:1,offset:0}],this.paintVertexArray=new M}return f(S,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(T,w){var C=this.paintVertexArray,M=C.length;C.reserve(T);var R=this.expression.evaluate({zoom:0},w);if(this.type==="color")for(var U=x(R),O=M;O<T;O++)C.emplaceBack(U[0],U[1]);else{for(var z=M;z<T;z++)C.emplaceBack(R);this.statistics.max=Math.max(this.statistics.max,R)}}},{key:"upload",value:function(T){this.paintVertexArray&&(this.paintVertexBuffer=T.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"setUniforms",value:function(T,w){T.gl.uniform1f(w.uniforms["a_".concat(this.name,"_t")],0)}}]),S}(),P=function(){function S(T,w,C,M,R){A(this,S),this.expression=T,this.name=w,this.type=C,this.useIntegerZoom=M,this.zoom=R,this.statistics={max:-1/0};var U=C==="color"?_:g;this.paintVertexAttributes=[{name:"a_".concat(w),type:"Float32",components:C==="color"?4:2,offset:0}],this.paintVertexArray=new U}return f(S,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(T,w){var C=this.paintVertexArray,M=C.length;C.reserve(T);var R=this.expression.evaluate({zoom:this.zoom},w),U=this.expression.evaluate({zoom:this.zoom+1},w);if(this.type==="color")for(var O=x(R),z=x(U),k=M;k<T;k++)C.emplaceBack(O[0],O[1],z[0],z[1]);else{for(var Q=M;Q<T;Q++)C.emplaceBack(R,U);this.statistics.max=Math.max(this.statistics.max,R,U)}}},{key:"upload",value:function(T){this.paintVertexArray&&(this.paintVertexBuffer=T.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"interpolationFactor",value:function(T){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(T),this.zoom,this.zoom+1):this.expression.interpolationFactor(T,this.zoom,this.zoom+1)}},{key:"setUniforms",value:function(T,w,C){T.gl.uniform1f(w.uniforms["a_".concat(this.name,"_t")],this.interpolationFactor(C.zoom))}}]),S}(),I=function(){function S(){A(this,S),this.binders={},this.cacheKey="",this._buffers=[]}return f(S,[{key:"populatePaintArrays",value:function(T,w){for(var C in this.binders)this.binders[C].populatePaintArray(T,w)}},{key:"defines",value:function(){var T=[];for(var w in this.binders)T.push.apply(T,this.binders[w].defines());return T}},{key:"setUniforms",value:function(T,w,C,M){for(var R in this.binders)this.binders[R].setUniforms(T,w,M,C.get(R))}},{key:"getPaintVertexBuffers",value:function(){return this._buffers}},{key:"upload",value:function(T){for(var w in this.binders)this.binders[w].upload(T);var C=[];for(var M in this.binders){var R=this.binders[M];(R instanceof B||R instanceof P)&&R.paintVertexBuffer&&C.push(R.paintVertexBuffer)}this._buffers=C}},{key:"destroy",value:function(){for(var T in this.binders)this.binders[T].destroy()}}],[{key:"createDynamic",value:function(T,w,C){var M=new S,R=[];for(var U in T.paint._values)if(C(U)){var O=T.paint.get(U);if(O instanceof m&&O.property.specification["property-function"]){var z=F(U,T.type),k=O.property.specification.type,Q=O.property.useIntegerZoom;O.value.kind==="constant"?(M.binders[U]=new E(O.value,z,k),R.push("/u_".concat(z))):O.value.kind==="source"?(M.binders[U]=new B(O.value,z,k),R.push("/a_".concat(z))):(M.binders[U]=new P(O.value,z,k,Q,w),R.push("/z_".concat(z)))}}return M.cacheKey=R.sort().join(""),M}}]),S}(),D=function(){function S(T,w,C){var M=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0};A(this,S),this.programConfigurations={};var R,U=l(w);try{for(U.s();!(R=U.n()).done;){var O=R.value;this.programConfigurations[O.id]=I.createDynamic(O,C,M),this.programConfigurations[O.id].layoutAttributes=T}}catch(z){U.e(z)}finally{U.f()}}return f(S,[{key:"populatePaintArrays",value:function(T,w){for(var C in this.programConfigurations)this.programConfigurations[C].populatePaintArrays(T,w)}},{key:"get",value:function(T){return this.programConfigurations[T]}},{key:"upload",value:function(T){for(var w in this.programConfigurations)this.programConfigurations[w].upload(T)}},{key:"destroy",value:function(){for(var T in this.programConfigurations)this.programConfigurations[T].destroy()}}]),S}();function F(S,T){return{"text-opacity":"opacity","icon-opacity":"opacity","text-color":"fill_color","icon-color":"fill_color","text-halo-color":"halo_color","icon-halo-color":"halo_color","text-halo-blur":"halo_blur","icon-halo-blur":"halo_blur","text-halo-width":"halo_width","icon-halo-width":"halo_width","line-gap-width":"gapwidth"}[S]||S.replace("".concat(T,"-"),"").replace(/-/g,"_")}d("ConstantBinder",E),d("SourceExpressionBinder",B),d("CompositeExpressionBinder",P),d("ProgramConfiguration",I,{omit:["_buffers"]}),d("ProgramConfigurationSet",D),r.exports={ProgramConfiguration:I,ProgramConfigurationSet:D}},2596:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}])},8500:function(r,a,s){function l(m,v){(v==null||v>m.length)&&(v=m.length);for(var y=0,g=new Array(v);y<v;y++)g[y]=m[y];return g}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function A(m,v){for(var y=0;y<v.length;y++){var g=v[y];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(m,g.key,g)}}var h=s(8316).warnOnce,f=s(1786).register,p=Math.pow(2,16)-1,d=function(){function m(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];u(this,m),this.segments=g}var v,y;return v=m,(y=[{key:"prepareSegment",value:function(g,_,x){var E=this.segments[this.segments.length-1];return g>p&&h("Max vertices per segment is ".concat(p,": bucket requested ").concat(g)),(!E||E.vertexLength+g>r.exports.MAX_VERTEX_ARRAY_LENGTH)&&(E={vertexOffset:_.length,primitiveOffset:x.length,vertexLength:0,primitiveLength:0},this.segments.push(E)),E}},{key:"get",value:function(){return this.segments}},{key:"destroy",value:function(){var g,_=function(B,P){var I=typeof Symbol<"u"&&B[Symbol.iterator]||B["@@iterator"];if(!I){if(Array.isArray(B)||(I=function(C,M){if(C){if(typeof C=="string")return l(C,M);var R=Object.prototype.toString.call(C).slice(8,-1);return R==="Object"&&C.constructor&&(R=C.constructor.name),R==="Map"||R==="Set"?Array.from(C):R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R)?l(C,M):void 0}}(B))||P){I&&(B=I);var D=0,F=function(){};return{s:F,n:function(){return D>=B.length?{done:!0}:{done:!1,value:B[D++]}},e:function(C){throw C},f:F}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
407
407
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var S,T=!0,w=!1;return{s:function(){I=I.call(B)},n:function(){var C=I.next();return T=C.done,C},e:function(C){w=!0,S=C},f:function(){try{T||I.return==null||I.return()}finally{if(w)throw S}}}}(this.segments);try{for(_.s();!(g=_.n()).done;){var x=g.value;for(var E in x.vaos)x.vaos[E].destroy()}}catch(B){_.e(B)}finally{_.f()}}}])&&A(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),m}();f("SegmentVector",d),r.exports={SegmentVector:d,MAX_VERTEX_ARRAY_LENGTH:p}},3892:function(r){function a(l,u){for(var A=0;A<u.length;A++){var h=u[A];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(l,h.key,h)}}var s=function(){function l(h,f,p){(function(d,m){if(!(d instanceof m))throw new TypeError("Cannot call a class as a function")})(this,l),this.column=h,this.row=f,this.zoom=p}var u,A;return u=l,(A=[{key:"clone",value:function(){return new l(this.column,this.row,this.zoom)}},{key:"zoomTo",value:function(h){return this.clone()._zoomTo(h)}},{key:"sub",value:function(h){return this.clone()._sub(h)}},{key:"_zoomTo",value:function(h){var f=Math.pow(2,h-this.zoom);return this.column*=f,this.row*=f,this.zoom=h,this}},{key:"_sub",value:function(h){return h=h.zoomTo(this.zoom),this.column-=h.column,this.row-=h.row,this}}])&&a(u.prototype,A),Object.defineProperty(u,"prototype",{writable:!1}),l}();r.exports=s},9069:function(r,a,s){function l(f){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},l(f)}function u(f,p){for(var d=0;d<p.length;d++){var m=p[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}var A=s(8316).wrap,h=function(){function f(v,y){if(function(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")}(this,f),isNaN(v)||isNaN(y))throw new Error("Invalid LngLat object: (".concat(v,", ").concat(y,")"));if(this.lng=+v,this.lat=+y,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}var p,d,m;return p=f,m=[{key:"convert",value:function(v){if(v instanceof f)return v;if(Array.isArray(v)&&(v.length===2||v.length===3))return new f(Number(v[0]),Number(v[1]));if(!Array.isArray(v)&&l(v)==="object"&&v!==null)return new f(Number(v.lng),Number(v.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}],(d=[{key:"wrap",value:function(){return new f(A(this.lng,-180,180),this.lat)}},{key:"toArray",value:function(){return[this.lng,this.lat]}},{key:"toString",value:function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}},{key:"toBounds",value:function(v){var y=360*v/40075017,g=y/Math.cos(Math.PI/180*this.lat);return new(s(4899))(new f(this.lng-g,this.lat-y),new f(this.lng+g,this.lat+y))}}])&&u(p.prototype,d),m&&u(p,m),Object.defineProperty(p,"prototype",{writable:!1}),f}();r.exports=h},4899:function(r,a,s){function l(h,f){for(var p=0;p<f.length;p++){var d=f[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(h,d.key,d)}}var u=s(9069),A=function(){function h(m,v){(function(y,g){if(!(y instanceof g))throw new TypeError("Cannot call a class as a function")})(this,h),m&&(v?this.setSouthWest(m).setNorthEast(v):m.length===4?this.setSouthWest([m[0],m[1]]).setNorthEast([m[2],m[3]]):this.setSouthWest(m[0]).setNorthEast(m[1]))}var f,p,d;return f=h,d=[{key:"convert",value:function(m){return!m||m instanceof h?m:new h(m)}}],(p=[{key:"setNorthEast",value:function(m){return this._ne=m instanceof u?new u(m.lng,m.lat):u.convert(m),this}},{key:"setSouthWest",value:function(m){return this._sw=m instanceof u?new u(m.lng,m.lat):u.convert(m),this}},{key:"extend",value:function(m){var v,y,g=this._sw,_=this._ne;if(m instanceof u)v=m,y=m;else{if(!(m instanceof h))return Array.isArray(m)?m.every(Array.isArray)?this.extend(h.convert(m)):this.extend(u.convert(m)):this;if(v=m._sw,y=m._ne,!v||!y)return this}return g||_?(g.lng=Math.min(v.lng,g.lng),g.lat=Math.min(v.lat,g.lat),_.lng=Math.max(y.lng,_.lng),_.lat=Math.max(y.lat,_.lat)):(this._sw=new u(v.lng,v.lat),this._ne=new u(y.lng,y.lat)),this}},{key:"getCenter",value:function(){return new u((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}},{key:"getSouthWest",value:function(){return this._sw}},{key:"getNorthEast",value:function(){return this._ne}},{key:"getNorthWest",value:function(){return new u(this.getWest(),this.getNorth())}},{key:"getSouthEast",value:function(){return new u(this.getEast(),this.getSouth())}},{key:"getWest",value:function(){return this._sw.lng}},{key:"getSouth",value:function(){return this._sw.lat}},{key:"getEast",value:function(){return this._ne.lng}},{key:"getNorth",value:function(){return this._ne.lat}},{key:"toArray",value:function(){return[this._sw.toArray(),this._ne.toArray()]}},{key:"toString",value:function(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}},{key:"isEmpty",value:function(){return!(this._sw&&this._ne)}}])&&l(f.prototype,p),d&&l(f,d),Object.defineProperty(f,"prototype",{writable:!1}),h}();r.exports=A},7773:function(r,a,s){function l(P,I){for(var D=0;D<I.length;D++){var F=I[D];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(P,F.key,F)}}var u=s(9069),A=s(5550),h=s(3892),f=s(8316),p=s(2643).number,d=s(1803),m=s(4792),v=(m.CanonicalTileID,m.UnwrappedTileID),y=s(900),g=s(3226),_=g.vec4,x=g.mat4,E=g.mat2,B=function(){function P(F,S,T){(function(w,C){if(!(w instanceof C))throw new TypeError("Cannot call a class as a function")})(this,P),this.tileSize=512,this._renderWorldCopies=T===void 0||T,this._minZoom=F||0,this._maxZoom=S||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new u(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={}}var I,D;return I=P,(D=[{key:"clone",value:function(){var F=new P(this._minZoom,this._maxZoom,this._renderWorldCopies);return F.tileSize=this.tileSize,F.latRange=this.latRange,F.width=this.width,F.height=this.height,F._center=this._center,F.zoom=this.zoom,F.angle=this.angle,F._fov=this._fov,F._pitch=this._pitch,F._unmodified=this._unmodified,F._calcMatrices(),F}},{key:"minZoom",get:function(){return this._minZoom},set:function(F){this._minZoom!==F&&(this._minZoom=F,this.zoom=Math.max(this.zoom,F))}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(F){this._maxZoom!==F&&(this._maxZoom=F,this.zoom=Math.min(this.zoom,F))}},{key:"renderWorldCopies",get:function(){return this._renderWorldCopies}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"centerPoint",get:function(){return this.size._div(2)}},{key:"size",get:function(){return new A(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(F){var S=-f.wrap(F,-180,180)*Math.PI/180;this.angle!==S&&(this._unmodified=!1,this.angle=S,this._calcMatrices(),this.rotationMatrix=E.create(),E.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}},{key:"pitch",get:function(){return this._pitch/Math.PI*180},set:function(F){var S=f.clamp(F,0,60)/180*Math.PI;this._pitch!==S&&(this._unmodified=!1,this._pitch=S,this._calcMatrices())}},{key:"fov",get:function(){return this._fov/Math.PI*180},set:function(F){F=Math.max(.01,Math.min(60,F)),this._fov!==F&&(this._unmodified=!1,this._fov=F/180*Math.PI,this._calcMatrices())}},{key:"zoom",get:function(){return this._zoom},set:function(F){var S=Math.min(Math.max(F,this.minZoom),this.maxZoom);this._zoom!==S&&(this._unmodified=!1,this._zoom=S,this.scale=this.zoomScale(S),this.tileZoom=Math.floor(S),this.zoomFraction=S-this.tileZoom,this._constrain(),this._calcMatrices())}},{key:"center",get:function(){return this._center},set:function(F){F.lat===this._center.lat&&F.lng===this._center.lng||(this._unmodified=!1,this._center=F,this._constrain(),this._calcMatrices())}},{key:"coveringZoomLevel",value:function(F){return(F.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/F.tileSize))}},{key:"getVisibleUnwrappedCoordinates",value:function(F){var S=this.pointCoordinate(new A(0,0),0),T=this.pointCoordinate(new A(this.width,0),0),w=Math.floor(S.column),C=Math.floor(T.column),M=[new v(0,F)];if(this._renderWorldCopies)for(var R=w;R<=C;R++)R!==0&&M.push(new v(R,F));return M}},{key:"coveringTiles",value:function(F){var S=this.coveringZoomLevel(F),T=S;if(F.minzoom!==void 0&&S<F.minzoom)return[];F.maxzoom!==void 0&&S>F.maxzoom&&(S=F.maxzoom);var w=this.pointCoordinate(this.centerPoint,S),C=new A(w.column-.5,w.row-.5),M=[this.pointCoordinate(new A(0,0),S),this.pointCoordinate(new A(this.width,0),S),this.pointCoordinate(new A(this.width,this.height),S),this.pointCoordinate(new A(0,this.height),S)];return d(S,M,F.reparseOverscaled?T:S,this._renderWorldCopies).sort(function(R,U){return C.dist(R.canonical)-C.dist(U.canonical)})}},{key:"resize",value:function(F,S){this.width=F,this.height=S,this.pixelsToGLUnits=[2/F,-2/S],this._constrain(),this._calcMatrices()}},{key:"unmodified",get:function(){return this._unmodified}},{key:"zoomScale",value:function(F){return Math.pow(2,F)}},{key:"scaleZoom",value:function(F){return Math.log(F)/Math.LN2}},{key:"project",value:function(F){return new A(this.lngX(F.lng),this.latY(F.lat))}},{key:"unproject",value:function(F){return new u(this.xLng(F.x),this.yLat(F.y))}},{key:"x",get:function(){return this.lngX(this.center.lng)}},{key:"y",get:function(){return this.latY(this.center.lat)}},{key:"point",get:function(){return new A(this.x,this.y)}},{key:"lngX",value:function(F){return(180+F)*this.worldSize/360}},{key:"latY",value:function(F){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+F*Math.PI/360)))*this.worldSize/360}},{key:"xLng",value:function(F){return 360*F/this.worldSize-180}},{key:"yLat",value:function(F){var S=180-360*F/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(S*Math.PI/180))-90}},{key:"setLocationAtPoint",value:function(F,S){var T=this.pointCoordinate(S)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(F)._sub(T)),this._renderWorldCopies&&(this.center=this.center.wrap())}},{key:"locationPoint",value:function(F){return this.coordinatePoint(this.locationCoordinate(F))}},{key:"pointLocation",value:function(F){return this.coordinateLocation(this.pointCoordinate(F))}},{key:"locationCoordinate",value:function(F){return new h(this.lngX(F.lng)/this.tileSize,this.latY(F.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)}},{key:"coordinateLocation",value:function(F){var S=F.zoomTo(this.zoom);return new u(this.xLng(S.column*this.tileSize),this.yLat(S.row*this.tileSize))}},{key:"pointCoordinate",value:function(F,S){S===void 0&&(S=this.tileZoom);var T=[F.x,F.y,0,1],w=[F.x,F.y,1,1];_.transformMat4(T,T,this.pixelMatrixInverse),_.transformMat4(w,w,this.pixelMatrixInverse);var C=T[3],M=w[3],R=T[1]/C,U=w[1]/M,O=T[2]/C,z=w[2]/M,k=O===z?0:(0-O)/(z-O);return new h(p(T[0]/C,w[0]/M,k)/this.tileSize,p(R,U,k)/this.tileSize,this.zoom)._zoomTo(S)}},{key:"coordinatePoint",value:function(F){var S=F.zoomTo(this.zoom),T=[S.column*this.tileSize,S.row*this.tileSize,0,1];return _.transformMat4(T,T,this.pixelMatrix),new A(T[0]/T[3],T[1]/T[3])}},{key:"calculatePosMatrix",value:function(F){var S=F.key;if(this._posMatrixCache[S])return this._posMatrixCache[S];var T=F.canonical,w=this.worldSize/this.zoomScale(T.z),C=T.x+Math.pow(2,T.z)*F.wrap,M=x.identity(new Float64Array(16));return x.translate(M,M,[C*w,T.y*w,0]),x.scale(M,M,[w/y,w/y,1]),x.multiply(M,this.projMatrix,M),this._posMatrixCache[S]=new Float32Array(M),this._posMatrixCache[S]}},{key:"_constrain",value:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var F,S,T,w,C=-90,M=90,R=-180,U=180,O=this.size,z=this._unmodified;if(this.latRange){var k=this.latRange;C=this.latY(k[1]),F=(M=this.latY(k[0]))-C<O.y?O.y/(M-C):0}if(this.lngRange){var Q=this.lngRange;R=this.lngX(Q[0]),S=(U=this.lngX(Q[1]))-R<O.x?O.x/(U-R):0}var V=Math.max(S||0,F||0);if(V)return this.center=this.unproject(new A(S?(U+R)/2:this.x,F?(M+C)/2:this.y)),this.zoom+=this.scaleZoom(V),this._unmodified=z,void(this._constraining=!1);if(this.latRange){var j=this.y,J=O.y/2;j-J<C&&(w=C+J),j+J>M&&(w=M-J)}if(this.lngRange){var ee=this.x,ie=O.x/2;ee-ie<R&&(T=R+ie),ee+ie>U&&(T=U-ie)}T===void 0&&w===void 0||(this.center=this.unproject(new A(T!==void 0?T:this.x,w!==void 0?w:this.y))),this._unmodified=z,this._constraining=!1}}},{key:"_calcMatrices",value:function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var F=this._fov/2,S=Math.PI/2+this._pitch,T=Math.sin(F)*this.cameraToCenterDistance/Math.sin(Math.PI-S-F),w=1.01*(Math.cos(Math.PI/2-this._pitch)*T+this.cameraToCenterDistance),C=new Float64Array(16);x.perspective(C,this._fov,this.width/this.height,1,w),x.scale(C,C,[1,-1,1]),x.translate(C,C,[0,0,-this.cameraToCenterDistance]),x.rotateX(C,C,this._pitch),x.rotateZ(C,C,this.angle),x.translate(C,C,[-this.x,-this.y,0]);var M=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(x.scale(C,C,[1,1,M,1]),this.projMatrix=C,C=x.create(),x.scale(C,C,[this.width/2,-this.height/2,1]),x.translate(C,C,[1,-1,0]),this.pixelMatrix=x.multiply(new Float64Array(16),C,this.projMatrix),!(C=x.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=C,this._posMatrixCache={}}}}])&&l(I.prototype,D),Object.defineProperty(I,"prototype",{writable:!1}),P}();r.exports=B},129:function(r,a,s){function l(h,f,p){return Object.defineProperty(h,"prototype",{writable:!1}),h}var u=s(6016),A=l(function h(f,p,d){(function(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")})(this,h),this.blendFunction=f,this.blendColor=p,this.mask=d});A.Replace=[1,0],A.disabled=new A(A.Replace,u.transparent,[!1,!1,!1,!1]),A.unblended=new A(A.Replace,u.transparent,[!0,!0,!0,!0]),A.alphaBlended=new A([1,771],u.transparent,[!0,!0,!0,!0]),r.exports=A},206:function(r,a,s){function l(oe,le){for(var ue=0;ue<le.length;ue++){var re=le[ue];re.enumerable=re.enumerable||!1,re.configurable=!0,"value"in re&&(re.writable=!0),Object.defineProperty(oe,re.key,re)}}var u=s(7612),A=s(3292),h=s(5197),f=(s(6937),s(2749),s(129)),p=s(8316),d=s(2578),m=d.ClearColor,v=d.ClearDepth,y=d.ClearStencil,g=d.ColorMask,_=d.DepthMask,x=d.StencilMask,E=d.StencilFunc,B=d.StencilOp,P=d.StencilTest,I=d.DepthRange,D=d.DepthTest,F=d.DepthFunc,S=d.Blend,T=d.BlendFunc,w=d.BlendColor,C=d.Program,M=d.LineWidth,R=d.ActiveTextureUnit,U=d.Viewport,O=d.BindFramebuffer,z=d.BindRenderbuffer,k=d.BindTexture,Q=d.BindVertexBuffer,V=d.BindElementBuffer,j=d.BindVertexArrayOES,J=d.PixelStoreUnpack,ee=d.PixelStoreUnpackPremultiplyAlpha,ie=function(){function oe(re){(function(ce,$){if(!(ce instanceof $))throw new TypeError("Cannot call a class as a function")})(this,oe),this.gl=re,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.lineWidthRange=re.getParameter(re.ALIASED_LINE_WIDTH_RANGE),this.clearColor=new m(this),this.clearDepth=new v(this),this.clearStencil=new y(this),this.colorMask=new g(this),this.depthMask=new _(this),this.stencilMask=new x(this),this.stencilFunc=new E(this),this.stencilOp=new B(this),this.stencilTest=new P(this),this.depthRange=new I(this),this.depthTest=new D(this),this.depthFunc=new F(this),this.blend=new S(this),this.blendFunc=new T(this),this.blendColor=new w(this),this.program=new C(this),this.lineWidth=new M(this),this.activeTexture=new R(this),this.viewport=new U(this),this.bindFramebuffer=new O(this),this.bindRenderbuffer=new z(this),this.bindTexture=new k(this),this.bindVertexBuffer=new Q(this),this.bindElementBuffer=new V(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new j(this),this.pixelStoreUnpack=new J(this),this.pixelStoreUnpackPremultiplyAlpha=new ee(this),this.extTextureFilterAnisotropic=re.getExtension("EXT_texture_filter_anisotropic")||re.getExtension("MOZ_EXT_texture_filter_anisotropic")||re.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=re.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=re.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&re.getExtension("OES_texture_half_float_linear")}var le,ue;return le=oe,(ue=[{key:"createIndexBuffer",value:function(re,ce){return new u(this,re,ce)}},{key:"createVertexBuffer",value:function(re,ce,$){return new A(this,re,ce,$)}},{key:"createRenderbuffer",value:function(re,ce,$){var q=this.gl,G=q.createRenderbuffer();return this.bindRenderbuffer.set(G),q.renderbufferStorage(q.RENDERBUFFER,re,ce,$),this.bindRenderbuffer.set(null),G}},{key:"createFramebuffer",value:function(re,ce){return new h(this,re,ce)}},{key:"clear",value:function(re){var ce=re.color,$=re.depth,q=this.gl,G=0;ce&&(G|=q.COLOR_BUFFER_BIT,this.clearColor.set(ce),this.colorMask.set([!0,!0,!0,!0])),$!==void 0&&(G|=q.DEPTH_BUFFER_BIT,this.clearDepth.set($),this.depthMask.set(!0)),q.clear(G)}},{key:"setDepthMode",value:function(re){re.func!==this.gl.ALWAYS||re.mask?(this.depthTest.set(!0),this.depthFunc.set(re.func),this.depthMask.set(re.mask),this.depthRange.set(re.range)):this.depthTest.set(!1)}},{key:"setStencilMode",value:function(re){re.func!==this.gl.ALWAYS||re.mask?(this.stencilTest.set(!0),this.stencilMask.set(re.mask),this.stencilOp.set([re.fail,re.depthFail,re.pass]),this.stencilFunc.set({func:re.test.func,ref:re.ref,mask:re.test.mask})):this.stencilTest.set(!1)}},{key:"setColorMode",value:function(re){p.deepEqual(re.blendFunction,f.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(re.blendFunction),this.blendColor.set(re.blendColor)),this.colorMask.set(re.mask)}}])&&l(le.prototype,ue),Object.defineProperty(le,"prototype",{writable:!1}),oe}();r.exports=ie},6937:function(r){function a(l,u,A){return Object.defineProperty(l,"prototype",{writable:!1}),l}var s=a(function l(u,A,h){(function(f,p){if(!(f instanceof p))throw new TypeError("Cannot call a class as a function")})(this,l),this.func=u,this.mask=A,this.range=h});s.ReadOnly=!1,s.ReadWrite=!0,s.disabled=new s(519,s.ReadOnly,[0,1]),r.exports=s},5197:function(r,a,s){function l(p,d){for(var m=0;m<d.length;m++){var v=d[m];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(p,v.key,v)}}var u=s(2578),A=u.ColorAttachment,h=u.DepthAttachment,f=function(){function p(v,y,g){(function(E,B){if(!(E instanceof B))throw new TypeError("Cannot call a class as a function")})(this,p),this.context=v,this.width=y,this.height=g;var _=v.gl,x=this.framebuffer=_.createFramebuffer();this.colorAttachment=new A(v,x),this.depthAttachment=new h(v,x)}var d,m;return d=p,(m=[{key:"destroy",value:function(){var v=this.context.gl,y=this.colorAttachment.get();y&&v.deleteTexture(y);var g=this.depthAttachment.get();g&&v.deleteRenderbuffer(g),v.deleteFramebuffer(this.framebuffer)}}])&&l(d.prototype,m),Object.defineProperty(d,"prototype",{writable:!1}),p}();r.exports=f},7612:function(r,a,s){function l(h,f){for(var p=0;p<f.length;p++){var d=f[p];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(h,d.key,d)}}var u=s(8583),A=function(){function h(d,m,v){(function(g,_){if(!(g instanceof _))throw new TypeError("Cannot call a class as a function")})(this,h),this.context=d;var y=d.gl;this.buffer=y.createBuffer(),this.dynamicDraw=!!v,this.unbindVAO(),d.bindElementBuffer.set(this.buffer),y.bufferData(y.ELEMENT_ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer}var f,p;return f=h,(p=[{key:"unbindVAO",value:function(){this.context.extVertexArrayObject&&this.context.bindVertexArrayOES.set(null)}},{key:"bind",value:function(){this.context.bindElementBuffer.set(this.buffer)}},{key:"updateData",value:function(d){var m=this.context.gl;u(this.dynamicDraw),this.unbindVAO(),this.bind(),m.bufferSubData(m.ELEMENT_ARRAY_BUFFER,0,d.arrayBuffer)}},{key:"destroy",value:function(){var d=this.context.gl;this.buffer&&(d.deleteBuffer(this.buffer),delete this.buffer)}}])&&l(f.prototype,p),Object.defineProperty(f,"prototype",{writable:!1}),h}();r.exports=A},2749:function(r){function a(u,A,h){return Object.defineProperty(u,"prototype",{writable:!1}),u}var s=7680,l=a(function u(A,h,f,p,d,m){(function(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")})(this,u),this.test=A,this.ref=h,this.mask=f,this.fail=p,this.depthFail=d,this.pass=m});l.disabled=new l({func:519,mask:0},0,0,s,s,s),r.exports=l},2578:function(r,a,s){function l(q){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},l(q)}function u(q,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(G&&G.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),Object.defineProperty(q,"prototype",{writable:!1}),G&&A(q,G)}function A(q,G){return A=Object.setPrototypeOf||function(Z,K){return Z.__proto__=K,Z},A(q,G)}function h(q){var G=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var Z,K=p(q);if(G){var W=p(this).constructor;Z=Reflect.construct(K,arguments,W)}else Z=K.apply(this,arguments);return f(this,Z)}}function f(q,G){if(G&&(l(G)==="object"||typeof G=="function"))return G;if(G!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(Z){if(Z===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Z}(q)}function p(q){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(G){return G.__proto__||Object.getPrototypeOf(G)},p(q)}function d(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function m(q,G){for(var Z=0;Z<G.length;Z++){var K=G[Z];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(q,K.key,K)}}function v(q,G,Z){return G&&m(q.prototype,G),Object.defineProperty(q,"prototype",{writable:!1}),q}var y=s(6016),g=s(8316),_=function(){function q(G){d(this,q),this.context=G,this.current=y.transparent}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G.r===Z.r&&G.g===Z.g&&G.b===Z.b&&G.a===Z.a||(this.context.gl.clearColor(G.r,G.g,G.b,G.a),this.current=G)}}]),q}(),x=function(){function q(G){d(this,q),this.context=G,this.current=1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.clearDepth(G),this.current=G)}}]),q}(),E=function(){function q(G){d(this,q),this.context=G,this.current=0}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.clearStencil(G),this.current=G)}}]),q}(),B=function(){function q(G){d(this,q),this.context=G,this.current=[!0,!0,!0,!0]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]&&G[2]===Z[2]&&G[3]===Z[3]||(this.context.gl.colorMask(G[0],G[1],G[2],G[3]),this.current=G)}}]),q}(),P=function(){function q(G){d(this,q),this.context=G,this.current=!0}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.depthMask(G),this.current=G)}}]),q}(),I=function(){function q(G){d(this,q),this.context=G,this.current=255}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.stencilMask(G),this.current=G)}}]),q}(),D=function(){function q(G){d(this,q),this.context=G,this.current={func:G.gl.ALWAYS,ref:0,mask:255}}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G.func===Z.func&&G.ref===Z.ref&&G.mask===Z.mask||(this.context.gl.stencilFunc(G.func,G.ref,G.mask),this.current=G)}}]),q}(),F=function(){function q(G){d(this,q),this.context=G;var Z=this.context.gl;this.current=[Z.KEEP,Z.KEEP,Z.KEEP]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]&&G[2]===Z[2]||(this.context.gl.stencilOp(G[0],G[1],G[2]),this.current=G)}}]),q}(),S=function(){function q(G){d(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;G?Z.enable(Z.STENCIL_TEST):Z.disable(Z.STENCIL_TEST),this.current=G}}}]),q}(),T=function(){function q(G){d(this,q),this.context=G,this.current=[0,1]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]||(this.context.gl.depthRange(G[0],G[1]),this.current=G)}}]),q}(),w=function(){function q(G){d(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;G?Z.enable(Z.DEPTH_TEST):Z.disable(Z.DEPTH_TEST),this.current=G}}}]),q}(),C=function(){function q(G){d(this,q),this.context=G,this.current=G.gl.LESS}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.depthFunc(G),this.current=G)}}]),q}(),M=function(){function q(G){d(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;G?Z.enable(Z.BLEND):Z.disable(Z.BLEND),this.current=G}}}]),q}(),R=function(){function q(G){d(this,q),this.context=G;var Z=this.context.gl;this.current=[Z.ONE,Z.ZERO]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]||(this.context.gl.blendFunc(G[0],G[1]),this.current=G)}}]),q}(),U=function(){function q(G){d(this,q),this.context=G,this.current=y.transparent}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G.r===Z.r&&G.g===Z.g&&G.b===Z.b&&G.a===Z.a||(this.context.gl.blendColor(G.r,G.g,G.b,G.a),this.current=G)}}]),q}(),O=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.useProgram(G),this.current=G)}}]),q}(),z=function(){function q(G){d(this,q),this.context=G,this.current=1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.context.lineWidthRange,K=g.clamp(G,Z[0],Z[1]);this.current!==K&&(this.context.gl.lineWidth(K),this.current=G)}}]),q}(),k=function(){function q(G){d(this,q),this.context=G,this.current=G.gl.TEXTURE0}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.activeTexture(G),this.current=G)}}]),q}(),Q=function(){function q(G){d(this,q),this.context=G;var Z=this.context.gl;this.current=[0,0,Z.drawingBufferWidth,Z.drawingBufferHeight]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]&&G[2]===Z[2]&&G[3]===Z[3]||(this.context.gl.viewport(G[0],G[1],G[2],G[3]),this.current=G)}}]),q}(),V=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindFramebuffer(Z.FRAMEBUFFER,G),this.current=G}}}]),q}(),j=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindRenderbuffer(Z.RENDERBUFFER,G),this.current=G}}}]),q}(),J=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindTexture(Z.TEXTURE_2D,G),this.current=G}}}]),q}(),ee=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindBuffer(Z.ARRAY_BUFFER,G),this.current=G}}}]),q}(),ie=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.context.gl;Z.bindBuffer(Z.ELEMENT_ARRAY_BUFFER,G),this.current=G}}]),q}(),oe=function(){function q(G){d(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&this.context.extVertexArrayObject&&(this.context.extVertexArrayObject.bindVertexArrayOES(G),this.current=G)}}]),q}(),le=function(){function q(G){d(this,q),this.context=G,this.current=4}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.pixelStorei(Z.UNPACK_ALIGNMENT,G),this.current=G}}}]),q}(),ue=function(){function q(G){d(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G),this.current=G}}}]),q}(),re=function(){function q(G,Z){d(this,q),this.context=G,this.current=null,this.parent=Z}return v(q,[{key:"get",value:function(){return this.current}}]),q}(),ce=function(q){u(Z,q);var G=h(Z);function Z(K,W){var H;return d(this,Z),(H=G.call(this,K,W)).dirty=!1,H}return v(Z,[{key:"set",value:function(K){if(this.dirty||this.current!==K){var W=this.context.gl;this.context.bindFramebuffer.set(this.parent),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_2D,K,0),this.current=K,this.dirty=!1}}},{key:"setDirty",value:function(){this.dirty=!0}}]),Z}(re),$=function(q){u(Z,q);var G=h(Z);function Z(){return d(this,Z),G.apply(this,arguments)}return v(Z,[{key:"set",value:function(K){if(this.current!==K){var W=this.context.gl;this.context.bindFramebuffer.set(this.parent),W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_ATTACHMENT,W.RENDERBUFFER,K),this.current=K}}}]),Z}(re);r.exports={ClearColor:_,ClearDepth:x,ClearStencil:E,ColorMask:B,DepthMask:P,StencilMask:I,StencilFunc:D,StencilOp:F,StencilTest:S,DepthRange:T,DepthTest:w,DepthFunc:C,Blend:M,BlendFunc:R,BlendColor:U,Program:O,LineWidth:z,ActiveTextureUnit:k,Viewport:Q,BindFramebuffer:V,BindRenderbuffer:j,BindTexture:J,BindVertexBuffer:ee,BindElementBuffer:ie,BindVertexArrayOES:oe,PixelStoreUnpack:le,PixelStoreUnpackPremultiplyAlpha:ue,ColorAttachment:ce,DepthAttachment:$}},3292:function(r,a,s){function l(f,p){for(var d=0;d<p.length;d++){var m=p[d];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(f,m.key,m)}}var u=s(8583),A={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},h=function(){function f(m,v,y,g){(function(x,E){if(!(x instanceof E))throw new TypeError("Cannot call a class as a function")})(this,f),this.length=v.length,this.attributes=y,this.itemSize=v.bytesPerElement,this.dynamicDraw=g,this.context=m;var _=m.gl;this.buffer=_.createBuffer(),m.bindVertexBuffer.set(this.buffer),_.bufferData(_.ARRAY_BUFFER,v.arrayBuffer,this.dynamicDraw?_.DYNAMIC_DRAW:_.STATIC_DRAW),this.dynamicDraw||delete v.arrayBuffer}var p,d;return p=f,(d=[{key:"bind",value:function(){this.context.bindVertexBuffer.set(this.buffer)}},{key:"updateData",value:function(m){u(m.length===this.length);var v=this.context.gl;this.bind(),v.bufferSubData(v.ARRAY_BUFFER,0,m.arrayBuffer)}},{key:"enableAttributes",value:function(m,v){for(var y=0;y<this.attributes.length;y++){var g=this.attributes[y],_=v.attributes[g.name];_!==void 0&&m.enableVertexAttribArray(_)}}},{key:"setVertexAttribPointers",value:function(m,v,y){for(var g=0;g<this.attributes.length;g++){var _=this.attributes[g],x=v.attributes[_.name];x!==void 0&&m.vertexAttribPointer(x,_.components,m[A[_.type]],!1,this.itemSize,_.offset+this.itemSize*(y||0))}}},{key:"destroy",value:function(){var m=this.context.gl;this.buffer&&(m.deleteBuffer(this.buffer),delete this.buffer)}}])&&l(p.prototype,d),Object.defineProperty(p,"prototype",{writable:!1}),f}();r.exports=h},5579:function(r,a,s){var l=s(2235),u=s(3103),A=s(4147).i8,h=s(2062),f=s(3340),p=s(3600),d=s(5060),m=s(7316),v=s(8841),y=s(3316),g=s(650),_=s(56),x=s(9069),E=s(4899),B=s(5550),P=s(1495),I=s(6752),D=s(4781),F=s(1282);r.exports={version:A,supported:l,workerCount:Math.max(Math.floor(u.hardwareConcurrency/2),1),setRTLTextPlugin:D.setRTLTextPlugin,Map:h,NavigationControl:f,GeolocateControl:p,AttributionControl:d,ScaleControl:m,FullscreenControl:v,Popup:y,Marker:g,Style:_,LngLat:x,LngLatBounds:E,Point:B,Evented:P,config:I,BasicRenderer:F,get accessToken(){return I.ACCESS_TOKEN},set accessToken(S){I.ACCESS_TOKEN=S}}},5155:function(r,a,s){function l(f,p){(p==null||p>f.length)&&(p=f.length);for(var d=0,m=new Array(p);d<p;d++)m[d]=f[d];return m}var u=s(7650),A=s(2749),h=s(6937);r.exports=function(f,p,d){var m=d.paint.get("background-color"),v=d.paint.get("background-opacity");if(v!==0){var y,g=f.context,_=g.gl,x=f.transform,E=x.tileSize,B=d.paint.get("background-pattern"),P=B||m.a!==1||v!==1?"translucent":"opaque";if(f.renderPass===P){if(g.setStencilMode(A.disabled),g.setDepthMode(f.depthModeForSublayer(0,P==="opaque"?h.ReadWrite:h.ReadOnly)),g.setColorMode(f.colorModeForRenderPass()),B){if(u.isPatternMissing(B,f))return;y=f.useProgram("backgroundPattern"),u.prepare(B,f,y),f.tileExtentPatternVAO.bind(g,y,f.tileExtentBuffer,[])}else y=f.useProgram("background"),_.uniform4fv(y.uniforms.u_color,[m.r,m.g,m.b,m.a]),f.tileExtentVAO.bind(g,y,f.tileExtentBuffer,[]);_.uniform1f(y.uniforms.u_opacity,v);var I,D=function(S,T){var w=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!w){if(Array.isArray(S)||(w=function(z,k){if(z){if(typeof z=="string")return l(z,k);var Q=Object.prototype.toString.call(z).slice(8,-1);return Q==="Object"&&z.constructor&&(Q=z.constructor.name),Q==="Map"||Q==="Set"?Array.from(z):Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q)?l(z,k):void 0}}(S))||T){w&&(S=w);var C=0,M=function(){};return{s:M,n:function(){return C>=S.length?{done:!0}:{done:!1,value:S[C++]}},e:function(z){throw z},f:M}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
@@ -2591,7 +2591,7 @@ ${Rx}
|
|
|
2591
2591
|
// out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, (a + .1)*4.);
|
|
2592
2592
|
out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, a);
|
|
2593
2593
|
}
|
|
2594
|
-
`,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let s=this.disposeVar(c.react(void 0));{const l=this.disposeVar(c.createProcessingFromAsyncFunc(async A=>{s.value=void 0;const h=e.url??c.ESDataMesh.defaults.url;if(!h)return;await A.promise(c.sleep(200));const f=(e.maxTime??23)|0;s.value=await A.promise(rO(c.ESSceneObject.context.getStrFromEnv(typeof h=="string"?h:h.url),f+1))}));l.start();const u=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>l.restart()))}{class l{constructor(h){this._buffer=h}[Symbol.iterator](){return oO(this._buffer)}}const u=()=>{if(!s.value)return;const{vertexBuffer:A,propBuffers:h,indexBuffer:f}=s.value,{minPos:p,maxPos:d}=c.getMinMaxCorner(new l(A));r.setLocalAxisedBoundingBox(p,d);const m=(e.maxTime??23)|0;let v=(e.currentTime??c.ESDataMesh.defaults.currentTime)/m;v=v<0?0:v>1?1:v;const y=v*m;let g=v*m|0,_=y-g;if(g>=m&&(g=m-1,_=1),!Number.isFinite(_)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=f,!h[g]||!h[g+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:A,componentsPerAttribute:3},a_prop:{typedArray:h[g],componentsPerAttribute:3},a_prop2:{typedArray:h[g+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${a.id}`},u_stripMinMaxValue:[e.minPropValue??c.ESDataMesh.defaults.minPropValue,e.maxPropValue??c.ESDataMesh.defaults.maxPropValue],u_ratio:_}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(s.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a,!0),!0):!1}};L(qu,"type",qu.register("ESCesiumViewer",c.ESDataMesh.type,qu));let ig=qu;const us=class us extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_heading",this.disposeVar(c.react(0)));L(this,"_textFunc",this.disposeVar(c.react(void 0)));const o=this;{const s=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=c.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=c.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=c.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?c.clampN180_180(u):c.clamp0_360(u)}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(s))}const r=this.disposeVar(new Ye(e,i));r.loop=!1,this.dispose(c.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(c.bind([r,"arcType"],[o,"arcType"])),this.dispose(c.bind([r,"color"],[o,"color"])),this.dispose(c.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(c.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(c.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(c.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(c.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(c.bind([r,"positions"],[o,"positions"])),this.dispose(c.bind([r,"show"],[o,"show"])),this.dispose(c.bind([r,"width"],[o,"width"])),this.dispose(c.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(c.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(s=>{e.actived&&r.flyTo(s)}));const a=this.disposeVar(new bt(e,i));this.dispose(c.bind([a,"shadowDom"],[o,"shadowDom"])),this.dispose(c.bind([a,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(c.bind([a,"show"],[o,"show"]));{const s=()=>{o.positions&&o.positions.length>=2?a.position=o.positions[1]:a.position=void 0};s(),this.dispose(o.positionsChanged.disposableOn(s))}{const s=()=>{const{heading:u}=o,A=(o.textFunc??us.defaultTextFunc_度格式)(u);a.innerHTML=_o(`方向: ${A}`,24)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(s))}this.ad(a.pickedEvent.don(s=>{Gi(s)===0&&this.pickedEvent.emit(s)}))}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(us,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(us,"defaultTextFunc_度分格式",e=>`${rl(e,!0)}`),L(us,"defaultTextFunc_度分秒格式",e=>`${rl(e,!1)}`),L(us,"defaults",{positions:[]});let qo=us;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:8,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(qo||(qo={})),c.extendClassProps(qo.prototype,qo.createDefaultProps);const Ku=class Ku extends sn{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new qo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):u==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Ku,"type",Ku.register("ESCesiumViewer",c.ESDirectionMeasurement.type,Ku));let rg=Ku;class fa extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distances",this.disposeVar(c.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await R0(e.viewer,this.positions??[]):this._distances.value=c.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const a=this.disposeVar(new Ye(e,i));a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"positions"],[this,"positions"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"])),this.dispose(c.bind([a,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&a.flyTo(s)}));{const s=[],l=()=>{for(let A of s)A.destroy();s.length=0};this.dispose(l);const u=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const h=Dd("起点",this.positions[0],e,i);h.dispose(c.track([h,"show"],[this,"show"])),h.dispose(c.track([h,"shadowDom"],[this,"shadowDom"])),h.dispose(c.track([h,"cssAllInitial"],[this,"cssAllInitial"])),s.push(h)}const A=this.distances.length;for(let h=0;h<A;++h){const f=this.distances[h],p=this.positions[h+1],d=Dd(`长度: ${Mh(f)}`,p,e,i);d.dispose(c.track([d,"show"],[this,"show"])),d.dispose(c.track([d,"shadowDom"],[this,"shadowDom"])),d.dispose(c.track([d,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(d.pickedEvent.don(m=>{Gi(m)===0&&this.pickedEvent.emit(m)})),s.push(d)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>c.inOrderRunning(u)))}}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(fa,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(fa||(fa={})),c.extendClassProps(fa.prototype,fa.createDefaultProps);const Zu=class Zu extends sn{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"ground"],[e,"strokeGround"]));{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Zu,"type",Zu.register("ESCesiumViewer",c.ESGeoLineString.type,Zu));let da=Zu;const $u=class $u extends da{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new fa(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L($u,"type",$u.register("ESCesiumViewer",c.ESDistanceMeasurement.type,$u));let og=$u;class pa extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.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:c.reactPositions(void 0),reverse:!1,edgeColor:c.reactArray([1,1,1,1]),edgeWidth:2})})(pa||(pa={})),c.extendClassProps(pa.prototype,pa.createDefaultProps);class sO extends c.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];c.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 aO extends c.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];c.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 Xu=class Xu extends Ln{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new pa(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new c.ESSceneObjectWithId);const o=this.ad(c.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const s=c.ESSceneObject.getSceneObject(e.targetID);o.value=s?(s.components.main??s).id:""})),this.dispose(c.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const a=this._czmPolygonClipping;a.showHelper=!1,this.dispose(c.bind([a,"positions"],[e,"points"])),this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.reverse=e.mode!=="in"};s(),this.dispose(e.modeChanged.disposableOn(s))}c.registerCreatedEventUpdate(this,e,()=>{const s=this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new c.ObjResettingWithEvent(s,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new aO(this):!l||!(l instanceof c.ES3DTileset)?void 0:new sO(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Xu,"type",Xu.register("ESCesiumViewer",c.ESExcavate.type,Xu));let sg=Xu;const Yu=class Yu extends He{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new wi(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 a=()=>{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)};a(),this.ad(e.scaleChanged.don(a))}this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"translation"],[e,"translation"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Gn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Yu,"type",Yu.register("ESCesiumViewer",c.ESFireParticleSystem.type,Yu));let ag=Yu;class ma extends c.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));L(this,"_ratio",this.disposeVar(c.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new c.ESPathImpl),this._geoPolyline=this.disposeVar(new Ye(e,i)),this._geoCanvasPointPoi=this.disposeVar(new Er(e,i)),this._player=this.disposeVar(new c.Player),this.dispose(c.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(c.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(c.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(c.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(c.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(c.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(c.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(c.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(c.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(c.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(c.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(c.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPath,"show"],[this,"show"])),this.dispose(c.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(c.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const a=this.granularity*Math.PI/180,s=bd(this.positions,this.arcType??"GEODESIC",a);if(s){this._geoPath.timePosRots=s.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(c.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(c.bind([this._player,"loop"],[this,"loop"])),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._player,"duration"],[this,"duration"])),this.dispose(c.bind([this._player,"playing"],[this,"playing"])),this.dispose(c.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:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.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"})})(ma||(ma={})),c.extendClassProps(ma.prototype,ma.createDefaultProps);class Kl extends c.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));this._geoPolylinePath=this.disposeVar(new ma(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(c.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(c.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(c.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(c.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(c.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(c.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(c.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(c.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(c.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(c.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(c.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(c.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(c.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const a=Rd(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=a}else this._geoPolylinePath.positions=void 0}catch(a){console.error(a),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(a=>{this._geoPolylinePath.flyTo(a)}))}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:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.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})})(Kl||(Kl={})),c.extendClassProps(Kl.prototype,Kl.createDefaultProps);const lO=[["256",256],["512",512],["1024",1024]],uO=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],In=class In extends c.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new c.Event));this.ad(c.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(c.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"accessToken"],"令牌",In.defaults.accessToken),new c.Number4Property([this,"rectangle"],"矩形范围",In.defaults.rectangle),new c.JsonProperty([this,"url"],"服务地址",In.defaults.url),new c.JsonProperty([this,"style"],"样式配置",In.defaults.style),new c.NumberProperty([this,"zIndex"],"层级序号",In.defaults.zIndex),new c.EnumProperty([this,"tileSize"],lO,"瓦片大小",256),new c.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",In.defaults.maximumLevel),new c.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",In.defaults.minimumLevel),new c.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",In.defaults.scheme)],more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EnumProperty([this,"splitDirection"],uO,"splitDirection","NONE"),new c.GroupProperty([],"czm","czm"),new c.NumberProperty([this,"czmAlpha"],"透明度"),new c.NumberProperty([this,"czmBrightness"],"亮度"),new c.NumberProperty([this,"czmContrast"],"对比度"),new c.NumberProperty([this,"czmHue"],"色相"),new c.NumberProperty([this,"czmSaturation"],"饱和度"),new c.NumberProperty([this,"czmGamma"],"伽马值")]}}};L(In,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),rectangle:c.reactJsonWithUndefined([-180,-90,180,90]),url:c.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:c.reactArrayWithUndefined([]),scheme:c.react("tms"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),L(In,"type",In.register("ESMVTLayer",In,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let mf=In;const cO=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},hO=async(t,n,e)=>(await fetch(`http://abc.gggis.com:13001/xyzinfo/${e}/${t}/${n}`)).json(),AO=async t=>{var u;const n=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=cO(o);let a=Math.floor((e+180)/360*Math.pow(2,r+1)),s=Math.floor((90-i)/180*Math.pow(2,r));return await hO(a,s,r)};class fO extends c.Destroyable{constructor(n,e,i){super();const o=async()=>{const a=await AO(n);e.datesEvent.emit(a,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const a=()=>{const s=e.currentDate?e.currentDate:0;i.url=`http://abc.gggis.com:13001/timetile/tms/${s}/tilemapresource.xml`};a(),this.d(e.currentDateChanged.don(a))}}}const qa=class qa extends c.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new c.ESImageryLayer));L(this,"_datesEvent",this.dv(new c.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(c.track([i,"show"],[this,"show"])),this.d(c.track([i,"zIndex"],[this,"zIndex"])),this.d(c.track([i,"rectangle"],[this,"rectangle"])),this.d(c.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(c.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new fO(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 esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"currentDate"],"时间","0"),new c.NumberProperty([this,"zIndex"],"层级",0),new c.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};L(qa,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:c.reactArray([-180,-90,180,90])})),L(qa,"type",qa.register("ESGeHistoryImagery",qa,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let gf=qa;const Ox=`async (dataSource, viewer) => {
|
|
2594
|
+
`,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let s=this.disposeVar(c.react(void 0));{const l=this.disposeVar(c.createProcessingFromAsyncFunc(async A=>{s.value=void 0;const h=e.url??c.ESDataMesh.defaults.url;if(!h)return;await A.promise(c.sleep(200));const f=(e.maxTime??23)|0;s.value=await A.promise(rO(c.ESSceneObject.context.getStrFromEnv(typeof h=="string"?h:h.url),f+1))}));l.start();const u=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>l.restart()))}{class l{constructor(h){this._buffer=h}[Symbol.iterator](){return oO(this._buffer)}}const u=()=>{if(!s.value)return;const{vertexBuffer:A,propBuffers:h,indexBuffer:f}=s.value,{minPos:p,maxPos:d}=c.getMinMaxCorner(new l(A));r.setLocalAxisedBoundingBox(p,d);const m=(e.maxTime??23)|0;let v=(e.currentTime??c.ESDataMesh.defaults.currentTime)/m;v=v<0?0:v>1?1:v;const y=v*m;let g=v*m|0,_=y-g;if(g>=m&&(g=m-1,_=1),!Number.isFinite(_)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=f,!h[g]||!h[g+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:A,componentsPerAttribute:3},a_prop:{typedArray:h[g],componentsPerAttribute:3},a_prop2:{typedArray:h[g+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${a.id}`},u_stripMinMaxValue:[e.minPropValue??c.ESDataMesh.defaults.minPropValue,e.maxPropValue??c.ESDataMesh.defaults.maxPropValue],u_ratio:_}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(s.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a,!0),!0):!1}};L(qu,"type",qu.register("ESCesiumViewer",c.ESDataMesh.type,qu));let ig=qu;const us=class us extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_heading",this.disposeVar(c.react(0)));L(this,"_textFunc",this.disposeVar(c.react(void 0)));const o=this;{const s=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=c.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=c.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=c.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?c.clampN180_180(u):c.clamp0_360(u)}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(s))}const r=this.disposeVar(new Ye(e,i));r.loop=!1,this.dispose(c.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(c.bind([r,"arcType"],[o,"arcType"])),this.dispose(c.bind([r,"color"],[o,"color"])),this.dispose(c.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(c.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(c.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(c.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(c.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(c.bind([r,"positions"],[o,"positions"])),this.dispose(c.bind([r,"show"],[o,"show"])),this.dispose(c.bind([r,"width"],[o,"width"])),this.dispose(c.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(c.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(s=>{e.actived&&r.flyTo(s)}));const a=this.disposeVar(new bt(e,i));this.dispose(c.bind([a,"shadowDom"],[o,"shadowDom"])),this.dispose(c.bind([a,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(c.bind([a,"show"],[o,"show"]));{const s=()=>{o.positions&&o.positions.length>=2?a.position=o.positions[1]:a.position=void 0};s(),this.dispose(o.positionsChanged.disposableOn(s))}{const s=()=>{const{heading:u}=o,A=(o.textFunc??us.defaultTextFunc_度格式)(u);a.innerHTML=_o(`方向: ${A}`,24)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(s))}this.ad(a.pickedEvent.don(s=>{Gi(s)===0&&this.pickedEvent.emit(s)}))}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(us,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(us,"defaultTextFunc_度分格式",e=>`${rl(e,!0)}`),L(us,"defaultTextFunc_度分秒格式",e=>`${rl(e,!1)}`),L(us,"defaults",{positions:[]});let qo=us;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:8,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(qo||(qo={})),c.extendClassProps(qo.prototype,qo.createDefaultProps);const Ku=class Ku extends sn{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new qo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):u==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Ku,"type",Ku.register("ESCesiumViewer",c.ESDirectionMeasurement.type,Ku));let rg=Ku;class fa extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distances",this.disposeVar(c.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await R0(e.viewer,this.positions??[]):this._distances.value=c.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const a=this.disposeVar(new Ye(e,i));a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"positions"],[this,"positions"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"])),this.dispose(c.bind([a,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&a.flyTo(s)}));{const s=[],l=()=>{for(let A of s)A.destroy();s.length=0};this.dispose(l);const u=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const h=Dd("起点",this.positions[0],e,i);h.dispose(c.track([h,"show"],[this,"show"])),h.dispose(c.track([h,"shadowDom"],[this,"shadowDom"])),h.dispose(c.track([h,"cssAllInitial"],[this,"cssAllInitial"])),s.push(h)}const A=this.distances.length;for(let h=0;h<A;++h){const f=this.distances[h],p=this.positions[h+1],d=Dd(`长度: ${Mh(f)}`,p,e,i);d.dispose(c.track([d,"show"],[this,"show"])),d.dispose(c.track([d,"shadowDom"],[this,"shadowDom"])),d.dispose(c.track([d,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(d.pickedEvent.don(m=>{Gi(m)===0&&this.pickedEvent.emit(m)})),s.push(d)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>c.inOrderRunning(u)))}}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(fa,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(fa||(fa={})),c.extendClassProps(fa.prototype,fa.createDefaultProps);const Zu=class Zu extends sn{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"ground"],[e,"strokeGround"]));{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Zu,"type",Zu.register("ESCesiumViewer",c.ESGeoLineString.type,Zu));let da=Zu;const $u=class $u extends da{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new fa(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L($u,"type",$u.register("ESCesiumViewer",c.ESDistanceMeasurement.type,$u));let og=$u;class pa extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.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:c.reactPositions(void 0),reverse:!1,edgeColor:c.reactArray([1,1,1,1]),edgeWidth:2})})(pa||(pa={})),c.extendClassProps(pa.prototype,pa.createDefaultProps);class sO extends c.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];c.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 aO extends c.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];c.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 Xu=class Xu extends Ln{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new pa(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new c.ESSceneObjectWithId);const o=this.ad(c.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const s=c.ESSceneObject.getSceneObject(e.targetID);o.value=s?(s.components.main??s).id:""})),this.dispose(c.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const a=this._czmPolygonClipping;a.showHelper=!1,this.dispose(c.bind([a,"positions"],[e,"points"])),this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.reverse=e.mode!=="in"};s(),this.dispose(e.modeChanged.disposableOn(s))}c.registerCreatedEventUpdate(this,e,()=>{const s=this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new c.ObjResettingWithEvent(s,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new aO(this):!l||!(l instanceof c.ES3DTileset)?void 0:new sO(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Xu,"type",Xu.register("ESCesiumViewer",c.ESExcavate.type,Xu));let sg=Xu;const Yu=class Yu extends He{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new wi(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 a=()=>{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)};a(),this.ad(e.scaleChanged.don(a))}this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"translation"],[e,"translation"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Gn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Yu,"type",Yu.register("ESCesiumViewer",c.ESFireParticleSystem.type,Yu));let ag=Yu;class ma extends c.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));L(this,"_ratio",this.disposeVar(c.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new c.ESPathImpl),this._geoPolyline=this.disposeVar(new Ye(e,i)),this._geoCanvasPointPoi=this.disposeVar(new Er(e,i)),this._player=this.disposeVar(new c.Player),this.dispose(c.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(c.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(c.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(c.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(c.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(c.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(c.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(c.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(c.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(c.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(c.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(c.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPath,"show"],[this,"show"])),this.dispose(c.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(c.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const a=this.granularity*Math.PI/180,s=bd(this.positions,this.arcType??"GEODESIC",a);if(s){this._geoPath.timePosRots=s.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(c.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(c.bind([this._player,"loop"],[this,"loop"])),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._player,"duration"],[this,"duration"])),this.dispose(c.bind([this._player,"playing"],[this,"playing"])),this.dispose(c.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:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.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"})})(ma||(ma={})),c.extendClassProps(ma.prototype,ma.createDefaultProps);class Kl extends c.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));this._geoPolylinePath=this.disposeVar(new ma(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(c.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(c.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(c.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(c.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(c.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(c.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(c.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(c.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(c.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(c.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(c.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(c.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(c.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const a=Rd(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=a}else this._geoPolylinePath.positions=void 0}catch(a){console.error(a),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(a=>{this._geoPolylinePath.flyTo(a)}))}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:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.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})})(Kl||(Kl={})),c.extendClassProps(Kl.prototype,Kl.createDefaultProps);const lO=[["256",256],["512",512],["1024",1024]],uO=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],In=class In extends c.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new c.Event));this.ad(c.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(c.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"accessToken"],"令牌",In.defaults.accessToken),new c.Number4Property([this,"rectangle"],"矩形范围",In.defaults.rectangle),new c.JsonProperty([this,"url"],"服务地址",In.defaults.url),new c.JsonProperty([this,"style"],"样式配置",In.defaults.style),new c.NumberProperty([this,"zIndex"],"层级序号",In.defaults.zIndex),new c.EnumProperty([this,"tileSize"],lO,"瓦片大小",256),new c.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",In.defaults.maximumLevel),new c.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",In.defaults.minimumLevel),new c.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",In.defaults.scheme),new c.EnumProperty([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考")],more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EnumProperty([this,"splitDirection"],uO,"splitDirection","NONE"),new c.GroupProperty([],"czm","czm"),new c.NumberProperty([this,"czmAlpha"],"透明度"),new c.NumberProperty([this,"czmBrightness"],"亮度"),new c.NumberProperty([this,"czmContrast"],"对比度"),new c.NumberProperty([this,"czmHue"],"色相"),new c.NumberProperty([this,"czmSaturation"],"饱和度"),new c.NumberProperty([this,"czmGamma"],"伽马值")]}}};L(In,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),rectangle:c.reactJsonWithUndefined([-180,-90,180,90]),url:c.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:c.reactArrayWithUndefined([]),scheme:c.react("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),L(In,"type",In.register("ESMVTLayer",In,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let mf=In;const cO=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},hO=async(t,n,e)=>(await fetch(`http://abc.gggis.com:13001/xyzinfo/${e}/${t}/${n}`)).json(),AO=async t=>{var u;const n=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=cO(o);let a=Math.floor((e+180)/360*Math.pow(2,r+1)),s=Math.floor((90-i)/180*Math.pow(2,r));return await hO(a,s,r)};class fO extends c.Destroyable{constructor(n,e,i){super();const o=async()=>{const a=await AO(n);e.datesEvent.emit(a,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const a=()=>{const s=e.currentDate?e.currentDate:0;i.url=`http://abc.gggis.com:13001/timetile/tms/${s}/tilemapresource.xml`};a(),this.d(e.currentDateChanged.don(a))}}}const qa=class qa extends c.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new c.ESImageryLayer));L(this,"_datesEvent",this.dv(new c.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(c.track([i,"show"],[this,"show"])),this.d(c.track([i,"zIndex"],[this,"zIndex"])),this.d(c.track([i,"rectangle"],[this,"rectangle"])),this.d(c.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(c.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new fO(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 esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"currentDate"],"时间","0"),new c.NumberProperty([this,"zIndex"],"层级",0),new c.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};L(qa,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:c.reactArray([-180,-90,180,90])})),L(qa,"type",qa.register("ESGeHistoryImagery",qa,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let gf=qa;const Ox=`async (dataSource, viewer) => {
|
|
2595
2595
|
viewer.clock.shouldAnimate = false;
|
|
2596
2596
|
const rider = dataSource.entities.getById("tour");
|
|
2597
2597
|
await viewer.flyTo(rider)
|
|
@@ -3594,7 +3594,7 @@ ${r_}
|
|
|
3594
3594
|
vec4 imageColor = texture(u_image, fract(v_st * u_stScale - addst));
|
|
3595
3595
|
out_FragColor = imageColor * u_color;
|
|
3596
3596
|
}
|
|
3597
|
-
`};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(s.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{this.czmCustomPrimitive.flyTo(a)}));{const a=()=>{const l=r.value?r.value:1,u=this.height??pr.defaults.height,{textureSizeInMeters:A=pr.defaults.textureSizeInMeters}=this,{textureUri:h=pr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:h},u_stScale:[l/A[0],u/A[1]],u_speed:this.textureMoveSpeed??pr.defaults.textureMoveSpeed,u_color:this.textureColor??pr.defaults.textureColor}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(s.disposableOn(a))}}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(pr,"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 $o=pr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),height:void 0,textureSizeInMeters:c.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:c.reactArrayWithUndefined(void 0),textureColor:c.reactArrayWithUndefined(void 0)})})($o||($o={})),c.extendClassProps($o.prototype,$o.createDefaultProps);const Tc=class Tc extends sn{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new $o(i,e.id)),this._czmPolygon=this.dv(new c.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,a=this._czmPolygon;i.add(a),this.dispose(()=>i.delete(a)),a.filled=!1,this.d(c.track([a,"points"],[e,"points"])),this.d(c.track([a,"stroked"],[e,"stroked"])),this.d(c.track([a,"strokeColor"],[e,"strokeColor"])),this.d(c.track([a,"strokeWidth"],[e,"strokeWidth"])),this.d(c.track([a,"strokeGround"],[e,"strokeGround"]));{const s={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=(f,p)=>{switch(f){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:[p,p]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[p*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",A=()=>{const f=e.materialMode,p=s[f];if(!p)return;r.textureUri=u+p.image,r.textureColor=f!=="gradientColor"?p.color:e.fillColor;const{textureMoveSpeed:d,textureSizeInMeters:m}=l(f,e.height);r.textureMoveSpeed=d,r.textureSizeInMeters=m};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(h.disposableOn(A))}{this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"height"],[e,"height"]));{const s=()=>{r.show=e.show&&e.filled};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(s))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(bn(r,o,i,e,a.czmCustomPrimitive),!0):!1}};L(Tc,"type",Tc.register("ESCesiumViewer",c.ESPolygonFence.type,Tc));let Hg=Tc;const Ic=class Ic extends sn{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(c.bind([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(c.bind([r,"height"],[e,"height"])),this.dispose(c.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(c.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(c.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"]));{const a=()=>{const s=e.points;if(s&&s.length>=2){const{minPos:l,maxPos:u}=c.getMinMaxCorner(s);r.rectangle=[l[0],l[1],u[0],u[1]],r.height=s[1][2],r.extrudedHeight=s[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}};L(Ic,"type",Ic.register("ESCesiumViewer",c.ESRectangle.type,Ic));let Gg=Ic;const uo=class uo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],uo.defaults.imageUrl),a=this.disposeVar(c.react(void 0)),s=()=>{const g=b.Material.fromType(b.Material.ImageType);g.uniforms.image=r.value,g.uniforms.repeat=Ze(this.repeat??uo.defaults.repeat),a.value=g};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(s));const u=(g,_)=>{const x=new b.PolylineMaterialAppearance({material:_,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const E=[];if(g.length<2)return;E.push(new b.GeometryInstance({geometry:new b.GroundPolylineGeometry({positions:g,width:this.width??uo.defaults.width,vertexFormat:b.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:b.ArcType[this.arcType??uo.defaults.arcType]}),id:this}));const B=new Bi({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??uo.defaults.allowPicking,compressVertices:!1});return B.ESSceneObjectID=i,B};let A;const h=new b.BoundingSphere,f=()=>{A&&(o.scene.primitives.remove(A),A=void 0)};this.dispose(f);const p=()=>{if(f(),!this.positions)return;const g=Yt(this.positions);if(g.length<2||!a.value){h.radius=-1;return}b.BoundingSphere.fromPoints(g,h),A=u(g,a.value),A&&o.scene.primitives.add(A)},d=()=>{A&&(A.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(g=>{if(e.actived&&h.radius>0){const _=De(h.center);_&&Fe(o,_,h.radius*4,void 0,g)}})),p(),d();const m=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,a.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(m.disposableOn(()=>{p(),d()}));const v=this.disposeVar(c.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(uo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Xo=uo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Xo||(Xo={})),c.extendClassProps(Xo.prototype,Xo.createDefaultProps);const Fc=class Fc extends sn{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Xo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"width"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Fc,"type",Fc.register("ESCesiumViewer",xf.type,Fc));let Wg=Fc;const Mc=class Mc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.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 c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const m=()=>{A.style.display=e.show??c.ESScale.defaults.show?"block":"none"};m(),e.dispose(e.showChanged.disposableOn(m))}A.style.position="fixed",A.style.width="125px",A.style.height="30px",A.style.border="1px solid rgba(49,50,56,.8)",A.style.padding="0 5px",A.style.backgroundColor="rgba(37,38,42,.8)",A.style.borderRadius="15px",A.style.pointerEvents="auto",A.style.transition=" right 0.4s linear";{const m=()=>{A.style.bottom=`${e.cssPosition?e.cssPosition[0]:c.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(A.style.right="auto",A.style.left=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`):(A.style.left="auto",A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(c.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));m(),this.dispose(v.disposableOn(()=>m()))}const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="125px",h.style.display="inline-block",h.style.textAlign="center",h.style.fontSize="14px",h.style.fontWeight="lighter",h.style.lineHeight="30px",h.style.color="#fff",h.innerHTML="1000km";const f=document.createElement("div");A.appendChild(f),this.dispose(()=>A.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left="30px";const p=()=>{const m=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||m&&m>1e6)A.style.display="none";else{A.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(h.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){f.style.width=`${y}px`;const g=(135-y)/2;f.style.left=`${g}px`}}};p();const d=setInterval(()=>{p()},200);this.dispose(()=>clearInterval(d))}}}get customDiv(){return this._customDiv}};L(Mc,"type",Mc.register("ESCesiumViewer",c.ESScale.type,Mc));let jg=Mc;const Dc=class Dc extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new ut(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(c.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(c.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(c.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(c.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(c.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(c.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(c.track([r,"cull"],[e,"cull"])),this.dispose(c.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(c.track([r,"pass"],[e,"pass"])),this.dispose(c.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(c.track([r,"renderState"],[e,"renderState"])),this.dispose(c.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(c.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(c.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(c.track([r,"attributes"],[e,"attributes"])),this.dispose(c.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(c.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(c.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(c.track([r,"count"],[e,"count"])),this.dispose(c.track([r,"offset"],[e,"offset"])),this.dispose(c.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(c.track([r,"localPosition"],[e,"localPosition"])),this.dispose(c.track([r,"localScale"],[e,"localScale"])),this.dispose(c.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(c.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(c.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(c.track([r,"occlude"],[e,"occlude"])),this.dispose(c.track([r,"castShadows"],[e,"castShadows"])),this.dispose(c.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(c.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(c.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(c.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const a=()=>{if(e.localRotation){const s=[...e.localRotation];s[0]-=90,r.localRotation=s}else r.localRotation=[-90,0,0]};a(),this.dispose(e.localRotationChanged.disposableOn(a))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a,!0),!0):!1}};L(Dc,"type",Dc.register("ESCesiumViewer",wf.type,Dc));let qg=Dc;const Rc=class Rc extends df{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Ot(i.viewer))return;this.czmGeoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{czmGeoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??c.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESDynamicWater.defaults.flowSpeed});else{const A=Object.assign({},Rh[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=e.show&&e.stroked},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=!!(e.show&&e.filled)},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){a.positions=[],s.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const A=e.points.map(f=>[f[0],f[1],0]),[h]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},A);a.positions=[...h,h[0]],s.points=[...h]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Mn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&a),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a!=null&&a.points?(Me(r,o,i,a.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(Rc,"type",Rc.register("ESCesiumViewer",c.ESDynamicWater.type,Rc));let Kg=Rc;const it=class it extends Hn{constructor(e,i){super(e,i);L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_pointFeatures",this.disposeVar(c.reactJsonWithUndefined(void 0)));L(this,"featureArrName","features");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=Ot(o);if(!r)return;const{screenManager:a}=r,s={scale:1*it.scaleFactor,font:"16px sans-serif",verticalOrigin:b.VerticalOrigin.BOTTOM,horizontalOrigin:b.HorizontalOrigin.CENTER,scaleByDistance:it.scaleByDistance,eyeOffset:new b.Cartesian3(0,0,-10),show:!0},l={scale:1*it.scaleFactor,verticalOrigin:b.VerticalOrigin.BOTTOM,horizontalOrigin:b.HorizontalOrigin.CENTER,scaleByDistance:it.scaleByDistance,image:it.clusterImageUrl};(async()=>{if(it.clusterImageAttribute===void 0){const u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(u).then(A=>A.json()).then(A=>{it.clusterImageAttribute=A}).catch(A=>{console.error(A)})}{const u=()=>{if(!e.data){this.pointFeatures=void 0;return}this.featureArrName=e.data.type=="FeatureCollection"?"features":"geometries";const A={type:e.data.type,[this.featureArrName]:[]};if(e.data.type==="FeatureCollection")for(let h=0;h<e.data.features.length;h++){const f=e.data.features[h];if(f.geometry.type=="Point")A[this.featureArrName].push(f);else if(f.geometry.type=="MultiPoint")for(let p=0;p<f.geometry.coordinates.length;p++)A[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.geometry.coordinates[p]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.geometry.type)}else if(e.data.type=="GeometryCollection")for(let h=0;h<e.data.geometries.length;h++){const f=e.data.geometries[h];if(f.type=="Point")A[this.featureArrName].push(f);else if(f.type=="MultiPoint")for(let p=0;p<f.coordinates.length;p++)A[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.coordinates[p]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.type)}this.pointFeatures=A};u(),this.ad(e.dataChanged.don(u))}{const u=()=>{this.dataSource&&o.dataSources.remove(this.dataSource),this.dataSource=void 0};this.ad(()=>u());const A=()=>{u(),this.pointFeatures&&b.GeoJsonDataSource.load(this.pointFeatures).then(h=>{o.dataSources.add(h).then(()=>{this.dataSource=h})})};A(),this.ad(this.pointFeaturesChanged.don(A))}this.ad(new c.ObjResettingWithEvent(this.dataSourceChanged,()=>{var d;if(!this.dataSource)return;const u=new c.Destroyable,A=this.dataSource;A.clustering.enabled=A.clustering.clusterBillboards=A.clustering.clusterLabels=A.clustering.clusterPoints=!0;for(let m=0;m<A.entities.values.length;m++){const v=A.entities.values[m];v.billboard&&(v.billboard.color=new b.ConstantProperty(b.Color.TRANSPARENT))}{const m=()=>{const y=A.clustering.pixelRange;A.clustering.pixelRange=0,A.clustering.pixelRange=y};m();let v=(d=this.czmViewer.viewer)==null?void 0:d.camera.moveEnd.addEventListener(()=>{m()});u.d(()=>{var y;v&&((y=this.czmViewer.viewer)==null||y.camera.moveEnd.removeEventListener(v))})}u.d(c.track([A.clustering,"pixelRange"],[e,"pixelRange"])),u.d(c.track([A.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),A.clustering.clusterEvent.addEventListener((m,v)=>{v.label&&(v.label.show=!1),v.billboard&&(v.billboard.show=!1),v.point&&(v.point.show=!1)});const h=u.ad(c.react(!1));let f=[];const p=o.scene.postUpdate.addEventListener(()=>{if(A.clustering._clusterLabelCollection)if(A.clustering._clusterLabelCollection._labels.length!=f.length||!A.clustering._clusterLabelCollection._labels.every(m=>f.includes(m.id.length))){f=[];for(let m=0;m<A.clustering._clusterLabelCollection._labels.length;m++){const v=A.clustering._clusterLabelCollection._labels[m];f.push(v.id.length)}h.value=!0}else h.value=!1});u.ad(()=>p());{let m={id:"",layer:"",screenObjectIds:[]},v={id:"",layer:"",screenObjectIds:[]};const y=()=>{m&&(a.remove(m.layer,m.id,{label:m.screenObjectIds}),m={id:"",layer:"",screenObjectIds:[]}),v&&(a.remove(v.layer,v.id,{billboard:v.screenObjectIds}),v={id:"",layer:"",screenObjectIds:[]})};u.ad(()=>{y()});const g=()=>{var F,S,T,w,C,M;if(y(),!e.show||!it.clusterImageAttribute)return;const x=e.style??c.ESEntityCluster.defaults.style,E=it.clusterImageAttribute[((F=x.nonCluster)==null?void 0:F.mode)??"SquareH01"],B=[-E.anchorPixelOffset[0]+E.textPixelOffset[0],-E.anchorPixelOffset[1]-E.textPixelOffset[1]],P={...s,pixelOffset:new b.Cartesian2(B[0]*it.scaleFactor,B[1]*it.scaleFactor),heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()]},I={...l,width:E.imageSize[0],height:E.imageSize[1],heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new b.Cartesian2(-E.anchorPixelOffset[0]*it.scaleFactor,-E.anchorPixelOffset[1]*it.scaleFactor),imageSubRegion:new b.BoundingRectangle(...E.imagePixelOffset,...E.imageSize)},D=new Map;if(A.clustering._clusterLabelCollection)for(let R=0;R<A.clustering._clusterLabelCollection._labels.length;R++){const U=A.clustering._clusterLabelCollection._labels[R];if(!it.clusterImageAttribute)continue;const O=U.text,z=De(U.position),k={index:U.id.map(le=>A.entities.values.length-1-A.clustering._collectionIndicesByEntity[le.id].billboardIndex).sort((le,ue)=>le-ue),name:O,position:z},Q=this.getClusterStyle(x.cluster??c.ESEntityCluster.defaults.style.cluster,U.id.length).mode,V=it.clusterImageAttribute[Q],j=[-V.anchorPixelOffset[0]+V.textPixelOffset[0],-V.anchorPixelOffset[1]-V.textPixelOffset[1]],J={...s,pixelOffset:new b.Cartesian2(j[0]*it.scaleFactor,j[1]*it.scaleFactor),heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()]},ee={...l,width:V.imageSize[0],height:V.imageSize[1],heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new b.Cartesian2(-V.anchorPixelOffset[0]*it.scaleFactor,-V.anchorPixelOffset[1]*it.scaleFactor),imageSubRegion:new b.BoundingRectangle(...V.imagePixelOffset,...V.imageSize)},ie=a.addImage(e.id,e.typeName,ee,k),oe=a.addLabel(e.id,e.typeName,J,k);v.id=ie.id,v.layer=ie.layer,v.screenObjectIds.push(ie.screenObjectId),m.id=oe.id,m.layer=oe.layer,m.screenObjectIds.push(oe.screenObjectId);for(let le=0;le<U.id.length;le++)D.set(U.id[le].id,1)}for(let R=0;R<A.entities.values.length;R++){const U=A.entities.values[R];if(D.has(U.id)||!this.pointFeatures||!i.isPointVisible(De((S=U.position)==null?void 0:S.getValue())))continue;const O=((T=this.pointFeatures[this.featureArrName][R])==null?void 0:T.coordinates)??((w=this.pointFeatures[this.featureArrName][R])==null?void 0:w.geometry.coordinates),z=((C=this.pointFeatures[this.featureArrName][R])==null?void 0:C.name)??((M=this.pointFeatures[this.featureArrName][R].properties)==null?void 0:M.name)??(R+1).toString(),k={index:R,name:z,position:O},Q=a.addImage(e.id,e.typeName,I,k),V=a.addLabel(e.id,e.typeName,P,k);v.id=Q.id,v.layer=Q.layer,v.screenObjectIds.push(Q.screenObjectId),m.id=V.id,m.layer=V.layer,m.screenObjectIds.push(V.screenObjectId)}};g();const _=u.ad(c.createNextAnimateFrameEvent(e.showChanged,e.styleChanged,e.heightReferenceChanged,h.changed));u.ad(_.don(g))}return u}))})()}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get dataSourceChanged(){return this._dataSource.changed}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}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,a=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&a})}};L(it,"type",it.register("ESCesiumViewer",c.ESEntityCluster.type,it)),L(it,"scaleFactor",.6),L(it,"scaleByDistance",new b.NearFarScalar(100,1,1e3,1)),L(it,"clusterImages"),L(it,"clusterImageAttribute"),L(it,"clusterImageUrl",c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"));let Zg=it;const Uc=class Uc extends Hn{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(Uc,"type",Uc.register("ESCesiumViewer",gf.type,Uc));let $g=Uc;const Oc=class Oc extends Ln{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Ot(i.viewer))return;this.geoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{geoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESGeoWater.defaults.waterColor,frequency:(e.frequency??c.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??c.ESGeoWater.defaults.waterImage});else{const A=Object.assign({},Rh[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=!!(e.show&&e.stroked)},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=e.show&&e.filled},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(a.positions=[...e.points,e.points[0]],s.points=[...e.points]):(a.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],s.points=[])};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(l))}this.ad(e.editingChanged.don(l=>{s.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(Oc,"type",Oc.register("ESCesiumViewer",c.ESGeoWater.type,Oc));let Xg=Oc;const Yg=65536*65536,o_=1/Yg,wL=12,s_=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Jg=0,Sf=1,eu=2,Ef=5;class bL{constructor(n=new Uint8Array(16)){this.buf=ArrayBuffer.isView(n)?n:new Uint8Array(n),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(n,e,i=this.length){for(;this.pos<i;){const o=this.readVarint(),r=o>>3,a=this.pos;this.type=o&7,n(r,e,this),this.pos===a&&this.skip(o)}return e}readMessage(n,e){return this.readFields(n,e,this.readVarint()+this.pos)}readFixed32(){const n=this.dataView.getUint32(this.pos,!0);return this.pos+=4,n}readSFixed32(){const n=this.dataView.getInt32(this.pos,!0);return this.pos+=4,n}readFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Yg;return this.pos+=8,n}readSFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Yg;return this.pos+=8,n}readFloat(){const n=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,n}readDouble(){const n=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,n}readVarint(n){const e=this.buf;let i,o;return o=e[this.pos++],i=o&127,o<128||(o=e[this.pos++],i|=(o&127)<<7,o<128)||(o=e[this.pos++],i|=(o&127)<<14,o<128)||(o=e[this.pos++],i|=(o&127)<<21,o<128)?i:(o=e[this.pos],i|=(o&15)<<28,xL(i,n,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const n=this.readVarint();return n%2===1?(n+1)/-2:n/2}readBoolean(){return!!this.readVarint()}readString(){const n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=wL&&s_?s_.decode(this.buf.subarray(e,n)):UL(this.buf,e,n)}readBytes(){const n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e}readPackedVarint(n=[],e){const i=this.readPackedEnd();for(;this.pos<i;)n.push(this.readVarint(e));return n}readPackedSVarint(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSVarint());return n}readPackedBoolean(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readBoolean());return n}readPackedFloat(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFloat());return n}readPackedDouble(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readDouble());return n}readPackedFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed32());return n}readPackedSFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed32());return n}readPackedFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed64());return n}readPackedSFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed64());return n}readPackedEnd(){return this.type===eu?this.readVarint()+this.pos:this.pos+1}skip(n){const e=n&7;if(e===Jg)for(;this.buf[this.pos++]>127;);else if(e===eu)this.pos=this.readVarint()+this.pos;else if(e===Ef)this.pos+=4;else if(e===Sf)this.pos+=8;else throw new Error(`Unimplemented type: ${e}`)}writeTag(n,e){this.writeVarint(n<<3|e)}realloc(n){let e=this.length||16;for(;e<this.pos+n;)e*=2;if(e!==this.length){const i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeSFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*o_),!0),this.pos+=8}writeSFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*o_),!0),this.pos+=8}writeVarint(n){if(n=+n||0,n>268435455||n<0){_L(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))}writeSVarint(n){this.writeVarint(n<0?-n*2-1:n*2)}writeBoolean(n){this.writeVarint(+n)}writeString(n){n=String(n),this.realloc(n.length*4),this.pos++;const e=this.pos;this.pos=OL(this.buf,n,this.pos);const i=this.pos-e;i>=128&&a_(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(n){this.realloc(4),this.dataView.setFloat32(this.pos,n,!0),this.pos+=4}writeDouble(n){this.realloc(8),this.dataView.setFloat64(this.pos,n,!0),this.pos+=8}writeBytes(n){const e=n.length;this.writeVarint(e),this.realloc(e);for(let i=0;i<e;i++)this.buf[this.pos++]=n[i]}writeRawMessage(n,e){this.pos++;const i=this.pos;n(e,this);const o=this.pos-i;o>=128&&a_(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeMessage(n,e,i){this.writeTag(n,eu),this.writeRawMessage(e,i)}writePackedVarint(n,e){e.length&&this.writeMessage(n,EL,e)}writePackedSVarint(n,e){e.length&&this.writeMessage(n,PL,e)}writePackedBoolean(n,e){e.length&&this.writeMessage(n,IL,e)}writePackedFloat(n,e){e.length&&this.writeMessage(n,BL,e)}writePackedDouble(n,e){e.length&&this.writeMessage(n,TL,e)}writePackedFixed32(n,e){e.length&&this.writeMessage(n,FL,e)}writePackedSFixed32(n,e){e.length&&this.writeMessage(n,ML,e)}writePackedFixed64(n,e){e.length&&this.writeMessage(n,DL,e)}writePackedSFixed64(n,e){e.length&&this.writeMessage(n,RL,e)}writeBytesField(n,e){this.writeTag(n,eu),this.writeBytes(e)}writeFixed32Field(n,e){this.writeTag(n,Ef),this.writeFixed32(e)}writeSFixed32Field(n,e){this.writeTag(n,Ef),this.writeSFixed32(e)}writeFixed64Field(n,e){this.writeTag(n,Sf),this.writeFixed64(e)}writeSFixed64Field(n,e){this.writeTag(n,Sf),this.writeSFixed64(e)}writeVarintField(n,e){this.writeTag(n,Jg),this.writeVarint(e)}writeSVarintField(n,e){this.writeTag(n,Jg),this.writeSVarint(e)}writeStringField(n,e){this.writeTag(n,eu),this.writeString(e)}writeFloatField(n,e){this.writeTag(n,Ef),this.writeFloat(e)}writeDoubleField(n,e){this.writeTag(n,Sf),this.writeDouble(e)}writeBooleanField(n,e){this.writeVarintField(n,+e)}}function xL(t,n,e){const i=e.buf;let o,r;if(r=i[e.pos++],o=(r&112)>>4,r<128||(r=i[e.pos++],o|=(r&127)<<3,r<128)||(r=i[e.pos++],o|=(r&127)<<10,r<128)||(r=i[e.pos++],o|=(r&127)<<17,r<128)||(r=i[e.pos++],o|=(r&127)<<24,r<128)||(r=i[e.pos++],o|=(r&1)<<31,r<128))return ya(t,o,n);throw new Error("Expected varint not more than 10 bytes")}function ya(t,n,e){return e?n*4294967296+(t>>>0):(n>>>0)*4294967296+(t>>>0)}function _L(t,n){let e,i;if(t>=0?(e=t%4294967296|0,i=t/4294967296|0):(e=~(-t%4294967296),i=~(-t/4294967296),e^4294967295?e=e+1|0:(e=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),CL(e,i,n),SL(i,n)}function CL(t,n,e){e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos]=t&127}function SL(t,n){const e=(t&7)<<4;n.buf[n.pos++]|=e|((t>>>=3)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127)))))}function a_(t,n,e){const i=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(Math.LN2*7));e.realloc(i);for(let o=e.pos-1;o>=t;o--)e.buf[o+i]=e.buf[o]}function EL(t,n){for(let e=0;e<t.length;e++)n.writeVarint(t[e])}function PL(t,n){for(let e=0;e<t.length;e++)n.writeSVarint(t[e])}function BL(t,n){for(let e=0;e<t.length;e++)n.writeFloat(t[e])}function TL(t,n){for(let e=0;e<t.length;e++)n.writeDouble(t[e])}function IL(t,n){for(let e=0;e<t.length;e++)n.writeBoolean(t[e])}function FL(t,n){for(let e=0;e<t.length;e++)n.writeFixed32(t[e])}function ML(t,n){for(let e=0;e<t.length;e++)n.writeSFixed32(t[e])}function DL(t,n){for(let e=0;e<t.length;e++)n.writeFixed64(t[e])}function RL(t,n){for(let e=0;e<t.length;e++)n.writeSFixed64(t[e])}function UL(t,n,e){let i="",o=n;for(;o<e;){const r=t[o];let a=null,s=r>239?4:r>223?3:r>191?2:1;if(o+s>e)break;let l,u,A;s===1?r<128&&(a=r):s===2?(l=t[o+1],(l&192)===128&&(a=(r&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=t[o+1],u=t[o+2],(l&192)===128&&(u&192)===128&&(a=(r&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=t[o+1],u=t[o+2],A=t[o+3],(l&192)===128&&(u&192)===128&&(A&192)===128&&(a=(r&15)<<18|(l&63)<<12|(u&63)<<6|A&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,i+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),i+=String.fromCharCode(a),o+=s}return i}function OL(t,n,e){for(let i=0,o,r;i<n.length;i++){if(o=n.charCodeAt(i),o>55295&&o<57344)if(r)if(o<56320){t[e++]=239,t[e++]=191,t[e++]=189,r=o;continue}else o=r-55296<<10|o-56320|65536,r=null;else{o>56319||i+1===n.length?(t[e++]=239,t[e++]=191,t[e++]=189):r=o;continue}else r&&(t[e++]=239,t[e++]=191,t[e++]=189,r=null);o<128?t[e++]=o:(o<2048?t[e++]=o>>6|192:(o<65536?t[e++]=o>>12|224:(t[e++]=o>>18|240,t[e++]=o>>12&63|128),t[e++]=o>>6&63|128),t[e++]=o&63|128)}return e}function Yr(t,n){this.x=t,this.y=n}Yr.prototype={clone(){return new Yr(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,n){return this.clone()._rotateAround(t,n)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){const n=t.x-this.x,e=t.y-this.y;return n*n+e*e},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult(t){const n=t[0]*this.x+t[1]*this.y,e=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=e,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){const t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){const n=Math.cos(t),e=Math.sin(t),i=n*this.x-e*this.y,o=e*this.x+n*this.y;return this.x=i,this.y=o,this},_rotateAround(t,n){const e=Math.cos(t),i=Math.sin(t),o=n.x+e*(this.x-n.x)-i*(this.y-n.y),r=n.y+i*(this.x-n.x)+e*(this.y-n.y);return this.x=o,this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Yr},Yr.convert=function(t){if(t instanceof Yr)return t;if(Array.isArray(t))return new Yr(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new Yr(+t.x,+t.y);throw new Error("Expected [x, y] or {x, y} point format")};class l_{constructor(n,e,i,o,r){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=n,this._geometry=-1,this._keys=o,this._values=r,n.readFields(LL,this,e)}loadGeometry(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos,i=[];let o,r=1,a=0,s=0,l=0;for(;n.pos<e;){if(a<=0){const u=n.readVarint();r=u&7,a=u>>3}if(a--,r===1||r===2)s+=n.readSVarint(),l+=n.readSVarint(),r===1&&(o&&i.push(o),o=[]),o&&o.push(new Yr(s,l));else if(r===7)o&&o.push(o[0].clone());else throw new Error(`unknown command ${r}`)}return o&&i.push(o),i}bbox(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos;let i=1,o=0,r=0,a=0,s=1/0,l=-1/0,u=1/0,A=-1/0;for(;n.pos<e;){if(o<=0){const h=n.readVarint();i=h&7,o=h>>3}if(o--,i===1||i===2)r+=n.readSVarint(),a+=n.readSVarint(),r<s&&(s=r),r>l&&(l=r),a<u&&(u=a),a>A&&(A=a);else if(i!==7)throw new Error(`unknown command ${i}`)}return[s,u,l,A]}toGeoJSON(n,e,i){const o=this.extent*Math.pow(2,i),r=this.extent*n,a=this.extent*e,s=this.loadGeometry();function l(f){return[(f.x+r)*360/o-180,360/Math.PI*Math.atan(Math.exp((1-(f.y+a)*2/o)*Math.PI))-90]}function u(f){return f.map(l)}let A;if(this.type===1){const f=[];for(const d of s)f.push(d[0]);const p=u(f);A=f.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){const f=s.map(u);A=f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}}else if(this.type===3){const f=kL(s),p=[];for(const d of f)p.push(d.map(u));A=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw new Error("unknown feature type");const h={type:"Feature",geometry:A,properties:this.properties};return this.id!=null&&(h.id=this.id),h}}l_.types=["Unknown","Point","LineString","Polygon"];function LL(t,n,e){t===1?n.id=e.readVarint():t===2?zL(e,n):t===3?n.type=e.readVarint():t===4&&(n._geometry=e.pos)}function zL(t,n){const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=n._keys[t.readVarint()],o=n._values[t.readVarint()];n.properties[i]=o}}function kL(t){const n=t.length;if(n<=1)return[t];const e=[];let i,o;for(let r=0;r<n;r++){const a=QL(t[r]);a!==0&&(o===void 0&&(o=a<0),o===a<0?(i&&e.push(i),i=[t[r]]):i&&i.push(t[r]))}return i&&e.push(i),e}function QL(t){let n=0;for(let e=0,i=t.length,o=i-1,r,a;e<i;o=e++)r=t[e],a=t[o],n+=(a.x-r.x)*(r.y+a.y);return n}class VL{constructor(n,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=n,this._keys=[],this._values=[],this._features=[],n.readFields(NL,this,e),this.length=this._features.length}feature(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];const e=this._pbf.readVarint()+this._pbf.pos;return new l_(this._pbf,e,this.extent,this._keys,this._values)}}function NL(t,n,e){t===15?n.version=e.readVarint():t===1?n.name=e.readString():t===5?n.extent=e.readVarint():t===2?n._features.push(e.pos):t===3?n._keys.push(e.readString()):t===4&&n._values.push(HL(e))}function HL(t){let n=null;const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=t.readVarint()>>3;n=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}if(n==null)throw new Error("unknown feature value");return n}class GL{constructor(n,e){this.layers=n.readFields(WL,{},e)}}function WL(t,n,e){if(t===3){const i=new VL(e,e.readVarint()+e.pos);i.length&&(n[i.name]=i)}}function jL(t){let n,e;if(Reflect.has(t,"type")&&t.type==="symbol"&&Reflect.has(t,"layout")){const i=t.layout;if(Reflect.has(i,"icon-image")){e={},e.image=i["icon-image"];const{horizontalOrigin:o,verticalOrigin:r}=u_(i["icon-anchor"]??"center");if(e.horizontalOrigin=o,e.verticalOrigin=r,Reflect.has(t,"paint")){const a=t.paint;e.color=b.Color.fromCssColorString(a["icon-color"]??"#FF0000").withAlpha(a["icon-opacity"]??1)}e.rotation=b.Math.toRadians(i["icon-rotate"]??0),e.scale=i["icon-size"]??1,e.show=(i.visibility??"visible")==="visible"}if(Reflect.has(i,"text-field")){n={},n.text=i["text-field"];const{horizontalOrigin:o,verticalOrigin:r}=u_(i["text-anchor"]??"center");if(n.horizontalOrigin=o,n.verticalOrigin=r,Reflect.has(t,"paint")){const a=t.paint;n.fillColor=b.Color.fromCssColorString(a["text-color"]??"#FFFFFF").withAlpha(a["text-opacity"]??1)}n.font=`${i["text-size"]??16}px ${i["text-font"]??"sans-serif"}`,n.show=(i.visibility??"visible")==="visible"}}return{labelStyle:n,billboardStyle:e}}function u_(t){let n=b.HorizontalOrigin.CENTER,e=b.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":n=b.HorizontalOrigin.LEFT;break;case"right":n=b.HorizontalOrigin.RIGHT;break;case"top":e=b.VerticalOrigin.TOP;break;case"bottom":e=b.VerticalOrigin.BOTTOM;break;case"top-left":n=b.HorizontalOrigin.LEFT,e=b.VerticalOrigin.TOP;break;case"top-right":n=b.HorizontalOrigin.RIGHT,e=b.VerticalOrigin.TOP;break;case"bottom-left":n=b.HorizontalOrigin.LEFT,e=b.VerticalOrigin.BOTTOM;break;case"bottom-right":n=b.HorizontalOrigin.RIGHT,e=b.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:n,verticalOrigin:e}}class qL extends c.Destroyable{constructor(e,i){super();L(this,"czmViewer");L(this,"czmESMVTLayer");L(this,"screenManager");L(this,"cacheSize",100);L(this,"urlMap",new Map);L(this,"tileScheme","xyz");L(this,"minimumLevel",0);L(this,"maximumLevel",18);L(this,"_cache",new Map);L(this,"lastTiles",new Map);this.czmViewer=e,this.czmESMVTLayer=i;const o=this.czmViewer.viewer;if(!o)return;const r=Ot(o);if(!r)return;this.screenManager=r.screenManager,this.tileScheme=i.sceneObject.scheme??"xyz",this.maximumLevel=i.sceneObject.maximumLevel,this.minimumLevel=i.sceneObject.minimumLevel,(()=>{do{if(!i.mvtLayerJson)break;if(typeof i.mvtLayerJson.mainJson=="string"){this.urlMap.set("customSource",[i.mvtLayerJson.mainJson]);break}if(typeof i.mvtLayerJson.mainJson=="object"){const s=i.mvtLayerJson.mainJson.sources;for(const l in s){const u=s[l];u.type==="vector"&&Reflect.has(u,"tiles")&&this.urlMap.set(l,u.tiles)}break}}while(!1)})(),this.ad(()=>{var l;const s=Array.from(this.lastTiles.values()).map(u=>u.featureTable).map(u=>Object.values(u)).flat(1/0);s&&((l=this.screenManager)==null||l.remove("default",this.czmESMVTLayer.sceneObject.id,s)),this.cache&&(this.cache.clear(),this.cache=null)})}get cache(){return this._cache}set cache(e){this._cache=e}addTiles(e){var a;if(this.urlMap.size==0)return;if(this.cache&&this.cache.has(e)&&this.lastTiles.has(e)){this.updateTiles([e],"show");return}const[i,o,r]=e.split("-").map(Number);(a=this.cache)==null||a.set(e,new Map),this.requestImage(o,r,i,e)}updateTiles(e,i="hide"){var o,r;for(let a=0;a<e.length;a++){const s=e[a],l=this.lastTiles.get(s);if(l){const u=Object.keys(l.featureTable);for(let A=0;A<u.length;A++){const h=u[A],f=l.featureTable[h];i=="delete"?(o=this.screenManager)==null||o.remove(l.layer,l.id,f):(r=this.screenManager)==null||r.update(l.layer,l.id,f,{all:{show:i=="show"}})}}i=="delete"&&this.lastTiles.delete(s)}}update(e){const i=Array.from(this.lastTiles.keys()),o=i.filter(s=>!e.includes(s)),r=i.filter(s=>e.includes(s)),a=e.filter(s=>!i.includes(s));this.updateTiles(o),this.updateTiles(r,"show");for(let s=0;s<a.length;s++){const l=a[s];this.addTiles(l)}}requestImage(e,i,o,r){const a=this.tileScheme=="tms"?Math.pow(2,o)-i-1:i;this.urlMap.size!=0&&this.urlMap.entries().forEach(([s,l])=>{if(l.length!=0&&l[0].includes("{z}")){const u=l[0].replace(/{z}/g,o.toString()).replace(/{x}/g,e.toString()).replace(/{y}/g,a.toString());fetch(u).then(A=>{var h,f;if(A.ok&&((h=this.cache)!=null&&h.has(r))&&((f=this.cache.get(r))==null?void 0:f.size)==0)return A.arrayBuffer()}).then(A=>{var d;const h=new bL(A),f=new GL(h),p=new Map;for(const m in f.layers){const v=f.layers[m];if(v.length<=0||v.feature(0).type!==1)continue;const y=[];for(let g=0;g<v.length;g++){const _=v.feature(g);y.push(_.toGeoJSON(e,i,o))}p.set(m,y)}(d=this.cache)==null||d.set(r,p),this.addScreenManage(r,p),this.clearCache()})}})}clearCache(){if(!this.cache)return;const e=this.cache.size-this.cacheSize;if(!(e<=0))for(let i=0;i<e;i++){const o=this.cache.keys().next().value;o&&(this.updateTiles([o],"delete"),this.cache.delete(o))}}addScreenManage(e,i){this.lastTiles.set(e,{layer:"default",id:this.czmESMVTLayer.sceneObject.id,featureTable:{}});const o=this.lastTiles.get(e);for(const[r,a]of i.entries()){const s=this.czmESMVTLayer.mvtLayerJson.pointJson.find(l=>l["source-layer"]==r)??{};for(const l of a){const{labelStyle:u,billboardStyle:A}=jL(s);let h,f;u&&(u.show=!this.screenManager.avoidanceManager.enable,h=this.screenManager.addLabel(this.czmESMVTLayer.sceneObject.id,"default",u??{},{position:l.geometry.coordinates,name:l.properties.NAME??l.properties.name,index:l.id})),A&&(A.show=!this.screenManager.avoidanceManager.enable,f=this.screenManager.addImage(this.czmESMVTLayer.sceneObject.id,"default",A??{},{position:l.geometry.coordinates,name:l.properties.NAME??l.properties.name,index:l.id})),o.featureTable[r]||(o.featureTable[r]=[]),h&&o.featureTable[r].push(h.screenObjectId),f&&o.featureTable[r].push(f.screenObjectId)}}}reset(){if(!this.cache)return;const e=Array.from(this.cache.keys());this.update([]),setTimeout(()=>{this.update(e)})}}class KL extends c.Destroyable{constructor(e,i){super();L(this,"vectorTilesCache");L(this,"czmViewer");L(this,"czmESMVTLayer");this.czmViewer=e,this.czmESMVTLayer=i,this.vectorTilesCache=this.ad(new qL(e,i)),this.updateTiles();const o=this.czmViewer.viewer.scene.globe._surface.tileLoadProgressEvent.addEventListener(r=>{r==0&&this.updateTiles()});this.ad(()=>{o()})}updateTiles(){const e=this.czmViewer.viewer;if(!e)return;const i=new Set;for(let o=0;o<e.scene.globe._surface._tilesToRender.length;o++){const r=e.scene.globe._surface._tilesToRender[o];if(r.data)for(let a=0;a<r.data.imagery.length;a++){const s=r.data.imagery[a],l=s.loadingImagery??s.readyImagery;if(l){const u=`${l.level}-${l.x}-${l.y}`;i.add(u)}}}this.vectorTilesCache.update(Array.from(i))}}const Lc=class Lc extends Hn{constructor(e,i){super(e,i);L(this,"_czmImagery");L(this,"_mvtLayerJson",this.disposeVar(c.reactJson({mainJson:"",pointJson:[],otherJson:[]})));L(this,"mvtLayerJsonChanged",this.ad(new c.Event));if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"alpha"],[e,"opacity"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"]));{const s=this.dv(c.createNextAnimateFrameEvent(e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.schemeChanged,this.mvtLayerJsonChanged)),l=()=>{!this.mvtLayerJson||this.mvtLayerJson.otherJson.length==0||(r.imageryProvider={type:"MVTImageryProvider",url:this.mvtLayerJson.mainJson,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:this.mvtLayerJson.otherJson,scheme:e.scheme})};l(),this.d(s.don(l))}{const s=A=>{const h=structuredClone(A);Reflect.deleteProperty(h,"layers"),this.mvtLayerJson={mainJson:h,pointJson:A.layers.filter(f=>f.type=="symbol"),otherJson:A.layers.filter(f=>f.type!="symbol")}},l=async()=>{var A;if(typeof e.url=="string")if(e.url.includes("{z}"))this.mvtLayerJson.mainJson=e.url;else{const h=await fetch(e.url);if((A=h.headers.get("Content-Type"))!=null&&A.includes("json")){const f=await h.json();s(f)}}else s(e.url);e.style&&e.style.length!=0&&(this.mvtLayerJson.pointJson=e.style.filter(h=>h.type=="symbol"),this.mvtLayerJson.otherJson=e.style.filter(h=>h.type!="symbol")),this.mvtLayerJsonChanged.emit()};l();const u=this.ad(c.createNextAnimateFrameEvent(e.urlChanged,e.styleChanged));this.ad(u.don(l))}const a=this.ad(c.createNextAnimateFrameEvent(e.schemeChanged,e.maximumLevelChanged,e.minimumLevelChanged,this.mvtLayerJsonChanged,e.showChanged));this.ad(new c.ObjResettingWithEvent(a,()=>{if(e.show)return new KL(i,this)}))}get czmImagery(){return this._czmImagery}get mvtLayerJson(){return this._mvtLayerJson.value}set mvtLayerJson(e){this._mvtLayerJson.value=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Lc,"type",Lc.register("ESCesiumViewer",mf.type,Lc));let ey=Lc;class ZL extends c.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 a=i.points.length;let s=[],l=[],u=[],A=[],h=[];for(let y=0;y<a-1;y++){const{outlinePionts:g,customPrimitivePoints:_}=this.divideFourPoints(i.points[y],i.points[y+1]);A.push(..._),h.push(...g),u.push(...this.setIndexs(y))}const[f,p,d]=wn({originPosition:A[0]},A),m=this.setFaces(f);s.push(...m.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(r,p,s,u,l)}divideFourPoints(n,e){const i=c.geoHeading(n,e),o=c.geoDestination(n,this._sceneObject.width/2,90+i),r=c.geoDestination(n,this._sceneObject.width/2,i-90),a=c.geoDestination(e,this._sceneObject.width/2,i-90),s=c.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],A=[r[0],r[1],r[2]+this._sceneObject.height/2],h=[r[0],r[1],r[2]-this._sceneObject.height/2],f=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],d=[a[0],a[1],a[2]+this._sceneObject.height/2],m=[a[0],a[1],a[2]-this._sceneObject.height/2],v=[[l,A],[l,f],[l,u],[u,p]],y=[[u,h],[A,d],[A,h],[h,m]],g=[[f,p],[f,d],[p,m],[d,m]];return{outlinePionts:[...v,...y,...g],customPrimitivePoints:[u,l,A,h,p,f,d,m]}}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 a=n.slice(8*r,8*(r+1));e.push(a)}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]=wn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,u,A,h)=>{if(A===0)return l.push(0),l;const f=A-1,p=h[f],d=Math.sqrt((p[0]-u[0])*(p[0]-u[0])+(p[1]-u[1])*(p[1]-u[1]));return l.push(l[f]+d),l},[]),a=r[o-1];return e.distances=a,r.map(l=>l/a)}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 a=[];if(r===i.length-1){const s=[1,0,1,1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}else{const s=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}o.push(a)}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 zc=class zc extends sn{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Ye(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new ft(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new ut(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(c.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,a=this._line;this.d(c.bind([a,"positions"],[e,"points"])),this.d(c.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(c.track([this.line,"color"],[e,"strokeColor"])),this.d(c.track([this.line,"width"],[e,"strokeWidth"])),this.d(c.track([this.line,"ground"],[e,"strokeGround"]));{const A=this.dv(c.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new c.ObjResettingWithEvent(A,()=>new ZL(this,this.sceneObject)))}{const A=()=>{a.show=e.show&&e.stroked};A();const h=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(h.don(A))}this.bindCustomPrimitive(e);let s="";const l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const A=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?s=u:e.materialMode==="color"?s="":s=l,r.uri=s,s==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
3597
|
+
`};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(s.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{this.czmCustomPrimitive.flyTo(a)}));{const a=()=>{const l=r.value?r.value:1,u=this.height??pr.defaults.height,{textureSizeInMeters:A=pr.defaults.textureSizeInMeters}=this,{textureUri:h=pr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:h},u_stScale:[l/A[0],u/A[1]],u_speed:this.textureMoveSpeed??pr.defaults.textureMoveSpeed,u_color:this.textureColor??pr.defaults.textureColor}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(s.disposableOn(a))}}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(pr,"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 $o=pr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),height:void 0,textureSizeInMeters:c.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:c.reactArrayWithUndefined(void 0),textureColor:c.reactArrayWithUndefined(void 0)})})($o||($o={})),c.extendClassProps($o.prototype,$o.createDefaultProps);const Tc=class Tc extends sn{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new $o(i,e.id)),this._czmPolygon=this.dv(new c.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,a=this._czmPolygon;i.add(a),this.dispose(()=>i.delete(a)),a.filled=!1,this.d(c.track([a,"points"],[e,"points"])),this.d(c.track([a,"stroked"],[e,"stroked"])),this.d(c.track([a,"strokeColor"],[e,"strokeColor"])),this.d(c.track([a,"strokeWidth"],[e,"strokeWidth"])),this.d(c.track([a,"strokeGround"],[e,"strokeGround"]));{const s={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=(f,p)=>{switch(f){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:[p,p]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[p,p]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[p*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",A=()=>{const f=e.materialMode,p=s[f];if(!p)return;r.textureUri=u+p.image,r.textureColor=f!=="gradientColor"?p.color:e.fillColor;const{textureMoveSpeed:d,textureSizeInMeters:m}=l(f,e.height);r.textureMoveSpeed=d,r.textureSizeInMeters=m};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(h.disposableOn(A))}{this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"height"],[e,"height"]));{const s=()=>{r.show=e.show&&e.filled};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(s))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(bn(r,o,i,e,a.czmCustomPrimitive),!0):!1}};L(Tc,"type",Tc.register("ESCesiumViewer",c.ESPolygonFence.type,Tc));let Hg=Tc;const Ic=class Ic extends sn{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(c.bind([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(c.bind([r,"height"],[e,"height"])),this.dispose(c.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(c.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(c.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"]));{const a=()=>{const s=e.points;if(s&&s.length>=2){const{minPos:l,maxPos:u}=c.getMinMaxCorner(s);r.rectangle=[l[0],l[1],u[0],u[1]],r.height=s[1][2],r.extrudedHeight=s[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}};L(Ic,"type",Ic.register("ESCesiumViewer",c.ESRectangle.type,Ic));let Gg=Ic;const uo=class uo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],uo.defaults.imageUrl),a=this.disposeVar(c.react(void 0)),s=()=>{const g=b.Material.fromType(b.Material.ImageType);g.uniforms.image=r.value,g.uniforms.repeat=Ze(this.repeat??uo.defaults.repeat),a.value=g};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(s));const u=(g,_)=>{const x=new b.PolylineMaterialAppearance({material:_,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const E=[];if(g.length<2)return;E.push(new b.GeometryInstance({geometry:new b.GroundPolylineGeometry({positions:g,width:this.width??uo.defaults.width,vertexFormat:b.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:b.ArcType[this.arcType??uo.defaults.arcType]}),id:this}));const B=new Bi({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??uo.defaults.allowPicking,compressVertices:!1});return B.ESSceneObjectID=i,B};let A;const h=new b.BoundingSphere,f=()=>{A&&(o.scene.primitives.remove(A),A=void 0)};this.dispose(f);const p=()=>{if(f(),!this.positions)return;const g=Yt(this.positions);if(g.length<2||!a.value){h.radius=-1;return}b.BoundingSphere.fromPoints(g,h),A=u(g,a.value),A&&o.scene.primitives.add(A)},d=()=>{A&&(A.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(g=>{if(e.actived&&h.radius>0){const _=De(h.center);_&&Fe(o,_,h.radius*4,void 0,g)}})),p(),d();const m=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,a.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(m.disposableOn(()=>{p(),d()}));const v=this.disposeVar(c.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(uo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Xo=uo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Xo||(Xo={})),c.extendClassProps(Xo.prototype,Xo.createDefaultProps);const Fc=class Fc extends sn{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Xo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"width"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Fc,"type",Fc.register("ESCesiumViewer",xf.type,Fc));let Wg=Fc;const Mc=class Mc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.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 c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const m=()=>{A.style.display=e.show??c.ESScale.defaults.show?"block":"none"};m(),e.dispose(e.showChanged.disposableOn(m))}A.style.position="fixed",A.style.width="125px",A.style.height="30px",A.style.border="1px solid rgba(49,50,56,.8)",A.style.padding="0 5px",A.style.backgroundColor="rgba(37,38,42,.8)",A.style.borderRadius="15px",A.style.pointerEvents="auto",A.style.transition=" right 0.4s linear";{const m=()=>{A.style.bottom=`${e.cssPosition?e.cssPosition[0]:c.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(A.style.right="auto",A.style.left=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`):(A.style.left="auto",A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(c.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));m(),this.dispose(v.disposableOn(()=>m()))}const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="125px",h.style.display="inline-block",h.style.textAlign="center",h.style.fontSize="14px",h.style.fontWeight="lighter",h.style.lineHeight="30px",h.style.color="#fff",h.innerHTML="1000km";const f=document.createElement("div");A.appendChild(f),this.dispose(()=>A.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left="30px";const p=()=>{const m=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||m&&m>1e6)A.style.display="none";else{A.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(h.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){f.style.width=`${y}px`;const g=(135-y)/2;f.style.left=`${g}px`}}};p();const d=setInterval(()=>{p()},200);this.dispose(()=>clearInterval(d))}}}get customDiv(){return this._customDiv}};L(Mc,"type",Mc.register("ESCesiumViewer",c.ESScale.type,Mc));let jg=Mc;const Dc=class Dc extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new ut(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Dt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(c.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(c.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(c.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(c.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(c.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(c.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(c.track([r,"cull"],[e,"cull"])),this.dispose(c.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(c.track([r,"pass"],[e,"pass"])),this.dispose(c.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(c.track([r,"renderState"],[e,"renderState"])),this.dispose(c.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(c.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(c.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(c.track([r,"attributes"],[e,"attributes"])),this.dispose(c.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(c.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(c.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(c.track([r,"count"],[e,"count"])),this.dispose(c.track([r,"offset"],[e,"offset"])),this.dispose(c.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(c.track([r,"localPosition"],[e,"localPosition"])),this.dispose(c.track([r,"localScale"],[e,"localScale"])),this.dispose(c.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(c.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(c.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(c.track([r,"occlude"],[e,"occlude"])),this.dispose(c.track([r,"castShadows"],[e,"castShadows"])),this.dispose(c.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(c.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(c.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(c.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const a=()=>{if(e.localRotation){const s=[...e.localRotation];s[0]-=90,r.localRotation=s}else r.localRotation=[-90,0,0]};a(),this.dispose(e.localRotationChanged.disposableOn(a))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(bn(r,o,i,e,a,!0),!0):!1}};L(Dc,"type",Dc.register("ESCesiumViewer",wf.type,Dc));let qg=Dc;const Rc=class Rc extends df{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Ot(i.viewer))return;this.czmGeoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{czmGeoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??c.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESDynamicWater.defaults.flowSpeed});else{const A=Object.assign({},Rh[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=e.show&&e.stroked},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=!!(e.show&&e.filled)},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){a.positions=[],s.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const A=e.points.map(f=>[f[0],f[1],0]),[h]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},A);a.positions=[...h,h[0]],s.points=[...h]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Mn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&a),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a!=null&&a.points?(Me(r,o,i,a.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(Rc,"type",Rc.register("ESCesiumViewer",c.ESDynamicWater.type,Rc));let Kg=Rc;const it=class it extends Hn{constructor(e,i){super(e,i);L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_pointFeatures",this.disposeVar(c.reactJsonWithUndefined(void 0)));L(this,"featureArrName","features");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=Ot(o);if(!r)return;const{screenManager:a}=r,s={scale:1*it.scaleFactor,font:"16px sans-serif",verticalOrigin:b.VerticalOrigin.BOTTOM,horizontalOrigin:b.HorizontalOrigin.CENTER,scaleByDistance:it.scaleByDistance,eyeOffset:new b.Cartesian3(0,0,-10),show:!0},l={scale:1*it.scaleFactor,verticalOrigin:b.VerticalOrigin.BOTTOM,horizontalOrigin:b.HorizontalOrigin.CENTER,scaleByDistance:it.scaleByDistance,image:it.clusterImageUrl};(async()=>{if(it.clusterImageAttribute===void 0){const u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(u).then(A=>A.json()).then(A=>{it.clusterImageAttribute=A}).catch(A=>{console.error(A)})}{const u=()=>{if(!e.data){this.pointFeatures=void 0;return}this.featureArrName=e.data.type=="FeatureCollection"?"features":"geometries";const A={type:e.data.type,[this.featureArrName]:[]};if(e.data.type==="FeatureCollection")for(let h=0;h<e.data.features.length;h++){const f=e.data.features[h];if(f.geometry.type=="Point")A[this.featureArrName].push(f);else if(f.geometry.type=="MultiPoint")for(let p=0;p<f.geometry.coordinates.length;p++)A[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.geometry.coordinates[p]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.geometry.type)}else if(e.data.type=="GeometryCollection")for(let h=0;h<e.data.geometries.length;h++){const f=e.data.geometries[h];if(f.type=="Point")A[this.featureArrName].push(f);else if(f.type=="MultiPoint")for(let p=0;p<f.coordinates.length;p++)A[this.featureArrName].push({type:"Feature",geometry:{type:"Point",coordinates:f.coordinates[p]},properties:f.properties??{}});else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",f.type)}this.pointFeatures=A};u(),this.ad(e.dataChanged.don(u))}{const u=()=>{this.dataSource&&o.dataSources.remove(this.dataSource),this.dataSource=void 0};this.ad(()=>u());const A=()=>{u(),this.pointFeatures&&b.GeoJsonDataSource.load(this.pointFeatures).then(h=>{o.dataSources.add(h).then(()=>{this.dataSource=h})})};A(),this.ad(this.pointFeaturesChanged.don(A))}this.ad(new c.ObjResettingWithEvent(this.dataSourceChanged,()=>{var d;if(!this.dataSource)return;const u=new c.Destroyable,A=this.dataSource;A.clustering.enabled=A.clustering.clusterBillboards=A.clustering.clusterLabels=A.clustering.clusterPoints=!0;for(let m=0;m<A.entities.values.length;m++){const v=A.entities.values[m];v.billboard&&(v.billboard.color=new b.ConstantProperty(b.Color.TRANSPARENT))}{const m=()=>{const y=A.clustering.pixelRange;A.clustering.pixelRange=0,A.clustering.pixelRange=y};m();let v=(d=this.czmViewer.viewer)==null?void 0:d.camera.moveEnd.addEventListener(()=>{m()});u.d(()=>{var y;v&&((y=this.czmViewer.viewer)==null||y.camera.moveEnd.removeEventListener(v))})}u.d(c.track([A.clustering,"pixelRange"],[e,"pixelRange"])),u.d(c.track([A.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),A.clustering.clusterEvent.addEventListener((m,v)=>{v.label&&(v.label.show=!1),v.billboard&&(v.billboard.show=!1),v.point&&(v.point.show=!1)});const h=u.ad(c.react(!1));let f=[];const p=o.scene.postUpdate.addEventListener(()=>{if(A.clustering._clusterLabelCollection)if(A.clustering._clusterLabelCollection._labels.length!=f.length||!A.clustering._clusterLabelCollection._labels.every(m=>f.includes(m.id.length))){f=[];for(let m=0;m<A.clustering._clusterLabelCollection._labels.length;m++){const v=A.clustering._clusterLabelCollection._labels[m];f.push(v.id.length)}h.value=!0}else h.value=!1});u.ad(()=>p());{let m={id:"",layer:"",screenObjectIds:[]},v={id:"",layer:"",screenObjectIds:[]};const y=()=>{m&&(a.remove(m.layer,m.id,{label:m.screenObjectIds}),m={id:"",layer:"",screenObjectIds:[]}),v&&(a.remove(v.layer,v.id,{billboard:v.screenObjectIds}),v={id:"",layer:"",screenObjectIds:[]})};u.ad(()=>{y()});const g=()=>{var F,S,T,w,C,M;if(y(),!e.show||!it.clusterImageAttribute)return;const x=e.style??c.ESEntityCluster.defaults.style,E=it.clusterImageAttribute[((F=x.nonCluster)==null?void 0:F.mode)??"SquareH01"],B=[-E.anchorPixelOffset[0]+E.textPixelOffset[0],-E.anchorPixelOffset[1]-E.textPixelOffset[1]],P={...s,pixelOffset:new b.Cartesian2(B[0]*it.scaleFactor,B[1]*it.scaleFactor),heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()]},I={...l,width:E.imageSize[0],height:E.imageSize[1],heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new b.Cartesian2(-E.anchorPixelOffset[0]*it.scaleFactor,-E.anchorPixelOffset[1]*it.scaleFactor),imageSubRegion:new b.BoundingRectangle(...E.imagePixelOffset,...E.imageSize)},D=new Map;if(A.clustering._clusterLabelCollection)for(let R=0;R<A.clustering._clusterLabelCollection._labels.length;R++){const U=A.clustering._clusterLabelCollection._labels[R];if(!it.clusterImageAttribute)continue;const O=U.text,z=De(U.position),k={index:U.id.map(le=>A.entities.values.length-1-A.clustering._collectionIndicesByEntity[le.id].billboardIndex).sort((le,ue)=>le-ue),name:O,position:z},Q=this.getClusterStyle(x.cluster??c.ESEntityCluster.defaults.style.cluster,U.id.length).mode,V=it.clusterImageAttribute[Q],j=[-V.anchorPixelOffset[0]+V.textPixelOffset[0],-V.anchorPixelOffset[1]-V.textPixelOffset[1]],J={...s,pixelOffset:new b.Cartesian2(j[0]*it.scaleFactor,j[1]*it.scaleFactor),heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()]},ee={...l,width:V.imageSize[0],height:V.imageSize[1],heightReference:b.HeightReference[(e.heightReference??c.ESEntityCluster.defaults.heightReference).toUpperCase()],pixelOffset:new b.Cartesian2(-V.anchorPixelOffset[0]*it.scaleFactor,-V.anchorPixelOffset[1]*it.scaleFactor),imageSubRegion:new b.BoundingRectangle(...V.imagePixelOffset,...V.imageSize)},ie=a.addImage(e.id,e.typeName,ee,k),oe=a.addLabel(e.id,e.typeName,J,k);v.id=ie.id,v.layer=ie.layer,v.screenObjectIds.push(ie.screenObjectId),m.id=oe.id,m.layer=oe.layer,m.screenObjectIds.push(oe.screenObjectId);for(let le=0;le<U.id.length;le++)D.set(U.id[le].id,1)}for(let R=0;R<A.entities.values.length;R++){const U=A.entities.values[R];if(D.has(U.id)||!this.pointFeatures||!i.isPointVisible(De((S=U.position)==null?void 0:S.getValue())))continue;const O=((T=this.pointFeatures[this.featureArrName][R])==null?void 0:T.coordinates)??((w=this.pointFeatures[this.featureArrName][R])==null?void 0:w.geometry.coordinates),z=((C=this.pointFeatures[this.featureArrName][R])==null?void 0:C.name)??((M=this.pointFeatures[this.featureArrName][R].properties)==null?void 0:M.name)??(R+1).toString(),k={index:R,name:z,position:O},Q=a.addImage(e.id,e.typeName,I,k),V=a.addLabel(e.id,e.typeName,P,k);v.id=Q.id,v.layer=Q.layer,v.screenObjectIds.push(Q.screenObjectId),m.id=V.id,m.layer=V.layer,m.screenObjectIds.push(V.screenObjectId)}};g();const _=u.ad(c.createNextAnimateFrameEvent(e.showChanged,e.styleChanged,e.heightReferenceChanged,h.changed));u.ad(_.don(g))}return u}))})()}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}get dataSourceChanged(){return this._dataSource.changed}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}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,a=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&a})}};L(it,"type",it.register("ESCesiumViewer",c.ESEntityCluster.type,it)),L(it,"scaleFactor",.6),L(it,"scaleByDistance",new b.NearFarScalar(100,1,1e3,1)),L(it,"clusterImages"),L(it,"clusterImageAttribute"),L(it,"clusterImageUrl",c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"));let Zg=it;const Uc=class Uc extends Hn{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(Uc,"type",Uc.register("ESCesiumViewer",gf.type,Uc));let $g=Uc;const Oc=class Oc extends Ln{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Ot(i.viewer))return;this.geoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Ro(i,e.id));const{geoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??c.ESGeoWater.defaults.waterColor,frequency:(e.frequency??c.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??c.ESGeoWater.defaults.waterImage});else{const A=Object.assign({},Rh[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=!!(e.show&&e.stroked)},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=e.show&&e.filled},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(a.positions=[...e.points,e.points[0]],s.points=[...e.points]):(a.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],s.points=[])};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(l))}this.ad(e.editingChanged.don(l=>{s.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(Oc,"type",Oc.register("ESCesiumViewer",c.ESGeoWater.type,Oc));let Xg=Oc;const Yg=65536*65536,o_=1/Yg,wL=12,s_=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Jg=0,Sf=1,eu=2,Ef=5;class bL{constructor(n=new Uint8Array(16)){this.buf=ArrayBuffer.isView(n)?n:new Uint8Array(n),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(n,e,i=this.length){for(;this.pos<i;){const o=this.readVarint(),r=o>>3,a=this.pos;this.type=o&7,n(r,e,this),this.pos===a&&this.skip(o)}return e}readMessage(n,e){return this.readFields(n,e,this.readVarint()+this.pos)}readFixed32(){const n=this.dataView.getUint32(this.pos,!0);return this.pos+=4,n}readSFixed32(){const n=this.dataView.getInt32(this.pos,!0);return this.pos+=4,n}readFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*Yg;return this.pos+=8,n}readSFixed64(){const n=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*Yg;return this.pos+=8,n}readFloat(){const n=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,n}readDouble(){const n=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,n}readVarint(n){const e=this.buf;let i,o;return o=e[this.pos++],i=o&127,o<128||(o=e[this.pos++],i|=(o&127)<<7,o<128)||(o=e[this.pos++],i|=(o&127)<<14,o<128)||(o=e[this.pos++],i|=(o&127)<<21,o<128)?i:(o=e[this.pos],i|=(o&15)<<28,xL(i,n,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){const n=this.readVarint();return n%2===1?(n+1)/-2:n/2}readBoolean(){return!!this.readVarint()}readString(){const n=this.readVarint()+this.pos,e=this.pos;return this.pos=n,n-e>=wL&&s_?s_.decode(this.buf.subarray(e,n)):UL(this.buf,e,n)}readBytes(){const n=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,n);return this.pos=n,e}readPackedVarint(n=[],e){const i=this.readPackedEnd();for(;this.pos<i;)n.push(this.readVarint(e));return n}readPackedSVarint(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSVarint());return n}readPackedBoolean(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readBoolean());return n}readPackedFloat(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFloat());return n}readPackedDouble(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readDouble());return n}readPackedFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed32());return n}readPackedSFixed32(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed32());return n}readPackedFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readFixed64());return n}readPackedSFixed64(n=[]){const e=this.readPackedEnd();for(;this.pos<e;)n.push(this.readSFixed64());return n}readPackedEnd(){return this.type===eu?this.readVarint()+this.pos:this.pos+1}skip(n){const e=n&7;if(e===Jg)for(;this.buf[this.pos++]>127;);else if(e===eu)this.pos=this.readVarint()+this.pos;else if(e===Ef)this.pos+=4;else if(e===Sf)this.pos+=8;else throw new Error(`Unimplemented type: ${e}`)}writeTag(n,e){this.writeVarint(n<<3|e)}realloc(n){let e=this.length||16;for(;e<this.pos+n;)e*=2;if(e!==this.length){const i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.dataView=new DataView(i.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeSFixed32(n){this.realloc(4),this.dataView.setInt32(this.pos,n,!0),this.pos+=4}writeFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*o_),!0),this.pos+=8}writeSFixed64(n){this.realloc(8),this.dataView.setInt32(this.pos,n&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(n*o_),!0),this.pos+=8}writeVarint(n){if(n=+n||0,n>268435455||n<0){_L(n,this);return}this.realloc(4),this.buf[this.pos++]=n&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=(n>>>=7)&127|(n>127?128:0),!(n<=127)&&(this.buf[this.pos++]=n>>>7&127)))}writeSVarint(n){this.writeVarint(n<0?-n*2-1:n*2)}writeBoolean(n){this.writeVarint(+n)}writeString(n){n=String(n),this.realloc(n.length*4),this.pos++;const e=this.pos;this.pos=OL(this.buf,n,this.pos);const i=this.pos-e;i>=128&&a_(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(n){this.realloc(4),this.dataView.setFloat32(this.pos,n,!0),this.pos+=4}writeDouble(n){this.realloc(8),this.dataView.setFloat64(this.pos,n,!0),this.pos+=8}writeBytes(n){const e=n.length;this.writeVarint(e),this.realloc(e);for(let i=0;i<e;i++)this.buf[this.pos++]=n[i]}writeRawMessage(n,e){this.pos++;const i=this.pos;n(e,this);const o=this.pos-i;o>=128&&a_(i,o,this),this.pos=i-1,this.writeVarint(o),this.pos+=o}writeMessage(n,e,i){this.writeTag(n,eu),this.writeRawMessage(e,i)}writePackedVarint(n,e){e.length&&this.writeMessage(n,EL,e)}writePackedSVarint(n,e){e.length&&this.writeMessage(n,PL,e)}writePackedBoolean(n,e){e.length&&this.writeMessage(n,IL,e)}writePackedFloat(n,e){e.length&&this.writeMessage(n,BL,e)}writePackedDouble(n,e){e.length&&this.writeMessage(n,TL,e)}writePackedFixed32(n,e){e.length&&this.writeMessage(n,FL,e)}writePackedSFixed32(n,e){e.length&&this.writeMessage(n,ML,e)}writePackedFixed64(n,e){e.length&&this.writeMessage(n,DL,e)}writePackedSFixed64(n,e){e.length&&this.writeMessage(n,RL,e)}writeBytesField(n,e){this.writeTag(n,eu),this.writeBytes(e)}writeFixed32Field(n,e){this.writeTag(n,Ef),this.writeFixed32(e)}writeSFixed32Field(n,e){this.writeTag(n,Ef),this.writeSFixed32(e)}writeFixed64Field(n,e){this.writeTag(n,Sf),this.writeFixed64(e)}writeSFixed64Field(n,e){this.writeTag(n,Sf),this.writeSFixed64(e)}writeVarintField(n,e){this.writeTag(n,Jg),this.writeVarint(e)}writeSVarintField(n,e){this.writeTag(n,Jg),this.writeSVarint(e)}writeStringField(n,e){this.writeTag(n,eu),this.writeString(e)}writeFloatField(n,e){this.writeTag(n,Ef),this.writeFloat(e)}writeDoubleField(n,e){this.writeTag(n,Sf),this.writeDouble(e)}writeBooleanField(n,e){this.writeVarintField(n,+e)}}function xL(t,n,e){const i=e.buf;let o,r;if(r=i[e.pos++],o=(r&112)>>4,r<128||(r=i[e.pos++],o|=(r&127)<<3,r<128)||(r=i[e.pos++],o|=(r&127)<<10,r<128)||(r=i[e.pos++],o|=(r&127)<<17,r<128)||(r=i[e.pos++],o|=(r&127)<<24,r<128)||(r=i[e.pos++],o|=(r&1)<<31,r<128))return ya(t,o,n);throw new Error("Expected varint not more than 10 bytes")}function ya(t,n,e){return e?n*4294967296+(t>>>0):(n>>>0)*4294967296+(t>>>0)}function _L(t,n){let e,i;if(t>=0?(e=t%4294967296|0,i=t/4294967296|0):(e=~(-t%4294967296),i=~(-t/4294967296),e^4294967295?e=e+1|0:(e=0,i=i+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),CL(e,i,n),SL(i,n)}function CL(t,n,e){e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos++]=t&127|128,t>>>=7,e.buf[e.pos]=t&127}function SL(t,n){const e=(t&7)<<4;n.buf[n.pos++]|=e|((t>>>=3)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127|((t>>>=7)?128:0),t&&(n.buf[n.pos++]=t&127)))))}function a_(t,n,e){const i=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(Math.LN2*7));e.realloc(i);for(let o=e.pos-1;o>=t;o--)e.buf[o+i]=e.buf[o]}function EL(t,n){for(let e=0;e<t.length;e++)n.writeVarint(t[e])}function PL(t,n){for(let e=0;e<t.length;e++)n.writeSVarint(t[e])}function BL(t,n){for(let e=0;e<t.length;e++)n.writeFloat(t[e])}function TL(t,n){for(let e=0;e<t.length;e++)n.writeDouble(t[e])}function IL(t,n){for(let e=0;e<t.length;e++)n.writeBoolean(t[e])}function FL(t,n){for(let e=0;e<t.length;e++)n.writeFixed32(t[e])}function ML(t,n){for(let e=0;e<t.length;e++)n.writeSFixed32(t[e])}function DL(t,n){for(let e=0;e<t.length;e++)n.writeFixed64(t[e])}function RL(t,n){for(let e=0;e<t.length;e++)n.writeSFixed64(t[e])}function UL(t,n,e){let i="",o=n;for(;o<e;){const r=t[o];let a=null,s=r>239?4:r>223?3:r>191?2:1;if(o+s>e)break;let l,u,A;s===1?r<128&&(a=r):s===2?(l=t[o+1],(l&192)===128&&(a=(r&31)<<6|l&63,a<=127&&(a=null))):s===3?(l=t[o+1],u=t[o+2],(l&192)===128&&(u&192)===128&&(a=(r&15)<<12|(l&63)<<6|u&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(l=t[o+1],u=t[o+2],A=t[o+3],(l&192)===128&&(u&192)===128&&(A&192)===128&&(a=(r&15)<<18|(l&63)<<12|(u&63)<<6|A&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,i+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),i+=String.fromCharCode(a),o+=s}return i}function OL(t,n,e){for(let i=0,o,r;i<n.length;i++){if(o=n.charCodeAt(i),o>55295&&o<57344)if(r)if(o<56320){t[e++]=239,t[e++]=191,t[e++]=189,r=o;continue}else o=r-55296<<10|o-56320|65536,r=null;else{o>56319||i+1===n.length?(t[e++]=239,t[e++]=191,t[e++]=189):r=o;continue}else r&&(t[e++]=239,t[e++]=191,t[e++]=189,r=null);o<128?t[e++]=o:(o<2048?t[e++]=o>>6|192:(o<65536?t[e++]=o>>12|224:(t[e++]=o>>18|240,t[e++]=o>>12&63|128),t[e++]=o>>6&63|128),t[e++]=o&63|128)}return e}function Yr(t,n){this.x=t,this.y=n}Yr.prototype={clone(){return new Yr(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,n){return this.clone()._rotateAround(t,n)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){const n=t.x-this.x,e=t.y-this.y;return n*n+e*e},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult(t){const n=t[0]*this.x+t[1]*this.y,e=t[2]*this.x+t[3]*this.y;return this.x=n,this.y=e,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){const t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){const n=Math.cos(t),e=Math.sin(t),i=n*this.x-e*this.y,o=e*this.x+n*this.y;return this.x=i,this.y=o,this},_rotateAround(t,n){const e=Math.cos(t),i=Math.sin(t),o=n.x+e*(this.x-n.x)-i*(this.y-n.y),r=n.y+i*(this.x-n.x)+e*(this.y-n.y);return this.x=o,this.y=r,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Yr},Yr.convert=function(t){if(t instanceof Yr)return t;if(Array.isArray(t))return new Yr(+t[0],+t[1]);if(t.x!==void 0&&t.y!==void 0)return new Yr(+t.x,+t.y);throw new Error("Expected [x, y] or {x, y} point format")};class l_{constructor(n,e,i,o,r){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=n,this._geometry=-1,this._keys=o,this._values=r,n.readFields(LL,this,e)}loadGeometry(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos,i=[];let o,r=1,a=0,s=0,l=0;for(;n.pos<e;){if(a<=0){const u=n.readVarint();r=u&7,a=u>>3}if(a--,r===1||r===2)s+=n.readSVarint(),l+=n.readSVarint(),r===1&&(o&&i.push(o),o=[]),o&&o.push(new Yr(s,l));else if(r===7)o&&o.push(o[0].clone());else throw new Error(`unknown command ${r}`)}return o&&i.push(o),i}bbox(){const n=this._pbf;n.pos=this._geometry;const e=n.readVarint()+n.pos;let i=1,o=0,r=0,a=0,s=1/0,l=-1/0,u=1/0,A=-1/0;for(;n.pos<e;){if(o<=0){const h=n.readVarint();i=h&7,o=h>>3}if(o--,i===1||i===2)r+=n.readSVarint(),a+=n.readSVarint(),r<s&&(s=r),r>l&&(l=r),a<u&&(u=a),a>A&&(A=a);else if(i!==7)throw new Error(`unknown command ${i}`)}return[s,u,l,A]}toGeoJSON(n,e,i){const o=this.extent*Math.pow(2,i),r=this.extent*n,a=this.extent*e,s=this.loadGeometry();function l(f){return[(f.x+r)*360/o-180,360/Math.PI*Math.atan(Math.exp((1-(f.y+a)*2/o)*Math.PI))-90]}function u(f){return f.map(l)}let A;if(this.type===1){const f=[];for(const d of s)f.push(d[0]);const p=u(f);A=f.length===1?{type:"Point",coordinates:p[0]}:{type:"MultiPoint",coordinates:p}}else if(this.type===2){const f=s.map(u);A=f.length===1?{type:"LineString",coordinates:f[0]}:{type:"MultiLineString",coordinates:f}}else if(this.type===3){const f=kL(s),p=[];for(const d of f)p.push(d.map(u));A=p.length===1?{type:"Polygon",coordinates:p[0]}:{type:"MultiPolygon",coordinates:p}}else throw new Error("unknown feature type");const h={type:"Feature",geometry:A,properties:this.properties};return this.id!=null&&(h.id=this.id),h}}l_.types=["Unknown","Point","LineString","Polygon"];function LL(t,n,e){t===1?n.id=e.readVarint():t===2?zL(e,n):t===3?n.type=e.readVarint():t===4&&(n._geometry=e.pos)}function zL(t,n){const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=n._keys[t.readVarint()],o=n._values[t.readVarint()];n.properties[i]=o}}function kL(t){const n=t.length;if(n<=1)return[t];const e=[];let i,o;for(let r=0;r<n;r++){const a=QL(t[r]);a!==0&&(o===void 0&&(o=a<0),o===a<0?(i&&e.push(i),i=[t[r]]):i&&i.push(t[r]))}return i&&e.push(i),e}function QL(t){let n=0;for(let e=0,i=t.length,o=i-1,r,a;e<i;o=e++)r=t[e],a=t[o],n+=(a.x-r.x)*(r.y+a.y);return n}class VL{constructor(n,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=n,this._keys=[],this._values=[],this._features=[],n.readFields(NL,this,e),this.length=this._features.length}feature(n){if(n<0||n>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[n];const e=this._pbf.readVarint()+this._pbf.pos;return new l_(this._pbf,e,this.extent,this._keys,this._values)}}function NL(t,n,e){t===15?n.version=e.readVarint():t===1?n.name=e.readString():t===5?n.extent=e.readVarint():t===2?n._features.push(e.pos):t===3?n._keys.push(e.readString()):t===4&&n._values.push(HL(e))}function HL(t){let n=null;const e=t.readVarint()+t.pos;for(;t.pos<e;){const i=t.readVarint()>>3;n=i===1?t.readString():i===2?t.readFloat():i===3?t.readDouble():i===4?t.readVarint64():i===5?t.readVarint():i===6?t.readSVarint():i===7?t.readBoolean():null}if(n==null)throw new Error("unknown feature value");return n}class GL{constructor(n,e){this.layers=n.readFields(WL,{},e)}}function WL(t,n,e){if(t===3){const i=new VL(e,e.readVarint()+e.pos);i.length&&(n[i.name]=i)}}function jL(t){let n,e;if(Reflect.has(t,"type")&&t.type==="symbol"&&Reflect.has(t,"layout")){const i=t.layout;e={},e.image=i["icon-image"]??c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/location.png");const{horizontalOrigin:o,verticalOrigin:r}=u_(i["icon-anchor"]??"right");if(e.horizontalOrigin=o,e.verticalOrigin=r,Reflect.has(t,"paint")){const a=t.paint;e.color=b.Color.fromCssColorString(a["icon-color"]??"#FFFFFF").withAlpha(a["icon-opacity"]??1)}if(e.rotation=b.Math.toRadians(i["icon-rotate"]??0),e.scale=i["icon-size"]??.5,e.width=i["icon-width"]??64,e.height=i["icon-height"]??64,e.pixelOffset=new b.Cartesian2(0,-25),e.pixelOffsetScaleByDistance=new b.NearFarScalar(150,1,8e6,0),e.show=(i.visibility??"visible")==="visible",Reflect.has(i,"text-field")){n={},n.text=i["text-field"];const{horizontalOrigin:a,verticalOrigin:s}=u_(i["text-anchor"]??"left");if(n.horizontalOrigin=a,n.verticalOrigin=s,Reflect.has(t,"paint")){const l=t.paint;n.fillColor=b.Color.fromCssColorString(l["text-color"]??"#FFFFFF").withAlpha(l["text-opacity"]??1)}n.font=`${i["text-size"]??16}px ${i["text-font"]??"sans-serif"}`,n.show=(i.visibility??"visible")==="visible",n.pixelOffset=new b.Cartesian2(0,-25),n.pixelOffsetScaleByDistance=new b.NearFarScalar(150,1,8e6,0)}}return{labelStyle:n,billboardStyle:e}}function u_(t){let n=b.HorizontalOrigin.CENTER,e=b.VerticalOrigin.CENTER;switch(t){case"center":break;case"left":n=b.HorizontalOrigin.LEFT;break;case"right":n=b.HorizontalOrigin.RIGHT;break;case"top":e=b.VerticalOrigin.TOP;break;case"bottom":e=b.VerticalOrigin.BOTTOM;break;case"top-left":n=b.HorizontalOrigin.LEFT,e=b.VerticalOrigin.TOP;break;case"top-right":n=b.HorizontalOrigin.RIGHT,e=b.VerticalOrigin.TOP;break;case"bottom-left":n=b.HorizontalOrigin.LEFT,e=b.VerticalOrigin.BOTTOM;break;case"bottom-right":n=b.HorizontalOrigin.RIGHT,e=b.VerticalOrigin.BOTTOM;break}return{horizontalOrigin:n,verticalOrigin:e}}class qL extends c.Destroyable{constructor(e,i){super();L(this,"czmViewer");L(this,"czmESMVTLayer");L(this,"screenManager");L(this,"cacheSize",300);L(this,"urlMap",new Map);L(this,"tileScheme","xyz");L(this,"heightReference","NONE");L(this,"minimumLevel",0);L(this,"maximumLevel",18);L(this,"_cache",new Map);L(this,"lastTiles",new Map);this.czmViewer=e,this.czmESMVTLayer=i;const o=this.czmViewer.viewer;if(!o)return;const r=Ot(o);if(!r)return;this.screenManager=r.screenManager,this.tileScheme=i.sceneObject.scheme??"xyz",this.heightReference=i.sceneObject.heightReference,this.maximumLevel=i.sceneObject.maximumLevel,this.minimumLevel=i.sceneObject.minimumLevel,(()=>{do{if(!i.mvtLayerJson)break;if(typeof i.mvtLayerJson.mainJson=="string"){this.urlMap.set("customSource",[i.mvtLayerJson.mainJson]);break}if(typeof i.mvtLayerJson.mainJson=="object"){const s=i.mvtLayerJson.mainJson.sources;for(const l in s){const u=s[l];u.type==="vector"&&Reflect.has(u,"tiles")&&this.urlMap.set(l,u.tiles)}break}}while(!1)})(),this.ad(()=>{var l;const s=Array.from(this.lastTiles.values()).map(u=>u.featureTable).map(u=>Object.values(u)).flat(1/0);s&&((l=this.screenManager)==null||l.remove("default",this.czmESMVTLayer.sceneObject.id,s)),this.cache&&(this.cache.clear(),this.cache=null)})}get cache(){return this._cache}set cache(e){this._cache=e}addTiles(e){var a;if(this.urlMap.size==0)return;if(this.cache&&this.cache.has(e)&&this.lastTiles.has(e)){this.updateTiles([e],"show");return}const[i,o,r]=e.split("-").map(Number);(a=this.cache)==null||a.set(e,new Map),this.requestImage(o,r,i,e)}updateTiles(e,i="hide"){var o,r,a,s,l;for(let u=0;u<e.length;u++){const A=e[u],h=this.lastTiles.get(A);if(h){const f=Object.keys(h.featureTable);for(let p=0;p<f.length;p++){const d=f[p],m=h.featureTable[d];if(i=="delete")(o=this.screenManager)==null||o.remove(h.layer,h.id,m);else{const v=(r=this.cache)==null?void 0:r.get(A);v&&((a=this.cache)==null||a.delete(A),(s=this.cache)==null||s.set(A,v)),this.screenManager.avoidanceManager.enable||(l=this.screenManager)==null||l.update(h.layer,h.id,m,{all:{show:i=="show"}})}}}i=="delete"&&this.lastTiles.delete(A)}}update(e){const i=Array.from(this.lastTiles.keys()),o=i.filter(s=>!e.includes(s)),r=i.filter(s=>e.includes(s)),a=e.filter(s=>!i.includes(s));this.updateTiles(o,"delete"),this.updateTiles(r,"show");for(let s=0;s<a.length;s++){const l=a[s];this.addTiles(l)}}requestImage(e,i,o,r){const a=this.tileScheme=="tms"?Math.pow(2,o)-i-1:i;this.urlMap.size!=0&&this.urlMap.entries().forEach(([s,l])=>{if(l.length!=0&&l[0].includes("{z}")){const u=l[0].replace(/{z}/g,o.toString()).replace(/{x}/g,e.toString()).replace(/{y}/g,a.toString());fetch(u).then(A=>{var h,f;if(A.ok&&((h=this.cache)!=null&&h.has(r))&&((f=this.cache.get(r))==null?void 0:f.size)==0)return A.arrayBuffer()}).then(A=>{var d,m,v;const h=new bL(A),f=new GL(h),p=new Map;for(const y in f.layers){const g=f.layers[y];if(g.length<=0||g.feature(0).type!==1)continue;const _=[];for(let x=0;x<g.length;x++){const E=g.feature(x);_.push(E.toGeoJSON(e,i,o))}p.set(y,_)}(d=this.cache)!=null&&d.has(r)&&((m=this.cache.get(r))==null?void 0:m.size)==0&&((v=this.cache)==null||v.set(r,p),this.addScreenManage(r,p),this.clearCache())})}})}clearCache(){if(!this.cache)return;const e=this.cache.size-this.cacheSize;if(!(e<=0))for(let i=0;i<e;i++){const o=this.cache.keys().next().value;o&&(this.updateTiles([o],"delete"),this.cache.delete(o))}}addScreenManage(e,i){var r,a;this.lastTiles.set(e,{layer:"default",id:this.czmESMVTLayer.sceneObject.id,featureTable:{}});const o=this.lastTiles.get(e);for(const[s,l]of i.entries()){const u=this.czmESMVTLayer.mvtLayerJson.pointJson.find(A=>A["source-layer"]==s)??{};for(const A of l){const h=Number.parseInt(e.split("-")[0]);if(Reflect.has(u,"minzoom")&&u.minzoom>h||Reflect.has(u,"maxzoom")&&u.maxzoom<h)continue;const{labelStyle:f,billboardStyle:p}=jL(u);let d,m;const v=this.heightReference=="NONE"?A.geometry.coordinates:KL(this.czmViewer,A.geometry.coordinates);A.properties.name&&(f&&(f.show=!this.screenManager.avoidanceManager.enable,d=this.screenManager.addLabel(this.czmESMVTLayer.sceneObject.id,"default",f??{},{position:v,name:A.properties.NAME??A.properties.name,index:A.id??u["source-layer"]+((r=A==null?void 0:A.properties)==null?void 0:r.osm_id)})),p&&A.properties.name&&(p.show=!this.screenManager.avoidanceManager.enable,m=this.screenManager.addImage(this.czmESMVTLayer.sceneObject.id,"default",p??{},{position:v,name:A.properties.NAME??A.properties.name,index:A.id??u["source-layer"]+((a=A==null?void 0:A.properties)==null?void 0:a.osm_id)})),o.featureTable[s]||(o.featureTable[s]=[]),d&&o.featureTable[s].push(d.screenObjectId),m&&o.featureTable[s].push(m.screenObjectId))}}}reset(){if(!this.cache)return;const e=Array.from(this.cache.keys());this.update([]),setTimeout(()=>{this.update(e)})}}function KL(t,n){var i;const e=(i=t.viewer)==null?void 0:i.scene.globe.getHeight(b.Cartographic.fromDegrees(n[0],n[1],n[2]??0));return[n[0],n[1],e??0]}class ZL extends c.Destroyable{constructor(e,i){var r;super();L(this,"vectorTilesCache");L(this,"czmViewer");L(this,"czmESMVTLayer");this.czmViewer=e,this.czmESMVTLayer=i,this.vectorTilesCache=this.ad(new qL(e,i)),this.updateTiles();const o=(r=this.czmViewer.viewer)==null?void 0:r.camera.moveEnd.addEventListener(()=>{this.updateTiles()});this.ad(()=>{o&&o()})}updateTiles(){const e=this.czmViewer.viewer;if(!e)return;const i=new Set;for(let o=0;o<e.scene.globe._surface._tilesToRender.length;o++){const r=e.scene.globe._surface._tilesToRender[o];if(r.data)for(let a=0;a<r.data.imagery.length;a++){const s=r.data.imagery[a],l=s.loadingImagery??s.readyImagery;if(l){const u=`${l.level}-${l.x}-${l.y}`;i.add(u)}}}this.vectorTilesCache.update(Array.from(i))}}const Lc=class Lc extends Hn{constructor(e,i){super(e,i);L(this,"_czmImagery");L(this,"_mvtLayerJson",this.disposeVar(c.reactJson({mainJson:"",pointJson:[],otherJson:[]})));L(this,"mvtLayerJsonChanged",this.ad(new c.Event));if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"alpha"],[e,"opacity"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"]));{const s=this.dv(c.createNextAnimateFrameEvent(e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.schemeChanged,this.mvtLayerJsonChanged)),l=()=>{!this.mvtLayerJson||this.mvtLayerJson.otherJson.length==0||(r.imageryProvider={type:"MVTImageryProvider",url:this.mvtLayerJson.mainJson,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:this.mvtLayerJson.otherJson,scheme:e.scheme})};l(),this.d(s.don(l))}{const s=A=>{const h=structuredClone(A);Reflect.deleteProperty(h,"layers"),this.mvtLayerJson={mainJson:h,pointJson:A.layers.filter(f=>f.type=="symbol"),otherJson:A.layers.filter(f=>f.type!="symbol")}},l=async()=>{var A;if(typeof e.url=="string")if(e.url.includes("{z}"))this.mvtLayerJson.mainJson=e.url;else{const h=await fetch(e.url);if((A=h.headers.get("Content-Type"))!=null&&A.includes("json")){const f=await h.json();s(f)}}else s(e.url);e.style&&e.style.length!=0&&(this.mvtLayerJson.pointJson=e.style.filter(h=>h.type=="symbol"),this.mvtLayerJson.otherJson=e.style.filter(h=>h.type!="symbol")),this.mvtLayerJsonChanged.emit()};l();const u=this.ad(c.createNextAnimateFrameEvent(e.urlChanged,e.styleChanged));this.ad(u.don(l))}const a=this.ad(c.createNextAnimateFrameEvent(e.schemeChanged,e.maximumLevelChanged,e.minimumLevelChanged,this.mvtLayerJsonChanged,e.showChanged,e.heightReferenceChanged));this.ad(new c.ObjResettingWithEvent(a,()=>{if(e.show)return new ZL(i,this)}))}get czmImagery(){return this._czmImagery}get mvtLayerJson(){return this._mvtLayerJson.value}set mvtLayerJson(e){this._mvtLayerJson.value=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Lc,"type",Lc.register("ESCesiumViewer",mf.type,Lc));let ey=Lc;class $L extends c.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 a=i.points.length;let s=[],l=[],u=[],A=[],h=[];for(let y=0;y<a-1;y++){const{outlinePionts:g,customPrimitivePoints:_}=this.divideFourPoints(i.points[y],i.points[y+1]);A.push(..._),h.push(...g),u.push(...this.setIndexs(y))}const[f,p,d]=wn({originPosition:A[0]},A),m=this.setFaces(f);s.push(...m.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(r,p,s,u,l)}divideFourPoints(n,e){const i=c.geoHeading(n,e),o=c.geoDestination(n,this._sceneObject.width/2,90+i),r=c.geoDestination(n,this._sceneObject.width/2,i-90),a=c.geoDestination(e,this._sceneObject.width/2,i-90),s=c.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],A=[r[0],r[1],r[2]+this._sceneObject.height/2],h=[r[0],r[1],r[2]-this._sceneObject.height/2],f=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],d=[a[0],a[1],a[2]+this._sceneObject.height/2],m=[a[0],a[1],a[2]-this._sceneObject.height/2],v=[[l,A],[l,f],[l,u],[u,p]],y=[[u,h],[A,d],[A,h],[h,m]],g=[[f,p],[f,d],[p,m],[d,m]];return{outlinePionts:[...v,...y,...g],customPrimitivePoints:[u,l,A,h,p,f,d,m]}}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 a=n.slice(8*r,8*(r+1));e.push(a)}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]=wn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,u,A,h)=>{if(A===0)return l.push(0),l;const f=A-1,p=h[f],d=Math.sqrt((p[0]-u[0])*(p[0]-u[0])+(p[1]-u[1])*(p[1]-u[1]));return l.push(l[f]+d),l},[]),a=r[o-1];return e.distances=a,r.map(l=>l/a)}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 a=[];if(r===i.length-1){const s=[1,0,1,1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}else{const s=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}o.push(a)}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 zc=class zc extends sn{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Ye(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new ft(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new ut(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(c.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,a=this._line;this.d(c.bind([a,"positions"],[e,"points"])),this.d(c.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(c.track([this.line,"color"],[e,"strokeColor"])),this.d(c.track([this.line,"width"],[e,"strokeWidth"])),this.d(c.track([this.line,"ground"],[e,"strokeGround"]));{const A=this.dv(c.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new c.ObjResettingWithEvent(A,()=>new $L(this,this.sceneObject)))}{const A=()=>{a.show=e.show&&e.stroked};A();const h=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(h.don(A))}this.bindCustomPrimitive(e);let s="";const l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const A=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?s=u:e.materialMode==="color"?s="":s=l,r.uri=s,s==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
|
|
3598
3598
|
in vec2 v_st;
|
|
3599
3599
|
void main()
|
|
3600
3600
|
{
|
|
@@ -3633,7 +3633,7 @@ ${r_}
|
|
|
3633
3633
|
{
|
|
3634
3634
|
v_st = a_st;
|
|
3635
3635
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
3636
|
-
}`,i.castShadows=!0,i.receiveShadows=!0,this.computeBoundingBox();{const o=()=>{i.show=e.show&&e.filled};o();const r=this.dv(c.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(zc,"type",zc.register("ESCesiumViewer",c.ESPipeFence.type,zc));let ty=zc;const kc=class kc extends da{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 ut(i,e.id)),a=this.ad(new ft(i,e.id));this.czmCustomPrimitive=r,this.czmTexture=a,this.d(c.track([r,"allowPicking"],[e,"allowPicking"]));const s=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new c.ObjResettingWithEvent(s,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new
|
|
3636
|
+
}`,i.castShadows=!0,i.receiveShadows=!0,this.computeBoundingBox();{const o=()=>{i.show=e.show&&e.filled};o();const r=this.dv(c.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(zc,"type",zc.register("ESCesiumViewer",c.ESPipeFence.type,zc));let ty=zc;const kc=class kc extends da{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 ut(i,e.id)),a=this.ad(new ft(i,e.id));this.czmCustomPrimitive=r,this.czmTexture=a,this.d(c.track([r,"allowPicking"],[e,"allowPicking"]));const s=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new c.ObjResettingWithEvent(s,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new XL(e,this);r.attributes=void 0}))}};L(kc,"type",kc.register("ESCesiumViewer",c.ESPipeline.type,kc));let ny=kc;class XL extends c.Destroyable{constructor(n,e){super(),this._sceneObject=n,this._czmESPipeline=e;const i=this._sceneObject,o=this._czmESPipeline,r=o.czmCustomPrimitive,a=o.czmTexture;if(!r||!a)return;{const u=()=>{r.show=i.show&&i.filled};u();const A=this.dv(c.createNextAnimateFrameEvent(i.showChanged,i.filledChanged));this.d(A.don(u))}const s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const u=()=>{i.materialImage.url!=""?a.uri=typeof i.materialImage.url=="string"?i.materialImage.url:i.materialImage.url.url:i.materialMode==="multipleArrows"||i.materialMode==="blue"?a.uri=l:a.uri=s;const h=c.getDistancesFromPositions(i.points,"GEODESIC"),p=h[h.length-1]/i.materialImage.uDis;r.uniformMap={u_image:{type:"texture",id:a.id},u_stScale:[p,2*Math.PI*i.radius/i.materialImage.vDis],u_speed:[i.speed/i.materialImage.uDis,0],u_color:i.fillColor}};u();const A=this.dv(c.createNextAnimateFrameEvent(i.speedChanged,i.materialImageChanged,i.materialModeChanged,i.fillColorChanged));this.d(A.don(u))}(()=>{if(!i.points||i.points.length>=2&&c.equalsN3(i.points[i.points.length-2],i.points[i.points.length-1]))return;const{position:A,modelMatrix:h,indexes:f,uvCoordinates:p}=this.coordinateTransformation(i.points,i.sides);r.modelMatrix=h,r.attributes={position:{typedArray:new Float32Array(A),componentsPerAttribute:3},st:{typedArray:new Float32Array([...p,...p.reverse()]),componentsPerAttribute:2}},r.indexTypedArray=new Uint16Array([...f,...f.reverse()]),r.fragmentShaderSource=`
|
|
3637
3637
|
in vec2 v_st;
|
|
3638
3638
|
uniform sampler2D u_image;
|
|
3639
3639
|
uniform vec4 u_color;
|
|
@@ -3655,7 +3655,7 @@ ${r_}
|
|
|
3655
3655
|
v_st = a_st;
|
|
3656
3656
|
gl_Position = czm_modelViewProjection * vec4(position,1.0);
|
|
3657
3657
|
}
|
|
3658
|
-
`;const d=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!d)return;const{min:m,max:v}=d;r.setLocalAxisedBoundingBox(m,v)})()}coordinateTransformation(n,e){const i=c.getDistancesFromPositions(n,"GEODESIC"),o=i[i.length-1],{circlePoints:r,uvCoordinates:a}=this.getCircularCoordinates(n,o),[s,l,u]=wn({originPosition:r[0]},r),A=this.triangleIndices(e);return{modelMatrix:l,position:s.flat(),indexes:A,uvCoordinates:a}}getCircularCoordinates(n,e){const{_sceneObject:i}=this,o=i.radius,r=i.sides,a=[],s=[];let l=0,u=function(A){let h=new b.Cartesian3(A.x,A.y,A.z),f=b.Cartographic.fromCartesian(h),p=b.Math.toDegrees(f.latitude),d=b.Math.toDegrees(f.longitude),m=f.height;return[d,p,m]};for(let A=0;A<n.length-1;A++){const h=n[A],f=n[A+1],p=l;l+=c.getDistancesFromPositions([h,f],"GEODESIC")[0];const d=p/e,m=l/e,v=b.Cartesian3.fromDegrees(...h),y=b.Cartesian3.fromDegrees(...f),g=b.Cartesian3.subtract(y,v,new b.Cartesian3);if(g.equals(b.Cartesian3.ZERO)){a.push(a[a.length-1]),s.push(s[s.length-3],s[s.length-2],s[s.length-1]);continue}const _=b.Cartesian3.normalize(g,new b.Cartesian3),x=new b.Cartesian3(0,0,1),E=new b.Cartesian3(1,0,0),B=b.Cartesian3.cross(_,Math.abs(b.Cartesian3.dot(_,x))!=1?x:E,new b.Cartesian3);if(B.equals(b.Cartesian3.ZERO)){a.push(a[a.length-1]),s.push(s[s.length-3],s[s.length-2],s[s.length-1]);continue}b.Cartesian3.normalize(B,B),b.Cartesian3.multiplyByScalar(B,o,B);for(let P=0;P<=r;P++){let I=b.Quaternion.fromAxisAngle(_,P*2*Math.PI/r),D=b.Matrix3.fromQuaternion(I),F=b.Matrix4.fromRotationTranslation(D,b.Cartesian3.ZERO);b.Matrix4.multiplyByTranslation(F,B,F);const S=b.Matrix4.getTranslation(F,new b.Cartesian3);b.Cartesian3.add(v,S,S);const T=b.Cartesian3.add(S,g,new b.Cartesian3);a.push(u(S),u(T)),s.push(d,P/r,m,P/r)}}return{circlePoints:a,uvCoordinates:s}}triangleIndices(n){var a;const{_sceneObject:e}=this,o=(((a=e.points)==null?void 0:a.length)-1)*(n+1);let r=new Uint32Array(o*6);for(let s=0;s<o;s++)r[s*6+0]=s*2+0,r[s*6+1]=s*2+1,r[s*6+2]=(s+1)%(n+1)==0?(s-n)*2:s*2+2,r[s*6+3]=s*2+1,r[s*6+4]=(s+1)%(n+1)==0?(s-n)*2+1:s*2+3,r[s*6+5]=(s+1)%(n+1)==0?(s-n)*2:s*2+2;return r}}function iy(t,n,e="children",i="dragType"){const o=[];return t.forEach(r=>{if(r[i]&&r[i]==="layer"){const a={id:r.id,visable:r.checked,color:r.config.color};n==="color"?delete a.visable:delete a.color,o.push(a)}if(r[e]&&r[e].length){const a=iy(r[e],n,e,i);a.length&&o.push(...a)}}),o}const Qc=class Qc extends ua{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.setLayerVisibleEvent.don((o,r)=>{try{let a=[];typeof r=="string"?a=JSON.parse(r):a=r;const l=iy(a,"visable").map(u=>{const A=typeof u.id=="string"?`'${u.id}'`:`'${u.id.toString()}'`;return[`\${${o}} === `+A,u.visable.toString()]});this.setFeatureVisable(l)}catch(a){console.error(a)}})),this.d(n.setLayerColorEvent.don((o,r)=>{try{let a=[];typeof r=="string"?a=JSON.parse(r):a=r;const l=iy(a,"color").map(u=>{const A=typeof u.id=="string"?`'${u.id}'`:`'${u.id.toString()}'`;return[`\${${o}} === `+A,u.color]});this.setFeatureColor(l)}catch(a){console.error(a)}}))}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(Qc,"type",Qc.register("ESCesiumViewer",c.ESPipeserTileset.type,Qc));let ry=Qc;var oy={exports:{}};oy.exports=Pf,oy.exports.default=Pf;function Pf(t,n,e){e=e||2;var i=n&&n.length,o=i?n[0]*e:t.length,r=c_(t,0,o,e,!0),a=[];if(!r||r.next===r.prev)return a;var s,l,u,A,h,f,p;if(i&&(r=tz(t,n,r,e)),t.length>80*e){s=u=t[0],l=A=t[1];for(var d=e;d<o;d+=e)h=t[d],f=t[d+1],h<s&&(s=h),f<l&&(l=f),h>u&&(u=h),f>A&&(A=f);p=Math.max(u-s,A-l),p=p!==0?32767/p:0}return tu(r,a,e,s,l,p,0),a}function c_(t,n,e,i,o){var r,a;if(o===ly(t,n,e,i)>0)for(r=n;r<e;r+=i)a=f_(r,t[r],t[r+1],a);else for(r=e-i;r>=n;r-=i)a=f_(r,t[r],t[r+1],a);return a&&Bf(a,a.next)&&(iu(a),a=a.next),a}function Yo(t,n){if(!t)return t;n||(n=t);var e=t,i;do if(i=!1,!e.steiner&&(Bf(e,e.next)||vt(e.prev,e,e.next)===0)){if(iu(e),e=n=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==n);return n}function tu(t,n,e,i,o,r,a){if(t){!a&&r&&sz(t,i,o,r);for(var s=t,l,u;t.prev!==t.next;){if(l=t.prev,u=t.next,r?YL(t,i,o,r):XL(t)){n.push(l.i/e|0),n.push(t.i/e|0),n.push(u.i/e|0),iu(t),t=u.next,s=u.next;continue}if(t=u,t===s){a?a===1?(t=JL(Yo(t),n,e),tu(t,n,e,i,o,r,2)):a===2&&ez(t,n,e,i,o,r):tu(Yo(t),n,e,i,o,r,1);break}}}}function XL(t){var n=t.prev,e=t,i=t.next;if(vt(n,e,i)>=0)return!1;for(var o=n.x,r=e.x,a=i.x,s=n.y,l=e.y,u=i.y,A=o<r?o<a?o:a:r<a?r:a,h=s<l?s<u?s:u:l<u?l:u,f=o>r?o>a?o:a:r>a?r:a,p=s>l?s>u?s:u:l>u?l:u,d=i.next;d!==n;){if(d.x>=A&&d.x<=f&&d.y>=h&&d.y<=p&&va(o,s,r,l,a,u,d.x,d.y)&&vt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function YL(t,n,e,i){var o=t.prev,r=t,a=t.next;if(vt(o,r,a)>=0)return!1;for(var s=o.x,l=r.x,u=a.x,A=o.y,h=r.y,f=a.y,p=s<l?s<u?s:u:l<u?l:u,d=A<h?A<f?A:f:h<f?h:f,m=s>l?s>u?s:u:l>u?l:u,v=A>h?A>f?A:f:h>f?h:f,y=sy(p,d,n,e,i),g=sy(m,v,n,e,i),_=t.prevZ,x=t.nextZ;_&&_.z>=y&&x&&x.z<=g;){if(_.x>=p&&_.x<=m&&_.y>=d&&_.y<=v&&_!==o&&_!==a&&va(s,A,l,h,u,f,_.x,_.y)&&vt(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=p&&x.x<=m&&x.y>=d&&x.y<=v&&x!==o&&x!==a&&va(s,A,l,h,u,f,x.x,x.y)&&vt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=y;){if(_.x>=p&&_.x<=m&&_.y>=d&&_.y<=v&&_!==o&&_!==a&&va(s,A,l,h,u,f,_.x,_.y)&&vt(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=g;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=v&&x!==o&&x!==a&&va(s,A,l,h,u,f,x.x,x.y)&&vt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function JL(t,n,e){var i=t;do{var o=i.prev,r=i.next.next;!Bf(o,r)&&h_(o,i,i.next,r)&&nu(o,r)&&nu(r,o)&&(n.push(o.i/e|0),n.push(i.i/e|0),n.push(r.i/e|0),iu(i),iu(i.next),i=t=r),i=i.next}while(i!==t);return Yo(i)}function ez(t,n,e,i,o,r){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&uz(a,s)){var l=A_(a,s);a=Yo(a,a.next),l=Yo(l,l.next),tu(a,n,e,i,o,r,0),tu(l,n,e,i,o,r,0);return}s=s.next}a=a.next}while(a!==t)}function tz(t,n,e,i){var o=[],r,a,s,l,u;for(r=0,a=n.length;r<a;r++)s=n[r]*i,l=r<a-1?n[r+1]*i:t.length,u=c_(t,s,l,i,!1),u===u.next&&(u.steiner=!0),o.push(lz(u));for(o.sort(nz),r=0;r<o.length;r++)e=iz(o[r],e);return e}function nz(t,n){return t.x-n.x}function iz(t,n){var e=rz(t,n);if(!e)return n;var i=A_(e,t);return Yo(i,i.next),Yo(e,e.next)}function rz(t,n){var e=n,i=t.x,o=t.y,r=-1/0,a;do{if(o<=e.y&&o>=e.next.y&&e.next.y!==e.y){var s=e.x+(o-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(s<=i&&s>r&&(r=s,a=e.x<e.next.x?e:e.next,s===i))return a}e=e.next}while(e!==n);if(!a)return null;var l=a,u=a.x,A=a.y,h=1/0,f;e=a;do i>=e.x&&e.x>=u&&i!==e.x&&va(o<A?i:r,o,u,A,o<A?r:i,o,e.x,e.y)&&(f=Math.abs(o-e.y)/(i-e.x),nu(e,t)&&(f<h||f===h&&(e.x>a.x||e.x===a.x&&oz(a,e)))&&(a=e,h=f)),e=e.next;while(e!==l);return a}function oz(t,n){return vt(t.prev,t,n.prev)<0&&vt(n.next,t,t.next)<0}function sz(t,n,e,i){var o=t;do o.z===0&&(o.z=sy(o.x,o.y,n,e,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,az(o)}function az(t){var n,e,i,o,r,a,s,l,u=1;do{for(e=t,t=null,r=null,a=0;e;){for(a++,i=e,s=0,n=0;n<u&&(s++,i=i.nextZ,!!i);n++);for(l=u;s>0||l>0&&i;)s!==0&&(l===0||!i||e.z<=i.z)?(o=e,e=e.nextZ,s--):(o=i,i=i.nextZ,l--),r?r.nextZ=o:t=o,o.prevZ=r,r=o;e=i}r.nextZ=null,u*=2}while(a>1);return t}function sy(t,n,e,i,o){return t=(t-e)*o|0,n=(n-i)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function lz(t){var n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function va(t,n,e,i,o,r,a,s){return(o-a)*(n-s)>=(t-a)*(r-s)&&(t-a)*(i-s)>=(e-a)*(n-s)&&(e-a)*(r-s)>=(o-a)*(i-s)}function uz(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!cz(t,n)&&(nu(t,n)&&nu(n,t)&&hz(t,n)&&(vt(t.prev,t,n.prev)||vt(t,n.prev,n))||Bf(t,n)&&vt(t.prev,t,t.next)>0&&vt(n.prev,n,n.next)>0)}function vt(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Bf(t,n){return t.x===n.x&&t.y===n.y}function h_(t,n,e,i){var o=If(vt(t,n,e)),r=If(vt(t,n,i)),a=If(vt(e,i,t)),s=If(vt(e,i,n));return!!(o!==r&&a!==s||o===0&&Tf(t,e,n)||r===0&&Tf(t,i,n)||a===0&&Tf(e,t,i)||s===0&&Tf(e,n,i))}function Tf(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function If(t){return t>0?1:t<0?-1:0}function cz(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&h_(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function nu(t,n){return vt(t.prev,t,t.next)<0?vt(t,n,t.next)>=0&&vt(t,t.prev,n)>=0:vt(t,n,t.prev)<0||vt(t,t.next,n)<0}function hz(t,n){var e=t,i=!1,o=(t.x+n.x)/2,r=(t.y+n.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&o<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==t);return i}function A_(t,n){var e=new ay(t.i,t.x,t.y),i=new ay(n.i,n.x,n.y),o=t.next,r=n.prev;return t.next=n,n.prev=t,e.next=o,o.prev=e,i.next=e,e.prev=i,r.next=i,i.prev=r,i}function f_(t,n,e,i){var o=new ay(t,n,e);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function iu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ay(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Pf.deviation=function(t,n,e,i){var o=n&&n.length,r=o?n[0]*e:t.length,a=Math.abs(ly(t,0,r,e));if(o)for(var s=0,l=n.length;s<l;s++){var u=n[s]*e,A=s<l-1?n[s+1]*e:t.length;a-=Math.abs(ly(t,u,A,e))}var h=0;for(s=0;s<i.length;s+=3){var f=i[s]*e,p=i[s+1]*e,d=i[s+2]*e;h+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return a===0&&h===0?0:Math.abs((h-a)/a)};function ly(t,n,e,i){for(var o=0,r=n,a=e-i;r<e;r+=i)o+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return o}Pf.flatten=function(t){for(var n=t[0][0].length,e={vertices:[],holes:[],dimensions:n},i=0,o=0;o<t.length;o++){for(var r=0;r<t[o].length;r++)for(var a=0;a<n;a++)e.vertices.push(t[o][r][a]);o>0&&(i+=t[o-1].length,e.holes.push(i))}return e};var Az=oy.exports;const fz=Ml(Az),Vc=class Vc extends Ln{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 u=()=>{this.geoPolygon&&(this.geoPolygon.fill=!1)};u(),this.d(e.filledChanged.don(u))}const r=this.czmSideCustomPrimitive=this.dv(new ut(i,e.id)),a=this.czmSideTexture=this.ad(new ft(i)),s=this.czmBottomCustomPrimitive=this.dv(new ut(i,e.id)),l=this.czmBottomTexture=this.ad(new ft(i));this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([s,"allowPicking"],[e,"allowPicking"]));{const u=()=>{r.show=e.show&&e.filled&&e.points&&e.points.length>2,s.show=e.show&&e.filled&&e.points&&e.points.length>2};u();const A=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.pointsChanged));this.dispose(A.don(u))}{const u=(f,p,d,m,v)=>{f.position=p;const y=d.flat();let g=m=="bottom"?fz(y,null,3):this._triangleIndices(d.length),_=[],x=-1/0,E=1/0,B=-1/0,P=1/0,I=0;if(m=="bottom"){for(let C=0;C<d.length;C++)B=B>d[C][0]?B:d[C][0],P=P<d[C][0]?P:d[C][0],x=x>d[C][1]?x:d[C][1],E=E<d[C][1]?E:d[C][1];this._width=B-P,this._height=x-E;for(let C=0;C<d.length;C++)_.push((d[C][0]-this._width/2)/this._width,(d[C][1]-this._height/2)/this._height)}else{for(let C=0;C<d.length;C++)this._width+=this._getDistance(d[C],d[C-1<0?0:C-1]),x=x>d[C][2]?x:d[C][2],E=E<d[C][2]?E:d[C][2];this._height=x-E;for(let C=0;C<d.length;C++)I+=this._getDistance(d[C],d[C-1<0?0:C-1]),_.push(I/this._width,(d[C][2]-E)/this._height)}f.indexTypedArray=new Uint16Array(v?g:g.reverse()),f.attributes={position:{typedArray:new Float32Array(y),componentsPerAttribute:3},st:{typedArray:new Float32Array(v?_:_.reverse()),componentsPerAttribute:2}};const D=m=="bottom"?e.bottomImage.uDis??50:e.sideImage.uDis??50,F=m=="bottom"?e.bottomImage.vDis??50:e.sideImage.vDis??50;f.fragmentShaderSource=`in vec2 v_st;
|
|
3658
|
+
`;const d=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!d)return;const{min:m,max:v}=d;r.setLocalAxisedBoundingBox(m,v)})()}coordinateTransformation(n,e){const i=c.getDistancesFromPositions(n,"GEODESIC"),o=i[i.length-1],{circlePoints:r,uvCoordinates:a}=this.getCircularCoordinates(n,o),[s,l,u]=wn({originPosition:r[0]},r),A=this.triangleIndices(e);return{modelMatrix:l,position:s.flat(),indexes:A,uvCoordinates:a}}getCircularCoordinates(n,e){const{_sceneObject:i}=this,o=i.radius,r=i.sides,a=[],s=[];let l=0,u=function(A){let h=new b.Cartesian3(A.x,A.y,A.z),f=b.Cartographic.fromCartesian(h),p=b.Math.toDegrees(f.latitude),d=b.Math.toDegrees(f.longitude),m=f.height;return[d,p,m]};for(let A=0;A<n.length-1;A++){const h=n[A],f=n[A+1],p=l;l+=c.getDistancesFromPositions([h,f],"GEODESIC")[0];const d=p/e,m=l/e,v=b.Cartesian3.fromDegrees(...h),y=b.Cartesian3.fromDegrees(...f),g=b.Cartesian3.subtract(y,v,new b.Cartesian3);if(g.equals(b.Cartesian3.ZERO)){a.push(a[a.length-1]),s.push(s[s.length-3],s[s.length-2],s[s.length-1]);continue}const _=b.Cartesian3.normalize(g,new b.Cartesian3),x=new b.Cartesian3(0,0,1),E=new b.Cartesian3(1,0,0),B=b.Cartesian3.cross(_,Math.abs(b.Cartesian3.dot(_,x))!=1?x:E,new b.Cartesian3);if(B.equals(b.Cartesian3.ZERO)){a.push(a[a.length-1]),s.push(s[s.length-3],s[s.length-2],s[s.length-1]);continue}b.Cartesian3.normalize(B,B),b.Cartesian3.multiplyByScalar(B,o,B);for(let P=0;P<=r;P++){let I=b.Quaternion.fromAxisAngle(_,P*2*Math.PI/r),D=b.Matrix3.fromQuaternion(I),F=b.Matrix4.fromRotationTranslation(D,b.Cartesian3.ZERO);b.Matrix4.multiplyByTranslation(F,B,F);const S=b.Matrix4.getTranslation(F,new b.Cartesian3);b.Cartesian3.add(v,S,S);const T=b.Cartesian3.add(S,g,new b.Cartesian3);a.push(u(S),u(T)),s.push(d,P/r,m,P/r)}}return{circlePoints:a,uvCoordinates:s}}triangleIndices(n){var a;const{_sceneObject:e}=this,o=(((a=e.points)==null?void 0:a.length)-1)*(n+1);let r=new Uint32Array(o*6);for(let s=0;s<o;s++)r[s*6+0]=s*2+0,r[s*6+1]=s*2+1,r[s*6+2]=(s+1)%(n+1)==0?(s-n)*2:s*2+2,r[s*6+3]=s*2+1,r[s*6+4]=(s+1)%(n+1)==0?(s-n)*2+1:s*2+3,r[s*6+5]=(s+1)%(n+1)==0?(s-n)*2:s*2+2;return r}}function iy(t,n,e="children",i="dragType"){const o=[];return t.forEach(r=>{if(r[i]&&r[i]==="layer"){const a={id:r.id,visable:r.checked,color:r.config.color};n==="color"?delete a.visable:delete a.color,o.push(a)}if(r[e]&&r[e].length){const a=iy(r[e],n,e,i);a.length&&o.push(...a)}}),o}const Qc=class Qc extends ua{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.setLayerVisibleEvent.don((o,r)=>{try{let a=[];typeof r=="string"?a=JSON.parse(r):a=r;const l=iy(a,"visable").map(u=>{const A=typeof u.id=="string"?`'${u.id}'`:`'${u.id.toString()}'`;return[`\${${o}} === `+A,u.visable.toString()]});this.setFeatureVisable(l)}catch(a){console.error(a)}})),this.d(n.setLayerColorEvent.don((o,r)=>{try{let a=[];typeof r=="string"?a=JSON.parse(r):a=r;const l=iy(a,"color").map(u=>{const A=typeof u.id=="string"?`'${u.id}'`:`'${u.id.toString()}'`;return[`\${${o}} === `+A,u.color]});this.setFeatureColor(l)}catch(a){console.error(a)}}))}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(Qc,"type",Qc.register("ESCesiumViewer",c.ESPipeserTileset.type,Qc));let ry=Qc;var oy={exports:{}};oy.exports=Pf,oy.exports.default=Pf;function Pf(t,n,e){e=e||2;var i=n&&n.length,o=i?n[0]*e:t.length,r=c_(t,0,o,e,!0),a=[];if(!r||r.next===r.prev)return a;var s,l,u,A,h,f,p;if(i&&(r=nz(t,n,r,e)),t.length>80*e){s=u=t[0],l=A=t[1];for(var d=e;d<o;d+=e)h=t[d],f=t[d+1],h<s&&(s=h),f<l&&(l=f),h>u&&(u=h),f>A&&(A=f);p=Math.max(u-s,A-l),p=p!==0?32767/p:0}return tu(r,a,e,s,l,p,0),a}function c_(t,n,e,i,o){var r,a;if(o===ly(t,n,e,i)>0)for(r=n;r<e;r+=i)a=f_(r,t[r],t[r+1],a);else for(r=e-i;r>=n;r-=i)a=f_(r,t[r],t[r+1],a);return a&&Bf(a,a.next)&&(iu(a),a=a.next),a}function Yo(t,n){if(!t)return t;n||(n=t);var e=t,i;do if(i=!1,!e.steiner&&(Bf(e,e.next)||vt(e.prev,e,e.next)===0)){if(iu(e),e=n=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==n);return n}function tu(t,n,e,i,o,r,a){if(t){!a&&r&&az(t,i,o,r);for(var s=t,l,u;t.prev!==t.next;){if(l=t.prev,u=t.next,r?JL(t,i,o,r):YL(t)){n.push(l.i/e|0),n.push(t.i/e|0),n.push(u.i/e|0),iu(t),t=u.next,s=u.next;continue}if(t=u,t===s){a?a===1?(t=ez(Yo(t),n,e),tu(t,n,e,i,o,r,2)):a===2&&tz(t,n,e,i,o,r):tu(Yo(t),n,e,i,o,r,1);break}}}}function YL(t){var n=t.prev,e=t,i=t.next;if(vt(n,e,i)>=0)return!1;for(var o=n.x,r=e.x,a=i.x,s=n.y,l=e.y,u=i.y,A=o<r?o<a?o:a:r<a?r:a,h=s<l?s<u?s:u:l<u?l:u,f=o>r?o>a?o:a:r>a?r:a,p=s>l?s>u?s:u:l>u?l:u,d=i.next;d!==n;){if(d.x>=A&&d.x<=f&&d.y>=h&&d.y<=p&&va(o,s,r,l,a,u,d.x,d.y)&&vt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function JL(t,n,e,i){var o=t.prev,r=t,a=t.next;if(vt(o,r,a)>=0)return!1;for(var s=o.x,l=r.x,u=a.x,A=o.y,h=r.y,f=a.y,p=s<l?s<u?s:u:l<u?l:u,d=A<h?A<f?A:f:h<f?h:f,m=s>l?s>u?s:u:l>u?l:u,v=A>h?A>f?A:f:h>f?h:f,y=sy(p,d,n,e,i),g=sy(m,v,n,e,i),_=t.prevZ,x=t.nextZ;_&&_.z>=y&&x&&x.z<=g;){if(_.x>=p&&_.x<=m&&_.y>=d&&_.y<=v&&_!==o&&_!==a&&va(s,A,l,h,u,f,_.x,_.y)&&vt(_.prev,_,_.next)>=0||(_=_.prevZ,x.x>=p&&x.x<=m&&x.y>=d&&x.y<=v&&x!==o&&x!==a&&va(s,A,l,h,u,f,x.x,x.y)&&vt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;_&&_.z>=y;){if(_.x>=p&&_.x<=m&&_.y>=d&&_.y<=v&&_!==o&&_!==a&&va(s,A,l,h,u,f,_.x,_.y)&&vt(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;x&&x.z<=g;){if(x.x>=p&&x.x<=m&&x.y>=d&&x.y<=v&&x!==o&&x!==a&&va(s,A,l,h,u,f,x.x,x.y)&&vt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function ez(t,n,e){var i=t;do{var o=i.prev,r=i.next.next;!Bf(o,r)&&h_(o,i,i.next,r)&&nu(o,r)&&nu(r,o)&&(n.push(o.i/e|0),n.push(i.i/e|0),n.push(r.i/e|0),iu(i),iu(i.next),i=t=r),i=i.next}while(i!==t);return Yo(i)}function tz(t,n,e,i,o,r){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&cz(a,s)){var l=A_(a,s);a=Yo(a,a.next),l=Yo(l,l.next),tu(a,n,e,i,o,r,0),tu(l,n,e,i,o,r,0);return}s=s.next}a=a.next}while(a!==t)}function nz(t,n,e,i){var o=[],r,a,s,l,u;for(r=0,a=n.length;r<a;r++)s=n[r]*i,l=r<a-1?n[r+1]*i:t.length,u=c_(t,s,l,i,!1),u===u.next&&(u.steiner=!0),o.push(uz(u));for(o.sort(iz),r=0;r<o.length;r++)e=rz(o[r],e);return e}function iz(t,n){return t.x-n.x}function rz(t,n){var e=oz(t,n);if(!e)return n;var i=A_(e,t);return Yo(i,i.next),Yo(e,e.next)}function oz(t,n){var e=n,i=t.x,o=t.y,r=-1/0,a;do{if(o<=e.y&&o>=e.next.y&&e.next.y!==e.y){var s=e.x+(o-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(s<=i&&s>r&&(r=s,a=e.x<e.next.x?e:e.next,s===i))return a}e=e.next}while(e!==n);if(!a)return null;var l=a,u=a.x,A=a.y,h=1/0,f;e=a;do i>=e.x&&e.x>=u&&i!==e.x&&va(o<A?i:r,o,u,A,o<A?r:i,o,e.x,e.y)&&(f=Math.abs(o-e.y)/(i-e.x),nu(e,t)&&(f<h||f===h&&(e.x>a.x||e.x===a.x&&sz(a,e)))&&(a=e,h=f)),e=e.next;while(e!==l);return a}function sz(t,n){return vt(t.prev,t,n.prev)<0&&vt(n.next,t,t.next)<0}function az(t,n,e,i){var o=t;do o.z===0&&(o.z=sy(o.x,o.y,n,e,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,lz(o)}function lz(t){var n,e,i,o,r,a,s,l,u=1;do{for(e=t,t=null,r=null,a=0;e;){for(a++,i=e,s=0,n=0;n<u&&(s++,i=i.nextZ,!!i);n++);for(l=u;s>0||l>0&&i;)s!==0&&(l===0||!i||e.z<=i.z)?(o=e,e=e.nextZ,s--):(o=i,i=i.nextZ,l--),r?r.nextZ=o:t=o,o.prevZ=r,r=o;e=i}r.nextZ=null,u*=2}while(a>1);return t}function sy(t,n,e,i,o){return t=(t-e)*o|0,n=(n-i)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function uz(t){var n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function va(t,n,e,i,o,r,a,s){return(o-a)*(n-s)>=(t-a)*(r-s)&&(t-a)*(i-s)>=(e-a)*(n-s)&&(e-a)*(r-s)>=(o-a)*(i-s)}function cz(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!hz(t,n)&&(nu(t,n)&&nu(n,t)&&Az(t,n)&&(vt(t.prev,t,n.prev)||vt(t,n.prev,n))||Bf(t,n)&&vt(t.prev,t,t.next)>0&&vt(n.prev,n,n.next)>0)}function vt(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function Bf(t,n){return t.x===n.x&&t.y===n.y}function h_(t,n,e,i){var o=If(vt(t,n,e)),r=If(vt(t,n,i)),a=If(vt(e,i,t)),s=If(vt(e,i,n));return!!(o!==r&&a!==s||o===0&&Tf(t,e,n)||r===0&&Tf(t,i,n)||a===0&&Tf(e,t,i)||s===0&&Tf(e,n,i))}function Tf(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function If(t){return t>0?1:t<0?-1:0}function hz(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&h_(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function nu(t,n){return vt(t.prev,t,t.next)<0?vt(t,n,t.next)>=0&&vt(t,t.prev,n)>=0:vt(t,n,t.prev)<0||vt(t,t.next,n)<0}function Az(t,n){var e=t,i=!1,o=(t.x+n.x)/2,r=(t.y+n.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&o<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==t);return i}function A_(t,n){var e=new ay(t.i,t.x,t.y),i=new ay(n.i,n.x,n.y),o=t.next,r=n.prev;return t.next=n,n.prev=t,e.next=o,o.prev=e,i.next=e,e.prev=i,r.next=i,i.prev=r,i}function f_(t,n,e,i){var o=new ay(t,n,e);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function iu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ay(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Pf.deviation=function(t,n,e,i){var o=n&&n.length,r=o?n[0]*e:t.length,a=Math.abs(ly(t,0,r,e));if(o)for(var s=0,l=n.length;s<l;s++){var u=n[s]*e,A=s<l-1?n[s+1]*e:t.length;a-=Math.abs(ly(t,u,A,e))}var h=0;for(s=0;s<i.length;s+=3){var f=i[s]*e,p=i[s+1]*e,d=i[s+2]*e;h+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return a===0&&h===0?0:Math.abs((h-a)/a)};function ly(t,n,e,i){for(var o=0,r=n,a=e-i;r<e;r+=i)o+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return o}Pf.flatten=function(t){for(var n=t[0][0].length,e={vertices:[],holes:[],dimensions:n},i=0,o=0;o<t.length;o++){for(var r=0;r<t[o].length;r++)for(var a=0;a<n;a++)e.vertices.push(t[o][r][a]);o>0&&(i+=t[o-1].length,e.holes.push(i))}return e};var fz=oy.exports;const dz=Ml(fz),Vc=class Vc extends Ln{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 u=()=>{this.geoPolygon&&(this.geoPolygon.fill=!1)};u(),this.d(e.filledChanged.don(u))}const r=this.czmSideCustomPrimitive=this.dv(new ut(i,e.id)),a=this.czmSideTexture=this.ad(new ft(i)),s=this.czmBottomCustomPrimitive=this.dv(new ut(i,e.id)),l=this.czmBottomTexture=this.ad(new ft(i));this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([s,"allowPicking"],[e,"allowPicking"]));{const u=()=>{r.show=e.show&&e.filled&&e.points&&e.points.length>2,s.show=e.show&&e.filled&&e.points&&e.points.length>2};u();const A=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.pointsChanged));this.dispose(A.don(u))}{const u=(f,p,d,m,v)=>{f.position=p;const y=d.flat();let g=m=="bottom"?dz(y,null,3):this._triangleIndices(d.length),_=[],x=-1/0,E=1/0,B=-1/0,P=1/0,I=0;if(m=="bottom"){for(let C=0;C<d.length;C++)B=B>d[C][0]?B:d[C][0],P=P<d[C][0]?P:d[C][0],x=x>d[C][1]?x:d[C][1],E=E<d[C][1]?E:d[C][1];this._width=B-P,this._height=x-E;for(let C=0;C<d.length;C++)_.push((d[C][0]-this._width/2)/this._width,(d[C][1]-this._height/2)/this._height)}else{for(let C=0;C<d.length;C++)this._width+=this._getDistance(d[C],d[C-1<0?0:C-1]),x=x>d[C][2]?x:d[C][2],E=E<d[C][2]?E:d[C][2];this._height=x-E;for(let C=0;C<d.length;C++)I+=this._getDistance(d[C],d[C-1<0?0:C-1]),_.push(I/this._width,(d[C][2]-E)/this._height)}f.indexTypedArray=new Uint16Array(v?g:g.reverse()),f.attributes={position:{typedArray:new Float32Array(y),componentsPerAttribute:3},st:{typedArray:new Float32Array(v?_:_.reverse()),componentsPerAttribute:2}};const D=m=="bottom"?e.bottomImage.uDis??50:e.sideImage.uDis??50,F=m=="bottom"?e.bottomImage.vDis??50:e.sideImage.vDis??50;f.fragmentShaderSource=`in vec2 v_st;
|
|
3659
3659
|
uniform sampler2D u_image;
|
|
3660
3660
|
uniform vec4 u_color;
|
|
3661
3661
|
void main()
|
|
@@ -3666,7 +3666,7 @@ ${r_}
|
|
|
3666
3666
|
vec4 imageColor = texture(u_image, st);
|
|
3667
3667
|
out_FragColor = imageColor * u_color;
|
|
3668
3668
|
}
|
|
3669
|
-
`;const S=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!S)return;const{min:T,max:w}=S;f.setLocalAxisedBoundingBox(T,w)},A=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:p}=c.getMinMaxCorner(e.points),d=f[2]-e.depth;if(!c.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=wn({originPosition:p},e.points.map((E,B)=>{let P=[...E];return P[2]=d,P}));u(s,p,x[0],"bottom",!0)}const m=this._interpolationAlongPolygon(e.points.map((x,E)=>b.Cartesian3.fromArray(c.lbhToXyz(x))),e.interpolation),v=await i.getHeightsByLonLats(m.map(x=>[x[0],x[1]]));let y=[];for(let x=0;x<m.length;x++){const E=m[x];y.push([E[0],E[1],v[x]??E[2]],[E[0],E[1],d])}const g=wn({originPosition:p},y);let _=this._isClockwise(e.points,i);u(r,p,g[0],"side",_)}else r.attributes=void 0,s.attributes=void 0};A();const h=this.dv(c.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(h.don(A))}{const u=()=>{a.uri=e.sideImage.url,l.uri=e.bottomImage.url,r.uniformMap={u_image:{type:"texture",id:a.id},u_color:[1,1,1,e.opacity]},s.uniformMap={u_image:{type:"texture",id:l.id},u_color:[1,1,1,e.opacity]}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(A.don(u))}}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],a=e[(l+1)%e.length],s=this._interpolationAlongLine(r,a,i);o.push(...s)}return o.push(o[0]),o}_interpolationAlongLine(e,i,o){var r=[],a=b.Cartesian3.distance(e,i),s=b.Cartesian3.subtract(i,e,new b.Cartesian3);s.equals(b.Cartesian3.ZERO)||b.Cartesian3.normalize(s,s);for(var l=0;l<a;){var u=new b.Cartesian3(s.x*l,s.y*l,s.z*l),A=b.Cartesian3.add(e,u,new b.Cartesian3);const h=De(A);h&&r.push(h),l+=o}return r}_isClockwise(e,i){if(i.viewer)for(let o=0;o<e.length;o++){let r=b.Cartesian3.fromDegrees(...e[o]),a=b.Cartesian3.fromDegrees(...e[(o+1)%e.length]),s=b.Cartesian3.fromDegrees(...e[(o+2)%e.length]),l=b.Cartesian3.subtract(a,r,new b.Cartesian3),u=b.Cartesian3.subtract(s,a,new b.Cartesian3);if(l.equals(b.Cartesian3.ZERO)||u.equals(b.Cartesian3.ZERO))return!0;if(b.Cartesian3.normalize(l,l),b.Cartesian3.normalize(u,u),Math.abs(b.Cartesian3.dot(l,u))==1){if(o==e.length-1)return!0;continue}let A=b.Cartesian3.cross(l,u,new b.Cartesian3);return b.Cartesian3.dot(A,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(Vc,"type",Vc.register("ESCesiumViewer",c.ESPit.type,Vc));let uy=Vc;const Nc=class Nc extends Ln{constructor(e,i){super(e,i);L(this,"_czmPolygonPrimitive");L(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new Lr(i,e.id)),console.log(this.czmPolygonPrimitive),this._geoPolylines=this.disposeVar(new ai(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}{const s=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};s(),this.ad(this.sceneObject.showChanged.don(s))}const r=this._geoPolylines;r.arcType="RHUMB";const a=this._czmPolygonPrimitive;this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"]));{a.perPositionHeight=!0;const s=()=>{r.show=e.show&&e.stroked,a.show=e.show&&e.filled,a.material={type:"Color",color:e.fillColor}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(l.don(s))}{const s=()=>{const u={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(r.positions=[[...e.points,e.points[0]]],u.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let A=0;A<e.innerRings.length;A++){const h=e.innerRings[A];u.holes.push({positions:h}),r.positions.push([...h,h[0]])}a.polygonHierarchy=u}else a.polygonHierarchy=u};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>s()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Nc,"type",Nc.register("ESCesiumViewer",c.ESPolygonWithHole.type,Nc));let cy=Nc;var an=63710088e-1,hy={centimeters:an*100,centimetres:an*100,degrees:an/111325,feet:an*3.28084,inches:an*39.37,kilometers:an/1e3,kilometres:an/1e3,meters:an,metres:an,miles:an/1609.344,millimeters:an*1e3,millimetres:an*1e3,nauticalmiles:an/1852,radians:1,yards:an*1.0936},dz={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/an,yards:1.0936133},Ay={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 zn(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 pz(t,n,e){switch(t){case"Point":return Xt(n).geometry;case"LineString":return Yn(n).geometry;case"Polygon":return Vt(n).geometry;case"MultiPoint":return d_(n).geometry;case"MultiLineString":return fy(n).geometry;case"MultiPolygon":return dy(n).geometry;default:throw new Error(t+" is invalid")}}function Xt(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(!Ff(t[0])||!Ff(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return zn(i,n,e)}function mz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Xt(i,n)}),e)}function Vt(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 a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:t};return zn(s,n,e)}function gz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Vt(i,n)}),e)}function Yn(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 zn(i,n,e)}function yz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Yn(i,n)}),e)}function Pn(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 fy(t,n,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:t};return zn(i,n,e)}function d_(t,n,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:t};return zn(i,n,e)}function dy(t,n,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:t};return zn(i,n,e)}function vz(t,n,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:t};return zn(i,n,e)}function wz(t,n){if(n===void 0&&(n=0),n&&!(n>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,n||0);return Math.round(t*e)/e}function py(t,n){n===void 0&&(n="kilometers");var e=hy[n];if(!e)throw new Error(n+" units is invalid");return t*e}function my(t,n){n===void 0&&(n="kilometers");var e=hy[n];if(!e)throw new Error(n+" units is invalid");return t/e}function bz(t,n){return p_(my(t,n))}function xz(t){var n=t%360;return n<0&&(n+=360),n}function p_(t){var n=t%(2*Math.PI);return n*180/Math.PI}function ru(t){var n=t%360;return n*Math.PI/180}function _z(t,n,e){if(n===void 0&&(n="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return py(my(t,n),e)}function Cz(t,n,e){if(n===void 0&&(n="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=Ay[n];if(!i)throw new Error("invalid original units");var o=Ay[e];if(!o)throw new Error("invalid final units");return t/i*o}function Ff(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function gy(t){return!!t&&t.constructor===Object}function Sz(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(n){if(!Ff(n))throw new Error("bbox must only contain numbers")})}function Ez(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const Pz=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:Ay,bearingToAzimuth:xz,convertArea:Cz,convertLength:_z,degreesToRadians:ru,earthRadius:an,factors:hy,feature:zn,featureCollection:Pn,geometry:pz,geometryCollection:vz,isNumber:Ff,isObject:gy,lengthToDegrees:bz,lengthToRadians:my,lineString:Yn,lineStrings:yz,multiLineString:fy,multiPoint:d_,multiPolygon:dy,point:Xt,points:mz,polygon:Vt,polygons:gz,radiansToDegrees:p_,radiansToLength:py,round:wz,unitsFactors:dz,validateBBox:Sz,validateId:Ez},Symbol.toStringTag,{value:"Module"}));function Mf(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 Ii(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 Bz(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 Fi(t){return t.type==="Feature"?t.geometry:t}function Tz(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Mi(t,n,e){e===void 0&&(e={});var i=Mf(t),o=Mf(n),r=ru(o[1]-i[1]),a=ru(o[0]-i[0]),s=ru(i[1]),l=ru(o[1]),u=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return py(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Jo(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,p=t.type,d=p==="FeatureCollection",m=p==="Feature",v=d?t.features.length:1,y=0;y<v;y++){u=d?t.features[y].geometry:m?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var g=0;g<s;g++){var _=0,x=0;if(a=f?u.geometries[g]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,_,x)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,_,x)===!1)return!1;h++,E==="MultiPoint"&&_++}E==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,_,x)===!1)return!1;h++}E==="MultiLineString"&&_++,E==="Polygon"&&x++}E==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,_,x)===!1)return!1;h++}x++}_++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Jo(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Iz(t,n,e,i){var o=e;return Jo(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function m_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function Fz(t,n,e){var i=e;return m_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function wa(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 Mz(t,n,e){var i=e;return wa(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function Dz(t){var n=[];return Jo(t,function(e){n.push(e)}),n}function yy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,p=t.type==="FeatureCollection",d=t.type==="Feature",m=p?t.features.length:1;for(e=0;e<m;e++){for(s=p?t.features[e].geometry:d?t.geometry:t,u=p?t.features[e].properties:d?t.properties:{},A=p?t.features[e].bbox:d?t.bbox:void 0,h=p?t.features[e].id:d?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Rz(t,n,e){var i=e;return yy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function rr(t,n){yy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(zn(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(zn(h,o),i,u)===!1)return!1}})}function Uz(t,n,e){var i=e;return rr(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function g_(t,n){rr(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(Jo(e,function(h,f,p,d,m){if(s===void 0||i>l||d>u||m>A){s=h,l=i,u=d,A=m,r=0;return}var v=Yn([s,h],e.properties);if(n(v,i,o,m,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function y_(t,n,e){var i=e,o=!1;return g_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function v_(t,n){if(!t)throw new Error("geojson is required");rr(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(Yn(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function Oz(t,n,e){var i=e;return v_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function Lz(t,n){if(n=n||{},!gy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),Yn([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),Yn([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),Yn([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),Yn([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function zz(t,n){if(n=n||{},!gy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return Xt(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),Xt(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),Xt(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),Xt(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),Xt(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),Xt(l[i][o][r],a,n)}throw new Error("geojson is invalid")}const kz=Object.freeze(Object.defineProperty({__proto__:null,coordAll:Dz,coordEach:Jo,coordReduce:Iz,featureEach:wa,featureReduce:Mz,findPoint:zz,findSegment:Lz,flattenEach:rr,flattenReduce:Uz,geomEach:yy,geomReduce:Rz,lineEach:v_,lineReduce:Oz,propEach:m_,propReduce:Fz,segmentEach:g_,segmentReduce:y_},Symbol.toStringTag,{value:"Module"}));function Qz(t,n){return n===void 0&&(n={}),y_(t,function(e,i){var o=i.geometry.coordinates;return e+Mi(o[0],o[1],n)},0)}function Vz(t){var n=Yn(t),e=Qz(n,{units:"meters"});return e}function*Nz(t){t.type==="FeatureCollection"?yield*t.features.map(n=>[n.geometry,n]):t.type==="Feature"&&(yield[t.geometry,t])}function*Hz(t){for(const[n,e]of Nz(t))if(n.type==="LineString")yield[n.coordinates,e];else if(n.type==="MultiLineString")for(let i of n.coordinates)yield[i,e]}function Gz(t,n,e){return[...Hz(t)].map(([i,o])=>{if(i.length<2)return;const r=i.map(l=>[l[0],l[1],l[2]??0]),s=Vz(r)/e;return{positions:r,repeat:s,width:n,extra:{geojson:{feature:o}}}}).filter(i=>!!i)}const ou=b.ArcType,Wz=b.arrayRemoveDuplicates,jz=b.BoundingSphere,Ft=b.Cartesian3,Bn=b.Color,ba=b.ComponentDatatype,qz=b.Frozen,kn=b.defined,xa=b.DeveloperError,Di=b.Ellipsoid,Kz=b.Geometry,_a=b.GeometryAttribute,Zz=b.GeometryAttributes,$z=b.GeometryType,Xz=b.IndexDatatype,w_=b.Math,su=b.PolylinePipeline,Yz=b.PrimitiveType,or=b.VertexFormat;var b_=[];function Jz(t,n,e,i,o){var r=b_;r.length=o;var a,s=e.red,l=e.green,u=e.blue,A=e.alpha,h=i.red,f=i.green,p=i.blue,d=i.alpha;if(Bn.equals(e,i)){for(a=0;a<o;a++)r[a]=Bn.clone(e);return r}var m=(h-s)/o,v=(f-l)/o,y=(p-u)/o,g=(d-A)/o;for(a=0;a<o;a++)r[a]=new Bn(s+a*m,l+a*v,u+a*y,A+a*g);return r}function Ca(t){t=t??qz.EMPTY_OBJECT;var n=t.positions,e=t.colors,i=t.width??1,o=t.colorsPerVertex??!1;if(!kn(n)||n.length<2)throw new xa("At least two positions are required.");if(typeof i!="number")throw new xa("width must be a number");if(kn(e)&&(o&&e.length<n.length||!o&&e.length<n.length-1))throw new xa("colors has an invalid length.");this._positions=n,this._colors=e,this._width=i,this._colorsPerVertex=o,this._vertexFormat=or.clone(t.vertexFormat??or.DEFAULT),this._arcType=t.arcType??ou.GEODESIC,this._granularity=t.granularity??w_.RADIANS_PER_DEGREE,this._ellipsoid=Di.clone(t.ellipsoid??Di.WGS84),this._workerName="createPolylineGeometry";var r=1+n.length*Ft.packedLength;r+=kn(e)?1+e.length*Bn.packedLength:1,this.packedLength=r+Di.packedLength+or.packedLength+4}Ca.pack=function(t,n,e){if(!kn(t))throw new xa("value is required");if(!kn(n))throw new xa("array is required");e=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 a=t._colors;for(r=kn(a)?a.length:0,n[e++]=r,i=0;i<r;++i,e+=Bn.packedLength)Bn.pack(a[i],n,e);return Di.pack(t._ellipsoid,n,e),e+=Di.packedLength,or.pack(t._vertexFormat,n,e),e+=or.packedLength,n[e++]=t._width,n[e++]=t._colorsPerVertex?1:0,n[e++]=t._arcType,n[e]=t._granularity,n};var x_=Di.clone(Di.UNIT_SPHERE),__=new or,es={positions:void 0,colors:void 0,ellipsoid:x_,vertexFormat:__,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};Ca.unpack=function(t,n,e){if(!kn(t))throw new xa("array is required");n=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 a=o>0?new Array(o):void 0;for(i=0;i<o;++i,n+=Bn.packedLength)a[i]=Bn.unpack(t,n);var s=Di.unpack(t,n,x_);n+=Di.packedLength;var l=or.unpack(t,n,__);n+=or.packedLength;var u=t[n++],A=t[n++]===1,h=t[n++],f=t[n];return kn(e)?(e._positions=r,e._colors=a,e._ellipsoid=Di.clone(s,e._ellipsoid),e._vertexFormat=or.clone(l,e._vertexFormat),e._width=u,e._colorsPerVertex=A,e._arcType=h,e._granularity=f,e):(es.positions=r,es.colors=a,es.width=u,es.colorsPerVertex=A,es.arcType=h,es.granularity=f,new Ca(es))};var C_=new Ft,S_=new Ft,E_=new Ft,P_=new Ft;Ca.createGeometry=function(t){var n=t._width,e=t._vertexFormat,i=t._colors,o=t._colorsPerVertex,r=t._arcType,a=t._granularity,s=t._ellipsoid,l,u,A,h=Wz(t._positions,Ft.equalsEpsilon),f=h.length;if(f<2||n<=0)return;if(r===ou.GEODESIC||r===ou.RHUMB){var p,d;r===ou.GEODESIC?(p=w_.chordLength(a,s.maximumRadius),d=su.numberOfPoints):(p=a,d=su.numberOfPointsRhumbLine);var m=su.extractHeights(h,s);if(kn(i)){var v=1;for(l=0;l<f-1;++l)v+=d(h[l],h[l+1],p);var y=new Array(v),g=0;for(l=0;l<f-1;++l){var _=h[l],x=h[l+1],E=i[l],B=d(_,x,p);if(o&&l<v){var P=i[l+1],I=Jz(_,x,E,P,B),D=I.length;for(u=0;u<D;++u)y[g++]=I[u]}else for(u=0;u<B;++u)y[g++]=Bn.clone(E)}y[g]=Bn.clone(i[i.length-1]),i=y,b_.length=0}r===ou.GEODESIC?h=su.generateCartesianArc({positions:h,minDistance:p,ellipsoid:s,height:m}):h=su.generateCartesianRhumbArc({positions:h,granularity:p,ellipsoid:s,height:m})}f=h.length;var F=f*4-4,S=new Float64Array(F*3),T=new Float64Array(F*3),w=new Float64Array(F*3),C=new Float32Array(F*2),M=e.st?new Float32Array(F*2):void 0,R=kn(i)?new Uint8Array(F*4):void 0,U=0,O=0,z=0,k=0,Q;let V=[0];{for(l=0;l<f-1;l++){const G=b.Cartesian3.distance(h[l],h[l+1]);V.push(V[V.length-1]+G)}V=V.map(G=>G/V[V.length-1])}for(u=0;u<f;++u){u===0?(Q=C_,Ft.subtract(h[0],h[1],Q),Ft.add(h[0],Q,Q)):Q=h[u-1],Ft.clone(Q,E_),Ft.clone(h[u],S_),u===f-1?(Q=C_,Ft.subtract(h[f-1],h[f-2],Q),Ft.add(h[f-1],Q,Q)):Q=h[u+1],Ft.clone(Q,P_);var j,J;kn(R)&&(u!==0&&!o?j=i[u-1]:j=i[u],u!==f-1&&(J=i[u]));var ee=u===0?2:0,ie=u===f-1?2:4;for(A=ee;A<ie;++A){Ft.pack(S_,S,U),Ft.pack(E_,T,U),Ft.pack(P_,w,U),U+=3;var oe=A-2<0?-1:1;if(C[O++]=2*(A%2)-1,C[O++]=oe*n,e.st&&(M[z++]=V[u],M[z++]=Math.max(C[O-2],0)),kn(R)){var le=A<2?j:J;R[k++]=Bn.floatToByte(le.red),R[k++]=Bn.floatToByte(le.green),R[k++]=Bn.floatToByte(le.blue),R[k++]=Bn.floatToByte(le.alpha)}}}var ue=new Zz;ue.position=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:S}),ue.prevPosition=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:T}),ue.nextPosition=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:w}),ue.expandAndWidth=new _a({componentDatatype:ba.FLOAT,componentsPerAttribute:2,values:C}),e.st&&(ue.st=new _a({componentDatatype:ba.FLOAT,componentsPerAttribute:2,values:M})),kn(R)&&(ue.color=new _a({componentDatatype:ba.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));var re=Xz.createTypedArray(F,f*6-6),ce=0,$=0,q=f-1;for(u=0;u<q;++u)re[$++]=ce,re[$++]=ce+2,re[$++]=ce+1,re[$++]=ce+1,re[$++]=ce+2,re[$++]=ce+3,ce+=4;return new Kz({attributes:ue,indices:re,primitiveType:Yz.TRIANGLES,boundingSphere:jz.fromPoints(h),geometryType:$z.POLYLINES})};var vy;function e6(){return typeof vy>"u"&&(vy=new b.EllipsoidGeodesic),vy}function t6(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 n6(t,n,e,i=1){var o=e6(),r=b.Cartesian3.fromDegreesArray([t[0],t[1],n[0],n[1]]),a=[0,0];t.length>=3&&n.length>=3&&(a=[t[2],n[2]]);var s=b.Cartographic.fromDegrees(t[0],t[1]),l=b.Cartographic.fromDegrees(n[0],n[1]);o.setEndPoints(s,l);var u=o.surfaceDistance,A=b.PolylinePipeline.generateCartesianArc({positions:r,height:a,minDistance:u/36}),h=A.length;return A.forEach(function(f,p){var d=p/(h-1),m=t6(d,u*i),v=b.Cartographic.fromCartesian(f);v.height+=m,b.Cartesian3.fromRadians(v.longitude,v.latitude,v.height,b.Ellipsoid.WGS84,A[p])}),A}function i6(t=[.8,.8,0,1],n=!0,e=!0,i){var o;const r=i?{type:"Image",uniforms:{color:new b.Color(...t)}}:{type:"Color",uniforms:{color:new b.Color(...t)}};n?(o=new b.PolylineMaterialAppearance({material:new b.Material({fabric:r,translucent:!1}),translucent:!1}),o.renderState.blending=b.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const A=b.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i)):(o=new b.PolylineMaterialAppearance({material:new b.Material({fabric:r,translucent:!0})}),o.getRenderState=function(){const A=b.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i));var a=b.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),s=`out vec4 v_twp;
|
|
3669
|
+
`;const S=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!S)return;const{min:T,max:w}=S;f.setLocalAxisedBoundingBox(T,w)},A=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:p}=c.getMinMaxCorner(e.points),d=f[2]-e.depth;if(!c.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=wn({originPosition:p},e.points.map((E,B)=>{let P=[...E];return P[2]=d,P}));u(s,p,x[0],"bottom",!0)}const m=this._interpolationAlongPolygon(e.points.map((x,E)=>b.Cartesian3.fromArray(c.lbhToXyz(x))),e.interpolation),v=await i.getHeightsByLonLats(m.map(x=>[x[0],x[1]]));let y=[];for(let x=0;x<m.length;x++){const E=m[x];y.push([E[0],E[1],v[x]??E[2]],[E[0],E[1],d])}const g=wn({originPosition:p},y);let _=this._isClockwise(e.points,i);u(r,p,g[0],"side",_)}else r.attributes=void 0,s.attributes=void 0};A();const h=this.dv(c.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(h.don(A))}{const u=()=>{a.uri=e.sideImage.url,l.uri=e.bottomImage.url,r.uniformMap={u_image:{type:"texture",id:a.id},u_color:[1,1,1,e.opacity]},s.uniformMap={u_image:{type:"texture",id:l.id},u_color:[1,1,1,e.opacity]}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(A.don(u))}}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],a=e[(l+1)%e.length],s=this._interpolationAlongLine(r,a,i);o.push(...s)}return o.push(o[0]),o}_interpolationAlongLine(e,i,o){var r=[],a=b.Cartesian3.distance(e,i),s=b.Cartesian3.subtract(i,e,new b.Cartesian3);s.equals(b.Cartesian3.ZERO)||b.Cartesian3.normalize(s,s);for(var l=0;l<a;){var u=new b.Cartesian3(s.x*l,s.y*l,s.z*l),A=b.Cartesian3.add(e,u,new b.Cartesian3);const h=De(A);h&&r.push(h),l+=o}return r}_isClockwise(e,i){if(i.viewer)for(let o=0;o<e.length;o++){let r=b.Cartesian3.fromDegrees(...e[o]),a=b.Cartesian3.fromDegrees(...e[(o+1)%e.length]),s=b.Cartesian3.fromDegrees(...e[(o+2)%e.length]),l=b.Cartesian3.subtract(a,r,new b.Cartesian3),u=b.Cartesian3.subtract(s,a,new b.Cartesian3);if(l.equals(b.Cartesian3.ZERO)||u.equals(b.Cartesian3.ZERO))return!0;if(b.Cartesian3.normalize(l,l),b.Cartesian3.normalize(u,u),Math.abs(b.Cartesian3.dot(l,u))==1){if(o==e.length-1)return!0;continue}let A=b.Cartesian3.cross(l,u,new b.Cartesian3);return b.Cartesian3.dot(A,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(Vc,"type",Vc.register("ESCesiumViewer",c.ESPit.type,Vc));let uy=Vc;const Nc=class Nc extends Ln{constructor(e,i){super(e,i);L(this,"_czmPolygonPrimitive");L(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new Lr(i,e.id)),console.log(this.czmPolygonPrimitive),this._geoPolylines=this.disposeVar(new ai(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}{const s=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};s(),this.ad(this.sceneObject.showChanged.don(s))}const r=this._geoPolylines;r.arcType="RHUMB";const a=this._czmPolygonPrimitive;this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"]));{a.perPositionHeight=!0;const s=()=>{r.show=e.show&&e.stroked,a.show=e.show&&e.filled,a.material={type:"Color",color:e.fillColor}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(l.don(s))}{const s=()=>{const u={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(r.positions=[[...e.points,e.points[0]]],u.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let A=0;A<e.innerRings.length;A++){const h=e.innerRings[A];u.holes.push({positions:h}),r.positions.push([...h,h[0]])}a.polygonHierarchy=u}else a.polygonHierarchy=u};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>s()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Nc,"type",Nc.register("ESCesiumViewer",c.ESPolygonWithHole.type,Nc));let cy=Nc;var an=63710088e-1,hy={centimeters:an*100,centimetres:an*100,degrees:an/111325,feet:an*3.28084,inches:an*39.37,kilometers:an/1e3,kilometres:an/1e3,meters:an,metres:an,miles:an/1609.344,millimeters:an*1e3,millimetres:an*1e3,nauticalmiles:an/1852,radians:1,yards:an*1.0936},pz={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/an,yards:1.0936133},Ay={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 zn(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 mz(t,n,e){switch(t){case"Point":return Xt(n).geometry;case"LineString":return Yn(n).geometry;case"Polygon":return Vt(n).geometry;case"MultiPoint":return d_(n).geometry;case"MultiLineString":return fy(n).geometry;case"MultiPolygon":return dy(n).geometry;default:throw new Error(t+" is invalid")}}function Xt(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(!Ff(t[0])||!Ff(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return zn(i,n,e)}function gz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Xt(i,n)}),e)}function Vt(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 a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:t};return zn(s,n,e)}function yz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Vt(i,n)}),e)}function Yn(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 zn(i,n,e)}function vz(t,n,e){return e===void 0&&(e={}),Pn(t.map(function(i){return Yn(i,n)}),e)}function Pn(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 fy(t,n,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:t};return zn(i,n,e)}function d_(t,n,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:t};return zn(i,n,e)}function dy(t,n,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:t};return zn(i,n,e)}function wz(t,n,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:t};return zn(i,n,e)}function bz(t,n){if(n===void 0&&(n=0),n&&!(n>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,n||0);return Math.round(t*e)/e}function py(t,n){n===void 0&&(n="kilometers");var e=hy[n];if(!e)throw new Error(n+" units is invalid");return t*e}function my(t,n){n===void 0&&(n="kilometers");var e=hy[n];if(!e)throw new Error(n+" units is invalid");return t/e}function xz(t,n){return p_(my(t,n))}function _z(t){var n=t%360;return n<0&&(n+=360),n}function p_(t){var n=t%(2*Math.PI);return n*180/Math.PI}function ru(t){var n=t%360;return n*Math.PI/180}function Cz(t,n,e){if(n===void 0&&(n="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return py(my(t,n),e)}function Sz(t,n,e){if(n===void 0&&(n="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=Ay[n];if(!i)throw new Error("invalid original units");var o=Ay[e];if(!o)throw new Error("invalid final units");return t/i*o}function Ff(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function gy(t){return!!t&&t.constructor===Object}function Ez(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(n){if(!Ff(n))throw new Error("bbox must only contain numbers")})}function Pz(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const Bz=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:Ay,bearingToAzimuth:_z,convertArea:Sz,convertLength:Cz,degreesToRadians:ru,earthRadius:an,factors:hy,feature:zn,featureCollection:Pn,geometry:mz,geometryCollection:wz,isNumber:Ff,isObject:gy,lengthToDegrees:xz,lengthToRadians:my,lineString:Yn,lineStrings:vz,multiLineString:fy,multiPoint:d_,multiPolygon:dy,point:Xt,points:gz,polygon:Vt,polygons:yz,radiansToDegrees:p_,radiansToLength:py,round:bz,unitsFactors:pz,validateBBox:Ez,validateId:Pz},Symbol.toStringTag,{value:"Module"}));function Mf(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 Ii(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 Tz(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 Fi(t){return t.type==="Feature"?t.geometry:t}function Iz(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Mi(t,n,e){e===void 0&&(e={});var i=Mf(t),o=Mf(n),r=ru(o[1]-i[1]),a=ru(o[0]-i[0]),s=ru(i[1]),l=ru(o[1]),u=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return py(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Jo(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,p=t.type,d=p==="FeatureCollection",m=p==="Feature",v=d?t.features.length:1,y=0;y<v;y++){u=d?t.features[y].geometry:m?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var g=0;g<s;g++){var _=0,x=0;if(a=f?u.geometries[g]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,_,x)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,_,x)===!1)return!1;h++,E==="MultiPoint"&&_++}E==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,_,x)===!1)return!1;h++}E==="MultiLineString"&&_++,E==="Polygon"&&x++}E==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,_,x)===!1)return!1;h++}x++}_++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Jo(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Fz(t,n,e,i){var o=e;return Jo(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function m_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function Mz(t,n,e){var i=e;return m_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function wa(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 Dz(t,n,e){var i=e;return wa(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function Rz(t){var n=[];return Jo(t,function(e){n.push(e)}),n}function yy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,p=t.type==="FeatureCollection",d=t.type==="Feature",m=p?t.features.length:1;for(e=0;e<m;e++){for(s=p?t.features[e].geometry:d?t.geometry:t,u=p?t.features[e].properties:d?t.properties:{},A=p?t.features[e].bbox:d?t.bbox:void 0,h=p?t.features[e].id:d?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Uz(t,n,e){var i=e;return yy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function rr(t,n){yy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(zn(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(zn(h,o),i,u)===!1)return!1}})}function Oz(t,n,e){var i=e;return rr(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function g_(t,n){rr(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(Jo(e,function(h,f,p,d,m){if(s===void 0||i>l||d>u||m>A){s=h,l=i,u=d,A=m,r=0;return}var v=Yn([s,h],e.properties);if(n(v,i,o,m,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function y_(t,n,e){var i=e,o=!1;return g_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function v_(t,n){if(!t)throw new Error("geojson is required");rr(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(Yn(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function Lz(t,n,e){var i=e;return v_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function zz(t,n){if(n=n||{},!gy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),Yn([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),Yn([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),Yn([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),Yn([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function kz(t,n){if(n=n||{},!gy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return Xt(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),Xt(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),Xt(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),Xt(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),Xt(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),Xt(l[i][o][r],a,n)}throw new Error("geojson is invalid")}const Qz=Object.freeze(Object.defineProperty({__proto__:null,coordAll:Rz,coordEach:Jo,coordReduce:Fz,featureEach:wa,featureReduce:Dz,findPoint:kz,findSegment:zz,flattenEach:rr,flattenReduce:Oz,geomEach:yy,geomReduce:Uz,lineEach:v_,lineReduce:Lz,propEach:m_,propReduce:Mz,segmentEach:g_,segmentReduce:y_},Symbol.toStringTag,{value:"Module"}));function Vz(t,n){return n===void 0&&(n={}),y_(t,function(e,i){var o=i.geometry.coordinates;return e+Mi(o[0],o[1],n)},0)}function Nz(t){var n=Yn(t),e=Vz(n,{units:"meters"});return e}function*Hz(t){t.type==="FeatureCollection"?yield*t.features.map(n=>[n.geometry,n]):t.type==="Feature"&&(yield[t.geometry,t])}function*Gz(t){for(const[n,e]of Hz(t))if(n.type==="LineString")yield[n.coordinates,e];else if(n.type==="MultiLineString")for(let i of n.coordinates)yield[i,e]}function Wz(t,n,e){return[...Gz(t)].map(([i,o])=>{if(i.length<2)return;const r=i.map(l=>[l[0],l[1],l[2]??0]),s=Nz(r)/e;return{positions:r,repeat:s,width:n,extra:{geojson:{feature:o}}}}).filter(i=>!!i)}const ou=b.ArcType,jz=b.arrayRemoveDuplicates,qz=b.BoundingSphere,Ft=b.Cartesian3,Bn=b.Color,ba=b.ComponentDatatype,Kz=b.Frozen,kn=b.defined,xa=b.DeveloperError,Di=b.Ellipsoid,Zz=b.Geometry,_a=b.GeometryAttribute,$z=b.GeometryAttributes,Xz=b.GeometryType,Yz=b.IndexDatatype,w_=b.Math,su=b.PolylinePipeline,Jz=b.PrimitiveType,or=b.VertexFormat;var b_=[];function ek(t,n,e,i,o){var r=b_;r.length=o;var a,s=e.red,l=e.green,u=e.blue,A=e.alpha,h=i.red,f=i.green,p=i.blue,d=i.alpha;if(Bn.equals(e,i)){for(a=0;a<o;a++)r[a]=Bn.clone(e);return r}var m=(h-s)/o,v=(f-l)/o,y=(p-u)/o,g=(d-A)/o;for(a=0;a<o;a++)r[a]=new Bn(s+a*m,l+a*v,u+a*y,A+a*g);return r}function Ca(t){t=t??Kz.EMPTY_OBJECT;var n=t.positions,e=t.colors,i=t.width??1,o=t.colorsPerVertex??!1;if(!kn(n)||n.length<2)throw new xa("At least two positions are required.");if(typeof i!="number")throw new xa("width must be a number");if(kn(e)&&(o&&e.length<n.length||!o&&e.length<n.length-1))throw new xa("colors has an invalid length.");this._positions=n,this._colors=e,this._width=i,this._colorsPerVertex=o,this._vertexFormat=or.clone(t.vertexFormat??or.DEFAULT),this._arcType=t.arcType??ou.GEODESIC,this._granularity=t.granularity??w_.RADIANS_PER_DEGREE,this._ellipsoid=Di.clone(t.ellipsoid??Di.WGS84),this._workerName="createPolylineGeometry";var r=1+n.length*Ft.packedLength;r+=kn(e)?1+e.length*Bn.packedLength:1,this.packedLength=r+Di.packedLength+or.packedLength+4}Ca.pack=function(t,n,e){if(!kn(t))throw new xa("value is required");if(!kn(n))throw new xa("array is required");e=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 a=t._colors;for(r=kn(a)?a.length:0,n[e++]=r,i=0;i<r;++i,e+=Bn.packedLength)Bn.pack(a[i],n,e);return Di.pack(t._ellipsoid,n,e),e+=Di.packedLength,or.pack(t._vertexFormat,n,e),e+=or.packedLength,n[e++]=t._width,n[e++]=t._colorsPerVertex?1:0,n[e++]=t._arcType,n[e]=t._granularity,n};var x_=Di.clone(Di.UNIT_SPHERE),__=new or,es={positions:void 0,colors:void 0,ellipsoid:x_,vertexFormat:__,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};Ca.unpack=function(t,n,e){if(!kn(t))throw new xa("array is required");n=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 a=o>0?new Array(o):void 0;for(i=0;i<o;++i,n+=Bn.packedLength)a[i]=Bn.unpack(t,n);var s=Di.unpack(t,n,x_);n+=Di.packedLength;var l=or.unpack(t,n,__);n+=or.packedLength;var u=t[n++],A=t[n++]===1,h=t[n++],f=t[n];return kn(e)?(e._positions=r,e._colors=a,e._ellipsoid=Di.clone(s,e._ellipsoid),e._vertexFormat=or.clone(l,e._vertexFormat),e._width=u,e._colorsPerVertex=A,e._arcType=h,e._granularity=f,e):(es.positions=r,es.colors=a,es.width=u,es.colorsPerVertex=A,es.arcType=h,es.granularity=f,new Ca(es))};var C_=new Ft,S_=new Ft,E_=new Ft,P_=new Ft;Ca.createGeometry=function(t){var n=t._width,e=t._vertexFormat,i=t._colors,o=t._colorsPerVertex,r=t._arcType,a=t._granularity,s=t._ellipsoid,l,u,A,h=jz(t._positions,Ft.equalsEpsilon),f=h.length;if(f<2||n<=0)return;if(r===ou.GEODESIC||r===ou.RHUMB){var p,d;r===ou.GEODESIC?(p=w_.chordLength(a,s.maximumRadius),d=su.numberOfPoints):(p=a,d=su.numberOfPointsRhumbLine);var m=su.extractHeights(h,s);if(kn(i)){var v=1;for(l=0;l<f-1;++l)v+=d(h[l],h[l+1],p);var y=new Array(v),g=0;for(l=0;l<f-1;++l){var _=h[l],x=h[l+1],E=i[l],B=d(_,x,p);if(o&&l<v){var P=i[l+1],I=ek(_,x,E,P,B),D=I.length;for(u=0;u<D;++u)y[g++]=I[u]}else for(u=0;u<B;++u)y[g++]=Bn.clone(E)}y[g]=Bn.clone(i[i.length-1]),i=y,b_.length=0}r===ou.GEODESIC?h=su.generateCartesianArc({positions:h,minDistance:p,ellipsoid:s,height:m}):h=su.generateCartesianRhumbArc({positions:h,granularity:p,ellipsoid:s,height:m})}f=h.length;var F=f*4-4,S=new Float64Array(F*3),T=new Float64Array(F*3),w=new Float64Array(F*3),C=new Float32Array(F*2),M=e.st?new Float32Array(F*2):void 0,R=kn(i)?new Uint8Array(F*4):void 0,U=0,O=0,z=0,k=0,Q;let V=[0];{for(l=0;l<f-1;l++){const G=b.Cartesian3.distance(h[l],h[l+1]);V.push(V[V.length-1]+G)}V=V.map(G=>G/V[V.length-1])}for(u=0;u<f;++u){u===0?(Q=C_,Ft.subtract(h[0],h[1],Q),Ft.add(h[0],Q,Q)):Q=h[u-1],Ft.clone(Q,E_),Ft.clone(h[u],S_),u===f-1?(Q=C_,Ft.subtract(h[f-1],h[f-2],Q),Ft.add(h[f-1],Q,Q)):Q=h[u+1],Ft.clone(Q,P_);var j,J;kn(R)&&(u!==0&&!o?j=i[u-1]:j=i[u],u!==f-1&&(J=i[u]));var ee=u===0?2:0,ie=u===f-1?2:4;for(A=ee;A<ie;++A){Ft.pack(S_,S,U),Ft.pack(E_,T,U),Ft.pack(P_,w,U),U+=3;var oe=A-2<0?-1:1;if(C[O++]=2*(A%2)-1,C[O++]=oe*n,e.st&&(M[z++]=V[u],M[z++]=Math.max(C[O-2],0)),kn(R)){var le=A<2?j:J;R[k++]=Bn.floatToByte(le.red),R[k++]=Bn.floatToByte(le.green),R[k++]=Bn.floatToByte(le.blue),R[k++]=Bn.floatToByte(le.alpha)}}}var ue=new $z;ue.position=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:S}),ue.prevPosition=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:T}),ue.nextPosition=new _a({componentDatatype:ba.DOUBLE,componentsPerAttribute:3,values:w}),ue.expandAndWidth=new _a({componentDatatype:ba.FLOAT,componentsPerAttribute:2,values:C}),e.st&&(ue.st=new _a({componentDatatype:ba.FLOAT,componentsPerAttribute:2,values:M})),kn(R)&&(ue.color=new _a({componentDatatype:ba.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));var re=Yz.createTypedArray(F,f*6-6),ce=0,$=0,q=f-1;for(u=0;u<q;++u)re[$++]=ce,re[$++]=ce+2,re[$++]=ce+1,re[$++]=ce+1,re[$++]=ce+2,re[$++]=ce+3,ce+=4;return new Zz({attributes:ue,indices:re,primitiveType:Jz.TRIANGLES,boundingSphere:qz.fromPoints(h),geometryType:Xz.POLYLINES})};var vy;function tk(){return typeof vy>"u"&&(vy=new b.EllipsoidGeodesic),vy}function nk(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 ik(t,n,e,i=1){var o=tk(),r=b.Cartesian3.fromDegreesArray([t[0],t[1],n[0],n[1]]),a=[0,0];t.length>=3&&n.length>=3&&(a=[t[2],n[2]]);var s=b.Cartographic.fromDegrees(t[0],t[1]),l=b.Cartographic.fromDegrees(n[0],n[1]);o.setEndPoints(s,l);var u=o.surfaceDistance,A=b.PolylinePipeline.generateCartesianArc({positions:r,height:a,minDistance:u/36}),h=A.length;return A.forEach(function(f,p){var d=p/(h-1),m=nk(d,u*i),v=b.Cartographic.fromCartesian(f);v.height+=m,b.Cartesian3.fromRadians(v.longitude,v.latitude,v.height,b.Ellipsoid.WGS84,A[p])}),A}function rk(t=[.8,.8,0,1],n=!0,e=!0,i){var o;const r=i?{type:"Image",uniforms:{color:new b.Color(...t)}}:{type:"Color",uniforms:{color:new b.Color(...t)}};n?(o=new b.PolylineMaterialAppearance({material:new b.Material({fabric:r,translucent:!1}),translucent:!1}),o.renderState.blending=b.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const A=b.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i)):(o=new b.PolylineMaterialAppearance({material:new b.Material({fabric:r,translucent:!0})}),o.getRenderState=function(){const A=b.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i));var a=b.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),s=`out vec4 v_twp;
|
|
3670
3670
|
out vec4 v_color;
|
|
3671
3671
|
out vec4 v_bgColor;
|
|
3672
3672
|
out float v_expand;
|
|
@@ -3692,7 +3692,7 @@ void main()
|
|
|
3692
3692
|
{
|
|
3693
3693
|
czm_twp2_main();
|
|
3694
3694
|
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+`
|
|
3695
|
-
`+u,o}function
|
|
3695
|
+
`+u,o}function ok(t,n,e,i,o,r,a){const s=Ca.createGeometry(new Ca({positions:n,width:e,vertexFormat:b.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:i}));if(s){r||(r=b.Color.clone(o||b.Color.WHITE),r.alpha=.2);var l=new b.GeometryInstance({geometry:s,id:t,attributes:{color:b.ColorGeometryInstanceAttribute.fromColor(o||b.Color.WHITE),bgColor:b.ColorGeometryInstanceAttribute.fromColor(r),twp:new b.GeometryInstanceAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:a})}});return l}}const Df=new b.Cartesian4(0,0,0,0),Ri=new b.Cartesian4(0,0,0,0),au={timeRatio:0,repeat:1,color:[1,1,1,1],bgColor:[1,1,1,1],bidirectional:0};function sk(t,n,e,i,o=!0,r=!0,a,s){var l=[];try{t.forEach(function(A,h){var f=A.positions&&A.positions.map(P=>b.Cartesian3.fromDegrees(...P))||ik(A.startPos,A.endPos,void 0,typeof A.heightRatio>"u"?1:A.heightRatio);const p=i(h,void 0,au),{timeRatio:d,repeat:m,color:v,bidirectional:y,bgColor:g}=p,_=new b.Color(...v),x=new b.Color(...g),E=[d,m,y,0];var B=ok(h,f,A.width,e,_,x,E);if(!B)throw new Error("cannot get geoemetry instance!");l.push(B)})}catch{return}var u=new b.Primitive({geometryInstances:l,appearance:rk(n,o,r,a),asynchronous:!1});return b.Primitive.prototype&&(u.ESSceneObjectID=s),u.update=function(A){const h=this;if(typeof h._batchTable<"u")for(var f=h._batchTableAttributeIndices.twp,p=h._batchTableAttributeIndices.color,d=h._batchTableAttributeIndices.bgColor,m=h._batchTable._numberOfInstances,v=0;v<m;++v){var y=v;au.timeRatio=0,au.repeat=1,au.color.splice(0,4,1,1,1);const g=i(y,A,au),{timeRatio:_,repeat:x,color:E,bidirectional:B,bgColor:P}=g;Df.x=_,Df.y=x,Df.z=typeof B!="number"?0:B,h._batchTable.setBatchedAttribute(y,f,Df),Ri.x=255*E[0],Ri.y=255*E[1],Ri.z=255*E[2],Ri.w=255*E[3],h._batchTable.setBatchedAttribute(y,p,Ri),Ri.x=255*P[0],Ri.y=255*P[1],Ri.z=255*P[2],Ri.w=255*P[3],h._batchTable.setBatchedAttribute(y,d,Ri)}b.Primitive.prototype.update.call(h,A)},u}class ak extends c.Destroyable{constructor(e,i,o){super();L(this,"_nativePrimitive");this._viewer=e;const r=this._viewer,a=i.routePaths;if(!a)throw new Error("!routePath");const s=i.arcType!==void 0?b.ArcType[i.arcType]:b.ArcType.GEODESIC,l=sk(a,i.color,s,(u,A,h)=>{const f=a[u];if(!i)return h;h.repeat=(f.repeat??1)*i.repeat;const p=f.startTime??i.startTime,d=f.transmissionTime??i.transmissionTime??i.duration??sr.defaults.duration,m=i.currentTime??sr.defaults.currentTime,v=c.clamp((m-p)/d,0,1);h.timeRatio=v/h.repeat;const y=f.color??i.color,g=f.bgColor??i.bgColor;return h.color.splice(0,4,...y),h.bgColor.splice(0,4,...g),h.bidirectional=f.bidirectional??i.bidirectional,(i.routePathCallback&&i.routePathCallback(h,u,A))??h},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 lk="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAATUlEQVQYlaXLOQqEUBQF0SMmojgvpfe/JiccEvlNwwuM24IK7oXKUkof7ylQoUGHHsPDMf4WNcpociTcuHBgx4oFczg9/O0tPKP7D3wBky8UMt76XnoAAAAASUVORK5CYII=",uk=`默认示例代码
|
|
3696
3696
|
\`\`\`
|
|
3697
3697
|
// result 最后的结果
|
|
3698
3698
|
// this 是当前的信号传输器集合
|
|
@@ -3706,7 +3706,7 @@ function (result, this, instanceIndex, frameState) {
|
|
|
3706
3706
|
result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
|
|
3707
3707
|
return result;
|
|
3708
3708
|
}\`\`\`
|
|
3709
|
-
`,co=class co extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_player");L(this,"_finalImageUrlReact",this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));L(this,"_routePaths",this.disposeVar(c.react(void 0)));L(this,"routePathCallback");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new c.Player);{const p=co.defaults;this.dispose(c.bind([this._player,"loop"],[this,"loop"],d=>d??p.loop,d=>d??p.loop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],d=>d??p.currentTime,d=>d??p.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],d=>d??p.duration,d=>d??p.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],d=>d??p.playing,d=>d??p.playing)),this.dispose(c.bind([this._player,"speed"],[this,"speed"],d=>d??p.speed,d=>d??p.speed))}const o=this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(c.createProcessingFromAsyncFunc(async p=>{this.routePaths=void 0;const d=o.value;if(d)try{const v=await(await fetch(d)).json();this.routePaths=Gz(v,this.width,this.repeatLength);return}catch(m){console.error(`geojson加载解析出错!${m}`),console.error(m)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const m=this.positionsSet;if(m){this.routePaths=m.map(v=>({positions:v,width:this.width}));return}}}));{const p=()=>{r.restart()};p();const d=this.disposeVar(c.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(d.disposableOn(p))}{const p=()=>{const d=Id(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);d&&(this.routePathCallback=d)};p(),this.dispose(this.routePathCallbackStrChanged.disposableOn(p))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new xs),u=this.disposeVar(c.createProcessingFromAsyncFunc(async p=>{if(!s.value)return;const d=V0(a.scene.context).getTextureHandler(s.value);if(d instanceof xs)l.reset(d);else{const m=await p.promise(d);l.reset(m)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,h=()=>u.restart();h(),this.dispose(s.changed.disposableOn(h));const f=this.ad(c.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new c.ObjResettingWithEvent(f,()=>this.routePaths?new s6(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(p=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,p);else{const d=computeBoundingSphere(this.routePaths[0].positions);if(!d)return;const[m,v]=d;Fe(a,m,v*3,void 0,p)}}))}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(co,"whiteGradientImageBase64",a6),L(co,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),L(co,"routePathCallbackStrMd",l6),L(co,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(co,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let sr=co;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:c.reactPositionsSet(void 0),data:c.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(sr||(sr={})),c.extendClassProps(sr.prototype,sr.createDefaultProps);class Jr extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_collection");this._collection=this.disposeVar(new sr(e,i)),this.dispose(c.track([this._collection,"show"],[this,"show"])),this.dispose(c.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(c.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(c.track([this._collection,"color"],[this,"color"])),this.dispose(c.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(c.track([this._collection,"width"],[this,"width"])),this.dispose(c.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(c.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(c.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(c.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(c.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(c.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(c.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([this._collection,"playing"],[this,"playing"])),this.dispose(c.track([this._collection,"loop"],[this,"loop"])),this.dispose(c.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._collection,"duration"],[this,"duration"])),this.dispose(c.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(c.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(Jr,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(Jr,"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:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:c.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Jr||(Jr={})),c.extendClassProps(Jr.prototype,Jr.createDefaultProps);const Hc=class Hc extends sn{constructor(e,i){super(e,i);L(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Jr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(c.track([r,"startTime"],[e,"startTime"])),this.dispose(c.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(c.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"brightening"],[e,"brightening"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Hc,"type",Hc.register("ESCesiumViewer",bf.type,Hc));let wy=Hc;function ts(t){var n=[1/0,1/0,-1/0,-1/0];return Jo(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}ts.default=ts;var B_={exports:{}};(function(t,n){(function(e,i){t.exports=i()})(Oo,function(){function e(g,_,x,E,B){(function P(I,D,F,S,T){for(;S>F;){if(S-F>600){var w=S-F+1,C=D-F+1,M=Math.log(w),R=.5*Math.exp(2*M/3),U=.5*Math.sqrt(M*R*(w-R)/w)*(C-w/2<0?-1:1),O=Math.max(F,Math.floor(D-C*R/w+U)),z=Math.min(S,Math.floor(D+(w-C)*R/w+U));P(I,D,O,z,T)}var k=I[D],Q=F,V=S;for(i(I,F,D),T(I[S],k)>0&&i(I,F,S);Q<V;){for(i(I,Q,V),Q++,V--;T(I[Q],k)<0;)Q++;for(;T(I[V],k)>0;)V--}T(I[F],k)===0?i(I,F,V):i(I,++V,S),V<=D&&(F=V+1),D<=V&&(S=V-1)}})(g,_,x||0,E||g.length-1,B||o)}function i(g,_,x){var E=g[_];g[_]=g[x],g[x]=E}function o(g,_){return g<_?-1:g>_?1:0}var r=function(g){g===void 0&&(g=9),this._maxEntries=Math.max(4,g),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(g,_,x){if(!x)return _.indexOf(g);for(var E=0;E<_.length;E++)if(x(g,_[E]))return E;return-1}function s(g,_){l(g,0,g.children.length,_,g)}function l(g,_,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=_;P<x;P++){var I=g.children[P];u(B,g.leaf?E(I):I)}return B}function u(g,_){return g.minX=Math.min(g.minX,_.minX),g.minY=Math.min(g.minY,_.minY),g.maxX=Math.max(g.maxX,_.maxX),g.maxY=Math.max(g.maxY,_.maxY),g}function A(g,_){return g.minX-_.minX}function h(g,_){return g.minY-_.minY}function f(g){return(g.maxX-g.minX)*(g.maxY-g.minY)}function p(g){return g.maxX-g.minX+(g.maxY-g.minY)}function d(g,_){return g.minX<=_.minX&&g.minY<=_.minY&&_.maxX<=g.maxX&&_.maxY<=g.maxY}function m(g,_){return _.minX<=g.maxX&&_.minY<=g.maxY&&_.maxX>=g.minX&&_.maxY>=g.minY}function v(g){return{children:g,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(g,_,x,E,B){for(var P=[_,x];P.length;)if(!((x=P.pop())-(_=P.pop())<=E)){var I=_+Math.ceil((x-_)/E/2)*E;e(g,I,_,x,B),P.push(_,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(g){var _=this.data,x=[];if(!m(g,_))return x;for(var E=this.toBBox,B=[];_;){for(var P=0;P<_.children.length;P++){var I=_.children[P],D=_.leaf?E(I):I;m(g,D)&&(_.leaf?x.push(I):d(g,D)?this._all(I,x):B.push(I))}_=B.pop()}return x},r.prototype.collides=function(g){var _=this.data;if(!m(g,_))return!1;for(var x=[];_;){for(var E=0;E<_.children.length;E++){var B=_.children[E],P=_.leaf?this.toBBox(B):B;if(m(g,P)){if(_.leaf||d(g,P))return!0;x.push(B)}}_=x.pop()}return!1},r.prototype.load=function(g){if(!g||!g.length)return this;if(g.length<this._minEntries){for(var _=0;_<g.length;_++)this.insert(g[_]);return this}var x=this._build(g.slice(),0,g.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(g){return g&&this._insert(g,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(g,_){if(!g)return this;for(var x,E,B,P=this.data,I=this.toBBox(g),D=[],F=[];P||D.length;){if(P||(P=D.pop(),E=D[D.length-1],x=F.pop(),B=!0),P.leaf){var S=a(g,P.children,_);if(S!==-1)return P.children.splice(S,1),D.push(P),this._condense(D),this}B||P.leaf||!d(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(D.push(P),F.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(g){return g},r.prototype.compareMinX=function(g,_){return g.minX-_.minX},r.prototype.compareMinY=function(g,_){return g.minY-_.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(g){return this.data=g,this},r.prototype._all=function(g,_){for(var x=[];g;)g.leaf?_.push.apply(_,g.children):x.push.apply(x,g.children),g=x.pop();return _},r.prototype._build=function(g,_,x,E){var B,P=x-_+1,I=this._maxEntries;if(P<=I)return s(B=v(g.slice(_,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var D=Math.ceil(P/I),F=D*Math.ceil(Math.sqrt(I));y(g,_,x,F,this.compareMinX);for(var S=_;S<=x;S+=F){var T=Math.min(S+F-1,x);y(g,S,T,D,this.compareMinY);for(var w=S;w<=T;w+=D){var C=Math.min(w+D-1,T);B.children.push(this._build(g,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(g,_,x,E){for(;E.push(_),!_.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,D=0;D<_.children.length;D++){var F=_.children[D],S=f(F),T=(w=g,C=F,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=F):T===P&&S<B&&(B=S,I=F)}_=I||_.children[0]}var w,C;return _},r.prototype._insert=function(g,_,x){var E=x?g:this.toBBox(g),B=[],P=this._chooseSubtree(E,this.data,_,B);for(P.children.push(g),u(P,E);_>=0&&B[_].children.length>this._maxEntries;)this._split(B,_),_--;this._adjustParentBBoxes(E,B,_)},r.prototype._split=function(g,_){var x=g[_],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),_?g[_-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(g,_){this.data=v([g,_]),this.data.height=g.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(g,_,x){for(var E,B,P,I,D,F,S,T=1/0,w=1/0,C=_;C<=x-_;C++){var M=l(g,0,C,this.toBBox),R=l(g,C,x,this.toBBox),U=(B=M,P=R,I=void 0,D=void 0,F=void 0,S=void 0,I=Math.max(B.minX,P.minX),D=Math.max(B.minY,P.minY),F=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,F-I)*Math.max(0,S-D)),O=f(M)+f(R);U<T?(T=U,E=C,w=O<w?O:w):U===T&&O<w&&(w=O,E=C)}return E||x-_},r.prototype._chooseSplitAxis=function(g,_,x){var E=g.leaf?this.compareMinX:A,B=g.leaf?this.compareMinY:h;this._allDistMargin(g,_,x,E)<this._allDistMargin(g,_,x,B)&&g.children.sort(E)},r.prototype._allDistMargin=function(g,_,x,E){g.children.sort(E);for(var B=this.toBBox,P=l(g,0,_,B),I=l(g,x-_,x,B),D=p(P)+p(I),F=_;F<x-_;F++){var S=g.children[F];u(P,g.leaf?B(S):S),D+=p(P)}for(var T=x-_-1;T>=_;T--){var w=g.children[T];u(I,g.leaf?B(w):w),D+=p(I)}return D},r.prototype._adjustParentBBoxes=function(g,_,x){for(var E=x;E>=0;E--)u(_[E],g)},r.prototype._condense=function(g){for(var _=g.length-1,x=void 0;_>=0;_--)g[_].children.length===0?_>0?(x=g[_-1].children).splice(x.indexOf(g[_]),1):this.clear():s(g[_],this.toBBox)},r})})(B_);var u6=B_.exports;function An(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=Mf(t),o=Fi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&c6(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(T_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,h=1;h<s[u].length&&!A;)T_(i,s[u][h],!e.ignoreBoundary)&&(A=!0),h++;A||(l=!0)}return l}function T_(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 a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var h=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;h&&(i=!i)}return i}function c6(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function h6(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return I_(t);case"FeatureCollection":return A6(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return by(t);default:throw new Error("unknown GeoJSON type")}}function I_(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=F_(t.properties),n.geometry=by(t.geometry),n}function F_(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]=F_(i):n[e]=i}),n}function A6(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 I_(e)}),n}function by(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return by(e)}),n):(n.coordinates=M_(t.coordinates),n)}function M_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return M_(e)})}function D_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=Tz(t),o=[];switch(i){case"LineString":o=xy(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(a){o.push(xy(a))});break;case"MultiPolygon":Ii(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(xy(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ii(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!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):zn({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function xy(t){var n=Ii(t);if(n.length===2&&!R_(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 a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&U_(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,R_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return U_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function R_(t,n){return t[0]===n[0]&&t[1]===n[1]}function U_(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,h=s-r,f=l-a,p=u*f-A*h;return p!==0?!1:Math.abs(h)>=Math.abs(f)?h>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function f6(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return Jo(t,function(r){e+=r[0],i+=r[1],o++},!0),Xt([e/o,i/o],n.properties)}function O_(t){if(!t)throw new Error("geojson is required");var n=[];return rr(t,function(e){d6(e,n)}),Pn(n)}function d6(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ii(i);break;case"LineString":e=[Ii(i)]}e.forEach(function(o){var r=p6(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function p6(t,n){var e=[];return t.reduce(function(i,o){var r=Yn([i,o],n);return r.bbox=m6(i,o),e.push(r),o}),e}function m6(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var _y={exports:{}},L_={};(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,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return h(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!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 C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,M=S;C<M.length;C++){var R=M[C];if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var U=0;U<R[R.length-1].length;U++)if(R[R.length-1][U]!==R[0][U])throw new Error("First and last Position are not equivalent.")}var O={type:"Polygon",coordinates:S};return n(O,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function h(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=h;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function p(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=p;function d(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=d;function m(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=m;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return _(v(S,T))}t.lengthToDegrees=y;function g(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=g;function _(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=_;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return m(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var M=t.areaFactors[w];if(!M)throw new Error("invalid final units");return S/C*M}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;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(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=D;function F(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=F})(L_);var Ut={};const g6=eb(Pz);Object.defineProperty(Ut,"__esModule",{value:!0});var ln=g6;function lu(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,p=t.type,d=p==="FeatureCollection",m=p==="Feature",v=d?t.features.length:1,y=0;y<v;y++){u=d?t.features[y].geometry:m?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var g=0;g<s;g++){var _=0,x=0;if(a=f?u.geometries[g]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,_,x)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,_,x)===!1)return!1;h++,E==="MultiPoint"&&_++}E==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,_,x)===!1)return!1;h++}E==="MultiLineString"&&_++,E==="Polygon"&&x++}E==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,_,x)===!1)return!1;h++}x++}_++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(lu(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function y6(t,n,e,i){var o=e;return lu(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function z_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function v6(t,n,e){var i=e;return z_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function k_(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 w6(t,n,e){var i=e;return k_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function b6(t){var n=[];return lu(t,function(e){n.push(e)}),n}function Cy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,p=t.type==="FeatureCollection",d=t.type==="Feature",m=p?t.features.length:1;for(e=0;e<m;e++){for(s=p?t.features[e].geometry:d?t.geometry:t,u=p?t.features[e].properties:d?t.properties:{},A=p?t.features[e].bbox:d?t.bbox:void 0,h=p?t.features[e].id:d?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function x6(t,n,e){var i=e;return Cy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function Rf(t,n){Cy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(ln.feature(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(ln.feature(h,o),i,u)===!1)return!1}})}function _6(t,n,e){var i=e;return Rf(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function Q_(t,n){Rf(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(lu(e,function(h,f,p,d,m){if(s===void 0||i>l||d>u||m>A){s=h,l=i,u=d,A=m,r=0;return}var v=ln.lineString([s,h],e.properties);if(n(v,i,o,m,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function C6(t,n,e){var i=e,o=!1;return Q_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function V_(t,n){if(!t)throw new Error("geojson is required");Rf(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(ln.lineString(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function S6(t,n,e){var i=e;return V_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function E6(t,n){if(n=n||{},!ln.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),ln.lineString([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),ln.lineString([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),ln.lineString([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),ln.lineString([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function P6(t,n){if(n=n||{},!ln.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return ln.point(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),ln.point(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),ln.point(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),ln.point(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),ln.point(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),ln.point(l[i][o][r],a,n)}throw new Error("geojson is invalid")}Ut.coordAll=b6,Ut.coordEach=lu,Ut.coordReduce=y6,Ut.featureEach=k_,Ut.featureReduce=w6,Ut.findPoint=P6,Ut.findSegment=E6,Ut.flattenEach=Rf,Ut.flattenReduce=_6,Ut.geomEach=Cy,Ut.geomReduce=x6,Ut.lineEach=V_,Ut.lineReduce=S6,Ut.propEach=z_,Ut.propReduce=v6,Ut.segmentEach=Q_,Ut.segmentReduce=C6;var Sy={};const B6=eb(kz);Object.defineProperty(Sy,"__esModule",{value:!0});var T6=B6;function Ey(t){var n=[1/0,1/0,-1/0,-1/0];return T6.coordEach(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}Ey.default=Ey,Sy.default=Ey;var Ui=u6,N_=L_,H_=Ut,Sa=Sy.default,I6=H_.featureEach;H_.coordEach,N_.polygon;var G_=N_.featureCollection;function W_(t){var n=new Ui(t);return n.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Sa(e),Ui.prototype.insert.call(this,e)},n.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Sa(o),i.push(o)}):I6(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Sa(o),i.push(o)}),Ui.prototype.load.call(this,i)},n.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Sa(e),Ui.prototype.remove.call(this,e,i)},n.clear=function(){return Ui.prototype.clear.call(this)},n.search=function(e){var i=Ui.prototype.search.call(this,this.toBBox(e));return G_(i)},n.collides=function(e){return Ui.prototype.collides.call(this,this.toBBox(e))},n.all=function(){var e=Ui.prototype.all.call(this);return G_(e)},n.toJSON=function(){return Ui.prototype.toJSON.call(this)},n.fromJSON=function(e){return Ui.prototype.fromJSON.call(this,e)},n.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=Sa(e);else if(e.type==="FeatureCollection")i=Sa(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},n}_y.exports=W_,_y.exports.default=W_;var F6=_y.exports;const M6=Ml(F6);function Py(t,n){var e={},i=[];if(t.type==="LineString"&&(t=zn(t)),n.type==="LineString"&&(n=zn(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=j_(t,n);return o&&i.push(o),Pn(i)}var r=M6();return r.load(O_(n)),wa(O_(t),function(a){wa(r.search(a),function(s){var l=j_(a,s);if(l){var u=Ii(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Pn(i)}function j_(t,n){var e=Ii(t),i=Ii(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],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],h=i[1][1],f=(h-u)*(a-o)-(A-l)*(s-r),p=(A-l)*(r-u)-(h-u)*(o-l),d=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var m=p/f,v=d/f;if(m>=0&&m<=1&&v>=0&&v<=1){var y=o+m*(a-o),g=r+m*(s-r);return Xt([y,g])}return null}function Uf(t,n,e){e===void 0&&(e={});for(var i=Mf(t),o=Ii(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),D6(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function D6(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],h=e[0]-s,f=e[1]-l,p=u-s,d=A-l,m=h*d-f*p;if(o!==null){if(Math.abs(m)>o)return!1}else if(m!==0)return!1;if(i){if(i==="start")return Math.abs(p)>=Math.abs(d)?p>0?s<r&&r<=u:u<=r&&r<s:d>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(p)>=Math.abs(d)?p>0?s<=r&&r<u:u<r&&r<=s:d>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(p)>=Math.abs(d)?p>0?s<r&&r<u:u<r&&r<s:d>0?l<a&&a<A:A<a&&a<l}else return Math.abs(p)>=Math.abs(d)?p>0?s<=r&&r<=u:u<=r&&r<=s:d>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function R6(t,n){var e=Fi(t),i=Fi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return U6(e,i);case"LineString":return Uf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return An(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return O6(e,i);case"LineString":return L6(e,i);case"Polygon":case"MultiPolygon":return z6(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return k6(e,i);case"Polygon":case"MultiPolygon":return Q6(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return V6(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function U6(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(K_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function O6(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)K_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function L6(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 z6(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=An(t.coordinates[1],n),!i){e=!1;break}i=An(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function k6(t,n){for(var e=0;e<t.coordinates.length;e++)if(!Uf(t.coordinates[e],n))return!1;return!0}function Q6(t,n){var e=ts(n),i=ts(t);if(!q_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!An(t.coordinates[r],n))return!1;if(o||(o=An(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=N6(t.coordinates[r],t.coordinates[r+1]);o=An(a,n,{ignoreBoundary:!0})}}return o}function V6(t,n){var e=ts(t),i=ts(n);if(!q_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!An(t.coordinates[0][o],n))return!1;return!0}function q_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function K_(t,n){return t[0]===n[0]&&t[1]===n[1]}function N6(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function Z_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Mi([o,r],[a,r],e),u=l*(a-o),A=n/Mi([o,r],[o,s],e),h=A*(s-r),f=a-o,p=s-r,d=Math.floor(f/u),m=Math.floor(p/h),v=(f-d*u)/2,y=(p-m*h)/2,g=o+v;g<=a;){for(var _=r+y;_<=s;){var x=Xt([g,_],e.properties);e.mask?R6(x,e.mask)&&i.push(x):i.push(x),_+=h}g+=u}return Pn(i)}function By(t,n){n===void 0&&(n={});var e=Fi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return H6(e,n);case"MultiPolygon":return G6(e,n);default:throw new Error("invalid poly")}}function H6(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return $_(i,o)}function G6(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push($_(a,o))}),Pn(r)}function $_(t,n){return t.length>1?fy(t,n):Yn(t[0],n)}var X_=Object.prototype.toString,Y_=function(n){var e=X_.call(n),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&X_.call(n.callee)==="[object Function]"),i},Ty,J_;function W6(){if(J_)return Ty;J_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Y_,o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var p=f.constructor;return p&&p.prototype===f},u={$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},A=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),h=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(p){var d=p!==null&&typeof p=="object",m=e.call(p)==="[object Function]",v=i(p),y=d&&e.call(p)==="[object String]",g=[];if(!d&&!m&&!v)throw new TypeError("Object.keys called on a non-object");var _=a&&m;if(y&&p.length>0&&!n.call(p,0))for(var x=0;x<p.length;++x)g.push(String(x));if(v&&p.length>0)for(var E=0;E<p.length;++E)g.push(String(E));else for(var B in p)!(_&&B==="prototype")&&n.call(p,B)&&g.push(String(B));if(r)for(var P=h(p),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(p,s[I])&&g.push(s[I]);return g}}return Ty=t,Ty}var j6=Array.prototype.slice,q6=Y_,eC=Object.keys,Of=eC?function(n){return eC(n)}:W6(),tC=Object.keys;Of.shim=function(){if(Object.keys){var n=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);n||(Object.keys=function(i){return q6(i)?tC(j6.call(i)):tC(i)})}else Object.keys=Of;return Object.keys||Of};var nC=Of,iC=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 a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0},K6=iC,Iy=function(){return K6()&&!!Symbol.toStringTag},rC=Object,oC=Error,Z6=EvalError,$6=RangeError,X6=ReferenceError,sC=SyntaxError,Ea=TypeError,Y6=URIError,J6=Math.abs,ek=Math.floor,tk=Math.max,nk=Math.min,ik=Math.pow,rk=Math.round,ok=Number.isNaN||function(n){return n!==n},sk=ok,ak=function(n){return sk(n)||n===0?n:n<0?-1:1},lk=Object.getOwnPropertyDescriptor,Lf=lk;if(Lf)try{Lf([],"length")}catch{Lf=null}var Pa=Lf,zf=Object.defineProperty||!1;if(zf)try{zf({},"a",{value:1})}catch{zf=!1}var kf=zf,Fy,aC;function uk(){if(aC)return Fy;aC=1;var t=typeof Symbol<"u"&&Symbol,n=iC;return Fy=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},Fy}var lC=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,ck=rC,uC=ck.getPrototypeOf||null,hk="Function.prototype.bind called on incompatible ",Ak=Object.prototype.toString,fk=Math.max,dk="[object Function]",cC=function(n,e){for(var i=[],o=0;o<n.length;o+=1)i[o]=n[o];for(var r=0;r<e.length;r+=1)i[r+n.length]=e[r];return i},pk=function(n,e){for(var i=[],o=e,r=0;o<n.length;o+=1,r+=1)i[r]=n[o];return i},mk=function(t,n){for(var e="",i=0;i<t.length;i+=1)e+=t[i],i+1<t.length&&(e+=n);return e},gk=function(n){var e=this;if(typeof e!="function"||Ak.apply(e)!==dk)throw new TypeError(hk+e);for(var i=pk(arguments,1),o,r=function(){if(this instanceof o){var A=e.apply(this,cC(i,arguments));return Object(A)===A?A:this}return e.apply(n,cC(i,arguments))},a=fk(0,e.length-i.length),s=[],l=0;l<a;l++)s[l]="$"+l;if(o=Function("binder","return function ("+mk(s,",")+"){ return binder.apply(this,arguments); }")(r),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},yk=gk,uu=Function.prototype.bind||yk,My=Function.prototype.call,Dy=Function.prototype.apply,vk=typeof Reflect<"u"&&Reflect&&Reflect.apply,wk=uu,bk=Dy,xk=My,_k=vk,hC=_k||wk.call(xk,bk),Ck=uu,Sk=Ea,Ek=My,Pk=hC,Ry=function(n){if(n.length<1||typeof n[0]!="function")throw new Sk("a function is required");return Pk(Ck,Ek,n)},Bk=Ry,AC=Pa,fC;try{fC=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Uy=!!fC&&AC&&AC(Object.prototype,"__proto__"),dC=Object,pC=dC.getPrototypeOf,Tk=Uy&&typeof Uy.get=="function"?Bk([Uy.get]):typeof pC=="function"?function(n){return pC(n==null?n:dC(n))}:!1,mC=lC,gC=uC,yC=Tk,vC=mC?function(n){return mC(n)}:gC?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return gC(n)}:yC?function(n){return yC(n)}:null,Ik=Function.prototype.call,Fk=Object.prototype.hasOwnProperty,Mk=uu,wC=Mk.call(Ik,Fk),We,Dk=rC,Rk=oC,Uk=Z6,Ok=$6,Lk=X6,Ba=sC,Ta=Ea,zk=Y6,kk=J6,Qk=ek,Vk=tk,Nk=nk,Hk=ik,Gk=rk,Wk=ak,bC=Function,Oy=function(t){try{return bC('"use strict"; return ('+t+").constructor;")()}catch{}},cu=Pa,jk=kf,Ly=function(){throw new Ta},qk=cu?function(){try{return arguments.callee,Ly}catch{try{return cu(arguments,"callee").get}catch{return Ly}}}():Ly,Ia=uk()(),Nt=vC,Kk=uC,Zk=lC,xC=Dy,hu=My,Fa={},$k=typeof Uint8Array>"u"||!Nt?We:Nt(Uint8Array),ns={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?We:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?We:ArrayBuffer,"%ArrayIteratorPrototype%":Ia&&Nt?Nt([][Symbol.iterator]()):We,"%AsyncFromSyncIteratorPrototype%":We,"%AsyncFunction%":Fa,"%AsyncGenerator%":Fa,"%AsyncGeneratorFunction%":Fa,"%AsyncIteratorPrototype%":Fa,"%Atomics%":typeof Atomics>"u"?We:Atomics,"%BigInt%":typeof BigInt>"u"?We:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?We:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?We:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?We:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Rk,"%eval%":eval,"%EvalError%":Uk,"%Float16Array%":typeof Float16Array>"u"?We:Float16Array,"%Float32Array%":typeof Float32Array>"u"?We:Float32Array,"%Float64Array%":typeof Float64Array>"u"?We:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?We:FinalizationRegistry,"%Function%":bC,"%GeneratorFunction%":Fa,"%Int8Array%":typeof Int8Array>"u"?We:Int8Array,"%Int16Array%":typeof Int16Array>"u"?We:Int16Array,"%Int32Array%":typeof Int32Array>"u"?We:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ia&&Nt?Nt(Nt([][Symbol.iterator]())):We,"%JSON%":typeof JSON=="object"?JSON:We,"%Map%":typeof Map>"u"?We:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ia||!Nt?We:Nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Dk,"%Object.getOwnPropertyDescriptor%":cu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?We:Promise,"%Proxy%":typeof Proxy>"u"?We:Proxy,"%RangeError%":Ok,"%ReferenceError%":Lk,"%Reflect%":typeof Reflect>"u"?We:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?We:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ia||!Nt?We:Nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?We:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ia&&Nt?Nt(""[Symbol.iterator]()):We,"%Symbol%":Ia?Symbol:We,"%SyntaxError%":Ba,"%ThrowTypeError%":qk,"%TypedArray%":$k,"%TypeError%":Ta,"%Uint8Array%":typeof Uint8Array>"u"?We:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?We:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?We:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?We:Uint32Array,"%URIError%":zk,"%WeakMap%":typeof WeakMap>"u"?We:WeakMap,"%WeakRef%":typeof WeakRef>"u"?We:WeakRef,"%WeakSet%":typeof WeakSet>"u"?We:WeakSet,"%Function.prototype.call%":hu,"%Function.prototype.apply%":xC,"%Object.defineProperty%":jk,"%Object.getPrototypeOf%":Kk,"%Math.abs%":kk,"%Math.floor%":Qk,"%Math.max%":Vk,"%Math.min%":Nk,"%Math.pow%":Hk,"%Math.round%":Gk,"%Math.sign%":Wk,"%Reflect.getPrototypeOf%":Zk};if(Nt)try{null.error}catch(t){var Xk=Nt(Nt(t));ns["%Error.prototype%"]=Xk}var Yk=function t(n){var e;if(n==="%AsyncFunction%")e=Oy("async function () {}");else if(n==="%GeneratorFunction%")e=Oy("function* () {}");else if(n==="%AsyncGeneratorFunction%")e=Oy("async function* () {}");else if(n==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(n==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&Nt&&(e=Nt(o.prototype))}return ns[n]=e,e},_C={__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"]},Au=uu,Qf=wC,Jk=Au.call(hu,Array.prototype.concat),eQ=Au.call(xC,Array.prototype.splice),CC=Au.call(hu,String.prototype.replace),Vf=Au.call(hu,String.prototype.slice),tQ=Au.call(hu,RegExp.prototype.exec),nQ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,iQ=/\\(\\)?/g,rQ=function(n){var e=Vf(n,0,1),i=Vf(n,-1);if(e==="%"&&i!=="%")throw new Ba("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Ba("invalid intrinsic syntax, expected opening `%`");var o=[];return CC(n,nQ,function(r,a,s,l){o[o.length]=s?CC(l,iQ,"$1"):a||r}),o},oQ=function(n,e){var i=n,o;if(Qf(_C,i)&&(o=_C[i],i="%"+o[0]+"%"),Qf(ns,i)){var r=ns[i];if(r===Fa&&(r=Yk(i)),typeof r>"u"&&!e)throw new Ta("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:r}}throw new Ba("intrinsic "+n+" does not exist!")},SC=function(n,e){if(typeof n!="string"||n.length===0)throw new Ta("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ta('"allowMissing" argument must be a boolean');if(tQ(/^%?[^%]*%?$/,n)===null)throw new Ba("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=rQ(n),o=i.length>0?i[0]:"",r=oQ("%"+o+"%",e),a=r.name,s=r.value,l=!1,u=r.alias;u&&(o=u[0],eQ(i,Jk([0,1],u)));for(var A=1,h=!0;A<i.length;A+=1){var f=i[A],p=Vf(f,0,1),d=Vf(f,-1);if((p==='"'||p==="'"||p==="`"||d==='"'||d==="'"||d==="`")&&p!==d)throw new Ba("property names with quotes must have matching quotes");if((f==="constructor"||!h)&&(l=!0),o+="."+f,a="%"+o+"%",Qf(ns,a))s=ns[a];else if(s!=null){if(!(f in s)){if(!e)throw new Ta("base intrinsic for "+n+" exists, but the property is not available.");return}if(cu&&A+1>=i.length){var m=cu(s,f);h=!!m,h&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[f]}else h=Qf(s,f),s=s[f];h&&!l&&(ns[a]=s)}}return s},EC=SC,PC=Ry,sQ=PC([EC("%String.prototype.indexOf%")]),zy=function(n,e){var i=EC(n,!!e);return typeof i=="function"&&sQ(n,".prototype.")>-1?PC([i]):i},aQ=Iy(),lQ=zy,ky=lQ("Object.prototype.toString"),Nf=function(n){return aQ&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:ky(n)==="[object Arguments]"},BC=function(n){return Nf(n)?!0:n!==null&&typeof n=="object"&&"length"in n&&typeof n.length=="number"&&n.length>=0&&ky(n)!=="[object Array]"&&"callee"in n&&ky(n.callee)==="[object Function]"},uQ=function(){return Nf(arguments)}();Nf.isLegacyArguments=BC;var cQ=uQ?Nf:BC,TC=kf,hQ=sC,Ma=Ea,IC=Pa,Qy=function(n,e,i){if(!n||typeof n!="object"&&typeof n!="function")throw new Ma("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ma("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ma("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ma("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ma("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ma("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!IC&&IC(n,e);if(TC)TC(n,e,{configurable:a===null&&l?l.configurable:!a,enumerable:o===null&&l?l.enumerable:!o,value:i,writable:r===null&&l?l.writable:!r});else if(s||!o&&!r&&!a)n[e]=i;else throw new hQ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Vy=kf,FC=function(){return!!Vy};FC.hasArrayLengthDefineBug=function(){if(!Vy)return null;try{return Vy([],"length",{value:1}).length!==1}catch{return!0}};var Ny=FC,AQ=nC,fQ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",dQ=Object.prototype.toString,pQ=Array.prototype.concat,MC=Qy,mQ=function(t){return typeof t=="function"&&dQ.call(t)==="[object Function]"},DC=Ny(),gQ=function(t,n,e,i){if(n in t){if(i===!0){if(t[n]===e)return}else if(!mQ(i)||!i())return}DC?MC(t,n,e,!0):MC(t,n,e)},RC=function(t,n){var e=arguments.length>2?arguments[2]:{},i=AQ(n);fQ&&(i=pQ.call(i,Object.getOwnPropertySymbols(n)));for(var o=0;o<i.length;o+=1)gQ(t,i[o],n[i[o]],e[i[o]])};RC.supportsDescriptors=!!DC;var fu=RC,UC={exports:{}},yQ=SC,OC=Qy,vQ=Ny(),LC=Pa,zC=Ea,wQ=yQ("%Math.floor%"),bQ=function(n,e){if(typeof n!="function")throw new zC("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||wQ(e)!==e)throw new zC("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,r=!0;if("length"in n&&LC){var a=LC(n,"length");a&&!a.configurable&&(o=!1),a&&!a.writable&&(r=!1)}return(o||r||!i)&&(vQ?OC(n,"length",e,!0,!0):OC(n,"length",e)),n},xQ=uu,_Q=Dy,CQ=hC,SQ=function(){return CQ(xQ,_Q,arguments)};(function(t){var n=bQ,e=kf,i=Ry,o=SQ;t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(UC);var kC=UC.exports,QC=function(t){return t!==t},VC=function(n,e){return n===0&&e===0?1/n===1/e:!!(n===e||QC(n)&&QC(e))},EQ=VC,NC=function(){return typeof Object.is=="function"?Object.is:EQ},PQ=NC,BQ=fu,TQ=function(){var n=PQ();return BQ(Object,{is:n},{is:function(){return Object.is!==n}}),n},IQ=fu,FQ=kC,MQ=VC,HC=NC,DQ=TQ,GC=FQ(HC(),Object);IQ(GC,{getPolyfill:HC,implementation:MQ,shim:DQ});var RQ=GC,WC=zy,UQ=Iy(),OQ=wC,LQ=Pa,Hy;if(UQ){var zQ=WC("RegExp.prototype.exec"),jC={},Gy=function(){throw jC},qC={toString:Gy,valueOf:Gy};typeof Symbol.toPrimitive=="symbol"&&(qC[Symbol.toPrimitive]=Gy),Hy=function(n){if(!n||typeof n!="object")return!1;var e=LQ(n,"lastIndex"),i=e&&OQ(e,"value");if(!i)return!1;try{zQ(n,qC)}catch(o){return o===jC}}}else{var kQ=WC("Object.prototype.toString"),QQ="[object RegExp]";Hy=function(n){return!n||typeof n!="object"&&typeof n!="function"?!1:kQ(n)===QQ}}var VQ=Hy,du=function(){return typeof(function(){}).name=="string"},pu=Object.getOwnPropertyDescriptor;if(pu)try{pu([],"length")}catch{pu=null}du.functionsHaveConfigurableNames=function(){if(!du()||!pu)return!1;var n=pu(function(){},"name");return!!n&&!!n.configurable};var NQ=Function.prototype.bind;du.boundFunctionsHaveNames=function(){return du()&&typeof NQ=="function"&&(function(){}).bind().name!==""};var HQ=du,KC=Qy,GQ=Ny(),WQ=HQ.functionsHaveConfigurableNames(),jQ=Ea,qQ=function(n,e){if(typeof n!="function")throw new jQ("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||WQ)&&(GQ?KC(n,"name",e,!0,!0):KC(n,"name",e)),n},KQ=qQ,ZQ=Ea,$Q=Object,ZC=KQ(function(){if(this==null||this!==$Q(this))throw new ZQ("RegExp.prototype.flags getter called on non-object");var n="";return this.hasIndices&&(n+="d"),this.global&&(n+="g"),this.ignoreCase&&(n+="i"),this.multiline&&(n+="m"),this.dotAll&&(n+="s"),this.unicode&&(n+="u"),this.unicodeSets&&(n+="v"),this.sticky&&(n+="y"),n},"get flags",!0),XQ=ZC,YQ=fu.supportsDescriptors,JQ=Object.getOwnPropertyDescriptor,$C=function(){if(YQ&&/a/mig.flags==="gim"){var n=JQ(RegExp.prototype,"flags");if(n&&typeof n.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),n.get.call(i),e==="dy")return n.get}}return XQ},e8=fu.supportsDescriptors,t8=$C,n8=Pa,i8=Object.defineProperty,r8=oC,XC=vC,o8=/a/,s8=function(){if(!e8||!XC)throw new r8("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var n=t8(),e=XC(o8),i=n8(e,"flags");return(!i||i.get!==n)&&i8(e,"flags",{configurable:!0,enumerable:!1,get:n}),n},a8=fu,l8=kC,u8=ZC,YC=$C,c8=s8,JC=l8(YC());a8(JC,{getPolyfill:YC,implementation:u8,shim:c8});var h8=JC,eS=zy,A8=eS("Date.prototype.getDay"),f8=function(n){try{return A8(n),!0}catch{return!1}},d8=eS("Object.prototype.toString"),p8="[object Date]",m8=Iy(),g8=function(n){return typeof n!="object"||n===null?!1:m8?f8(n):d8(n)===p8},tS=nC,nS=cQ,iS=RQ,rS=VQ,oS=h8,sS=g8,aS=Date.prototype.getTime;function lS(t,n,e){var i=e||{};return(i.strict?iS(t,n):t===n)?!0:!t||!n||typeof t!="object"&&typeof n!="object"?i.strict?iS(t,n):t==n:y8(t,n,i)}function uS(t){return t==null}function cS(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function y8(t,n,e){var i,o;if(typeof t!=typeof n||uS(t)||uS(n)||t.prototype!==n.prototype||nS(t)!==nS(n))return!1;var r=rS(t),a=rS(n);if(r!==a)return!1;if(r||a)return t.source===n.source&&oS(t)===oS(n);if(sS(t)&&sS(n))return aS.call(t)===aS.call(n);var s=cS(t),l=cS(n);if(s!==l)return!1;if(s||l){if(t.length!==n.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}if(typeof t!=typeof n)return!1;try{var u=tS(t),A=tS(n)}catch{return!1}if(u.length!==A.length)return!1;for(u.sort(),A.sort(),i=u.length-1;i>=0;i--)if(u[i]!=A[i])return!1;for(i=u.length-1;i>=0;i--)if(o=u[i],!lS(t[o],n[o],e))return!1;return!0}var v8=lS;function w8(t,n){var e=!0;return rr(t,function(i){rr(n,function(o){if(e===!1)return!1;e=b8(i.geometry,o.geometry)})}),e}function b8(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!S8(t.coordinates,n.coordinates);case"LineString":return!hS(n,t);case"Polygon":return!An(t,n)}break;case"LineString":switch(n.type){case"Point":return!hS(t,n);case"LineString":return!x8(t,n);case"Polygon":return!AS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!An(n,t);case"LineString":return!AS(t,n);case"Polygon":return!_8(n,t)}}return!1}function hS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(C8(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function x8(t,n){var e=Py(t,n);return e.features.length>0}function AS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(An(o,t))return!0}var r=Py(n,By(t));return r.features.length>0}function _8(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(An(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(An(s,t))return!0}var l=Py(By(t),By(n));return l.features.length>0}function C8(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function S8(t,n){return t[0]===n[0]&&t[1]===n[1]}var E8=v8,Oi=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=t&&t.direction?t.direction:!1,this.pseudoNode=t&&t.pseudoNode?t.pseudoNode:!1,this.objectComparator=t&&t.objectComparator?t.objectComparator:P8};Oi.prototype.compare=function(t,n){if(t.type!==n.type||!dS(t,n))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,n.coordinates);case"LineString":return this.compareLine(t.coordinates,n.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,n);case"Feature":return this.compareFeature(t,n);default:if(t.type.indexOf("Multi")===0){var e=this,i=fS(t),o=fS(n);return i.every(function(r){return this.some(function(a){return e.compare(r,a)})},o)}}return!1};function fS(t){return t.coordinates.map(function(n){return{type:t.type.replace("Multi",""),coordinates:n}})}function dS(t,n){return t.hasOwnProperty("coordinates")?t.coordinates.length===n.coordinates.length:t.length===n.length}Oi.prototype.compareCoord=function(t,n){if(t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==n[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,n,e,i){if(!dS(t,n))return!1;var o=this.pseudoNode?t:this.removePseudo(t),r=this.pseudoNode?n:this.removePseudo(n);if(!(i&&!this.compareCoord(o[0],r[0])&&(r=this.fixStartIndex(r,o),!r))){var a=this.compareCoord(o[e],r[e]);return this.direction||a?this.comparePath(o,r):this.compareCoord(o[e],r[r.length-(1+e)])?this.comparePath(o.slice().reverse(),r):!1}},Oi.prototype.fixStartIndex=function(t,n){for(var e,i=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],n[0])){i=o;break}return i>=0&&(e=[].concat(t.slice(i,t.length),t.slice(1,i+1))),e},Oi.prototype.comparePath=function(t,n){var e=this;return t.every(function(i,o){return e.compareCoord(i,this[o])},n)},Oi.prototype.comparePolygon=function(t,n){if(this.compareLine(t.coordinates[0],n.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),i=n.coordinates.slice(1,n.coordinates.length),o=this;return e.every(function(r){return this.some(function(a){return o.compareLine(r,a,1,!0)})},i)}else return!1},Oi.prototype.compareFeature=function(t,n){return t.id!==n.id||!this.objectComparator(t.properties,n.properties)||!this.compareBBox(t,n)?!1:this.compare(t.geometry,n.geometry)},Oi.prototype.compareBBox=function(t,n){return!!(!t.bbox&&!n.bbox||t.bbox&&n.bbox&&this.compareCoord(t.bbox,n.bbox))},Oi.prototype.removePseudo=function(t){return t};function P8(t,n){return E8(t,n,{strict:!0})}var B8=Oi;const T8=Ml(B8);function I8(t,n){var e=Fi(t).type,i=Fi(n).type;if(e!==i)return!1;var o=new T8({precision:6});return o.compare(D_(t),D_(n))}function F8(t,n){var e=!1;return rr(t,function(i){rr(n,function(o){if(e===!0)return!0;e=!w8(i.geometry,o.geometry)})}),e}/**
|
|
3709
|
+
`,co=class co extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_player");L(this,"_finalImageUrlReact",this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));L(this,"_routePaths",this.disposeVar(c.react(void 0)));L(this,"routePathCallback");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new c.Player);{const p=co.defaults;this.dispose(c.bind([this._player,"loop"],[this,"loop"],d=>d??p.loop,d=>d??p.loop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],d=>d??p.currentTime,d=>d??p.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],d=>d??p.duration,d=>d??p.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],d=>d??p.playing,d=>d??p.playing)),this.dispose(c.bind([this._player,"speed"],[this,"speed"],d=>d??p.speed,d=>d??p.speed))}const o=this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(c.createProcessingFromAsyncFunc(async p=>{this.routePaths=void 0;const d=o.value;if(d)try{const v=await(await fetch(d)).json();this.routePaths=Wz(v,this.width,this.repeatLength);return}catch(m){console.error(`geojson加载解析出错!${m}`),console.error(m)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const m=this.positionsSet;if(m){this.routePaths=m.map(v=>({positions:v,width:this.width}));return}}}));{const p=()=>{r.restart()};p();const d=this.disposeVar(c.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(d.disposableOn(p))}{const p=()=>{const d=Id(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);d&&(this.routePathCallback=d)};p(),this.dispose(this.routePathCallbackStrChanged.disposableOn(p))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new xs),u=this.disposeVar(c.createProcessingFromAsyncFunc(async p=>{if(!s.value)return;const d=V0(a.scene.context).getTextureHandler(s.value);if(d instanceof xs)l.reset(d);else{const m=await p.promise(d);l.reset(m)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,h=()=>u.restart();h(),this.dispose(s.changed.disposableOn(h));const f=this.ad(c.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new c.ObjResettingWithEvent(f,()=>this.routePaths?new ak(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(p=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,p);else{const d=computeBoundingSphere(this.routePaths[0].positions);if(!d)return;const[m,v]=d;Fe(a,m,v*3,void 0,p)}}))}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(co,"whiteGradientImageBase64",lk),L(co,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),L(co,"routePathCallbackStrMd",uk),L(co,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(co,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let sr=co;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:c.reactPositionsSet(void 0),data:c.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(sr||(sr={})),c.extendClassProps(sr.prototype,sr.createDefaultProps);class Jr extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_collection");this._collection=this.disposeVar(new sr(e,i)),this.dispose(c.track([this._collection,"show"],[this,"show"])),this.dispose(c.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(c.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(c.track([this._collection,"color"],[this,"color"])),this.dispose(c.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(c.track([this._collection,"width"],[this,"width"])),this.dispose(c.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(c.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(c.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(c.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(c.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(c.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(c.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([this._collection,"playing"],[this,"playing"])),this.dispose(c.track([this._collection,"loop"],[this,"loop"])),this.dispose(c.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._collection,"duration"],[this,"duration"])),this.dispose(c.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(c.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(Jr,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(Jr,"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:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:c.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Jr||(Jr={})),c.extendClassProps(Jr.prototype,Jr.createDefaultProps);const Hc=class Hc extends sn{constructor(e,i){super(e,i);L(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Jr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(c.track([r,"startTime"],[e,"startTime"])),this.dispose(c.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(c.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"brightening"],[e,"brightening"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Hc,"type",Hc.register("ESCesiumViewer",bf.type,Hc));let wy=Hc;function ts(t){var n=[1/0,1/0,-1/0,-1/0];return Jo(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}ts.default=ts;var B_={exports:{}};(function(t,n){(function(e,i){t.exports=i()})(Oo,function(){function e(g,_,x,E,B){(function P(I,D,F,S,T){for(;S>F;){if(S-F>600){var w=S-F+1,C=D-F+1,M=Math.log(w),R=.5*Math.exp(2*M/3),U=.5*Math.sqrt(M*R*(w-R)/w)*(C-w/2<0?-1:1),O=Math.max(F,Math.floor(D-C*R/w+U)),z=Math.min(S,Math.floor(D+(w-C)*R/w+U));P(I,D,O,z,T)}var k=I[D],Q=F,V=S;for(i(I,F,D),T(I[S],k)>0&&i(I,F,S);Q<V;){for(i(I,Q,V),Q++,V--;T(I[Q],k)<0;)Q++;for(;T(I[V],k)>0;)V--}T(I[F],k)===0?i(I,F,V):i(I,++V,S),V<=D&&(F=V+1),D<=V&&(S=V-1)}})(g,_,x||0,E||g.length-1,B||o)}function i(g,_,x){var E=g[_];g[_]=g[x],g[x]=E}function o(g,_){return g<_?-1:g>_?1:0}var r=function(g){g===void 0&&(g=9),this._maxEntries=Math.max(4,g),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(g,_,x){if(!x)return _.indexOf(g);for(var E=0;E<_.length;E++)if(x(g,_[E]))return E;return-1}function s(g,_){l(g,0,g.children.length,_,g)}function l(g,_,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=_;P<x;P++){var I=g.children[P];u(B,g.leaf?E(I):I)}return B}function u(g,_){return g.minX=Math.min(g.minX,_.minX),g.minY=Math.min(g.minY,_.minY),g.maxX=Math.max(g.maxX,_.maxX),g.maxY=Math.max(g.maxY,_.maxY),g}function A(g,_){return g.minX-_.minX}function h(g,_){return g.minY-_.minY}function f(g){return(g.maxX-g.minX)*(g.maxY-g.minY)}function p(g){return g.maxX-g.minX+(g.maxY-g.minY)}function d(g,_){return g.minX<=_.minX&&g.minY<=_.minY&&_.maxX<=g.maxX&&_.maxY<=g.maxY}function m(g,_){return _.minX<=g.maxX&&_.minY<=g.maxY&&_.maxX>=g.minX&&_.maxY>=g.minY}function v(g){return{children:g,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(g,_,x,E,B){for(var P=[_,x];P.length;)if(!((x=P.pop())-(_=P.pop())<=E)){var I=_+Math.ceil((x-_)/E/2)*E;e(g,I,_,x,B),P.push(_,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(g){var _=this.data,x=[];if(!m(g,_))return x;for(var E=this.toBBox,B=[];_;){for(var P=0;P<_.children.length;P++){var I=_.children[P],D=_.leaf?E(I):I;m(g,D)&&(_.leaf?x.push(I):d(g,D)?this._all(I,x):B.push(I))}_=B.pop()}return x},r.prototype.collides=function(g){var _=this.data;if(!m(g,_))return!1;for(var x=[];_;){for(var E=0;E<_.children.length;E++){var B=_.children[E],P=_.leaf?this.toBBox(B):B;if(m(g,P)){if(_.leaf||d(g,P))return!0;x.push(B)}}_=x.pop()}return!1},r.prototype.load=function(g){if(!g||!g.length)return this;if(g.length<this._minEntries){for(var _=0;_<g.length;_++)this.insert(g[_]);return this}var x=this._build(g.slice(),0,g.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(g){return g&&this._insert(g,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(g,_){if(!g)return this;for(var x,E,B,P=this.data,I=this.toBBox(g),D=[],F=[];P||D.length;){if(P||(P=D.pop(),E=D[D.length-1],x=F.pop(),B=!0),P.leaf){var S=a(g,P.children,_);if(S!==-1)return P.children.splice(S,1),D.push(P),this._condense(D),this}B||P.leaf||!d(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(D.push(P),F.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(g){return g},r.prototype.compareMinX=function(g,_){return g.minX-_.minX},r.prototype.compareMinY=function(g,_){return g.minY-_.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(g){return this.data=g,this},r.prototype._all=function(g,_){for(var x=[];g;)g.leaf?_.push.apply(_,g.children):x.push.apply(x,g.children),g=x.pop();return _},r.prototype._build=function(g,_,x,E){var B,P=x-_+1,I=this._maxEntries;if(P<=I)return s(B=v(g.slice(_,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var D=Math.ceil(P/I),F=D*Math.ceil(Math.sqrt(I));y(g,_,x,F,this.compareMinX);for(var S=_;S<=x;S+=F){var T=Math.min(S+F-1,x);y(g,S,T,D,this.compareMinY);for(var w=S;w<=T;w+=D){var C=Math.min(w+D-1,T);B.children.push(this._build(g,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(g,_,x,E){for(;E.push(_),!_.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,D=0;D<_.children.length;D++){var F=_.children[D],S=f(F),T=(w=g,C=F,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=F):T===P&&S<B&&(B=S,I=F)}_=I||_.children[0]}var w,C;return _},r.prototype._insert=function(g,_,x){var E=x?g:this.toBBox(g),B=[],P=this._chooseSubtree(E,this.data,_,B);for(P.children.push(g),u(P,E);_>=0&&B[_].children.length>this._maxEntries;)this._split(B,_),_--;this._adjustParentBBoxes(E,B,_)},r.prototype._split=function(g,_){var x=g[_],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),_?g[_-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(g,_){this.data=v([g,_]),this.data.height=g.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(g,_,x){for(var E,B,P,I,D,F,S,T=1/0,w=1/0,C=_;C<=x-_;C++){var M=l(g,0,C,this.toBBox),R=l(g,C,x,this.toBBox),U=(B=M,P=R,I=void 0,D=void 0,F=void 0,S=void 0,I=Math.max(B.minX,P.minX),D=Math.max(B.minY,P.minY),F=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,F-I)*Math.max(0,S-D)),O=f(M)+f(R);U<T?(T=U,E=C,w=O<w?O:w):U===T&&O<w&&(w=O,E=C)}return E||x-_},r.prototype._chooseSplitAxis=function(g,_,x){var E=g.leaf?this.compareMinX:A,B=g.leaf?this.compareMinY:h;this._allDistMargin(g,_,x,E)<this._allDistMargin(g,_,x,B)&&g.children.sort(E)},r.prototype._allDistMargin=function(g,_,x,E){g.children.sort(E);for(var B=this.toBBox,P=l(g,0,_,B),I=l(g,x-_,x,B),D=p(P)+p(I),F=_;F<x-_;F++){var S=g.children[F];u(P,g.leaf?B(S):S),D+=p(P)}for(var T=x-_-1;T>=_;T--){var w=g.children[T];u(I,g.leaf?B(w):w),D+=p(I)}return D},r.prototype._adjustParentBBoxes=function(g,_,x){for(var E=x;E>=0;E--)u(_[E],g)},r.prototype._condense=function(g){for(var _=g.length-1,x=void 0;_>=0;_--)g[_].children.length===0?_>0?(x=g[_-1].children).splice(x.indexOf(g[_]),1):this.clear():s(g[_],this.toBBox)},r})})(B_);var ck=B_.exports;function An(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=Mf(t),o=Fi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&hk(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(T_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,h=1;h<s[u].length&&!A;)T_(i,s[u][h],!e.ignoreBoundary)&&(A=!0),h++;A||(l=!0)}return l}function T_(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 a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var h=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;h&&(i=!i)}return i}function hk(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function Ak(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return I_(t);case"FeatureCollection":return fk(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return by(t);default:throw new Error("unknown GeoJSON type")}}function I_(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=F_(t.properties),n.geometry=by(t.geometry),n}function F_(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]=F_(i):n[e]=i}),n}function fk(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 I_(e)}),n}function by(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return by(e)}),n):(n.coordinates=M_(t.coordinates),n)}function M_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return M_(e)})}function D_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=Iz(t),o=[];switch(i){case"LineString":o=xy(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(a){o.push(xy(a))});break;case"MultiPolygon":Ii(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(xy(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ii(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!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):zn({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function xy(t){var n=Ii(t);if(n.length===2&&!R_(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 a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&U_(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,R_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return U_(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function R_(t,n){return t[0]===n[0]&&t[1]===n[1]}function U_(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,h=s-r,f=l-a,p=u*f-A*h;return p!==0?!1:Math.abs(h)>=Math.abs(f)?h>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function dk(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return Jo(t,function(r){e+=r[0],i+=r[1],o++},!0),Xt([e/o,i/o],n.properties)}function O_(t){if(!t)throw new Error("geojson is required");var n=[];return rr(t,function(e){pk(e,n)}),Pn(n)}function pk(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ii(i);break;case"LineString":e=[Ii(i)]}e.forEach(function(o){var r=mk(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function mk(t,n){var e=[];return t.reduce(function(i,o){var r=Yn([i,o],n);return r.bbox=gk(i,o),e.push(r),o}),e}function gk(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var _y={exports:{}},L_={};(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,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return h(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!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 C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,M=S;C<M.length;C++){var R=M[C];if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var U=0;U<R[R.length-1].length;U++)if(R[R.length-1][U]!==R[0][U])throw new Error("First and last Position are not equivalent.")}var O={type:"Polygon",coordinates:S};return n(O,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function h(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=h;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function p(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=p;function d(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=d;function m(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=m;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return _(v(S,T))}t.lengthToDegrees=y;function g(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=g;function _(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=_;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return m(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var M=t.areaFactors[w];if(!M)throw new Error("invalid final units");return S/C*M}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;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(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=D;function F(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=F})(L_);var Ut={};const yk=eb(Bz);Object.defineProperty(Ut,"__esModule",{value:!0});var ln=yk;function lu(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,p=t.type,d=p==="FeatureCollection",m=p==="Feature",v=d?t.features.length:1,y=0;y<v;y++){u=d?t.features[y].geometry:m?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var g=0;g<s;g++){var _=0,x=0;if(a=f?u.geometries[g]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,_,x)===!1)return!1;h++,_++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,_,x)===!1)return!1;h++,E==="MultiPoint"&&_++}E==="LineString"&&_++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,_,x)===!1)return!1;h++}E==="MultiLineString"&&_++,E==="Polygon"&&x++}E==="Polygon"&&_++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,_,x)===!1)return!1;h++}x++}_++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(lu(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function vk(t,n,e,i){var o=e;return lu(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function z_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function wk(t,n,e){var i=e;return z_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function k_(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 bk(t,n,e){var i=e;return k_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function xk(t){var n=[];return lu(t,function(e){n.push(e)}),n}function Cy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,p=t.type==="FeatureCollection",d=t.type==="Feature",m=p?t.features.length:1;for(e=0;e<m;e++){for(s=p?t.features[e].geometry:d?t.geometry:t,u=p?t.features[e].properties:d?t.properties:{},A=p?t.features[e].bbox:d?t.bbox:void 0,h=p?t.features[e].id:d?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function _k(t,n,e){var i=e;return Cy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function Rf(t,n){Cy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(ln.feature(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(ln.feature(h,o),i,u)===!1)return!1}})}function Ck(t,n,e){var i=e;return Rf(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function Q_(t,n){Rf(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(lu(e,function(h,f,p,d,m){if(s===void 0||i>l||d>u||m>A){s=h,l=i,u=d,A=m,r=0;return}var v=ln.lineString([s,h],e.properties);if(n(v,i,o,m,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function Sk(t,n,e){var i=e,o=!1;return Q_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function V_(t,n){if(!t)throw new Error("geojson is required");Rf(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(ln.lineString(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function Ek(t,n,e){var i=e;return V_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function Pk(t,n){if(n=n||{},!ln.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),ln.lineString([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),ln.lineString([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),ln.lineString([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),ln.lineString([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function Bk(t,n){if(n=n||{},!ln.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return ln.point(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),ln.point(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),ln.point(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),ln.point(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),ln.point(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),ln.point(l[i][o][r],a,n)}throw new Error("geojson is invalid")}Ut.coordAll=xk,Ut.coordEach=lu,Ut.coordReduce=vk,Ut.featureEach=k_,Ut.featureReduce=bk,Ut.findPoint=Bk,Ut.findSegment=Pk,Ut.flattenEach=Rf,Ut.flattenReduce=Ck,Ut.geomEach=Cy,Ut.geomReduce=_k,Ut.lineEach=V_,Ut.lineReduce=Ek,Ut.propEach=z_,Ut.propReduce=wk,Ut.segmentEach=Q_,Ut.segmentReduce=Sk;var Sy={};const Tk=eb(Qz);Object.defineProperty(Sy,"__esModule",{value:!0});var Ik=Tk;function Ey(t){var n=[1/0,1/0,-1/0,-1/0];return Ik.coordEach(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}Ey.default=Ey,Sy.default=Ey;var Ui=ck,N_=L_,H_=Ut,Sa=Sy.default,Fk=H_.featureEach;H_.coordEach,N_.polygon;var G_=N_.featureCollection;function W_(t){var n=new Ui(t);return n.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Sa(e),Ui.prototype.insert.call(this,e)},n.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Sa(o),i.push(o)}):Fk(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Sa(o),i.push(o)}),Ui.prototype.load.call(this,i)},n.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Sa(e),Ui.prototype.remove.call(this,e,i)},n.clear=function(){return Ui.prototype.clear.call(this)},n.search=function(e){var i=Ui.prototype.search.call(this,this.toBBox(e));return G_(i)},n.collides=function(e){return Ui.prototype.collides.call(this,this.toBBox(e))},n.all=function(){var e=Ui.prototype.all.call(this);return G_(e)},n.toJSON=function(){return Ui.prototype.toJSON.call(this)},n.fromJSON=function(e){return Ui.prototype.fromJSON.call(this,e)},n.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=Sa(e);else if(e.type==="FeatureCollection")i=Sa(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},n}_y.exports=W_,_y.exports.default=W_;var Mk=_y.exports;const Dk=Ml(Mk);function Py(t,n){var e={},i=[];if(t.type==="LineString"&&(t=zn(t)),n.type==="LineString"&&(n=zn(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=j_(t,n);return o&&i.push(o),Pn(i)}var r=Dk();return r.load(O_(n)),wa(O_(t),function(a){wa(r.search(a),function(s){var l=j_(a,s);if(l){var u=Ii(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),Pn(i)}function j_(t,n){var e=Ii(t),i=Ii(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],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],h=i[1][1],f=(h-u)*(a-o)-(A-l)*(s-r),p=(A-l)*(r-u)-(h-u)*(o-l),d=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var m=p/f,v=d/f;if(m>=0&&m<=1&&v>=0&&v<=1){var y=o+m*(a-o),g=r+m*(s-r);return Xt([y,g])}return null}function Uf(t,n,e){e===void 0&&(e={});for(var i=Mf(t),o=Ii(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),Rk(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Rk(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],h=e[0]-s,f=e[1]-l,p=u-s,d=A-l,m=h*d-f*p;if(o!==null){if(Math.abs(m)>o)return!1}else if(m!==0)return!1;if(i){if(i==="start")return Math.abs(p)>=Math.abs(d)?p>0?s<r&&r<=u:u<=r&&r<s:d>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(p)>=Math.abs(d)?p>0?s<=r&&r<u:u<r&&r<=s:d>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(p)>=Math.abs(d)?p>0?s<r&&r<u:u<r&&r<s:d>0?l<a&&a<A:A<a&&a<l}else return Math.abs(p)>=Math.abs(d)?p>0?s<=r&&r<=u:u<=r&&r<=s:d>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function Uk(t,n){var e=Fi(t),i=Fi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return Ok(e,i);case"LineString":return Uf(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return An(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return Lk(e,i);case"LineString":return zk(e,i);case"Polygon":case"MultiPolygon":return kk(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return Qk(e,i);case"Polygon":case"MultiPolygon":return Vk(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return Nk(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function Ok(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(K_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function Lk(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)K_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function zk(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 kk(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=An(t.coordinates[1],n),!i){e=!1;break}i=An(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function Qk(t,n){for(var e=0;e<t.coordinates.length;e++)if(!Uf(t.coordinates[e],n))return!1;return!0}function Vk(t,n){var e=ts(n),i=ts(t);if(!q_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!An(t.coordinates[r],n))return!1;if(o||(o=An(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=Hk(t.coordinates[r],t.coordinates[r+1]);o=An(a,n,{ignoreBoundary:!0})}}return o}function Nk(t,n){var e=ts(t),i=ts(n);if(!q_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!An(t.coordinates[0][o],n))return!1;return!0}function q_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function K_(t,n){return t[0]===n[0]&&t[1]===n[1]}function Hk(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function Z_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Mi([o,r],[a,r],e),u=l*(a-o),A=n/Mi([o,r],[o,s],e),h=A*(s-r),f=a-o,p=s-r,d=Math.floor(f/u),m=Math.floor(p/h),v=(f-d*u)/2,y=(p-m*h)/2,g=o+v;g<=a;){for(var _=r+y;_<=s;){var x=Xt([g,_],e.properties);e.mask?Uk(x,e.mask)&&i.push(x):i.push(x),_+=h}g+=u}return Pn(i)}function By(t,n){n===void 0&&(n={});var e=Fi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return Gk(e,n);case"MultiPolygon":return Wk(e,n);default:throw new Error("invalid poly")}}function Gk(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return $_(i,o)}function Wk(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push($_(a,o))}),Pn(r)}function $_(t,n){return t.length>1?fy(t,n):Yn(t[0],n)}var X_=Object.prototype.toString,Y_=function(n){var e=X_.call(n),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&X_.call(n.callee)==="[object Function]"),i},Ty,J_;function jk(){if(J_)return Ty;J_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Y_,o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var p=f.constructor;return p&&p.prototype===f},u={$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},A=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),h=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(p){var d=p!==null&&typeof p=="object",m=e.call(p)==="[object Function]",v=i(p),y=d&&e.call(p)==="[object String]",g=[];if(!d&&!m&&!v)throw new TypeError("Object.keys called on a non-object");var _=a&&m;if(y&&p.length>0&&!n.call(p,0))for(var x=0;x<p.length;++x)g.push(String(x));if(v&&p.length>0)for(var E=0;E<p.length;++E)g.push(String(E));else for(var B in p)!(_&&B==="prototype")&&n.call(p,B)&&g.push(String(B));if(r)for(var P=h(p),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(p,s[I])&&g.push(s[I]);return g}}return Ty=t,Ty}var qk=Array.prototype.slice,Kk=Y_,eC=Object.keys,Of=eC?function(n){return eC(n)}:jk(),tC=Object.keys;Of.shim=function(){if(Object.keys){var n=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);n||(Object.keys=function(i){return Kk(i)?tC(qk.call(i)):tC(i)})}else Object.keys=Of;return Object.keys||Of};var nC=Of,iC=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 a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0},Zk=iC,Iy=function(){return Zk()&&!!Symbol.toStringTag},rC=Object,oC=Error,$k=EvalError,Xk=RangeError,Yk=ReferenceError,sC=SyntaxError,Ea=TypeError,Jk=URIError,e6=Math.abs,t6=Math.floor,n6=Math.max,i6=Math.min,r6=Math.pow,o6=Math.round,s6=Number.isNaN||function(n){return n!==n},a6=s6,l6=function(n){return a6(n)||n===0?n:n<0?-1:1},u6=Object.getOwnPropertyDescriptor,Lf=u6;if(Lf)try{Lf([],"length")}catch{Lf=null}var Pa=Lf,zf=Object.defineProperty||!1;if(zf)try{zf({},"a",{value:1})}catch{zf=!1}var kf=zf,Fy,aC;function c6(){if(aC)return Fy;aC=1;var t=typeof Symbol<"u"&&Symbol,n=iC;return Fy=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},Fy}var lC=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,h6=rC,uC=h6.getPrototypeOf||null,A6="Function.prototype.bind called on incompatible ",f6=Object.prototype.toString,d6=Math.max,p6="[object Function]",cC=function(n,e){for(var i=[],o=0;o<n.length;o+=1)i[o]=n[o];for(var r=0;r<e.length;r+=1)i[r+n.length]=e[r];return i},m6=function(n,e){for(var i=[],o=e,r=0;o<n.length;o+=1,r+=1)i[r]=n[o];return i},g6=function(t,n){for(var e="",i=0;i<t.length;i+=1)e+=t[i],i+1<t.length&&(e+=n);return e},y6=function(n){var e=this;if(typeof e!="function"||f6.apply(e)!==p6)throw new TypeError(A6+e);for(var i=m6(arguments,1),o,r=function(){if(this instanceof o){var A=e.apply(this,cC(i,arguments));return Object(A)===A?A:this}return e.apply(n,cC(i,arguments))},a=d6(0,e.length-i.length),s=[],l=0;l<a;l++)s[l]="$"+l;if(o=Function("binder","return function ("+g6(s,",")+"){ return binder.apply(this,arguments); }")(r),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},v6=y6,uu=Function.prototype.bind||v6,My=Function.prototype.call,Dy=Function.prototype.apply,w6=typeof Reflect<"u"&&Reflect&&Reflect.apply,b6=uu,x6=Dy,_6=My,C6=w6,hC=C6||b6.call(_6,x6),S6=uu,E6=Ea,P6=My,B6=hC,Ry=function(n){if(n.length<1||typeof n[0]!="function")throw new E6("a function is required");return B6(S6,P6,n)},T6=Ry,AC=Pa,fC;try{fC=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Uy=!!fC&&AC&&AC(Object.prototype,"__proto__"),dC=Object,pC=dC.getPrototypeOf,I6=Uy&&typeof Uy.get=="function"?T6([Uy.get]):typeof pC=="function"?function(n){return pC(n==null?n:dC(n))}:!1,mC=lC,gC=uC,yC=I6,vC=mC?function(n){return mC(n)}:gC?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return gC(n)}:yC?function(n){return yC(n)}:null,F6=Function.prototype.call,M6=Object.prototype.hasOwnProperty,D6=uu,wC=D6.call(F6,M6),We,R6=rC,U6=oC,O6=$k,L6=Xk,z6=Yk,Ba=sC,Ta=Ea,k6=Jk,Q6=e6,V6=t6,N6=n6,H6=i6,G6=r6,W6=o6,j6=l6,bC=Function,Oy=function(t){try{return bC('"use strict"; return ('+t+").constructor;")()}catch{}},cu=Pa,q6=kf,Ly=function(){throw new Ta},K6=cu?function(){try{return arguments.callee,Ly}catch{try{return cu(arguments,"callee").get}catch{return Ly}}}():Ly,Ia=c6()(),Nt=vC,Z6=uC,$6=lC,xC=Dy,hu=My,Fa={},X6=typeof Uint8Array>"u"||!Nt?We:Nt(Uint8Array),ns={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?We:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?We:ArrayBuffer,"%ArrayIteratorPrototype%":Ia&&Nt?Nt([][Symbol.iterator]()):We,"%AsyncFromSyncIteratorPrototype%":We,"%AsyncFunction%":Fa,"%AsyncGenerator%":Fa,"%AsyncGeneratorFunction%":Fa,"%AsyncIteratorPrototype%":Fa,"%Atomics%":typeof Atomics>"u"?We:Atomics,"%BigInt%":typeof BigInt>"u"?We:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?We:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?We:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?We:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":U6,"%eval%":eval,"%EvalError%":O6,"%Float16Array%":typeof Float16Array>"u"?We:Float16Array,"%Float32Array%":typeof Float32Array>"u"?We:Float32Array,"%Float64Array%":typeof Float64Array>"u"?We:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?We:FinalizationRegistry,"%Function%":bC,"%GeneratorFunction%":Fa,"%Int8Array%":typeof Int8Array>"u"?We:Int8Array,"%Int16Array%":typeof Int16Array>"u"?We:Int16Array,"%Int32Array%":typeof Int32Array>"u"?We:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ia&&Nt?Nt(Nt([][Symbol.iterator]())):We,"%JSON%":typeof JSON=="object"?JSON:We,"%Map%":typeof Map>"u"?We:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ia||!Nt?We:Nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":R6,"%Object.getOwnPropertyDescriptor%":cu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?We:Promise,"%Proxy%":typeof Proxy>"u"?We:Proxy,"%RangeError%":L6,"%ReferenceError%":z6,"%Reflect%":typeof Reflect>"u"?We:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?We:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ia||!Nt?We:Nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?We:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ia&&Nt?Nt(""[Symbol.iterator]()):We,"%Symbol%":Ia?Symbol:We,"%SyntaxError%":Ba,"%ThrowTypeError%":K6,"%TypedArray%":X6,"%TypeError%":Ta,"%Uint8Array%":typeof Uint8Array>"u"?We:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?We:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?We:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?We:Uint32Array,"%URIError%":k6,"%WeakMap%":typeof WeakMap>"u"?We:WeakMap,"%WeakRef%":typeof WeakRef>"u"?We:WeakRef,"%WeakSet%":typeof WeakSet>"u"?We:WeakSet,"%Function.prototype.call%":hu,"%Function.prototype.apply%":xC,"%Object.defineProperty%":q6,"%Object.getPrototypeOf%":Z6,"%Math.abs%":Q6,"%Math.floor%":V6,"%Math.max%":N6,"%Math.min%":H6,"%Math.pow%":G6,"%Math.round%":W6,"%Math.sign%":j6,"%Reflect.getPrototypeOf%":$6};if(Nt)try{null.error}catch(t){var Y6=Nt(Nt(t));ns["%Error.prototype%"]=Y6}var J6=function t(n){var e;if(n==="%AsyncFunction%")e=Oy("async function () {}");else if(n==="%GeneratorFunction%")e=Oy("function* () {}");else if(n==="%AsyncGeneratorFunction%")e=Oy("async function* () {}");else if(n==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(n==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&Nt&&(e=Nt(o.prototype))}return ns[n]=e,e},_C={__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"]},Au=uu,Qf=wC,eQ=Au.call(hu,Array.prototype.concat),tQ=Au.call(xC,Array.prototype.splice),CC=Au.call(hu,String.prototype.replace),Vf=Au.call(hu,String.prototype.slice),nQ=Au.call(hu,RegExp.prototype.exec),iQ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rQ=/\\(\\)?/g,oQ=function(n){var e=Vf(n,0,1),i=Vf(n,-1);if(e==="%"&&i!=="%")throw new Ba("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Ba("invalid intrinsic syntax, expected opening `%`");var o=[];return CC(n,iQ,function(r,a,s,l){o[o.length]=s?CC(l,rQ,"$1"):a||r}),o},sQ=function(n,e){var i=n,o;if(Qf(_C,i)&&(o=_C[i],i="%"+o[0]+"%"),Qf(ns,i)){var r=ns[i];if(r===Fa&&(r=J6(i)),typeof r>"u"&&!e)throw new Ta("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:r}}throw new Ba("intrinsic "+n+" does not exist!")},SC=function(n,e){if(typeof n!="string"||n.length===0)throw new Ta("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ta('"allowMissing" argument must be a boolean');if(nQ(/^%?[^%]*%?$/,n)===null)throw new Ba("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=oQ(n),o=i.length>0?i[0]:"",r=sQ("%"+o+"%",e),a=r.name,s=r.value,l=!1,u=r.alias;u&&(o=u[0],tQ(i,eQ([0,1],u)));for(var A=1,h=!0;A<i.length;A+=1){var f=i[A],p=Vf(f,0,1),d=Vf(f,-1);if((p==='"'||p==="'"||p==="`"||d==='"'||d==="'"||d==="`")&&p!==d)throw new Ba("property names with quotes must have matching quotes");if((f==="constructor"||!h)&&(l=!0),o+="."+f,a="%"+o+"%",Qf(ns,a))s=ns[a];else if(s!=null){if(!(f in s)){if(!e)throw new Ta("base intrinsic for "+n+" exists, but the property is not available.");return}if(cu&&A+1>=i.length){var m=cu(s,f);h=!!m,h&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[f]}else h=Qf(s,f),s=s[f];h&&!l&&(ns[a]=s)}}return s},EC=SC,PC=Ry,aQ=PC([EC("%String.prototype.indexOf%")]),zy=function(n,e){var i=EC(n,!!e);return typeof i=="function"&&aQ(n,".prototype.")>-1?PC([i]):i},lQ=Iy(),uQ=zy,ky=uQ("Object.prototype.toString"),Nf=function(n){return lQ&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:ky(n)==="[object Arguments]"},BC=function(n){return Nf(n)?!0:n!==null&&typeof n=="object"&&"length"in n&&typeof n.length=="number"&&n.length>=0&&ky(n)!=="[object Array]"&&"callee"in n&&ky(n.callee)==="[object Function]"},cQ=function(){return Nf(arguments)}();Nf.isLegacyArguments=BC;var hQ=cQ?Nf:BC,TC=kf,AQ=sC,Ma=Ea,IC=Pa,Qy=function(n,e,i){if(!n||typeof n!="object"&&typeof n!="function")throw new Ma("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ma("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ma("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ma("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ma("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ma("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!IC&&IC(n,e);if(TC)TC(n,e,{configurable:a===null&&l?l.configurable:!a,enumerable:o===null&&l?l.enumerable:!o,value:i,writable:r===null&&l?l.writable:!r});else if(s||!o&&!r&&!a)n[e]=i;else throw new AQ("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Vy=kf,FC=function(){return!!Vy};FC.hasArrayLengthDefineBug=function(){if(!Vy)return null;try{return Vy([],"length",{value:1}).length!==1}catch{return!0}};var Ny=FC,fQ=nC,dQ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",pQ=Object.prototype.toString,mQ=Array.prototype.concat,MC=Qy,gQ=function(t){return typeof t=="function"&&pQ.call(t)==="[object Function]"},DC=Ny(),yQ=function(t,n,e,i){if(n in t){if(i===!0){if(t[n]===e)return}else if(!gQ(i)||!i())return}DC?MC(t,n,e,!0):MC(t,n,e)},RC=function(t,n){var e=arguments.length>2?arguments[2]:{},i=fQ(n);dQ&&(i=mQ.call(i,Object.getOwnPropertySymbols(n)));for(var o=0;o<i.length;o+=1)yQ(t,i[o],n[i[o]],e[i[o]])};RC.supportsDescriptors=!!DC;var fu=RC,UC={exports:{}},vQ=SC,OC=Qy,wQ=Ny(),LC=Pa,zC=Ea,bQ=vQ("%Math.floor%"),xQ=function(n,e){if(typeof n!="function")throw new zC("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||bQ(e)!==e)throw new zC("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,r=!0;if("length"in n&&LC){var a=LC(n,"length");a&&!a.configurable&&(o=!1),a&&!a.writable&&(r=!1)}return(o||r||!i)&&(wQ?OC(n,"length",e,!0,!0):OC(n,"length",e)),n},_Q=uu,CQ=Dy,SQ=hC,EQ=function(){return SQ(_Q,CQ,arguments)};(function(t){var n=xQ,e=kf,i=Ry,o=EQ;t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(UC);var kC=UC.exports,QC=function(t){return t!==t},VC=function(n,e){return n===0&&e===0?1/n===1/e:!!(n===e||QC(n)&&QC(e))},PQ=VC,NC=function(){return typeof Object.is=="function"?Object.is:PQ},BQ=NC,TQ=fu,IQ=function(){var n=BQ();return TQ(Object,{is:n},{is:function(){return Object.is!==n}}),n},FQ=fu,MQ=kC,DQ=VC,HC=NC,RQ=IQ,GC=MQ(HC(),Object);FQ(GC,{getPolyfill:HC,implementation:DQ,shim:RQ});var UQ=GC,WC=zy,OQ=Iy(),LQ=wC,zQ=Pa,Hy;if(OQ){var kQ=WC("RegExp.prototype.exec"),jC={},Gy=function(){throw jC},qC={toString:Gy,valueOf:Gy};typeof Symbol.toPrimitive=="symbol"&&(qC[Symbol.toPrimitive]=Gy),Hy=function(n){if(!n||typeof n!="object")return!1;var e=zQ(n,"lastIndex"),i=e&&LQ(e,"value");if(!i)return!1;try{kQ(n,qC)}catch(o){return o===jC}}}else{var QQ=WC("Object.prototype.toString"),VQ="[object RegExp]";Hy=function(n){return!n||typeof n!="object"&&typeof n!="function"?!1:QQ(n)===VQ}}var NQ=Hy,du=function(){return typeof(function(){}).name=="string"},pu=Object.getOwnPropertyDescriptor;if(pu)try{pu([],"length")}catch{pu=null}du.functionsHaveConfigurableNames=function(){if(!du()||!pu)return!1;var n=pu(function(){},"name");return!!n&&!!n.configurable};var HQ=Function.prototype.bind;du.boundFunctionsHaveNames=function(){return du()&&typeof HQ=="function"&&(function(){}).bind().name!==""};var GQ=du,KC=Qy,WQ=Ny(),jQ=GQ.functionsHaveConfigurableNames(),qQ=Ea,KQ=function(n,e){if(typeof n!="function")throw new qQ("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||jQ)&&(WQ?KC(n,"name",e,!0,!0):KC(n,"name",e)),n},ZQ=KQ,$Q=Ea,XQ=Object,ZC=ZQ(function(){if(this==null||this!==XQ(this))throw new $Q("RegExp.prototype.flags getter called on non-object");var n="";return this.hasIndices&&(n+="d"),this.global&&(n+="g"),this.ignoreCase&&(n+="i"),this.multiline&&(n+="m"),this.dotAll&&(n+="s"),this.unicode&&(n+="u"),this.unicodeSets&&(n+="v"),this.sticky&&(n+="y"),n},"get flags",!0),YQ=ZC,JQ=fu.supportsDescriptors,e8=Object.getOwnPropertyDescriptor,$C=function(){if(JQ&&/a/mig.flags==="gim"){var n=e8(RegExp.prototype,"flags");if(n&&typeof n.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),n.get.call(i),e==="dy")return n.get}}return YQ},t8=fu.supportsDescriptors,n8=$C,i8=Pa,r8=Object.defineProperty,o8=oC,XC=vC,s8=/a/,a8=function(){if(!t8||!XC)throw new o8("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var n=n8(),e=XC(s8),i=i8(e,"flags");return(!i||i.get!==n)&&r8(e,"flags",{configurable:!0,enumerable:!1,get:n}),n},l8=fu,u8=kC,c8=ZC,YC=$C,h8=a8,JC=u8(YC());l8(JC,{getPolyfill:YC,implementation:c8,shim:h8});var A8=JC,eS=zy,f8=eS("Date.prototype.getDay"),d8=function(n){try{return f8(n),!0}catch{return!1}},p8=eS("Object.prototype.toString"),m8="[object Date]",g8=Iy(),y8=function(n){return typeof n!="object"||n===null?!1:g8?d8(n):p8(n)===m8},tS=nC,nS=hQ,iS=UQ,rS=NQ,oS=A8,sS=y8,aS=Date.prototype.getTime;function lS(t,n,e){var i=e||{};return(i.strict?iS(t,n):t===n)?!0:!t||!n||typeof t!="object"&&typeof n!="object"?i.strict?iS(t,n):t==n:v8(t,n,i)}function uS(t){return t==null}function cS(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function v8(t,n,e){var i,o;if(typeof t!=typeof n||uS(t)||uS(n)||t.prototype!==n.prototype||nS(t)!==nS(n))return!1;var r=rS(t),a=rS(n);if(r!==a)return!1;if(r||a)return t.source===n.source&&oS(t)===oS(n);if(sS(t)&&sS(n))return aS.call(t)===aS.call(n);var s=cS(t),l=cS(n);if(s!==l)return!1;if(s||l){if(t.length!==n.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}if(typeof t!=typeof n)return!1;try{var u=tS(t),A=tS(n)}catch{return!1}if(u.length!==A.length)return!1;for(u.sort(),A.sort(),i=u.length-1;i>=0;i--)if(u[i]!=A[i])return!1;for(i=u.length-1;i>=0;i--)if(o=u[i],!lS(t[o],n[o],e))return!1;return!0}var w8=lS;function b8(t,n){var e=!0;return rr(t,function(i){rr(n,function(o){if(e===!1)return!1;e=x8(i.geometry,o.geometry)})}),e}function x8(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!E8(t.coordinates,n.coordinates);case"LineString":return!hS(n,t);case"Polygon":return!An(t,n)}break;case"LineString":switch(n.type){case"Point":return!hS(t,n);case"LineString":return!_8(t,n);case"Polygon":return!AS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!An(n,t);case"LineString":return!AS(t,n);case"Polygon":return!C8(n,t)}}return!1}function hS(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(S8(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function _8(t,n){var e=Py(t,n);return e.features.length>0}function AS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(An(o,t))return!0}var r=Py(n,By(t));return r.features.length>0}function C8(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(An(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(An(s,t))return!0}var l=Py(By(t),By(n));return l.features.length>0}function S8(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function E8(t,n){return t[0]===n[0]&&t[1]===n[1]}var P8=w8,Oi=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=t&&t.direction?t.direction:!1,this.pseudoNode=t&&t.pseudoNode?t.pseudoNode:!1,this.objectComparator=t&&t.objectComparator?t.objectComparator:B8};Oi.prototype.compare=function(t,n){if(t.type!==n.type||!dS(t,n))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,n.coordinates);case"LineString":return this.compareLine(t.coordinates,n.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,n);case"Feature":return this.compareFeature(t,n);default:if(t.type.indexOf("Multi")===0){var e=this,i=fS(t),o=fS(n);return i.every(function(r){return this.some(function(a){return e.compare(r,a)})},o)}}return!1};function fS(t){return t.coordinates.map(function(n){return{type:t.type.replace("Multi",""),coordinates:n}})}function dS(t,n){return t.hasOwnProperty("coordinates")?t.coordinates.length===n.coordinates.length:t.length===n.length}Oi.prototype.compareCoord=function(t,n){if(t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==n[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,n,e,i){if(!dS(t,n))return!1;var o=this.pseudoNode?t:this.removePseudo(t),r=this.pseudoNode?n:this.removePseudo(n);if(!(i&&!this.compareCoord(o[0],r[0])&&(r=this.fixStartIndex(r,o),!r))){var a=this.compareCoord(o[e],r[e]);return this.direction||a?this.comparePath(o,r):this.compareCoord(o[e],r[r.length-(1+e)])?this.comparePath(o.slice().reverse(),r):!1}},Oi.prototype.fixStartIndex=function(t,n){for(var e,i=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],n[0])){i=o;break}return i>=0&&(e=[].concat(t.slice(i,t.length),t.slice(1,i+1))),e},Oi.prototype.comparePath=function(t,n){var e=this;return t.every(function(i,o){return e.compareCoord(i,this[o])},n)},Oi.prototype.comparePolygon=function(t,n){if(this.compareLine(t.coordinates[0],n.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),i=n.coordinates.slice(1,n.coordinates.length),o=this;return e.every(function(r){return this.some(function(a){return o.compareLine(r,a,1,!0)})},i)}else return!1},Oi.prototype.compareFeature=function(t,n){return t.id!==n.id||!this.objectComparator(t.properties,n.properties)||!this.compareBBox(t,n)?!1:this.compare(t.geometry,n.geometry)},Oi.prototype.compareBBox=function(t,n){return!!(!t.bbox&&!n.bbox||t.bbox&&n.bbox&&this.compareCoord(t.bbox,n.bbox))},Oi.prototype.removePseudo=function(t){return t};function B8(t,n){return P8(t,n,{strict:!0})}var T8=Oi;const I8=Ml(T8);function F8(t,n){var e=Fi(t).type,i=Fi(n).type;if(e!==i)return!1;var o=new I8({precision:6});return o.compare(D_(t),D_(n))}function M8(t,n){var e=!1;return rr(t,function(i){rr(n,function(o){if(e===!0)return!0;e=!b8(i.geometry,o.geometry)})}),e}/**
|
|
3710
3710
|
* splaytree v3.1.2
|
|
3711
3711
|
* Fast Splay tree for Node and browser
|
|
3712
3712
|
*
|
|
@@ -3726,8 +3726,8 @@ function (result, this, instanceIndex, frameState) {
|
|
|
3726
3726
|
|
|
3727
3727
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
3728
3728
|
and limitations under the License.
|
|
3729
|
-
***************************************************************************** */function
|
|
3730
|
-
`);var r=n+(e?" ":"│ ");t.left&&jy(t.left,r,!1,i,o),t.right&&jy(t.right,r,!0,i,o)}}var qy=function(){function t(n){n===void 0&&(n=D8),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=Wy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new eo(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=to(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>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=to(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=to(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=to(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=to(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=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.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 O8(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&&$y(n,e,0,o-1,r),this._root===null)this._root=Ky(n,e,0,o),this._size=o;else{var a=L8(this.toList(),U8(n,e),r);o=this._size+o,this._root=Zy({head:a},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 jy(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),a=r.left,s=r.right;o(n,e)<0?s=Wy(e,i,s,o):a=Wy(e,i,a,o),this._root=R8(a,s,o)},t.prototype.split=function(n){return pS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return M8(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 Ky(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new eo(a,s);return l.left=Ky(t,n,e,r),l.right=Ky(t,n,r+1,i),l}return null}function U8(t,n){for(var e=new eo(null,null),i=e,o=0;o<t.length;o++)i=i.next=new eo(t[o],n[o]);return i.next=null,e.next}function O8(t){for(var n=t,e=[],i=!1,o=new eo(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 Zy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Zy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Zy(t,o+1,e),a}return null}function L8(t,n,e){for(var i=new eo(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function $y(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}$y(t,n,e,s,o),$y(t,n,s+1,i,o)}}const ar=11102230246251565e-32,un=134217729,z8=(3+8*ar)*ar;function Xy(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],h=0,f=0;A>u==A>-u?(r=u,u=n[++h]):(r=A,A=i[++f]);let p=0;if(h<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++h]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[p++]=s);h<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[p++]=s);for(;h<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h],r=a,s!==0&&(o[p++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[p++]=s);return(r!==0||p===0)&&(o[p++]=r),p}function k8(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function mu(t){return new Float64Array(t)}const Q8=(3+16*ar)*ar,V8=(2+12*ar)*ar,N8=(9+64*ar)*ar*ar,Da=mu(4),mS=mu(8),gS=mu(12),yS=mu(16),fn=mu(4);function H8(t,n,e,i,o,r,a){let s,l,u,A,h,f,p,d,m,v,y,g,_,x,E,B,P,I;const D=t-o,F=e-o,S=n-r,T=i-r;x=D*T,f=un*D,p=f-(f-D),d=D-p,f=un*T,m=f-(f-T),v=T-m,E=d*v-(x-p*m-d*m-p*v),B=S*F,f=un*S,p=f-(f-S),d=S-p,f=un*F,m=f-(f-F),v=F-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,Da[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,Da[1]=_-(y+h)+(h-B),I=g+y,h=I-g,Da[2]=g-(I-h)+(y-h),Da[3]=I;let w=k8(4,Da),C=V8*a;if(w>=C||-w>=C||(h=t-D,s=t-(D+h)+(h-o),h=e-F,u=e-(F+h)+(h-o),h=n-S,l=n-(S+h)+(h-r),h=i-T,A=i-(T+h)+(h-r),s===0&&l===0&&u===0&&A===0)||(C=N8*a+z8*Math.abs(w),w+=D*A+T*s-(S*u+F*l),w>=C||-w>=C))return w;x=s*T,f=un*s,p=f-(f-s),d=s-p,f=un*T,m=f-(f-T),v=T-m,E=d*v-(x-p*m-d*m-p*v),B=l*F,f=un*l,p=f-(f-l),d=l-p,f=un*F,m=f-(f-F),v=F-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const M=Xy(4,Da,4,fn,mS);x=D*A,f=un*D,p=f-(f-D),d=D-p,f=un*A,m=f-(f-A),v=A-m,E=d*v-(x-p*m-d*m-p*v),B=S*u,f=un*S,p=f-(f-S),d=S-p,f=un*u,m=f-(f-u),v=u-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const R=Xy(M,mS,4,fn,gS);x=s*A,f=un*s,p=f-(f-s),d=s-p,f=un*A,m=f-(f-A),v=A-m,E=d*v-(x-p*m-d*m-p*v),B=l*u,f=un*l,p=f-(f-l),d=l-p,f=un*u,m=f-(f-u),v=u-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const U=Xy(R,gS,4,fn,yS);return yS[U-1]}function gu(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=Q8*u?l:-H8(t,n,e,i,o,r,u)}const yu=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,Yy=(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 no=Number.EPSILON;no===void 0&&(no=Math.pow(2,-52));const G8=no*no,vS=(t,n)=>{if(-no<t&&t<no&&-no<n&&n<no)return 0;const e=t-n;return e*e<G8*t*n?0:t<n?-1:1};class W8{constructor(){this.reset()}reset(){this.xRounder=new wS,this.yRounder=new wS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class wS{constructor(){this.tree=new qy,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&vS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&vS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const vu=new W8,Hf=(t,n)=>t.x*n.y-t.y*n.x,bS=(t,n)=>t.x*n.x+t.y*n.y,xS=(t,n,e)=>{const i=gu(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},Gf=t=>Math.sqrt(bS(t,t)),j8=(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)/Gf(o)/Gf(i)},q8=(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 bS(o,i)/Gf(o)/Gf(i)},_S=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},CS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},K8=(t,n,e,i)=>{if(n.x===0)return CS(e,i,t.x);if(i.x===0)return CS(t,n,e.x);if(n.y===0)return _S(e,i,t.y);if(i.y===0)return _S(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},a=Hf(r,n)/o,s=Hf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,h=e.y+a*i.y,f=(l+u)/2,p=(A+h)/2;return{x:f,y:p}};class Jn{static compare(n,e){const i=Jn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:io.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:j8(this.point,n.point,r.point),cosine:q8(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let Z8=0;class io{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const h=n.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const h=e.comparePoint(n.leftSE.point);if(h!==0)return h;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const h=e.comparePoint(n.rightSE.point);if(h!==0)return h}if(r>a){const h=n.comparePoint(e.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(r!==a){const h=u-s,f=r-i,p=A-l,d=a-o;if(h>f&&p<d)return 1;if(h<f&&p>d)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++Z8,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,a;const s=Jn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Jn(o,!0),u=new Jn(r,!1);return new io(l,u,[i],[a])}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,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=Yy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=yu(e,s)&&this.comparePoint(s)===0,A=yu(i,r)&&n.comparePoint(r)===0,h=yu(e,l)&&this.comparePoint(l)===0,f=yu(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!h?a:!f&&h?l:null;if(A)return h&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&h)return null;if(f)return a;if(h)return l;const p=K8(r,this.vector(),s,n.vector());return p===null||!yu(o,p)?null:vu.round(p.x,p.y)}split(n){const e=[],i=n.events!==void 0,o=new Jn(n,!0),r=new Jn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new io(o,a,this.rings.slice(),this.windings.slice());return Jn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Jn.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=io.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,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=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 s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],h=e.indexOf(u);h===-1?(e.push(u),i.push(A)):i[h]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const h=r.indexOf(u.poly);h!==-1&&r.splice(h,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].multiPoly;o.indexOf(u)===-1&&o.push(u)}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(fi.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===fi.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 ${fi.type}`)}return this._isInResult}}class SS{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=vu.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 a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=vu.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(io.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(io.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 $8{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new SS(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 SS(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,a=o.length;r<a;r++)n.push(o[r])}return n}}class ES{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 $8(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,a=o.length;r<a;r++)n.push(o[r])}return n}}class Wf{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 a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,h=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const m=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${m.x}, ${m.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let p=null;for(let m=0,v=h.length;m<v;m++)if(h[m].point===s.point){p=m;break}if(p!==null){const m=h.splice(p)[0],v=u.splice(m.index);v.unshift(v[0].otherSE),e.push(new Wf(v.reverse()));continue}h.push({index:u.length,point:s.point});const d=s.getLeftmostComparator(a);l=f.sort(d)[0].otherSE;break}e.push(new Wf(u))}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 u=1,A=this.events.length-1;u<A;u++){const h=this.events[u].point,f=this.events[u+1].point;xS(h,n,f)!==0&&(e.push(h),n=h)}if(e.length===1)return null;const i=e[0],o=e[1];xS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].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 a=this.events[o];Jn.compare(n,a)>0&&(n=a)}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 PS{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 X8{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 PS(r));else{const a=r.enclosingRing();a.poly||e.push(new PS(a)),a.poly.addInterior(r)}}return e}}class Y8{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:io.compare;this.queue=n,this.tree=new qy(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,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const h=s.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(u=h),!s.isAnEndpoint(h))){const f=this._splitSafely(s,h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}}let A=null;if(l){const h=l.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(A=h),!l.isAnEndpoint(h))){const f=this._splitSafely(l,h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}}if(u!==null||A!==null){let h=null;u===null?h=A:A===null?h=u:h=Jn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}}}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 BS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,J8=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class eV{run(n,e,i){fi.type=n,vu.reset();const o=[new ES(e,!0)];for(let h=0,f=i.length;h<f;h++)o.push(new ES(i[h],!1));if(fi.numMultiPolys=o.length,fi.type==="difference"){const h=o[0];let f=1;for(;f<o.length;)Yy(o[f].bbox,h.bbox)!==null?f++:o.splice(f,1)}if(fi.type==="intersection")for(let h=0,f=o.length;h<f;h++){const p=o[h];for(let d=h+1,m=o.length;d<m;d++)if(Yy(p.bbox,o[d].bbox)===null)return[]}const r=new qy(Jn.compare);for(let h=0,f=o.length;h<f;h++){const p=o[h].getSweepEvents();for(let d=0,m=p.length;d<m;d++)if(r.insert(p[d]),r.size>BS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new Y8(r);let s=r.size,l=r.pop();for(;l;){const h=l.key;if(r.size===s){const p=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${p.id} [${p.leftSE.point.x}, ${p.leftSE.point.y}] -> [${p.rightSE.point.x}, ${p.rightSE.point.y}] from queue.`)}if(r.size>BS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>J8)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(h);for(let p=0,d=f.length;p<d;p++){const m=f[p];m.consumedBy===void 0&&r.insert(m)}s=r.size,l=r.pop()}vu.reset();const u=Wf.factory(a.segments);return new X8(u).getGeom()}}const fi=new eV;var tV={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 fi.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 fi.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 fi.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 fi.run("difference",t,e)}};function jf(t,n,e){e===void 0&&(e={});var i=Fi(t),o=Fi(n),r=tV.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?Vt(r[0],e.properties):dy(r,e.properties)}function nV(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Mi([o,l],[a,l],e),h=A*(a-o),f=n*2/Mi([u,r],[u,s],e),p=f*(s-r),d=h/2,m=d*2,v=Math.sqrt(3)/2*p,y=a-o,g=s-r,_=3/4*m,x=v,E=(y-m)/(m-d/2),B=Math.floor(E),P=(B*_-d/2-y)/2-d/2+_/2,I=Math.floor((g-v)/v),D=(g-I*v)/2,F=I*v-g>v/2;F&&(D-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var M=[],R=0;R<=B;R++)for(var U=0;U<=I;U++){var O=R%2===1;if(!(U===0&&O)&&!(U===0&&F)){var z=R*_+o-P,k=U*x+r+D;if(O&&(k-=v/2),e.triangles===!0)rV([z,k],h/2,p/2,JSON.parse(i),S,T).forEach(function(V){e.mask?jf(e.mask,V)&&M.push(V):M.push(V)});else{var Q=iV([z,k],h/2,p/2,JSON.parse(i),S,T);e.mask?jf(e.mask,Q)&&M.push(Q):M.push(Q)}}}return Pn(M)}function iV(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),Vt([a],i)}function rV(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(Vt([l],i))}return a}function oV(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Mi([r,a],[s,a],i),A=u*(s-r),h=e/Mi([r,a],[r,l],i),f=h*(l-a),p=s-r,d=l-a,m=Math.floor(p/A),v=Math.floor(d/f),y=(p-m*A)/2,g=(d-v*f)/2,_=r+y,x=0;x<m;x++){for(var E=a+g,B=0;B<v;B++){var P=Vt([[[_,E],[_,E+f],[_+A,E+f],[_+A,E],[_,E]]],i.properties);i.mask?F8(i.mask,P)&&o.push(P):o.push(P),E+=f}_+=A}return Pn(o)}function sV(t,n,e){return e===void 0&&(e={}),oV(t,n,n,e)}function aV(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Mi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Mi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,h=t[1];h<=t[3];){var f=null,p=null;l%2===0&&A%2===0?(f=Vt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)):l%2===0&&A%2===1?(f=Vt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties)):A%2===0&&l%2===1?(f=Vt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties),p=Vt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties)):A%2===1&&l%2===1&&(f=Vt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)),e.mask?(jf(e.mask,f)&&i.push(f),jf(e.mask,p)&&i.push(p)):(i.push(f),i.push(p)),h+=s,A++}l++,u+=r}return Pn(i)}function lV(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(Bz(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 a=ts(t),s;switch(i){case"point":case"points":s=Z_(a,n,e);break;case"square":case"squares":s=sV(a,n,e);break;case"hex":case"hexes":s=nV(a,n,e);break;case"triangle":case"triangles":s=aV(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return wa(s,function(u){var A=0,h=0;wa(t,function(p){var d=i==="point"?u:f6(u),m=Mi(d,p,e),v;if(o!==void 0&&(v=p.properties[o]),v===void 0&&(v=p.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");m===0&&(A=v);var y=1/Math.pow(m,r);h+=y,A+=y*v});var f=h6(u);f.properties[o]=A/h,l.push(f)}),Pn(l)}function uV(t,n,e){const i=b.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=b.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=b.Cartesian3.subtract(o,i,new b.Cartesian3);b.Cartesian3.normalize(r,r);const a=new b.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const TS=(t=0)=>new Promise(n=>setTimeout(n,t));function cV(t,n){const e=Pn(t.map(l=>Xt(l))),i=Vt([t]);return lV(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>An(Xt(l),i))}function hV(t){const n=b.JulianDate.fromDate(t),e=b.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ya(e)}function AV(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,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const Gc=class Gc extends Ln{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 Uo(i,e.id));this.czmPointPrimitiveCollection=r,this.d(c.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],A=e.sampleDistance,h=cV(u,A).map(_=>[..._,e.height]),f=Math.floor(e.extrudedHeight/A);if(f>0){const _=[...h];for(let x=1;x<=f;x++)h.push(..._.map(E=>[E[0],E[1],e.height+x*A]))}const{startTime:p,endTime:d,spanTime:m}=e,v=m*36e5,y=Math.floor((d-p)/v),g=Array(h.length).fill(0);e:for(let _=0;_<y;_++){if(await TS(),this._stopRun)break e;const x=new Date(p+_*v),E=hV(x);t:for(let B=0;B<h.length;B++){if(await TS(),this._stopRun)break t;uV(h[B],E,o.scene)||(g[B]=(g[B]*y+1)/y)}!this._stopRun&&(e.progress=Number(((_+1)/y*100).toFixed(2))),console.log("colorScalelist",g),l(h,g)}},s=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}));const l=(u,A)=>{const h=u.map((f,p)=>({position:[...f],color:AV(e.startColor,e.endColor,A[p]),pixelSize:10}));r.pointPrimitiveOptions=h}}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};L(Gc,"type",Gc.register("ESCesiumViewer",c.ESSunshineAnalysis.type,Gc));let Jy=Gc;const IS=Math.pow(2,-52),qf=new Uint32Array(512);class ev{static from(n,e=gV,i=yV){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new ev(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,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let D=0;D<a;D++){const F=n[2*D],S=n[2*D+1];F<s&&(s=F),S<l&&(l=S),F>u&&(u=F),S>A&&(A=S),this._ids[D]=D}const h=(s+u)/2,f=(l+A)/2;let p,d,m;for(let D=0,F=1/0;D<a;D++){const S=tv(h,f,n[2*D],n[2*D+1]);S<F&&(p=D,F=S)}const v=n[2*p],y=n[2*p+1];for(let D=0,F=1/0;D<a;D++){if(D===p)continue;const S=tv(v,y,n[2*D],n[2*D+1]);S<F&&S>0&&(d=D,F=S)}let g=n[2*d],_=n[2*d+1],x=1/0;for(let D=0;D<a;D++){if(D===p||D===d)continue;const F=pV(v,y,g,_,n[2*D],n[2*D+1]);F<x&&(m=D,x=F)}let E=n[2*m],B=n[2*m+1];if(x===1/0){for(let S=0;S<a;S++)this._dists[S]=n[2*S]-n[0]||n[2*S+1]-n[1];Ra(this._ids,this._dists,0,a-1);const D=new Uint32Array(a);let F=0;for(let S=0,T=-1/0;S<a;S++){const w=this._ids[S],C=this._dists[w];C>T&&(D[F++]=w,T=C)}this.hull=D.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(gu(v,y,g,_,E,B)<0){const D=d,F=g,S=_;d=m,g=E,_=B,m=D,E=F,B=S}const P=mV(v,y,g,_,E,B);this._cx=P.x,this._cy=P.y;for(let D=0;D<a;D++)this._dists[D]=tv(n[2*D],n[2*D+1],P.x,P.y);Ra(this._ids,this._dists,0,a-1),this._hullStart=p;let I=3;i[p]=e[m]=d,i[d]=e[p]=m,i[m]=e[d]=p,o[p]=0,o[d]=1,o[m]=2,r.fill(-1),r[this._hashKey(v,y)]=p,r[this._hashKey(g,_)]=d,r[this._hashKey(E,B)]=m,this.trianglesLen=0,this._addTriangle(p,d,m,-1,-1,-1);for(let D=0,F,S;D<this._ids.length;D++){const T=this._ids[D],w=n[2*T],C=n[2*T+1];if(D>0&&Math.abs(w-F)<=IS&&Math.abs(C-S)<=IS||(F=w,S=C,T===p||T===d||T===m))continue;let M=0;for(let k=0,Q=this._hashKey(w,C);k<this._hashSize&&(M=r[(Q+k)%this._hashSize],!(M!==-1&&M!==i[M]));k++);M=e[M];let R=M,U;for(;U=i[R],gu(w,C,n[2*R],n[2*R+1],n[2*U],n[2*U+1])>=0;)if(R=U,R===M){R=-1;break}if(R===-1)continue;let O=this._addTriangle(R,T,i[R],-1,-1,o[R]);o[T]=this._legalize(O+2),o[R]=O,I++;let z=i[R];for(;U=i[z],gu(w,C,n[2*z],n[2*z+1],n[2*U],n[2*U+1])<0;)O=this._addTriangle(z,T,U,o[T],-1,o[z]),o[T]=this._legalize(O+2),i[z]=z,I--,z=U;if(R===M)for(;U=e[R],gu(w,C,n[2*U],n[2*U+1],n[2*R],n[2*R+1])<0;)O=this._addTriangle(U,T,R,-1,o[R],o[U]),this._legalize(O+2),o[U]=O,i[R]=R,I--,R=U;this._hullStart=e[T]=R,i[R]=e[z]=T,i[T]=z,r[this._hashKey(w,C)]=T,r[this._hashKey(n[2*R],n[2*R+1])]=R}this.hull=new Uint32Array(I);for(let D=0,F=this._hullStart;D<I;D++)this.hull[D]=F,F=i[F];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(fV(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=qf[--r];continue}const u=s-s%3,A=l+(n+1)%3,h=u+(s+2)%3,f=e[a],p=e[n],d=e[A],m=e[h];if(dV(o[2*f],o[2*f+1],o[2*p],o[2*p+1],o[2*d],o[2*d+1],o[2*m],o[2*m+1])){e[n]=m,e[s]=f;const y=i[h];if(y===-1){let _=this._hullStart;do{if(this._hullTri[_]===h){this._hullTri[_]=n;break}_=this._hullPrev[_]}while(_!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,h);const g=u+(s+1)%3;r<qf.length&&(qf[r++]=g)}else{if(r===0)break;n=qf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function fV(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function tv(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function dV(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,h=i-s,f=o-a,p=r-s,d=l*l+u*u,m=A*A+h*h,v=f*f+p*p;return l*(h*v-m*p)-u*(A*v-m*f)+d*(A*p-h*f)<0}function pV(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=(u*A-s*h)*f,d=(a*h-l*A)*f;return p*p+d*d}function mV(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=t+(u*A-s*h)*f,d=n+(a*h-l*A)*f;return{x:p,y:d}}function Ra(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;wu(t,o,r),n[t[e]]>n[t[i]]&&wu(t,e,i),n[t[r]]>n[t[i]]&&wu(t,r,i),n[t[e]]>n[t[r]]&&wu(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;wu(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(Ra(t,n,r,i),Ra(t,n,e,a-1)):(Ra(t,n,e,a-1),Ra(t,n,r,i))}}function wu(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function gV(t){return t[0]}function yV(t){return t[1]}const FS=(t=0)=>new Promise(n=>setTimeout(n,t)),As=class As extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_startEvent",this.disposeVar(new c.Event));L(this,"_stopEvent",this.dv(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.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 Ye(e,i)),this._customPrimitive=this.disposeVar(new ut(e,i)),this._geoDivPoi=this.disposeVar(new bt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Gi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
3729
|
+
***************************************************************************** */function D8(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(A){return l([u,A])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,o=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1],r=u;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(u);break}r[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(A){u=[6,A],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var eo=function(){function t(n,e){this.next=null,this.key=n,this.data=e,this.left=null,this.right=null}return t}();function R8(t,n){return t>n?1:t<n?-1:0}function to(t,n,e){for(var i=new eo(null,null),o=i,r=i;;){var a=e(t,n.key);if(a<0){if(n.left===null)break;if(e(t,n.left.key)<0){var s=n.left;if(n.left=s.right,s.right=n,n=s,n.left===null)break}r.left=n,r=n,n=n.left}else if(a>0){if(n.right===null)break;if(e(t,n.right.key)>0){var s=n.right;if(n.right=s.left,s.left=n,n=s,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 Wy(t,n,e,i){var o=new eo(t,n);if(e===null)return o.left=o.right=null,o;e=to(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=to(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 U8(t,n,e){return n===null?t:(t===null||(n=to(t.key,n,e),n.left=t),n)}function jy(t,n,e,i,o){if(t){i(""+n+(e?"└── ":"├── ")+o(t)+`
|
|
3730
|
+
`);var r=n+(e?" ":"│ ");t.left&&jy(t.left,r,!1,i,o),t.right&&jy(t.right,r,!0,i,o)}}var qy=function(){function t(n){n===void 0&&(n=R8),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=Wy(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new eo(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=to(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>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=to(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=to(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=to(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=to(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=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.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 L8(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&&$y(n,e,0,o-1,r),this._root===null)this._root=Ky(n,e,0,o),this._size=o;else{var a=z8(this.toList(),O8(n,e),r);o=this._size+o,this._root=Zy({head:a},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 jy(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),a=r.left,s=r.right;o(n,e)<0?s=Wy(e,i,s,o):a=Wy(e,i,a,o),this._root=U8(a,s,o)},t.prototype.split=function(n){return pS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return D8(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 Ky(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new eo(a,s);return l.left=Ky(t,n,e,r),l.right=Ky(t,n,r+1,i),l}return null}function O8(t,n){for(var e=new eo(null,null),i=e,o=0;o<t.length;o++)i=i.next=new eo(t[o],n[o]);return i.next=null,e.next}function L8(t){for(var n=t,e=[],i=!1,o=new eo(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 Zy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Zy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Zy(t,o+1,e),a}return null}function z8(t,n,e){for(var i=new eo(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function $y(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}$y(t,n,e,s,o),$y(t,n,s+1,i,o)}}const ar=11102230246251565e-32,un=134217729,k8=(3+8*ar)*ar;function Xy(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],h=0,f=0;A>u==A>-u?(r=u,u=n[++h]):(r=A,A=i[++f]);let p=0;if(h<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++h]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[p++]=s);h<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[p++]=s);for(;h<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h],r=a,s!==0&&(o[p++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[p++]=s);return(r!==0||p===0)&&(o[p++]=r),p}function Q8(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function mu(t){return new Float64Array(t)}const V8=(3+16*ar)*ar,N8=(2+12*ar)*ar,H8=(9+64*ar)*ar*ar,Da=mu(4),mS=mu(8),gS=mu(12),yS=mu(16),fn=mu(4);function G8(t,n,e,i,o,r,a){let s,l,u,A,h,f,p,d,m,v,y,g,_,x,E,B,P,I;const D=t-o,F=e-o,S=n-r,T=i-r;x=D*T,f=un*D,p=f-(f-D),d=D-p,f=un*T,m=f-(f-T),v=T-m,E=d*v-(x-p*m-d*m-p*v),B=S*F,f=un*S,p=f-(f-S),d=S-p,f=un*F,m=f-(f-F),v=F-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,Da[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,Da[1]=_-(y+h)+(h-B),I=g+y,h=I-g,Da[2]=g-(I-h)+(y-h),Da[3]=I;let w=Q8(4,Da),C=N8*a;if(w>=C||-w>=C||(h=t-D,s=t-(D+h)+(h-o),h=e-F,u=e-(F+h)+(h-o),h=n-S,l=n-(S+h)+(h-r),h=i-T,A=i-(T+h)+(h-r),s===0&&l===0&&u===0&&A===0)||(C=H8*a+k8*Math.abs(w),w+=D*A+T*s-(S*u+F*l),w>=C||-w>=C))return w;x=s*T,f=un*s,p=f-(f-s),d=s-p,f=un*T,m=f-(f-T),v=T-m,E=d*v-(x-p*m-d*m-p*v),B=l*F,f=un*l,p=f-(f-l),d=l-p,f=un*F,m=f-(f-F),v=F-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const M=Xy(4,Da,4,fn,mS);x=D*A,f=un*D,p=f-(f-D),d=D-p,f=un*A,m=f-(f-A),v=A-m,E=d*v-(x-p*m-d*m-p*v),B=S*u,f=un*S,p=f-(f-S),d=S-p,f=un*u,m=f-(f-u),v=u-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const R=Xy(M,mS,4,fn,gS);x=s*A,f=un*s,p=f-(f-s),d=s-p,f=un*A,m=f-(f-A),v=A-m,E=d*v-(x-p*m-d*m-p*v),B=l*u,f=un*l,p=f-(f-l),d=l-p,f=un*u,m=f-(f-u),v=u-m,P=d*v-(B-p*m-d*m-p*v),y=E-P,h=E-y,fn[0]=E-(y+h)+(h-P),g=x+y,h=g-x,_=x-(g-h)+(y-h),y=_-B,h=_-y,fn[1]=_-(y+h)+(h-B),I=g+y,h=I-g,fn[2]=g-(I-h)+(y-h),fn[3]=I;const U=Xy(R,gS,4,fn,yS);return yS[U-1]}function gu(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=V8*u?l:-G8(t,n,e,i,o,r,u)}const yu=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,Yy=(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 no=Number.EPSILON;no===void 0&&(no=Math.pow(2,-52));const W8=no*no,vS=(t,n)=>{if(-no<t&&t<no&&-no<n&&n<no)return 0;const e=t-n;return e*e<W8*t*n?0:t<n?-1:1};class j8{constructor(){this.reset()}reset(){this.xRounder=new wS,this.yRounder=new wS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class wS{constructor(){this.tree=new qy,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&vS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&vS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const vu=new j8,Hf=(t,n)=>t.x*n.y-t.y*n.x,bS=(t,n)=>t.x*n.x+t.y*n.y,xS=(t,n,e)=>{const i=gu(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},Gf=t=>Math.sqrt(bS(t,t)),q8=(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)/Gf(o)/Gf(i)},K8=(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 bS(o,i)/Gf(o)/Gf(i)},_S=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},CS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},Z8=(t,n,e,i)=>{if(n.x===0)return CS(e,i,t.x);if(i.x===0)return CS(t,n,e.x);if(n.y===0)return _S(e,i,t.y);if(i.y===0)return _S(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},a=Hf(r,n)/o,s=Hf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,h=e.y+a*i.y,f=(l+u)/2,p=(A+h)/2;return{x:f,y:p}};class Jn{static compare(n,e){const i=Jn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:io.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:q8(this.point,n.point,r.point),cosine:K8(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let $8=0;class io{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const h=n.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const h=e.comparePoint(n.leftSE.point);if(h!==0)return h;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const h=e.comparePoint(n.rightSE.point);if(h!==0)return h}if(r>a){const h=n.comparePoint(e.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(r!==a){const h=u-s,f=r-i,p=A-l,d=a-o;if(h>f&&p<d)return 1;if(h<f&&p>d)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++$8,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,a;const s=Jn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Jn(o,!0),u=new Jn(r,!1);return new io(l,u,[i],[a])}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,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=Yy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=yu(e,s)&&this.comparePoint(s)===0,A=yu(i,r)&&n.comparePoint(r)===0,h=yu(e,l)&&this.comparePoint(l)===0,f=yu(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!h?a:!f&&h?l:null;if(A)return h&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&h)return null;if(f)return a;if(h)return l;const p=Z8(r,this.vector(),s,n.vector());return p===null||!yu(o,p)?null:vu.round(p.x,p.y)}split(n){const e=[],i=n.events!==void 0,o=new Jn(n,!0),r=new Jn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new io(o,a,this.rings.slice(),this.windings.slice());return Jn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Jn.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=io.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,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=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 s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],h=e.indexOf(u);h===-1?(e.push(u),i.push(A)):i[h]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const h=r.indexOf(u.poly);h!==-1&&r.splice(h,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].multiPoly;o.indexOf(u)===-1&&o.push(u)}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(fi.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===fi.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 ${fi.type}`)}return this._isInResult}}class SS{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=vu.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 a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=vu.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(io.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(io.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 X8{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new SS(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 SS(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,a=o.length;r<a;r++)n.push(o[r])}return n}}class ES{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 X8(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,a=o.length;r<a;r++)n.push(o[r])}return n}}class Wf{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 a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,h=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const m=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${m.x}, ${m.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let p=null;for(let m=0,v=h.length;m<v;m++)if(h[m].point===s.point){p=m;break}if(p!==null){const m=h.splice(p)[0],v=u.splice(m.index);v.unshift(v[0].otherSE),e.push(new Wf(v.reverse()));continue}h.push({index:u.length,point:s.point});const d=s.getLeftmostComparator(a);l=f.sort(d)[0].otherSE;break}e.push(new Wf(u))}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 u=1,A=this.events.length-1;u<A;u++){const h=this.events[u].point,f=this.events[u+1].point;xS(h,n,f)!==0&&(e.push(h),n=h)}if(e.length===1)return null;const i=e[0],o=e[1];xS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].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 a=this.events[o];Jn.compare(n,a)>0&&(n=a)}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 PS{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 Y8{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 PS(r));else{const a=r.enclosingRing();a.poly||e.push(new PS(a)),a.poly.addInterior(r)}}return e}}class J8{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:io.compare;this.queue=n,this.tree=new qy(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,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const h=s.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(u=h),!s.isAnEndpoint(h))){const f=this._splitSafely(s,h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}}let A=null;if(l){const h=l.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(A=h),!l.isAnEndpoint(h))){const f=this._splitSafely(l,h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}}if(u!==null||A!==null){let h=null;u===null?h=A:A===null?h=u:h=Jn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(h);for(let p=0,d=f.length;p<d;p++)i.push(f[p])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}}}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 BS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,eV=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class tV{run(n,e,i){fi.type=n,vu.reset();const o=[new ES(e,!0)];for(let h=0,f=i.length;h<f;h++)o.push(new ES(i[h],!1));if(fi.numMultiPolys=o.length,fi.type==="difference"){const h=o[0];let f=1;for(;f<o.length;)Yy(o[f].bbox,h.bbox)!==null?f++:o.splice(f,1)}if(fi.type==="intersection")for(let h=0,f=o.length;h<f;h++){const p=o[h];for(let d=h+1,m=o.length;d<m;d++)if(Yy(p.bbox,o[d].bbox)===null)return[]}const r=new qy(Jn.compare);for(let h=0,f=o.length;h<f;h++){const p=o[h].getSweepEvents();for(let d=0,m=p.length;d<m;d++)if(r.insert(p[d]),r.size>BS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new J8(r);let s=r.size,l=r.pop();for(;l;){const h=l.key;if(r.size===s){const p=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${p.id} [${p.leftSE.point.x}, ${p.leftSE.point.y}] -> [${p.rightSE.point.x}, ${p.rightSE.point.y}] from queue.`)}if(r.size>BS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>eV)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(h);for(let p=0,d=f.length;p<d;p++){const m=f[p];m.consumedBy===void 0&&r.insert(m)}s=r.size,l=r.pop()}vu.reset();const u=Wf.factory(a.segments);return new Y8(u).getGeom()}}const fi=new tV;var nV={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 fi.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 fi.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 fi.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 fi.run("difference",t,e)}};function jf(t,n,e){e===void 0&&(e={});var i=Fi(t),o=Fi(n),r=nV.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?Vt(r[0],e.properties):dy(r,e.properties)}function iV(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Mi([o,l],[a,l],e),h=A*(a-o),f=n*2/Mi([u,r],[u,s],e),p=f*(s-r),d=h/2,m=d*2,v=Math.sqrt(3)/2*p,y=a-o,g=s-r,_=3/4*m,x=v,E=(y-m)/(m-d/2),B=Math.floor(E),P=(B*_-d/2-y)/2-d/2+_/2,I=Math.floor((g-v)/v),D=(g-I*v)/2,F=I*v-g>v/2;F&&(D-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var M=[],R=0;R<=B;R++)for(var U=0;U<=I;U++){var O=R%2===1;if(!(U===0&&O)&&!(U===0&&F)){var z=R*_+o-P,k=U*x+r+D;if(O&&(k-=v/2),e.triangles===!0)oV([z,k],h/2,p/2,JSON.parse(i),S,T).forEach(function(V){e.mask?jf(e.mask,V)&&M.push(V):M.push(V)});else{var Q=rV([z,k],h/2,p/2,JSON.parse(i),S,T);e.mask?jf(e.mask,Q)&&M.push(Q):M.push(Q)}}}return Pn(M)}function rV(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),Vt([a],i)}function oV(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(Vt([l],i))}return a}function sV(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Mi([r,a],[s,a],i),A=u*(s-r),h=e/Mi([r,a],[r,l],i),f=h*(l-a),p=s-r,d=l-a,m=Math.floor(p/A),v=Math.floor(d/f),y=(p-m*A)/2,g=(d-v*f)/2,_=r+y,x=0;x<m;x++){for(var E=a+g,B=0;B<v;B++){var P=Vt([[[_,E],[_,E+f],[_+A,E+f],[_+A,E],[_,E]]],i.properties);i.mask?M8(i.mask,P)&&o.push(P):o.push(P),E+=f}_+=A}return Pn(o)}function aV(t,n,e){return e===void 0&&(e={}),sV(t,n,n,e)}function lV(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Mi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Mi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,h=t[1];h<=t[3];){var f=null,p=null;l%2===0&&A%2===0?(f=Vt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)):l%2===0&&A%2===1?(f=Vt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties)):A%2===0&&l%2===1?(f=Vt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties),p=Vt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties)):A%2===1&&l%2===1&&(f=Vt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),p=Vt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)),e.mask?(jf(e.mask,f)&&i.push(f),jf(e.mask,p)&&i.push(p)):(i.push(f),i.push(p)),h+=s,A++}l++,u+=r}return Pn(i)}function uV(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(Tz(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 a=ts(t),s;switch(i){case"point":case"points":s=Z_(a,n,e);break;case"square":case"squares":s=aV(a,n,e);break;case"hex":case"hexes":s=iV(a,n,e);break;case"triangle":case"triangles":s=lV(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return wa(s,function(u){var A=0,h=0;wa(t,function(p){var d=i==="point"?u:dk(u),m=Mi(d,p,e),v;if(o!==void 0&&(v=p.properties[o]),v===void 0&&(v=p.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");m===0&&(A=v);var y=1/Math.pow(m,r);h+=y,A+=y*v});var f=Ak(u);f.properties[o]=A/h,l.push(f)}),Pn(l)}function cV(t,n,e){const i=b.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=b.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=b.Cartesian3.subtract(o,i,new b.Cartesian3);b.Cartesian3.normalize(r,r);const a=new b.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const TS=(t=0)=>new Promise(n=>setTimeout(n,t));function hV(t,n){const e=Pn(t.map(l=>Xt(l))),i=Vt([t]);return uV(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>An(Xt(l),i))}function AV(t){const n=b.JulianDate.fromDate(t),e=b.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return Ya(e)}function fV(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,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const Gc=class Gc extends Ln{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 Uo(i,e.id));this.czmPointPrimitiveCollection=r,this.d(c.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],A=e.sampleDistance,h=hV(u,A).map(_=>[..._,e.height]),f=Math.floor(e.extrudedHeight/A);if(f>0){const _=[...h];for(let x=1;x<=f;x++)h.push(..._.map(E=>[E[0],E[1],e.height+x*A]))}const{startTime:p,endTime:d,spanTime:m}=e,v=m*36e5,y=Math.floor((d-p)/v),g=Array(h.length).fill(0);e:for(let _=0;_<y;_++){if(await TS(),this._stopRun)break e;const x=new Date(p+_*v),E=AV(x);t:for(let B=0;B<h.length;B++){if(await TS(),this._stopRun)break t;cV(h[B],E,o.scene)||(g[B]=(g[B]*y+1)/y)}!this._stopRun&&(e.progress=Number(((_+1)/y*100).toFixed(2))),console.log("colorScalelist",g),l(h,g)}},s=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}));const l=(u,A)=>{const h=u.map((f,p)=>({position:[...f],color:fV(e.startColor,e.endColor,A[p]),pixelSize:10}));r.pointPrimitiveOptions=h}}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};L(Gc,"type",Gc.register("ESCesiumViewer",c.ESSunshineAnalysis.type,Gc));let Jy=Gc;const IS=Math.pow(2,-52),qf=new Uint32Array(512);class ev{static from(n,e=yV,i=vV){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new ev(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,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let D=0;D<a;D++){const F=n[2*D],S=n[2*D+1];F<s&&(s=F),S<l&&(l=S),F>u&&(u=F),S>A&&(A=S),this._ids[D]=D}const h=(s+u)/2,f=(l+A)/2;let p,d,m;for(let D=0,F=1/0;D<a;D++){const S=tv(h,f,n[2*D],n[2*D+1]);S<F&&(p=D,F=S)}const v=n[2*p],y=n[2*p+1];for(let D=0,F=1/0;D<a;D++){if(D===p)continue;const S=tv(v,y,n[2*D],n[2*D+1]);S<F&&S>0&&(d=D,F=S)}let g=n[2*d],_=n[2*d+1],x=1/0;for(let D=0;D<a;D++){if(D===p||D===d)continue;const F=mV(v,y,g,_,n[2*D],n[2*D+1]);F<x&&(m=D,x=F)}let E=n[2*m],B=n[2*m+1];if(x===1/0){for(let S=0;S<a;S++)this._dists[S]=n[2*S]-n[0]||n[2*S+1]-n[1];Ra(this._ids,this._dists,0,a-1);const D=new Uint32Array(a);let F=0;for(let S=0,T=-1/0;S<a;S++){const w=this._ids[S],C=this._dists[w];C>T&&(D[F++]=w,T=C)}this.hull=D.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(gu(v,y,g,_,E,B)<0){const D=d,F=g,S=_;d=m,g=E,_=B,m=D,E=F,B=S}const P=gV(v,y,g,_,E,B);this._cx=P.x,this._cy=P.y;for(let D=0;D<a;D++)this._dists[D]=tv(n[2*D],n[2*D+1],P.x,P.y);Ra(this._ids,this._dists,0,a-1),this._hullStart=p;let I=3;i[p]=e[m]=d,i[d]=e[p]=m,i[m]=e[d]=p,o[p]=0,o[d]=1,o[m]=2,r.fill(-1),r[this._hashKey(v,y)]=p,r[this._hashKey(g,_)]=d,r[this._hashKey(E,B)]=m,this.trianglesLen=0,this._addTriangle(p,d,m,-1,-1,-1);for(let D=0,F,S;D<this._ids.length;D++){const T=this._ids[D],w=n[2*T],C=n[2*T+1];if(D>0&&Math.abs(w-F)<=IS&&Math.abs(C-S)<=IS||(F=w,S=C,T===p||T===d||T===m))continue;let M=0;for(let k=0,Q=this._hashKey(w,C);k<this._hashSize&&(M=r[(Q+k)%this._hashSize],!(M!==-1&&M!==i[M]));k++);M=e[M];let R=M,U;for(;U=i[R],gu(w,C,n[2*R],n[2*R+1],n[2*U],n[2*U+1])>=0;)if(R=U,R===M){R=-1;break}if(R===-1)continue;let O=this._addTriangle(R,T,i[R],-1,-1,o[R]);o[T]=this._legalize(O+2),o[R]=O,I++;let z=i[R];for(;U=i[z],gu(w,C,n[2*z],n[2*z+1],n[2*U],n[2*U+1])<0;)O=this._addTriangle(z,T,U,o[T],-1,o[z]),o[T]=this._legalize(O+2),i[z]=z,I--,z=U;if(R===M)for(;U=e[R],gu(w,C,n[2*U],n[2*U+1],n[2*R],n[2*R+1])<0;)O=this._addTriangle(U,T,R,-1,o[R],o[U]),this._legalize(O+2),o[U]=O,i[R]=R,I--,R=U;this._hullStart=e[T]=R,i[R]=e[z]=T,i[T]=z,r[this._hashKey(w,C)]=T,r[this._hashKey(n[2*R],n[2*R+1])]=R}this.hull=new Uint32Array(I);for(let D=0,F=this._hullStart;D<I;D++)this.hull[D]=F,F=i[F];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(dV(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=qf[--r];continue}const u=s-s%3,A=l+(n+1)%3,h=u+(s+2)%3,f=e[a],p=e[n],d=e[A],m=e[h];if(pV(o[2*f],o[2*f+1],o[2*p],o[2*p+1],o[2*d],o[2*d+1],o[2*m],o[2*m+1])){e[n]=m,e[s]=f;const y=i[h];if(y===-1){let _=this._hullStart;do{if(this._hullTri[_]===h){this._hullTri[_]=n;break}_=this._hullPrev[_]}while(_!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,h);const g=u+(s+1)%3;r<qf.length&&(qf[r++]=g)}else{if(r===0)break;n=qf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function dV(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function tv(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function pV(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,h=i-s,f=o-a,p=r-s,d=l*l+u*u,m=A*A+h*h,v=f*f+p*p;return l*(h*v-m*p)-u*(A*v-m*f)+d*(A*p-h*f)<0}function mV(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=(u*A-s*h)*f,d=(a*h-l*A)*f;return p*p+d*d}function gV(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),p=t+(u*A-s*h)*f,d=n+(a*h-l*A)*f;return{x:p,y:d}}function Ra(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;wu(t,o,r),n[t[e]]>n[t[i]]&&wu(t,e,i),n[t[r]]>n[t[i]]&&wu(t,r,i),n[t[e]]>n[t[r]]&&wu(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;wu(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(Ra(t,n,r,i),Ra(t,n,e,a-1)):(Ra(t,n,e,a-1),Ra(t,n,r,i))}}function wu(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function yV(t){return t[0]}function vV(t){return t[1]}const FS=(t=0)=>new Promise(n=>setTimeout(n,t)),As=class As extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_startEvent",this.disposeVar(new c.Event));L(this,"_stopEvent",this.dv(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.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 Ye(e,i)),this._customPrimitive=this.disposeVar(new ut(e,i)),this._geoDivPoi=this.disposeVar(new bt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Gi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
|
|
3731
3731
|
uniform vec4 u_color;
|
|
3732
3732
|
void main()
|
|
3733
3733
|
{
|
|
@@ -3739,7 +3739,7 @@ void main()
|
|
|
3739
3739
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
3740
3740
|
}
|
|
3741
3741
|
`,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(c.track([this._customPrimitive,"show"],[this,"show"])),this.d(c.track([this._geoPolyline,"show"],[this,"show"])),this.d(c.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(c.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(c.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let r=function(u,A){const h=[];for(const f of A)switch(f){case"SquareMeter_SquareKilometer":u>=1e6?h.push(`面积:${(u/1e6).toFixed(2)} km²`):h.push(`面积:${u.toFixed(2)} m²`);break;case"MU_Hectare":const p=u*(1/666.7);if(p>=15){const d=p/15;h.push(`面积:${d.toFixed(2)} 公顷`)}else h.push(`面积:${p.toFixed(2)} 亩`);break}return h};const a=()=>{let u=[];this.totalArea?this._starting?u=["分析计算中..."]:u=[...r(this.totalArea,this.units)]:this._starting?u=["分析计算中..."]:u=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=_o([...u].join(`
|
|
3742
|
-
`),24))};a(),this.d(this.totalAreaChanged.don(a)),this.d(this.unitsChanged.don(a)),this.d(c.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Dx(this.positions):this._geoDivPoi.position=void 0)}));const s=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 u=this.interpolationDistance??As.defaults.interpolationDistance,A=this.interpolation??As.defaults.interpolation,h=this.offsetHeight??As.defaults.offsetHeight,f=this.drillDepth??As.defaults.drillDepth,p=[];if(this.positions)for(let z=0;z<this.positions.length;++z){const k=b.Cartesian3.fromDegrees(this.positions[z][0],this.positions[z][1],this.positions[z][2]);p.push(k)}var d=wV(p);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z)){console.warn("法向量计算错误!");return}var m=bV(p),v=b.Cartesian3.normalize(m,new b.Cartesian3),y=b.Cartesian3.dot(v,d);y<0&&(d=MS(d),p.reverse());let g=b.Transforms.eastNorthUpToFixedFrame(m),_=b.Matrix4.inverseTransformation(g,new b.Matrix4);if(Math.abs(y)<.999){const z=xV(d,v);var x=MS(m),E=b.Matrix4.fromTranslation(x,new b.Matrix4);_=b.Matrix4.multiply(z,E,E),g=b.Matrix4.inverse(_,new b.Matrix4)}var B=Ua(p,_),P=[],I=[],D=CV(B);if(A&&u>0){var F=_V(B);const z=Math.max(F.maxy-F.miny,F.maxx-F.minx);var S=BV(D,F,u);const k=await nv(S,g,_,d,o.scene,h,f,z);var T=TV(B,u);const Q=await nv(T,g,_,d,o.scene,h,f,z);I.push(...k.world_cartesian),P.push(...k.local),I.push(...Q.world_cartesian),P.push(...Q.local);for(let V=0;V<B.length;++V){const j=B[V];var w=await nv([j],g,_,d,o.scene,h,f,z);if(w.local.length>0)P.push(...w.local),I.push(...w.world_cartesian);else{const J=[j.x,j.y,j.z+h];P.push(J);var C=Ua([b.Cartesian3.fromArray(J)],g);for(let ee=0;ee<C.length;++ee)I.push(C[ee])}}}else{const z=B.map(k=>b.Cartesian3.fromArray([k.x,k.y,k.z+z]));P=z,I=Ua(z,g)}var M=SV(P,D);const R=EV(I,M);this.totalArea=R;const U=[];P.forEach(z=>{const k=[z.x,z.y,z.z];k&&U.push(...k)});const O={position:{typedArray:new Float32Array(U),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=b.Matrix4.toArray(g),this.customPrimitive.attributes=O;const z=await vV([...M]);this.customPrimitive.indexTypedArray=new Uint32Array(z),this.customPrimitive.show=!0;const k=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!k)return;const{min:Q,max:V}=k;this.customPrimitive.setLocalAxisedBoundingBox(Q,V)}},l=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(s()),this._starting=!1,a()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,a(),l.restart()})),this.d(this.stopEvent.don(()=>{l.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,a()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};L(As,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let is=As;(t=>{t.createDefaultProps=()=>({positions:c.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:c.reactArray([1,1,1,1]),units:c.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(is||(is={})),c.extendClassProps(is.prototype,is.createDefaultProps);async function vV(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 FS(),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 wV(t){var n=new b.Cartesian3(0,0,0),e=new b.Cartesian3(0,0,0),i=new b.Cartesian3(0,0,0),o=new b.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var a=t[u],s;u==0?s=t[t.length-1]:s=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=b.Cartesian3.subtract(a,s,n),e=b.Cartesian3.subtract(a,l,e),i=b.Cartesian3.cross(n,e,i),!i.equalsEpsilon(b.Cartesian3.ZERO,b.Math.EPSILON6)&&(i=b.Cartesian3.normalize(i,i),o=b.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function bV(t){var n=new b.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=b.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function MS(t){return new b.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function xV(t,n){var e=b.Cartesian3.cross(t,n,new b.Cartesian3);e=b.Cartesian3.normalize(e,e);var i=b.Cartesian3.cross(t,e,new b.Cartesian3);i=b.Cartesian3.normalize(i,i);var o=t,r=new b.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 Ua(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=b.Matrix4.multiplyByPoint(n,i,new b.Cartesian3);e.push(o)}return e}function _V(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 CV(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function SV(t,n){var e=[];t.forEach(a=>{const s=[a.x,a.y];e.push(s)});var i=ev.from(e).triangles;const o=[],r=Vt([n]);for(let a=0;a<i.length;a+=3){const s=i[a],l=i[a+1],u=i[a+2],A=(t[s].x+t[l].x+t[u].x)/3,h=(t[s].y+t[l].y+t[u].y)/3;An([A,h],r)&&o.push(s,l,u)}return new Uint32Array(o.reverse())}function EV(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+=PV(o)}return e}function PV(t){var n=b.Cartesian3.distance(t[0],t[1]),e=b.Cartesian3.distance(t[1],t[2]),i=b.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 BV(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)FV([o,r],t)&&i.push(new b.Cartesian3(o,r,0));return i}function TV(t,n){var e=[];for(let a=0;a<t.length;++a){var i=t[a],o;a==t.length-1?o=t[0]:o=t[a+1];var r=IV(i,o,n);e.push(...r)}return e}function IV(t,n,e){var i=[],o=b.Cartesian3.distance(t,n),r=b.Cartesian3.subtract(n,t,new b.Cartesian3);if(r.equalsEpsilon(b.Cartesian3.ZERO,b.Math.EPSILON6))return[];r=b.Cartesian3.normalize(r,r);for(var a=e;a<o;){var s=new b.Cartesian3(r.x*a,r.y*a,r.z*a),l=b.Cartesian3.add(t,s,new b.Cartesian3);i.push(l),a+=e}return i}function FV(t,n){var e=Xt(t);if(!I8(Xt(n[0]),Xt(n[n.length-1])))return!1;var i=[];i.push(n);var o=Vt(i);return An(e,o)}async function nv(t,n,e,i,o,r,a,s){var l=[];t.forEach(_=>{var x=_.clone();x.z=s,l.push(x)});var u=Ua(l,n),A=new b.Cartesian3(-1*i.x,-1*i.y,-1*i.z),h=[],f=[],p=[];for(let _=0;_<u.length;++_){await FS();var d=u[_],m=new b.Ray(d,A),v=void 0;try{v=o.pickFromRay(m)}catch{}if(!v){m=new b.Ray(d,i);try{v=o.pickFromRay(m)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var g=Ua([y],e);g.forEach(x=>{x.z+=r}),y=Ua(g,n)[0],p.push(y),y=b.Cartographic.fromCartesian(y),h.push([y.longitude,y.latitude,y.height]),f.push(g[0])}}}return{local:f,world:h,world_cartesian:p}}const Wc=class Wc extends Ln{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new is(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(c.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(c.track([r,"units"],[e,"units"])),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"positions"],[e,"points"])),this.d(c.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(c.track([r,"offsetHeight"],[e,"offsetHeight"]));{const a=()=>{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};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(s.disposableOn(a))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}};L(Wc,"type",Wc.register("ESCesiumViewer",c.ESSurfaceAreaMeasurement.type,Wc));let iv=Wc;async function MV(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const jc=class jc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.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 c.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof at))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A)),A.style.width="100%",A.style.position="absolute",A.style.height=`${c.ESViewerStatusBar.defaults.height}px`,A.style.left="0",A.style.bottom="0",A.style.color="#fff",A.style.padding="0 20px 0 0",A.style.boxSizing="border-box",A.style.lineHeight=`${c.ESViewerStatusBar.defaults.height}px`,A.style.zIndex="100",A.style.alignContent="center",A.style.justifyContent="space-between";const h=document.createElement("span");A.appendChild(h),this.dispose(()=>A.removeChild(h));const f=document.createElement("span");h.appendChild(f),this.dispose(()=>h.removeChild(f));const p=document.createElement("span");h.appendChild(p),p.addEventListener("dblclick",function(){let m=p.innerHTML;m.startsWith("鼠标位置")&&(m=m.slice(5)),MV(m)}),p.style.cursor="pointer",this.dispose(()=>h.removeChild(p));const d=document.createElement("span");A.appendChild(d),this.dispose(()=>A.removeChild(d));{const m=()=>{A.style.height=(e.height??c.ESViewerStatusBar.defaults.height)+"px",A.style.lineHeight=(e.height??c.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(m)),m()}{const m=()=>{A.style.fontSize=(e.fontSize??c.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(m)),m()}{const m=()=>{e.bgColor?A.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:A.style.background=`rgba(${c.ESViewerStatusBar.defaults.bgColor[0]},${c.ESViewerStatusBar.defaults.bgColor[1]},${c.ESViewerStatusBar.defaults.bgColor[2]},${c.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(m)),m()}{d.innerText=`Cesium 版本 : ${b.VERSION} `;let m;const v=()=>{e.show?(A.style.display="flex",m=this.disposeVar(c.createAnimateFrameWithStartValues(()=>{var E;let y="",g="";const _=u.getCameraInfo();if(_){const B=(I,D)=>_.position[I].toFixed(D),P=(I,D)=>_.rotation[I].toFixed(D);y=`帧率:${u.getFPS()}FPS 经度: ${B(0,5)}° 纬度: ${B(1,5)}° 高度: ${B(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}f.innerText=y;const x=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(x){const B=(P,I)=>x[P].toFixed(I);g=`鼠标位置:${B(0,5)}° ${B(1,5)}° ${B(2,2)}m`}else g="暂时无法获取鼠标位置...";p.innerText=g})),m.start()):(A.style.display="none",m.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};L(jc,"type",jc.register("ESCesiumViewer",c.ESViewerStatusBar.type,jc));let rv=jc;const qc=class qc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.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(c.track([r,"show"],[e,"show"])),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof at))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));const h=document.createElement("div");A.appendChild(h),h.style.width="100%",h.className="ESViewerStatusBarScale",h.style.position="absolute",h.style.display="flex",h.style.height=`${c.ESViewerStatusBarScale.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=`${c.ESViewerStatusBarScale.defaults.height}px`,h.style.zIndex="100",h.style.alignContent="center",h.style.justifyContent="space-between";const f=document.createElement("div");h.appendChild(f);const p=document.createElement("div");f.appendChild(p);const d=document.createElement("div");f.appendChild(d);const m=document.createElement("div");h.appendChild(m);const v=document.createElement("div");m.appendChild(v);const y=document.createElement("div");v.appendChild(y);const g=document.createElement("div");v.appendChild(g);const _=document.createElement("span");m.appendChild(_);{const I=()=>{h.style.height=(e.height??c.ESViewerStatusBarScale.defaults.height)+"px",h.style.lineHeight=(e.height??c.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(I)),I()}{const I=()=>{h.style.fontSize=(e.fontSize??c.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(I)),I()}{const I=()=>{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(${c.ESViewerStatusBarScale.defaults.bgColor[0]},${c.ESViewerStatusBarScale.defaults.bgColor[1]},${c.ESViewerStatusBarScale.defaults.bgColor[2]},${c.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(I)),I()}f.style.display="flex",p.style.fontWeight="bold",p.style.padding="0 0 0 25px";let x="EarthSDK";p.innerText=x,d.style.fontWeight="";let E="——免费开源地球可视化开发包";d.innerText=E,m.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",g.style.borderRight="1px solid #fff",g.style.borderLeft="1px solid #fff",g.style.borderBottom="1px solid #fff",g.style.position="absolute",g.style.height="10px",g.style.top="15px",g.style.width="75px",g.style.right="30px",_.style.display="flex",_.style.zIndex="101",_.style.justifyContent="flex-end",_.style.right="0";const B=()=>{const I=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||I&&I>1e6)v.style.display="none";else{v.style.display="block";const D=i.viewerLegend.legend.computedLengthInStr;D&&(y.innerHTML=D);const F=i.viewerLegend.legend.computedLengthInPixels;if(F){g.style.width=`${F}px`;const S=(135-F)/2;g.style.left=`${S}px`}}};B();const P=setInterval(()=>{B()},200);this.dispose(()=>clearInterval(P));{let I;const D=()=>{e.show?(A.style.display="block",I=this.disposeVar(c.createAnimateFrameWithStartValues(()=>{var w;let F="";const S=u.getCameraInfo();if(S){const C=(M,R)=>S.position[M].toFixed(R);F+=`帧率:${u.getFPS()}FPS 相机: ${C(2,2)}米 `}const T=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(T){const C=(M,R)=>T[M].toFixed(R);F+=`位置:${C(0,5)}° ${C(1,5)}° ${C(2,2)}米`}else F+="暂时无法获取鼠标位置...";_.innerText=F})),I.start()):(A.style.display="none",I.destroy())};this.dispose(e.showChanged.disposableOn(D)),D()}}}}get customDiv(){return this._customDiv}};L(qc,"type",qc.register("ESCesiumViewer",c.ESViewerStatusBarScale.type,qc));let ov=qc;const DS=b.Math.toDegrees,DV=new b.Cartographic;function RS(t,n,e){const i=b.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=b.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=b.Cartesian3.subtract(o,i,new b.Cartesian3);b.Cartesian3.normalize(r,r);const a=new b.Ray(i,r),s=e.pickFromRay(a),l=e.globe.pick(a,e);var u;if(s&&s.position&&l){const d=b.Cartesian3.distance(i,s.position),m=b.Cartesian3.distance(i,l);u=d<m?s.position:l}else s&&s.position?u=s.position:l&&(u=l);if(!u)return;const A=b.Cartesian3.distance(i,o),f=b.Cartesian3.distance(i,u)>A?o:u,p=b.Cartographic.fromCartesian(f,void 0,DV);return[DS(p.longitude),DS(p.latitude),p.height]}const Kc=class Kc extends sn{constructor(e,i){super(e,i);L(this,"_hideGeoPolylines",this.disposeVar(new Un(this.czmViewer,this.sceneObject.id)));L(this,"_visibleGeoPolylines",this.disposeVar(new Un(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,a=this._visibleGeoPolylines;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([a,"show"],[e,"show"])),this.d(c.track([a,"color"],[e,"visibleColor"])),this.d(c.track([r,"color"],[e,"invisibleColor"]));{const s=()=>{const u=e.points,A=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,a.positions=void 0;return}const h=[],f=[],[p,d,m]=u[0],v=[p,d,m+A];try{u.forEach((y,g)=>{if(g===0)return;const _=RS(v,y,o.scene);_?(h.push([y,_]),f.push([v,_])):f.push([v,y])}),r.positions=h,a.positions=f}catch(y){console.warn(y)}};s();const l=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(s))}}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 a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,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 a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}};L(Kc,"type",Kc.register("ESCesiumViewer",c.ESVisibilityAnalysis.type,Kc));let sv=Kc;class bu extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.dv(new c.Event));L(this,"_enableEvent",this.dv(new c.Event));L(this,"_clearEvent",this.dv(new c.Event));L(this,"_gridPoints",this.dv(c.reactJson([])));L(this,"excavationPolylines");L(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Un(e,i)),a=this.dv(new Un(e,i));this.excavationPolylines=r,this.fillPolylines=a;const s=r;s.color=[1,1,0,1],this.d(c.track([s,"show"],[this,"show"])),s.show=!1,s.depthTest=!0;const l=a;l.color=[0,0,1,1],this.d(c.track([l,"show"],[this,"show"])),l.show=!1;{const p=this.ad(new Ti(e,i));this.d(c.track([p,"show"],[this,"show"])),this.d(c.bind([p,"allowPicking"],[this,"allowPicking"])),this.d(c.bind([p,"positions"],[this,"positions"])),this.d(c.bind([p,"depthTest"],[this,"depthTest"])),this.d(c.bind([p,"outlineWidth"],[this,"outlineWidth"])),this.d(c.bind([p,"outlineColor"],[this,"outlineColor"])),this.d(c.bind([p,"outline"],[this,"outline"])),this.d(c.bind([p,"color"],[this,"fillColor"])),this.d(c.bind([p,"fill"],[this,"filled"])),this.d(c.bind([p,"strokeGround"],[this,"strokeGround"])),this.d(c.bind([p,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{p.flyTo(v)}));const d=()=>{p.positions=this.positions};d();const m=this.dv(c.createNextAnimateFrameEvent(this.positionsChanged));this.d(m.don(d))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:p,maxPos:d}=c.getMinMaxCorner(this.positions),m=p[0],v=p[1],y=d[0],g=d[1],x={type:"Polygon",coordinates:[[...this.positions.map(T=>[T[0],T[1]])]]},E=[m,v,y,g],B=this.gridWidth,D=Z_(E,B,{units:"meters",mask:x}).features.map(T=>T.geometry.coordinates),F=b.Math.toRadians;return D.map(T=>new b.Cartographic(F(T[0]),F(T[1])))},A=()=>{s.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,s.depthTest=!0},h=this.dv(c.createProcessingFromAsyncFunc(async p=>{const d=u();let m=0,v=300;const y=Math.ceil(d.length/v),g=[];do{let _=[];m===y-1?_=d.slice(m*v):_=d.slice(m*v,(m+1)*v);const x=o.scene.sampleHeightMostDetailed(_),E=await p.promise(x);if(m===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const B=b.Math.toDegrees,P=E.filter(I=>I!=null).map(I=>[B(I.longitude),B(I.latitude),I.height]);g.push(...P)}m++}while(m<y);!g||!g.length||(this.gridPoints=g)}));let f=null;{const p=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let d=0;const m=[];let v=0;const y=[];this.gridPoints.forEach(g=>{const _=this.positions;g[2]>_[0][2]?(d+=this.gridWidth*this.gridWidth*(g[2]-_[0][2]),m.push([g,[g[0],g[1],_[0][2]]])):(v+=this.gridWidth*this.gridWidth*(_[0][2]-g[2]),y.push([g,[g[0],g[1],_[0][2]]]))}),s.positions=m,l.positions=y,s.show=!0,l.show=!0,this.area=Mx(this.positions),this.cutVolume=d,this.fillVolume=v,this.cutAndFillVolume=v-d,f&&clearTimeout(f),f=setTimeout(()=>{s.depthTest=!1},200)};p(),this.d(this.gridPointsChanged.don(p)),this.d(()=>clearTimeout(f))}{const p=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};p(),this.d(this.positionsChanged.don(p))}{const p=()=>{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};p(),this.d(this.planeHeightChanged.don(p))}this.d(this.enableEvent.don(()=>{A(),this.gridPoints=[],this.progress=0,h.restart()})),this.d(this.clearEvent.don(()=>{A()}))}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:c.reactPositions(void 0),planeHeight:c.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})})(bu||(bu={})),c.extendClassProps(bu.prototype,bu.createDefaultProps);const Zc=class Zc extends Ln{constructor(e,i){super(e,i);L(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new bu(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"positions"],[e,"points"])),this.d(c.track([r,"allowPicking"],[e,"allowPicking"])),this.d(c.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(c.track([r,"gridWidth"],[e,"gridWidth"])),this.d(c.track([e,"cutVolume"],[r,"cutVolume"])),this.d(c.track([e,"fillVolume"],[r,"fillVolume"])),this.d(c.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(c.bind([e,"progress"],[r,"progress"])),this.d(c.track([r,"depthTest"],[e,"depthTest"])),this.d(c.track([r,"outline"],[e,"stroked"])),this.d(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(c.track([r,"outlineColor"],[e,"strokeColor"])),this.d(c.track([r,"filled"],[e,"filled"])),this.d(c.track([r,"fillColor"],[e,"fillColor"])),this.d(c.track([r,"fillGround"],[e,"fillGround"])),this.d(c.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(c.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:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Zc,"type",Zc.register("ESCesiumViewer",c.ESVolumeMeasurement.type,Zc));let av=Zc;const $c=class $c extends Ln{constructor(e,i){super(e,i);L(this,"czmEntity");L(this,"czmPolyline",this.ad(new c.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(c.bind([r,"show"],[e,"show"])),this.ad(c.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(c.bind([r,"stroked"],[e,"stroked"])),this.ad(c.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(c.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const h=structuredClone(e.points);h.push(h[0]),e.perPositionHeight?r.points=h:r.points=h.map(f=>(f[2]=e.height??c.ESGeoExtrudedPolygon.defaults.height,f))}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(A.don(u))}const a=this.czmEntity=o.entities.add({polygon:{}});b.Entity.prototype&&(a.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(a));let s=new b.PolygonHierarchy;a.polygon&&(a.polygon.hierarchy=new b.CallbackProperty(()=>s,!1));const l=()=>{const u=Yt(e.points??[]);if(u.length<2){s=new b.PolygonHierarchy;return}s=new b.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{a.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!a.show&&e.filled)};u();const A=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(A.don(u))}{const u=()=>{a.polygon&&(a.polygon.perPositionHeight=new b.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{a.polygon&&(a.polygon.height=new b.ConstantProperty(e.height??c.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{a.polygon&&(a.polygon.extrudedHeight=new b.ConstantProperty(e.extrudedHeight??c.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const A=b.Color.fromCartesian4(b.Cartesian4.fromArray(e.fillColor));a.polygon&&(a.polygon.material=A)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new c.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new at.ObjectsToExcludeWrapper(i,a)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=c.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};L($c,"type",$c.register("ESCesiumViewer",c.ESGeoExtrudedPolygon.type,$c));let lv=$c;const Xc=class Xc extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(c.bind([o,"position"],[n,"position"])),this.dispose(c.bind([o,"rotation"],[n,"rotation"])),this.ad(c.bind([o,"scale"],[n,"scale"])),this.ad(c.track([r,"scale"],[n,"scale"])),this.dispose(c.track([r,"rotation"],[n,"rotation"]));const a=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};a();const s=this.dv(c.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(s.don(a)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};L(Xc,"type",Xc.register("ESCesiumViewer",c.ESHumanPoi.type,Xc));let uv=Xc;const Yc=class Yc extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var A,h,f,p;const u=(p=(f=(h=(A=l==null?void 0:l._root)==null?void 0:A._content)==null?void 0:h._model)==null?void 0:f._featureTables[0])==null?void 0:p._features[0];u?o.strokeFeature([u],b.Color.LIME.toBytes().map(d=>d/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),a=o.url,s=Date.now();a.includes("?reload=")?o.url=a.replace(/\?reload=\d+/,`?reload=${s}`):o.url=a+`?reload=${s}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const s=n.layerConfig;if(!s){o.style=void 0;return}const l=n.colorBlendMode,u=(f,p)=>{try{if(f.getPropertyIds().includes("materialName"))return b.Color.clone(b.Color.WHITE,p);const d=f.getProperty("layer"),m=f.getProperty("dataset"),v=d.toString(),y=m.toString(),g=s.find(x=>x.dataset.toString()===y&&x.layer.toString()===v);if(g&&g.value.color){const x=g.value.color;return b.Color.fromCssColorString(x,p)}const _=s.filter(x=>x.dataset.toString()===y);if(_.length==1&&_[0].value.color){const x=_[0].value.color;return b.Color.fromCssColorString(x,p)}else return b.Color.clone(b.Color.WHITE,p)}catch(d){return console.warn(d),b.Color.clone(b.Color.WHITE,p)}},A=f=>{try{if(f.getPropertyIds().includes("id")){const _=Object.entries(n.visJson);for(let x=0;x<_.length;x++){const E=_[x];if(f.getProperty("id").toString()===E[0])return E[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const p=f.getProperty("layer"),d=f.getProperty("dataset"),m=p.toString(),v=d.toString(),y=s.find(_=>_.dataset.toString()===v&&_.layer.toString()===m);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const g=s.filter(_=>_.dataset.toString()===v);return!(g.length==1&&g[0].value.visible===!1)}catch(p){return console.warn(p),!0}};let h;l!=="HIGHLIGHT"?h=new b.Cesium3DTileStyle({color:{evaluateColor:function(f,p){return u(f,p)}},show:{evaluate:function(f){return A(f)}}}):h=new b.Cesium3DTileStyle({show:{evaluate:function(f){return A(f)}}}),console.log("style",h),o.style=h};r();const a=this.dv(c.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged,n.visJsonChanged));this.d(a.don(()=>{r()}))}))}};L(Yc,"type",Yc.register("ESCesiumViewer",c.ESRtsTileset.type,Yc));let cv=Yc;const Jc=class Jc extends ua{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Jc,"type",Jc.register("ESCesiumViewer",c.ESRtsFeatureEditing.type,Jc));let hv=Jc;const eh=class eh extends ua{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(eh,"type",eh.register("ESCesiumViewer",c.ESMsTileset.type,eh));let Av=eh;const th=class th extends He{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Wn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(th,"type",th.register("ESCesiumViewer",c.ESStaticMesh.type,th));let fv=th;const nh=class nh extends sn{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new P0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),a=Number.isFinite(n.radius)?n.radius:c.ESSkylineAnalysis.defaults.radius,{depths:s,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,a),A=De(i.camera.position);u.push(A),n.depths=s,n.windowPositions=l,n.points=u}))}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(nh,"type",nh.register("ESCesiumViewer",c.ESSkylineAnalysis.type,nh));let dv=nh;class RV extends c.Destroyable{constructor(e,i){super();L(this,"_rectangle");L(this,"_updateHeatMapEvent",this.disposeVar(new c.Event));const o=e.sceneObject;this._rectangle=this.ad(new Ci(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(c.bind([this.rectangle,"show"],[o,"show"])),this.ad(c.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 UV extends c.Destroyable{constructor(e,i){super();L(this,"_primitive");L(this,"_updateHeatMapEvent",this.disposeVar(new c.Event));L(this,"czmViewer");L(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,a=r.sceneObject,s=o.viewer;if(!s)return;let l,u;const A=this.ad(new c.Event),h=()=>{f(),!(!l||!u)&&(this._primitive=s.scene.primitives.add(new b.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:a.allowPicking})))},f=()=>{this.primitive&&s.scene.primitives.remove(this.primitive)};this.ad(f);{const p=()=>{this.primitive&&(this.primitive.show=a.show)};p(),this.ad(a.showChanged.don(p))}{const p=this.ad(c.createNextAnimateFrameEvent(a.allowPickingChanged,A));this.ad(p.don(h))}{const p=()=>{r.rectangle&&(l=new b.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 m=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=c.getDistancesFromPositions([[r.rectangle[0],m,0],[r.rectangle[2],m,0]],"GEODESIC")[0]/5;u=new b.MaterialAppearance({material:new b.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)),p(),this.primitive||A.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
3742
|
+
`),24))};a(),this.d(this.totalAreaChanged.don(a)),this.d(this.unitsChanged.don(a)),this.d(c.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Dx(this.positions):this._geoDivPoi.position=void 0)}));const s=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 u=this.interpolationDistance??As.defaults.interpolationDistance,A=this.interpolation??As.defaults.interpolation,h=this.offsetHeight??As.defaults.offsetHeight,f=this.drillDepth??As.defaults.drillDepth,p=[];if(this.positions)for(let z=0;z<this.positions.length;++z){const k=b.Cartesian3.fromDegrees(this.positions[z][0],this.positions[z][1],this.positions[z][2]);p.push(k)}var d=bV(p);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z)){console.warn("法向量计算错误!");return}var m=xV(p),v=b.Cartesian3.normalize(m,new b.Cartesian3),y=b.Cartesian3.dot(v,d);y<0&&(d=MS(d),p.reverse());let g=b.Transforms.eastNorthUpToFixedFrame(m),_=b.Matrix4.inverseTransformation(g,new b.Matrix4);if(Math.abs(y)<.999){const z=_V(d,v);var x=MS(m),E=b.Matrix4.fromTranslation(x,new b.Matrix4);_=b.Matrix4.multiply(z,E,E),g=b.Matrix4.inverse(_,new b.Matrix4)}var B=Ua(p,_),P=[],I=[],D=SV(B);if(A&&u>0){var F=CV(B);const z=Math.max(F.maxy-F.miny,F.maxx-F.minx);var S=TV(D,F,u);const k=await nv(S,g,_,d,o.scene,h,f,z);var T=IV(B,u);const Q=await nv(T,g,_,d,o.scene,h,f,z);I.push(...k.world_cartesian),P.push(...k.local),I.push(...Q.world_cartesian),P.push(...Q.local);for(let V=0;V<B.length;++V){const j=B[V];var w=await nv([j],g,_,d,o.scene,h,f,z);if(w.local.length>0)P.push(...w.local),I.push(...w.world_cartesian);else{const J=[j.x,j.y,j.z+h];P.push(J);var C=Ua([b.Cartesian3.fromArray(J)],g);for(let ee=0;ee<C.length;++ee)I.push(C[ee])}}}else{const z=B.map(k=>b.Cartesian3.fromArray([k.x,k.y,k.z+z]));P=z,I=Ua(z,g)}var M=EV(P,D);const R=PV(I,M);this.totalArea=R;const U=[];P.forEach(z=>{const k=[z.x,z.y,z.z];k&&U.push(...k)});const O={position:{typedArray:new Float32Array(U),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=b.Matrix4.toArray(g),this.customPrimitive.attributes=O;const z=await wV([...M]);this.customPrimitive.indexTypedArray=new Uint32Array(z),this.customPrimitive.show=!0;const k=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!k)return;const{min:Q,max:V}=k;this.customPrimitive.setLocalAxisedBoundingBox(Q,V)}},l=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(s()),this._starting=!1,a()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,a(),l.restart()})),this.d(this.stopEvent.don(()=>{l.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,a()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};L(As,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let is=As;(t=>{t.createDefaultProps=()=>({positions:c.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:c.reactArray([1,1,1,1]),units:c.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(is||(is={})),c.extendClassProps(is.prototype,is.createDefaultProps);async function wV(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 FS(),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 bV(t){var n=new b.Cartesian3(0,0,0),e=new b.Cartesian3(0,0,0),i=new b.Cartesian3(0,0,0),o=new b.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var a=t[u],s;u==0?s=t[t.length-1]:s=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=b.Cartesian3.subtract(a,s,n),e=b.Cartesian3.subtract(a,l,e),i=b.Cartesian3.cross(n,e,i),!i.equalsEpsilon(b.Cartesian3.ZERO,b.Math.EPSILON6)&&(i=b.Cartesian3.normalize(i,i),o=b.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function xV(t){var n=new b.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=b.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function MS(t){return new b.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function _V(t,n){var e=b.Cartesian3.cross(t,n,new b.Cartesian3);e=b.Cartesian3.normalize(e,e);var i=b.Cartesian3.cross(t,e,new b.Cartesian3);i=b.Cartesian3.normalize(i,i);var o=t,r=new b.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 Ua(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=b.Matrix4.multiplyByPoint(n,i,new b.Cartesian3);e.push(o)}return e}function CV(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 SV(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function EV(t,n){var e=[];t.forEach(a=>{const s=[a.x,a.y];e.push(s)});var i=ev.from(e).triangles;const o=[],r=Vt([n]);for(let a=0;a<i.length;a+=3){const s=i[a],l=i[a+1],u=i[a+2],A=(t[s].x+t[l].x+t[u].x)/3,h=(t[s].y+t[l].y+t[u].y)/3;An([A,h],r)&&o.push(s,l,u)}return new Uint32Array(o.reverse())}function PV(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+=BV(o)}return e}function BV(t){var n=b.Cartesian3.distance(t[0],t[1]),e=b.Cartesian3.distance(t[1],t[2]),i=b.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 TV(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)MV([o,r],t)&&i.push(new b.Cartesian3(o,r,0));return i}function IV(t,n){var e=[];for(let a=0;a<t.length;++a){var i=t[a],o;a==t.length-1?o=t[0]:o=t[a+1];var r=FV(i,o,n);e.push(...r)}return e}function FV(t,n,e){var i=[],o=b.Cartesian3.distance(t,n),r=b.Cartesian3.subtract(n,t,new b.Cartesian3);if(r.equalsEpsilon(b.Cartesian3.ZERO,b.Math.EPSILON6))return[];r=b.Cartesian3.normalize(r,r);for(var a=e;a<o;){var s=new b.Cartesian3(r.x*a,r.y*a,r.z*a),l=b.Cartesian3.add(t,s,new b.Cartesian3);i.push(l),a+=e}return i}function MV(t,n){var e=Xt(t);if(!F8(Xt(n[0]),Xt(n[n.length-1])))return!1;var i=[];i.push(n);var o=Vt(i);return An(e,o)}async function nv(t,n,e,i,o,r,a,s){var l=[];t.forEach(_=>{var x=_.clone();x.z=s,l.push(x)});var u=Ua(l,n),A=new b.Cartesian3(-1*i.x,-1*i.y,-1*i.z),h=[],f=[],p=[];for(let _=0;_<u.length;++_){await FS();var d=u[_],m=new b.Ray(d,A),v=void 0;try{v=o.pickFromRay(m)}catch{}if(!v){m=new b.Ray(d,i);try{v=o.pickFromRay(m)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var g=Ua([y],e);g.forEach(x=>{x.z+=r}),y=Ua(g,n)[0],p.push(y),y=b.Cartographic.fromCartesian(y),h.push([y.longitude,y.latitude,y.height]),f.push(g[0])}}}return{local:f,world:h,world_cartesian:p}}const Wc=class Wc extends Ln{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new is(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(c.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(c.track([r,"units"],[e,"units"])),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"positions"],[e,"points"])),this.d(c.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(c.track([r,"offsetHeight"],[e,"offsetHeight"]));{const a=()=>{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};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(s.disposableOn(a))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}};L(Wc,"type",Wc.register("ESCesiumViewer",c.ESSurfaceAreaMeasurement.type,Wc));let iv=Wc;async function DV(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const jc=class jc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.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 c.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof at))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A)),A.style.width="100%",A.style.position="absolute",A.style.height=`${c.ESViewerStatusBar.defaults.height}px`,A.style.left="0",A.style.bottom="0",A.style.color="#fff",A.style.padding="0 20px 0 0",A.style.boxSizing="border-box",A.style.lineHeight=`${c.ESViewerStatusBar.defaults.height}px`,A.style.zIndex="100",A.style.alignContent="center",A.style.justifyContent="space-between";const h=document.createElement("span");A.appendChild(h),this.dispose(()=>A.removeChild(h));const f=document.createElement("span");h.appendChild(f),this.dispose(()=>h.removeChild(f));const p=document.createElement("span");h.appendChild(p),p.addEventListener("dblclick",function(){let m=p.innerHTML;m.startsWith("鼠标位置")&&(m=m.slice(5)),DV(m)}),p.style.cursor="pointer",this.dispose(()=>h.removeChild(p));const d=document.createElement("span");A.appendChild(d),this.dispose(()=>A.removeChild(d));{const m=()=>{A.style.height=(e.height??c.ESViewerStatusBar.defaults.height)+"px",A.style.lineHeight=(e.height??c.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(m)),m()}{const m=()=>{A.style.fontSize=(e.fontSize??c.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(m)),m()}{const m=()=>{e.bgColor?A.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:A.style.background=`rgba(${c.ESViewerStatusBar.defaults.bgColor[0]},${c.ESViewerStatusBar.defaults.bgColor[1]},${c.ESViewerStatusBar.defaults.bgColor[2]},${c.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(m)),m()}{d.innerText=`Cesium 版本 : ${b.VERSION} `;let m;const v=()=>{e.show?(A.style.display="flex",m=this.disposeVar(c.createAnimateFrameWithStartValues(()=>{var E;let y="",g="";const _=u.getCameraInfo();if(_){const B=(I,D)=>_.position[I].toFixed(D),P=(I,D)=>_.rotation[I].toFixed(D);y=`帧率:${u.getFPS()}FPS 经度: ${B(0,5)}° 纬度: ${B(1,5)}° 高度: ${B(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}f.innerText=y;const x=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(x){const B=(P,I)=>x[P].toFixed(I);g=`鼠标位置:${B(0,5)}° ${B(1,5)}° ${B(2,2)}m`}else g="暂时无法获取鼠标位置...";p.innerText=g})),m.start()):(A.style.display="none",m.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};L(jc,"type",jc.register("ESCesiumViewer",c.ESViewerStatusBar.type,jc));let rv=jc;const qc=class qc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.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(c.track([r,"show"],[e,"show"])),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof at))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));const h=document.createElement("div");A.appendChild(h),h.style.width="100%",h.className="ESViewerStatusBarScale",h.style.position="absolute",h.style.display="flex",h.style.height=`${c.ESViewerStatusBarScale.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=`${c.ESViewerStatusBarScale.defaults.height}px`,h.style.zIndex="100",h.style.alignContent="center",h.style.justifyContent="space-between";const f=document.createElement("div");h.appendChild(f);const p=document.createElement("div");f.appendChild(p);const d=document.createElement("div");f.appendChild(d);const m=document.createElement("div");h.appendChild(m);const v=document.createElement("div");m.appendChild(v);const y=document.createElement("div");v.appendChild(y);const g=document.createElement("div");v.appendChild(g);const _=document.createElement("span");m.appendChild(_);{const I=()=>{h.style.height=(e.height??c.ESViewerStatusBarScale.defaults.height)+"px",h.style.lineHeight=(e.height??c.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(I)),I()}{const I=()=>{h.style.fontSize=(e.fontSize??c.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(I)),I()}{const I=()=>{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(${c.ESViewerStatusBarScale.defaults.bgColor[0]},${c.ESViewerStatusBarScale.defaults.bgColor[1]},${c.ESViewerStatusBarScale.defaults.bgColor[2]},${c.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(I)),I()}f.style.display="flex",p.style.fontWeight="bold",p.style.padding="0 0 0 25px";let x="EarthSDK";p.innerText=x,d.style.fontWeight="";let E="——免费开源地球可视化开发包";d.innerText=E,m.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",g.style.borderRight="1px solid #fff",g.style.borderLeft="1px solid #fff",g.style.borderBottom="1px solid #fff",g.style.position="absolute",g.style.height="10px",g.style.top="15px",g.style.width="75px",g.style.right="30px",_.style.display="flex",_.style.zIndex="101",_.style.justifyContent="flex-end",_.style.right="0";const B=()=>{const I=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||I&&I>1e6)v.style.display="none";else{v.style.display="block";const D=i.viewerLegend.legend.computedLengthInStr;D&&(y.innerHTML=D);const F=i.viewerLegend.legend.computedLengthInPixels;if(F){g.style.width=`${F}px`;const S=(135-F)/2;g.style.left=`${S}px`}}};B();const P=setInterval(()=>{B()},200);this.dispose(()=>clearInterval(P));{let I;const D=()=>{e.show?(A.style.display="block",I=this.disposeVar(c.createAnimateFrameWithStartValues(()=>{var w;let F="";const S=u.getCameraInfo();if(S){const C=(M,R)=>S.position[M].toFixed(R);F+=`帧率:${u.getFPS()}FPS 相机: ${C(2,2)}米 `}const T=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(T){const C=(M,R)=>T[M].toFixed(R);F+=`位置:${C(0,5)}° ${C(1,5)}° ${C(2,2)}米`}else F+="暂时无法获取鼠标位置...";_.innerText=F})),I.start()):(A.style.display="none",I.destroy())};this.dispose(e.showChanged.disposableOn(D)),D()}}}}get customDiv(){return this._customDiv}};L(qc,"type",qc.register("ESCesiumViewer",c.ESViewerStatusBarScale.type,qc));let ov=qc;const DS=b.Math.toDegrees,RV=new b.Cartographic;function RS(t,n,e){const i=b.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=b.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=b.Cartesian3.subtract(o,i,new b.Cartesian3);b.Cartesian3.normalize(r,r);const a=new b.Ray(i,r),s=e.pickFromRay(a),l=e.globe.pick(a,e);var u;if(s&&s.position&&l){const d=b.Cartesian3.distance(i,s.position),m=b.Cartesian3.distance(i,l);u=d<m?s.position:l}else s&&s.position?u=s.position:l&&(u=l);if(!u)return;const A=b.Cartesian3.distance(i,o),f=b.Cartesian3.distance(i,u)>A?o:u,p=b.Cartographic.fromCartesian(f,void 0,RV);return[DS(p.longitude),DS(p.latitude),p.height]}const Kc=class Kc extends sn{constructor(e,i){super(e,i);L(this,"_hideGeoPolylines",this.disposeVar(new Un(this.czmViewer,this.sceneObject.id)));L(this,"_visibleGeoPolylines",this.disposeVar(new Un(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,a=this._visibleGeoPolylines;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([a,"show"],[e,"show"])),this.d(c.track([a,"color"],[e,"visibleColor"])),this.d(c.track([r,"color"],[e,"invisibleColor"]));{const s=()=>{const u=e.points,A=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,a.positions=void 0;return}const h=[],f=[],[p,d,m]=u[0],v=[p,d,m+A];try{u.forEach((y,g)=>{if(g===0)return;const _=RS(v,y,o.scene);_?(h.push([y,_]),f.push([v,_])):f.push([v,y])}),r.positions=h,a.positions=f}catch(y){console.warn(y)}};s();const l=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(s))}}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 a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,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 a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}};L(Kc,"type",Kc.register("ESCesiumViewer",c.ESVisibilityAnalysis.type,Kc));let sv=Kc;class bu extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.dv(new c.Event));L(this,"_enableEvent",this.dv(new c.Event));L(this,"_clearEvent",this.dv(new c.Event));L(this,"_gridPoints",this.dv(c.reactJson([])));L(this,"excavationPolylines");L(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Un(e,i)),a=this.dv(new Un(e,i));this.excavationPolylines=r,this.fillPolylines=a;const s=r;s.color=[1,1,0,1],this.d(c.track([s,"show"],[this,"show"])),s.show=!1,s.depthTest=!0;const l=a;l.color=[0,0,1,1],this.d(c.track([l,"show"],[this,"show"])),l.show=!1;{const p=this.ad(new Ti(e,i));this.d(c.track([p,"show"],[this,"show"])),this.d(c.bind([p,"allowPicking"],[this,"allowPicking"])),this.d(c.bind([p,"positions"],[this,"positions"])),this.d(c.bind([p,"depthTest"],[this,"depthTest"])),this.d(c.bind([p,"outlineWidth"],[this,"outlineWidth"])),this.d(c.bind([p,"outlineColor"],[this,"outlineColor"])),this.d(c.bind([p,"outline"],[this,"outline"])),this.d(c.bind([p,"color"],[this,"fillColor"])),this.d(c.bind([p,"fill"],[this,"filled"])),this.d(c.bind([p,"strokeGround"],[this,"strokeGround"])),this.d(c.bind([p,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{p.flyTo(v)}));const d=()=>{p.positions=this.positions};d();const m=this.dv(c.createNextAnimateFrameEvent(this.positionsChanged));this.d(m.don(d))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:p,maxPos:d}=c.getMinMaxCorner(this.positions),m=p[0],v=p[1],y=d[0],g=d[1],x={type:"Polygon",coordinates:[[...this.positions.map(T=>[T[0],T[1]])]]},E=[m,v,y,g],B=this.gridWidth,D=Z_(E,B,{units:"meters",mask:x}).features.map(T=>T.geometry.coordinates),F=b.Math.toRadians;return D.map(T=>new b.Cartographic(F(T[0]),F(T[1])))},A=()=>{s.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,s.depthTest=!0},h=this.dv(c.createProcessingFromAsyncFunc(async p=>{const d=u();let m=0,v=300;const y=Math.ceil(d.length/v),g=[];do{let _=[];m===y-1?_=d.slice(m*v):_=d.slice(m*v,(m+1)*v);const x=o.scene.sampleHeightMostDetailed(_),E=await p.promise(x);if(m===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const B=b.Math.toDegrees,P=E.filter(I=>I!=null).map(I=>[B(I.longitude),B(I.latitude),I.height]);g.push(...P)}m++}while(m<y);!g||!g.length||(this.gridPoints=g)}));let f=null;{const p=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let d=0;const m=[];let v=0;const y=[];this.gridPoints.forEach(g=>{const _=this.positions;g[2]>_[0][2]?(d+=this.gridWidth*this.gridWidth*(g[2]-_[0][2]),m.push([g,[g[0],g[1],_[0][2]]])):(v+=this.gridWidth*this.gridWidth*(_[0][2]-g[2]),y.push([g,[g[0],g[1],_[0][2]]]))}),s.positions=m,l.positions=y,s.show=!0,l.show=!0,this.area=Mx(this.positions),this.cutVolume=d,this.fillVolume=v,this.cutAndFillVolume=v-d,f&&clearTimeout(f),f=setTimeout(()=>{s.depthTest=!1},200)};p(),this.d(this.gridPointsChanged.don(p)),this.d(()=>clearTimeout(f))}{const p=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};p(),this.d(this.positionsChanged.don(p))}{const p=()=>{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};p(),this.d(this.planeHeightChanged.don(p))}this.d(this.enableEvent.don(()=>{A(),this.gridPoints=[],this.progress=0,h.restart()})),this.d(this.clearEvent.don(()=>{A()}))}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:c.reactPositions(void 0),planeHeight:c.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})})(bu||(bu={})),c.extendClassProps(bu.prototype,bu.createDefaultProps);const Zc=class Zc extends Ln{constructor(e,i){super(e,i);L(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new bu(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"positions"],[e,"points"])),this.d(c.track([r,"allowPicking"],[e,"allowPicking"])),this.d(c.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(c.track([r,"gridWidth"],[e,"gridWidth"])),this.d(c.track([e,"cutVolume"],[r,"cutVolume"])),this.d(c.track([e,"fillVolume"],[r,"fillVolume"])),this.d(c.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(c.bind([e,"progress"],[r,"progress"])),this.d(c.track([r,"depthTest"],[e,"depthTest"])),this.d(c.track([r,"outline"],[e,"stroked"])),this.d(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(c.track([r,"outlineColor"],[e,"strokeColor"])),this.d(c.track([r,"filled"],[e,"filled"])),this.d(c.track([r,"fillColor"],[e,"fillColor"])),this.d(c.track([r,"fillGround"],[e,"fillGround"])),this.d(c.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(c.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:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Zc,"type",Zc.register("ESCesiumViewer",c.ESVolumeMeasurement.type,Zc));let av=Zc;const $c=class $c extends Ln{constructor(e,i){super(e,i);L(this,"czmEntity");L(this,"czmPolyline",this.ad(new c.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(c.bind([r,"show"],[e,"show"])),this.ad(c.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(c.bind([r,"stroked"],[e,"stroked"])),this.ad(c.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(c.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const h=structuredClone(e.points);h.push(h[0]),e.perPositionHeight?r.points=h:r.points=h.map(f=>(f[2]=e.height??c.ESGeoExtrudedPolygon.defaults.height,f))}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(A.don(u))}const a=this.czmEntity=o.entities.add({polygon:{}});b.Entity.prototype&&(a.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(a));let s=new b.PolygonHierarchy;a.polygon&&(a.polygon.hierarchy=new b.CallbackProperty(()=>s,!1));const l=()=>{const u=Yt(e.points??[]);if(u.length<2){s=new b.PolygonHierarchy;return}s=new b.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{a.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!a.show&&e.filled)};u();const A=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(A.don(u))}{const u=()=>{a.polygon&&(a.polygon.perPositionHeight=new b.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{a.polygon&&(a.polygon.height=new b.ConstantProperty(e.height??c.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{a.polygon&&(a.polygon.extrudedHeight=new b.ConstantProperty(e.extrudedHeight??c.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const A=b.Color.fromCartesian4(b.Cartesian4.fromArray(e.fillColor));a.polygon&&(a.polygon.material=A)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new c.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new at.ObjectsToExcludeWrapper(i,a)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=c.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};L($c,"type",$c.register("ESCesiumViewer",c.ESGeoExtrudedPolygon.type,$c));let lv=$c;const Xc=class Xc extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(c.bind([o,"position"],[n,"position"])),this.dispose(c.bind([o,"rotation"],[n,"rotation"])),this.ad(c.bind([o,"scale"],[n,"scale"])),this.ad(c.track([r,"scale"],[n,"scale"])),this.dispose(c.track([r,"rotation"],[n,"rotation"]));const a=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};a();const s=this.dv(c.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(s.don(a)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};L(Xc,"type",Xc.register("ESCesiumViewer",c.ESHumanPoi.type,Xc));let uv=Xc;const Yc=class Yc extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var A,h,f,p;const u=(p=(f=(h=(A=l==null?void 0:l._root)==null?void 0:A._content)==null?void 0:h._model)==null?void 0:f._featureTables[0])==null?void 0:p._features[0];u?o.strokeFeature([u],b.Color.LIME.toBytes().map(d=>d/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),a=o.url,s=Date.now();a.includes("?reload=")?o.url=a.replace(/\?reload=\d+/,`?reload=${s}`):o.url=a+`?reload=${s}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const s=n.layerConfig;if(!s){o.style=void 0;return}const l=n.colorBlendMode,u=(f,p)=>{try{if(f.getPropertyIds().includes("materialName"))return b.Color.clone(b.Color.WHITE,p);const d=f.getProperty("layer"),m=f.getProperty("dataset"),v=d.toString(),y=m.toString(),g=s.find(x=>x.dataset.toString()===y&&x.layer.toString()===v);if(g&&g.value.color){const x=g.value.color;return b.Color.fromCssColorString(x,p)}const _=s.filter(x=>x.dataset.toString()===y);if(_.length==1&&_[0].value.color){const x=_[0].value.color;return b.Color.fromCssColorString(x,p)}else return b.Color.clone(b.Color.WHITE,p)}catch(d){return console.warn(d),b.Color.clone(b.Color.WHITE,p)}},A=f=>{try{if(f.getPropertyIds().includes("id")){const _=Object.entries(n.visJson);for(let x=0;x<_.length;x++){const E=_[x];if(f.getProperty("id").toString()===E[0])return E[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const p=f.getProperty("layer"),d=f.getProperty("dataset"),m=p.toString(),v=d.toString(),y=s.find(_=>_.dataset.toString()===v&&_.layer.toString()===m);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const g=s.filter(_=>_.dataset.toString()===v);return!(g.length==1&&g[0].value.visible===!1)}catch(p){return console.warn(p),!0}};let h;l!=="HIGHLIGHT"?h=new b.Cesium3DTileStyle({color:{evaluateColor:function(f,p){return u(f,p)}},show:{evaluate:function(f){return A(f)}}}):h=new b.Cesium3DTileStyle({show:{evaluate:function(f){return A(f)}}}),console.log("style",h),o.style=h};r();const a=this.dv(c.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged,n.visJsonChanged));this.d(a.don(()=>{r()}))}))}};L(Yc,"type",Yc.register("ESCesiumViewer",c.ESRtsTileset.type,Yc));let cv=Yc;const Jc=class Jc extends ua{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Jc,"type",Jc.register("ESCesiumViewer",c.ESRtsFeatureEditing.type,Jc));let hv=Jc;const eh=class eh extends ua{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(eh,"type",eh.register("ESCesiumViewer",c.ESMsTileset.type,eh));let Av=eh;const th=class th extends He{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Wn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(th,"type",th.register("ESCesiumViewer",c.ESStaticMesh.type,th));let fv=th;const nh=class nh extends sn{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new P0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),a=Number.isFinite(n.radius)?n.radius:c.ESSkylineAnalysis.defaults.radius,{depths:s,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,a),A=De(i.camera.position);u.push(A),n.depths=s,n.windowPositions=l,n.points=u}))}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(nh,"type",nh.register("ESCesiumViewer",c.ESSkylineAnalysis.type,nh));let dv=nh;class UV extends c.Destroyable{constructor(e,i){super();L(this,"_rectangle");L(this,"_updateHeatMapEvent",this.disposeVar(new c.Event));const o=e.sceneObject;this._rectangle=this.ad(new Ci(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(c.bind([this.rectangle,"show"],[o,"show"])),this.ad(c.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 OV extends c.Destroyable{constructor(e,i){super();L(this,"_primitive");L(this,"_updateHeatMapEvent",this.disposeVar(new c.Event));L(this,"czmViewer");L(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,a=r.sceneObject,s=o.viewer;if(!s)return;let l,u;const A=this.ad(new c.Event),h=()=>{f(),!(!l||!u)&&(this._primitive=s.scene.primitives.add(new b.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:a.allowPicking})))},f=()=>{this.primitive&&s.scene.primitives.remove(this.primitive)};this.ad(f);{const p=()=>{this.primitive&&(this.primitive.show=a.show)};p(),this.ad(a.showChanged.don(p))}{const p=this.ad(c.createNextAnimateFrameEvent(a.allowPickingChanged,A));this.ad(p.don(h))}{const p=()=>{r.rectangle&&(l=new b.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 m=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=c.getDistancesFromPositions([[r.rectangle[0],m,0],[r.rectangle[2],m,0]],"GEODESIC")[0]/5;u=new b.MaterialAppearance({material:new b.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)),p(),this.primitive||A.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
|
|
3743
3743
|
in vec3 position3DHigh;
|
|
3744
3744
|
in vec3 position3DLow;
|
|
3745
3745
|
in vec3 normal;
|
|
@@ -3762,7 +3762,7 @@ void main()
|
|
|
3762
3762
|
p += vec4(color.a * upDir * ${e??1e3}, 0.0);
|
|
3763
3763
|
|
|
3764
3764
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
3765
|
-
}`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,a=Math.ceil(i||256),[s,l,u,A]=o.rectangle,h=(u-s)/(r-1),f=(A-l)/(a-1),p=[],d=[],m=[],v=[];for(let y=0;y<r;y++){const g=s+h*y;for(let _=0;_<a;_++){const x=l+f*_;o.heatmap.getValueAt({x:y,y:_});const E=b.Cartesian3.fromDegrees(g,x,o.heatmap._renderer._min);p.push(E.x,E.y,E.z),d.push(y/(r-1),_/(a-1)),_!==a-1&&y!==r-1&&(m.push((y+1)*a+_+1,y*a+_+1,y*a+_),m.push(y*a+_,(y+1)*a+_,(y+1)*a+_+1))}}return this.createGeometry(p,d,m,v)}createGeometry(e,i,o,r){return new b.Geometry({attributes:new b.GeometryAttributes({position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:b.BoundingSphere.fromVertices(e,new b.Cartesian3,3),primitiveType:b.PrimitiveType.TRIANGLES})}}const Tn={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:{}};class OV{constructor(n){L(this,"_coordinator");L(this,"_data");L(this,"_radi");L(this,"_min");L(this,"_max");L(this,"_xField");L(this,"_yField");L(this,"_valueField");L(this,"_cfgRadius");this._coordinator=new US,this._data={},this._radi={},this._min=0,this._max=1,this._xField=n.xField||n.defaultXField||Tn.defaultXField,this._yField=n.yField||n.defaultYField||Tn.defaultYField,this._valueField=n.valueField||n.defaultValueField||Tn.defaultValueField,n.radius&&(this._cfgRadius=n.radius)}_organiseData(n,e){const i=n[this._xField],o=n[this._yField],r=n[this._valueField]||1,a=n.radius||this._cfgRadius||Tn.defaultRadius;return this._data[i]||(this._data[i]={},this._radi[i]={}),this._data[i][o]?this._data[i][o]+=r:(this._data[i][o]=r,this._radi[i][o]=a),this._data[i][o]>this._max?(e?this.setDataMax(this._data[i][o]):this._max=this._data[i][o],!1):{x:i,y:o,value:r,radius:a,min:this._min,max:this._max}}_unOrganizeData(){const n=[];for(const e in this._data)for(const i in this._data[e])n.push({x:Number(e),y:Number(i),radius:this._radi[e][i],value:this._data[e][i]});return{min:this._min,max:this._max,data:n}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(n){if(Array.isArray(n))n.forEach(e=>this.addData(e));else{const e=this._organiseData(n,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(n){this._data={},this._radi={};for(const e of n.data)this._organiseData(e,!1);return this._max=n.max,this._min=n.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(n){return this._max=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(n){return this._min=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(n){this._coordinator=n}getData(){return this._unOrganizeData()}}class LV{constructor(n){L(this,"shadowCanvas");L(this,"canvas");L(this,"_renderBoundaries");L(this,"_width");L(this,"_height");L(this,"shadowCtx");L(this,"ctx");L(this,"_palette");L(this,"_templates");L(this,"_blur",Tn.defaultBlur);L(this,"_opacity",0);L(this,"_maxOpacity",Tn.defaultMaxOpacity*255);L(this,"_minOpacity",Tn.defaultMinOpacity*255);L(this,"_useGradientOpacity",!1);L(this,"_min",0);L(this,"_max",1);const e=n.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=n.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const i=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+i.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+i.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(n),this._templates={},this._setStyles(n)}_getColorPalette(n){const e=n.gradient||n.defaultGradient||Tn.defaultGradient,i=document.createElement("canvas"),o=i.getContext("2d");i.width=256,i.height=1;const r=o.createLinearGradient(0,0,256,1);for(const a in e)r.addColorStop(Number(a),e[a]);return o.fillStyle=r,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(n,e){const i=document.createElement("canvas"),o=i.getContext("2d"),r=n,a=n;if(i.width=i.height=n*2,e===1)o.beginPath(),o.arc(r,a,n,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const s=o.createRadialGradient(r,a,n*e,r,a,n);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=s,o.fillRect(0,0,2*n,2*n)}return i}renderPartial(n){this._drawAlpha(n),this._colorize()}renderAll(n){this._clear(),this._drawAlpha(this._prepareData(n)),this._colorize()}_prepareData(n){const e=[],i=Object.keys(n.data);for(const o of i){const r=Object.keys(n.data[o]);for(const a of r)e.push({x:Number(o),y:Number(a),value:n.data[o][a],radius:n.radi[o][a]})}return{min:n.min,max:n.max,data:e}}updateConfig(n){n.gradient&&(this._palette=this._getColorPalette(n)),this._setStyles(n)}setDimensions(n,e){this._width=n,this._height=e,this.canvas.width=this.shadowCanvas.width=n,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(n){this._blur=n.blur===0?0:n.blur||n.defaultBlur||Tn.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity||Tn.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity||Tn.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity}_drawAlpha(n){this._min=n.min,this._max=n.max;const e=1-this._blur;for(const i of n.data){const o=i.radius,r=i.x-o,a=i.y-o,s=Math.min(i.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(s-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],r,a),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],r),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],a),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],r+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],a+2*o)}}_colorize(){let[n,e,i,o]=this._renderBoundaries;n=Math.max(0,n),e=Math.max(0,e),i=Math.min(this._width-n,i-n),o=Math.min(this._height-e,o-e);const r=this.shadowCtx.getImageData(n,e,i,o),a=r.data;for(let s=3;s<a.length;s+=4){const l=a[s],u=l*4;if(!u)continue;let A;this._opacity>0?A=this._opacity:A=l<this._maxOpacity?l<this._minOpacity?this._minOpacity:l:this._maxOpacity,a[s-3]=this._palette[u],a[s-2]=this._palette[u+1],a[s-1]=this._palette[u+2],a[s]=this._useGradientOpacity?this._palette[u+3]:A}this.ctx.putImageData(r,n,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(n){const i=this.shadowCtx.getImageData(n.x,n.y,1,1).data[3];return Math.abs(this._max-this._min)*(i/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class US{constructor(){L(this,"cStore");this.cStore={}}on(n,e,i){this.cStore[n]||(this.cStore[n]=[]),this.cStore[n].push(o=>e.call(i,o))}emit(n,e){this.cStore[n]&&this.cStore[n].forEach(i=>i(e))}}class zV{constructor(n={}){L(this,"_config");L(this,"_coordinator");L(this,"_renderer");L(this,"_store");if(this._config={...Tn,...n},this._coordinator=new US,this._config.plugin){const e=Tn.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new LV(this._config),this._store=new OV(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",n=>this._renderer.renderPartial(n),this._renderer),this._coordinator.on("renderall",n=>this._renderer.renderAll(n),this._renderer),this._coordinator.on("extremachange",n=>{var e,i;(i=(e=this._config).onExtremaChange)==null||i.call(e,{min:n.min,max:n.max,gradient:this._config.gradient||this._config.defaultGradient||Tn.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(n){return this._store.addData(n),this}setData(n){return this._store.setData(n),this}setDataMax(n){return this._store.setDataMax(n),this}setDataMin(n){return this._store.setDataMin(n),this}configure(n){return this._config={...this._config,...n},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(n){return this._store.getValueAt?this._store.getValueAt(n):this._renderer.getValueAt?this._renderer.getValueAt(n):null}}const kV=t=>new zV(t),ih=class ih extends Hn{constructor(e,i){super(e,i);L(this,"_heatmap");L(this,"_div");L(this,"_primitiveObj");L(this,"_rectangle",this.disposeVar(c.react(void 0)));L(this,"onePixelRadius",1e-4);const o=i.viewer,r=256;if(this._primitiveObj=this.ad(new c.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new UV(this,i):new RV(this,i))),!o){console.warn("viewer is undefined!");return}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=kV({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const a=this.ad(new c.Event);let s=[],l={max:100,min:0};{const u=()=>{const h={radius:e.radius??c.ESHeatMap.defaults.radius,gradient:e.gradient??c.ESHeatMap.defaults.gradient,blur:e.blur??c.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(h),this.heatmap._store._cfgRadius=h.radius,a.emit()};u();const A=this.ad(c.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(A.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:h,minPos:f}=c.getMinMaxCorner(e.data),p=h[0]-f[0],d=h[1]-f[1];if(l={max:h[2]??100,min:f[2]??0},!Number.isFinite(p)||!Number.isFinite(d)||p<=0||d<=0)return;const m=1/Math.cos((f[1]+d*.5)*Math.PI/180);if(m==1/0)return;const v=r*d/p*m;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=p/r*(e.radius??c.ESHeatMap.defaults.radius)*2,g=d/v*(e.radius??c.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,g),this.rectangle=[f[0]-y,f[1]-g,h[0]+y,h[1]+g],s=QV(e.data,this.rectangle,r,v),a.emit()}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(A.don(u))}{const u=()=>{const A={max:l.max,min:l.min,data:s};this.heatmap.setData(A),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(a.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{a.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(ih,"type",ih.register("ESCesiumViewer",c.ESHeatMap.type,ih));let pv=ih;function QV(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 rh=class rh extends sn{constructor(e,i){super(e,i);L(this,"czmPoints");if(!i.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new Uo(i,e.id)),this._updateShow();const r=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(r.don(()=>this._updateShow())),this._updatePoints();const a=this.ad(c.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(a.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(i=>{var o,r,a,s;return{position:i,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??c.ESGeoPoints.defaults.pointStyle.size,color:((r=this.sceneObject.pointStyle)==null?void 0:r.color)??c.ESGeoPoints.defaults.pointStyle.color,outlineColor:((a=this.sceneObject.pointStyle)==null?void 0:a.outlineColor)??c.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((s=this.sceneObject.pointStyle)==null?void 0:s.outlineWidth)??c.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(rh,"type",rh.register("ESCesiumViewer",c.ESGeoPoints.type,rh));let mv=rh;const fs=class fs extends Fn{constructor(e){super();L(this,"_config",this.disposeVar(c.react(fs.defaultConfig)));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_pointerEventFilterFunc",this.disposeVar(c.react(fs.defaultPointerEventFilterFunc)));L(this,"point");L(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new c.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new VV(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}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new Wn(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};L(fs,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),L(fs,"defaultPointerEventFilterFunc",e=>e.button===0),L(fs,"defaults",{...Fn.defaults,position:[116.39,39.9,0]});let Li=fs;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),position:c.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Li||(Li={})),c.extendClassProps(Li.prototype,Li.createDefaultProps);class VV extends c.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,a)=>{a=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||a=="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(r=>{if(!r.pointerEvent)return;const a=new NV(this,r.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const l=[...s];e.editingHeightOffset&&(l[2]+=e.editingHeightOffset),i.position=l,this._doings.splice(0,this._doings.indexOf(a)+1).forEach(A=>A.destroy())});this._doings.push(a)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class NV extends c.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=i0(o,e,this._owner.placeEditing.virtualHeight),[a]=c.getEventFromPromise(r);this.dispose(a.disposableOn(i))}}class Qn extends Fn{constructor(){super()}}L(Qn,"defaults",{...Fn.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),position:c.reactArrayWithUndefined(void 0)})})(Qn||(Qn={})),c.extendClassProps(Qn.prototype,Qn.createDefaultProps);function gv(t,n){const e=new Ye(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const ii=class ii extends c.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(gv(n,ii.defaults.xAxisColor)),i=this.disposeVar(gv(n,ii.defaults.yAxisColor)),o=this.disposeVar(gv(n,ii.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const a=this.ad(c.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(a.disposableOn(r))}{const r=()=>{const{position:s=ii.defaults.position,heading:l=ii.defaults.heading}=this,[u,A,h]=s,{dimensions:f=ii.defaults.dimensions}=this;o.positions=[s,[u,A,h+f[2]]];const p=c.geoRhumbDestination(s,f[0],90+l);p&&(e.positions=[s,p]);const d=c.geoRhumbDestination(s,f[1],0+l);d&&(i.positions=[s,d])};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(a.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??ii.defaults.xAxisColor,i.color=this.yAxisColor??ii.defaults.yAxisColor,o.color=this.zAxisColor??ii.defaults.zAxisColor};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(a.disposableOn(r))}}};L(ii,"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 ro=ii;(t=>{t.createDefaultProps=()=>({show:!0,position:c.reactArrayWithUndefined(void 0),heading:0,dimensions:c.reactArray([1e3,1e3,1e3]),xAxisColor:c.reactArray([1,0,0,1]),yAxisColor:c.reactArray([0,1,0,1]),zAxisColor:c.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(ro||(ro={})),c.extendClassProps(ro.prototype,ro.createDefaultProps);const ho=class ho extends Qn{constructor(e){super();L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.ad(c.react("none")),originPosition:this.disposeVar(c.reactArray(Qn.defaults.position)),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_createCoordinates",e=>{const i=this.ad(new ro(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{OS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const a=[...this.position??ho.defaults.position];e.editingHeightOffset&&(a[2]-=e.editingHeightOffset),i.position=a};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 ro(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:a}=this._opInfo;{const s=()=>{i.position=o.value};s(),this.dispose(o.changed.disposableOn(s))}{const s=()=>{i.heading=r.value??0};s(),this.dispose(r.changed.disposableOn(s))}{const s=()=>{i.dimensions=a.value};s(),this.dispose(a.changed.disposableOn(s))}return i});L(this,"_createGrid",e=>{const i=this.ad(new ai(e));{const o=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],u=[];for(let A=-4;A<5;++A){const h=c.geoRhumbDestination(a,l*.2*A,s+90);if(h){const f=c.geoRhumbDestination(h,l,s+180),p=c.geoRhumbDestination(h,l,s);f&&p&&u.push([f,h,p])}}for(let A=-4;A<5;++A){const h=c.geoRhumbDestination(a,l*.2*A,s);if(h){const f=c.geoRhumbDestination(h,l,s-90),p=c.geoRhumbDestination(h,l,s+90);f&&p&&u.push([f,h,p])}}i.positions=u};o();const r=this.disposeVar(c.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 Ye(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(c.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 ai(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(c.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originDimensions.value[0],l=[],u=32;for(let A=0;A<=u;++A){const h=c.geoRhumbDestination(a,s,A*360/u);h&&l.push(h)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});L(this,"_pickingXYProcessing",e=>this.ad(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new b.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!ys(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;fo(s,a),this._opInfo.constraintMode.value==="x"?mo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="y"?mo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a;const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A})})));L(this,"_pickingZProcessing",e=>this.ad(new c.Processing(()=>{const i=new b.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!Sh(e.viewer.scene,rt(this._opInfo.originPosition.value),a,i))return;const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(De(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s]}})})));L(this,"_pickingZAxisProcessing",e=>this.ad(new c.Processing(()=>{const i=[0,0,0],o=new b.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!ys(e.viewer.scene,a,this._opInfo.originPosition.value[2],o))return;fo(o,i);const s=c.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=c.geoRhumbHeading(this._opInfo.originPosition.value,i)-s;let A=this._opInfo.originHeading.value+u;A=b.Math.toDegrees(b.Math.negativePiToPi(b.Math.toRadians(A))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=A})})));if(!e.viewer)return;const i=this.ad(c.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new Cd(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const a=[...r];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),this.position=a}})),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,a)=>r===this._opInfo.targetPosition.value[a])){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),a=this._createGrid(e),s=this._createHelpLine(e),l=this._createCircle(e);{const u=()=>{l.show=a.show=this.enabled&&this.showCircle,s.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};u();const A=this.ad(c.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(A.don(u))}{const u=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};u();const A=this.ad(c.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(A.don(u))}{const u=()=>{a.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],OS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),A=this._pickingZProcessing(e),h=this._pickingZAxisProcessing(e),f=()=>{const _=[...this.position??ho.defaults.position];e.editingHeightOffset&&(_[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=_},p=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,d=()=>this._opInfo.originDimensions.value=i.value,m={constraintMode:"none",startDragPos:[0,0,0]},v=_=>{const x={position:o.position??ho.defaults.position,heading:o.heading??ho.defaults.heading,dimensions:o.dimensions??ho.defaults.dimensions};e.viewer&&Ad(_,e.viewer.scene,x,this.axisSnapPixelSize,m,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=m.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=m.startDragPos},y=this.ad(c.createProcessingFromAsyncFunc(async _=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",_.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(_,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((p(),this.headingChanged.don(p))),x.disposer.dispose((d(),i.changed.don(d))),x.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&v(E.pointerEvent)})),await c.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(I=>{I.pointerEvent&&v(I.pointerEvent),I.pointerEvent&&I.pointerEvent.button===0&&m.constraintMode!=="none"&&B()}))}))}),this._opInfo.step.value=!1,await c.step(_,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const E=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),B=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,E,B),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(A.restart(),x.disposer.dispose(()=>A.cancel())):this._opInfo.constraintMode.value==="zAxis"?(h.restart(),x.disposer.dispose(()=>h.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await c.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerUpEvent.don(()=>{B()})),E.disposer.dispose(e.pointerOutEvent.don(()=>B()))}))}),y.restart()})),g=()=>{this.enabled?y.restart():y.isRunning&&y.cancel()};g(),this.ad(this.enabledChanged.don(g))}}}};L(ho,"defaults",{...Qn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let lr=ho;(t=>{t.createDefaultProps=()=>({...Qn.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})})(lr||(lr={})),c.extendClassProps(lr.prototype,lr.createDefaultProps);function OS(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 yv extends c.HasOwner{constructor(e){super(e);L(this,"_valid",!1);L(this,"_normal",new b.Cartesian3(0,0,0));L(this,"_origin",new b.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=oi(e);return r0(this.scene,i,this.normal,o)}}class HV extends yv{constructor(n){super(n);{const e=()=>{const o=lt({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(c.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class GV extends yv{constructor(n){super(n);const e=()=>{const i=lt({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=lt({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:b.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 WV extends yv{constructor(n){super(n);const e=()=>{const i=lt({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=lt({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:b.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 Oa extends c.Destroyable{constructor(e){super();L(this,"_czmTexture");L(this,"_customPrimitiveForCircle");L(this,"_circleCanvas");L(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ft(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(c.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const a=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,A=this.color,h=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, ${A[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${A[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=h,u.stroke();{u.lineWidth=1,u.beginPath();let d=b.Math.zeroToTwoPi(l.startRotation),m=b.Math.zeroToTwoPi(l.endRotation);m<d&&(m+=b.Math.TWO_PI),(d!==m||d!==0)&&(u.moveTo(128,128),u.arc(128,128,64,d,m,m-d>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=b.Math.negativePiToPi(l.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,b.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const v=`${(b.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var p=u.measureText(v).width;u.translate(128,128),u.rotate(Math.PI*.5),f=b.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(i.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(v,128-p*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};a();const s=this.ad(c.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(s.don(a)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(a))}{const r=()=>{const s=lt({rotation:this.selfRotation});if(!s)return;const l=lt({position:this.position,rotation:this.rotation,localModelMatrix:b.Matrix4.toArray(s)});if(!l)return;const{viewer:u}=e;if(!u)return;const A=b.Cartesian3.dot(u.scene.camera.directionWC,new b.Cartesian3(l[8],l[9],l[10]));i.value=A>0};r();const a=this.ad(c.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(a.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(jV(e)),this.dispose(c.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(c.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(c.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(c.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=lt({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&b.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(qV(e)),this.dispose(c.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([this._debugAxis,"position"],[this,"position"])),this.dispose(c.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(c.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=lt({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&b.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(Oa,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,color:c.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(Oa||(Oa={})),c.extendClassProps(Oa.prototype,Oa.createDefaultProps);function jV(t){return Td({type:"CzmCustomPrimitive",allowPicking:!0,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]},ut,t)}function qV(t){return Td({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
|
|
3765
|
+
}`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,a=Math.ceil(i||256),[s,l,u,A]=o.rectangle,h=(u-s)/(r-1),f=(A-l)/(a-1),p=[],d=[],m=[],v=[];for(let y=0;y<r;y++){const g=s+h*y;for(let _=0;_<a;_++){const x=l+f*_;o.heatmap.getValueAt({x:y,y:_});const E=b.Cartesian3.fromDegrees(g,x,o.heatmap._renderer._min);p.push(E.x,E.y,E.z),d.push(y/(r-1),_/(a-1)),_!==a-1&&y!==r-1&&(m.push((y+1)*a+_+1,y*a+_+1,y*a+_),m.push(y*a+_,(y+1)*a+_,(y+1)*a+_+1))}}return this.createGeometry(p,d,m,v)}createGeometry(e,i,o,r){return new b.Geometry({attributes:new b.GeometryAttributes({position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:b.BoundingSphere.fromVertices(e,new b.Cartesian3,3),primitiveType:b.PrimitiveType.TRIANGLES})}}const Tn={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:{}};class LV{constructor(n){L(this,"_coordinator");L(this,"_data");L(this,"_radi");L(this,"_min");L(this,"_max");L(this,"_xField");L(this,"_yField");L(this,"_valueField");L(this,"_cfgRadius");this._coordinator=new US,this._data={},this._radi={},this._min=0,this._max=1,this._xField=n.xField||n.defaultXField||Tn.defaultXField,this._yField=n.yField||n.defaultYField||Tn.defaultYField,this._valueField=n.valueField||n.defaultValueField||Tn.defaultValueField,n.radius&&(this._cfgRadius=n.radius)}_organiseData(n,e){const i=n[this._xField],o=n[this._yField],r=n[this._valueField]||1,a=n.radius||this._cfgRadius||Tn.defaultRadius;return this._data[i]||(this._data[i]={},this._radi[i]={}),this._data[i][o]?this._data[i][o]+=r:(this._data[i][o]=r,this._radi[i][o]=a),this._data[i][o]>this._max?(e?this.setDataMax(this._data[i][o]):this._max=this._data[i][o],!1):{x:i,y:o,value:r,radius:a,min:this._min,max:this._max}}_unOrganizeData(){const n=[];for(const e in this._data)for(const i in this._data[e])n.push({x:Number(e),y:Number(i),radius:this._radi[e][i],value:this._data[e][i]});return{min:this._min,max:this._max,data:n}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(n){if(Array.isArray(n))n.forEach(e=>this.addData(e));else{const e=this._organiseData(n,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(n){this._data={},this._radi={};for(const e of n.data)this._organiseData(e,!1);return this._max=n.max,this._min=n.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(n){return this._max=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(n){return this._min=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(n){this._coordinator=n}getData(){return this._unOrganizeData()}}class zV{constructor(n){L(this,"shadowCanvas");L(this,"canvas");L(this,"_renderBoundaries");L(this,"_width");L(this,"_height");L(this,"shadowCtx");L(this,"ctx");L(this,"_palette");L(this,"_templates");L(this,"_blur",Tn.defaultBlur);L(this,"_opacity",0);L(this,"_maxOpacity",Tn.defaultMaxOpacity*255);L(this,"_minOpacity",Tn.defaultMinOpacity*255);L(this,"_useGradientOpacity",!1);L(this,"_min",0);L(this,"_max",1);const e=n.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=n.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const i=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+i.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+i.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(n),this._templates={},this._setStyles(n)}_getColorPalette(n){const e=n.gradient||n.defaultGradient||Tn.defaultGradient,i=document.createElement("canvas"),o=i.getContext("2d");i.width=256,i.height=1;const r=o.createLinearGradient(0,0,256,1);for(const a in e)r.addColorStop(Number(a),e[a]);return o.fillStyle=r,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(n,e){const i=document.createElement("canvas"),o=i.getContext("2d"),r=n,a=n;if(i.width=i.height=n*2,e===1)o.beginPath(),o.arc(r,a,n,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const s=o.createRadialGradient(r,a,n*e,r,a,n);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=s,o.fillRect(0,0,2*n,2*n)}return i}renderPartial(n){this._drawAlpha(n),this._colorize()}renderAll(n){this._clear(),this._drawAlpha(this._prepareData(n)),this._colorize()}_prepareData(n){const e=[],i=Object.keys(n.data);for(const o of i){const r=Object.keys(n.data[o]);for(const a of r)e.push({x:Number(o),y:Number(a),value:n.data[o][a],radius:n.radi[o][a]})}return{min:n.min,max:n.max,data:e}}updateConfig(n){n.gradient&&(this._palette=this._getColorPalette(n)),this._setStyles(n)}setDimensions(n,e){this._width=n,this._height=e,this.canvas.width=this.shadowCanvas.width=n,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(n){this._blur=n.blur===0?0:n.blur||n.defaultBlur||Tn.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity||Tn.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity||Tn.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity}_drawAlpha(n){this._min=n.min,this._max=n.max;const e=1-this._blur;for(const i of n.data){const o=i.radius,r=i.x-o,a=i.y-o,s=Math.min(i.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(s-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],r,a),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],r),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],a),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],r+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],a+2*o)}}_colorize(){let[n,e,i,o]=this._renderBoundaries;n=Math.max(0,n),e=Math.max(0,e),i=Math.min(this._width-n,i-n),o=Math.min(this._height-e,o-e);const r=this.shadowCtx.getImageData(n,e,i,o),a=r.data;for(let s=3;s<a.length;s+=4){const l=a[s],u=l*4;if(!u)continue;let A;this._opacity>0?A=this._opacity:A=l<this._maxOpacity?l<this._minOpacity?this._minOpacity:l:this._maxOpacity,a[s-3]=this._palette[u],a[s-2]=this._palette[u+1],a[s-1]=this._palette[u+2],a[s]=this._useGradientOpacity?this._palette[u+3]:A}this.ctx.putImageData(r,n,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(n){const i=this.shadowCtx.getImageData(n.x,n.y,1,1).data[3];return Math.abs(this._max-this._min)*(i/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class US{constructor(){L(this,"cStore");this.cStore={}}on(n,e,i){this.cStore[n]||(this.cStore[n]=[]),this.cStore[n].push(o=>e.call(i,o))}emit(n,e){this.cStore[n]&&this.cStore[n].forEach(i=>i(e))}}class kV{constructor(n={}){L(this,"_config");L(this,"_coordinator");L(this,"_renderer");L(this,"_store");if(this._config={...Tn,...n},this._coordinator=new US,this._config.plugin){const e=Tn.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new zV(this._config),this._store=new LV(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",n=>this._renderer.renderPartial(n),this._renderer),this._coordinator.on("renderall",n=>this._renderer.renderAll(n),this._renderer),this._coordinator.on("extremachange",n=>{var e,i;(i=(e=this._config).onExtremaChange)==null||i.call(e,{min:n.min,max:n.max,gradient:this._config.gradient||this._config.defaultGradient||Tn.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(n){return this._store.addData(n),this}setData(n){return this._store.setData(n),this}setDataMax(n){return this._store.setDataMax(n),this}setDataMin(n){return this._store.setDataMin(n),this}configure(n){return this._config={...this._config,...n},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(n){return this._store.getValueAt?this._store.getValueAt(n):this._renderer.getValueAt?this._renderer.getValueAt(n):null}}const QV=t=>new kV(t),ih=class ih extends Hn{constructor(e,i){super(e,i);L(this,"_heatmap");L(this,"_div");L(this,"_primitiveObj");L(this,"_rectangle",this.disposeVar(c.react(void 0)));L(this,"onePixelRadius",1e-4);const o=i.viewer,r=256;if(this._primitiveObj=this.ad(new c.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new OV(this,i):new UV(this,i))),!o){console.warn("viewer is undefined!");return}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=QV({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const a=this.ad(new c.Event);let s=[],l={max:100,min:0};{const u=()=>{const h={radius:e.radius??c.ESHeatMap.defaults.radius,gradient:e.gradient??c.ESHeatMap.defaults.gradient,blur:e.blur??c.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(h),this.heatmap._store._cfgRadius=h.radius,a.emit()};u();const A=this.ad(c.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(A.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:h,minPos:f}=c.getMinMaxCorner(e.data),p=h[0]-f[0],d=h[1]-f[1];if(l={max:h[2]??100,min:f[2]??0},!Number.isFinite(p)||!Number.isFinite(d)||p<=0||d<=0)return;const m=1/Math.cos((f[1]+d*.5)*Math.PI/180);if(m==1/0)return;const v=r*d/p*m;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=p/r*(e.radius??c.ESHeatMap.defaults.radius)*2,g=d/v*(e.radius??c.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,g),this.rectangle=[f[0]-y,f[1]-g,h[0]+y,h[1]+g],s=VV(e.data,this.rectangle,r,v),a.emit()}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(A.don(u))}{const u=()=>{const A={max:l.max,min:l.min,data:s};this.heatmap.setData(A),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(a.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{a.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(ih,"type",ih.register("ESCesiumViewer",c.ESHeatMap.type,ih));let pv=ih;function VV(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 rh=class rh extends sn{constructor(e,i){super(e,i);L(this,"czmPoints");if(!i.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new Uo(i,e.id)),this._updateShow();const r=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(r.don(()=>this._updateShow())),this._updatePoints();const a=this.ad(c.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(a.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(i=>{var o,r,a,s;return{position:i,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??c.ESGeoPoints.defaults.pointStyle.size,color:((r=this.sceneObject.pointStyle)==null?void 0:r.color)??c.ESGeoPoints.defaults.pointStyle.color,outlineColor:((a=this.sceneObject.pointStyle)==null?void 0:a.outlineColor)??c.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((s=this.sceneObject.pointStyle)==null?void 0:s.outlineWidth)??c.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(rh,"type",rh.register("ESCesiumViewer",c.ESGeoPoints.type,rh));let mv=rh;const fs=class fs extends Fn{constructor(e){super();L(this,"_config",this.disposeVar(c.react(fs.defaultConfig)));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_pointerEventFilterFunc",this.disposeVar(c.react(fs.defaultPointerEventFilterFunc)));L(this,"point");L(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new c.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new NV(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}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new Wn(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};L(fs,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),L(fs,"defaultPointerEventFilterFunc",e=>e.button===0),L(fs,"defaults",{...Fn.defaults,position:[116.39,39.9,0]});let Li=fs;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),position:c.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Li||(Li={})),c.extendClassProps(Li.prototype,Li.createDefaultProps);class NV extends c.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,a)=>{a=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||a=="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(r=>{if(!r.pointerEvent)return;const a=new HV(this,r.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const l=[...s];e.editingHeightOffset&&(l[2]+=e.editingHeightOffset),i.position=l,this._doings.splice(0,this._doings.indexOf(a)+1).forEach(A=>A.destroy())});this._doings.push(a)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class HV extends c.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=i0(o,e,this._owner.placeEditing.virtualHeight),[a]=c.getEventFromPromise(r);this.dispose(a.disposableOn(i))}}class Qn extends Fn{constructor(){super()}}L(Qn,"defaults",{...Fn.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),position:c.reactArrayWithUndefined(void 0)})})(Qn||(Qn={})),c.extendClassProps(Qn.prototype,Qn.createDefaultProps);function gv(t,n){const e=new Ye(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const ii=class ii extends c.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(gv(n,ii.defaults.xAxisColor)),i=this.disposeVar(gv(n,ii.defaults.yAxisColor)),o=this.disposeVar(gv(n,ii.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const a=this.ad(c.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(a.disposableOn(r))}{const r=()=>{const{position:s=ii.defaults.position,heading:l=ii.defaults.heading}=this,[u,A,h]=s,{dimensions:f=ii.defaults.dimensions}=this;o.positions=[s,[u,A,h+f[2]]];const p=c.geoRhumbDestination(s,f[0],90+l);p&&(e.positions=[s,p]);const d=c.geoRhumbDestination(s,f[1],0+l);d&&(i.positions=[s,d])};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(a.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??ii.defaults.xAxisColor,i.color=this.yAxisColor??ii.defaults.yAxisColor,o.color=this.zAxisColor??ii.defaults.zAxisColor};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(a.disposableOn(r))}}};L(ii,"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 ro=ii;(t=>{t.createDefaultProps=()=>({show:!0,position:c.reactArrayWithUndefined(void 0),heading:0,dimensions:c.reactArray([1e3,1e3,1e3]),xAxisColor:c.reactArray([1,0,0,1]),yAxisColor:c.reactArray([0,1,0,1]),zAxisColor:c.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(ro||(ro={})),c.extendClassProps(ro.prototype,ro.createDefaultProps);const ho=class ho extends Qn{constructor(e){super();L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.ad(c.react("none")),originPosition:this.disposeVar(c.reactArray(Qn.defaults.position)),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_createCoordinates",e=>{const i=this.ad(new ro(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{OS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const a=[...this.position??ho.defaults.position];e.editingHeightOffset&&(a[2]-=e.editingHeightOffset),i.position=a};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 ro(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:a}=this._opInfo;{const s=()=>{i.position=o.value};s(),this.dispose(o.changed.disposableOn(s))}{const s=()=>{i.heading=r.value??0};s(),this.dispose(r.changed.disposableOn(s))}{const s=()=>{i.dimensions=a.value};s(),this.dispose(a.changed.disposableOn(s))}return i});L(this,"_createGrid",e=>{const i=this.ad(new ai(e));{const o=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],u=[];for(let A=-4;A<5;++A){const h=c.geoRhumbDestination(a,l*.2*A,s+90);if(h){const f=c.geoRhumbDestination(h,l,s+180),p=c.geoRhumbDestination(h,l,s);f&&p&&u.push([f,h,p])}}for(let A=-4;A<5;++A){const h=c.geoRhumbDestination(a,l*.2*A,s);if(h){const f=c.geoRhumbDestination(h,l,s-90),p=c.geoRhumbDestination(h,l,s+90);f&&p&&u.push([f,h,p])}}i.positions=u};o();const r=this.disposeVar(c.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 Ye(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(c.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 ai(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(c.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originDimensions.value[0],l=[],u=32;for(let A=0;A<=u;++A){const h=c.geoRhumbDestination(a,s,A*360/u);h&&l.push(h)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});L(this,"_pickingXYProcessing",e=>this.ad(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new b.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!ys(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;fo(s,a),this._opInfo.constraintMode.value==="x"?mo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="y"?mo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a;const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A})})));L(this,"_pickingZProcessing",e=>this.ad(new c.Processing(()=>{const i=new b.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!Sh(e.viewer.scene,rt(this._opInfo.originPosition.value),a,i))return;const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(De(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s]}})})));L(this,"_pickingZAxisProcessing",e=>this.ad(new c.Processing(()=>{const i=[0,0,0],o=new b.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!ys(e.viewer.scene,a,this._opInfo.originPosition.value[2],o))return;fo(o,i);const s=c.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=c.geoRhumbHeading(this._opInfo.originPosition.value,i)-s;let A=this._opInfo.originHeading.value+u;A=b.Math.toDegrees(b.Math.negativePiToPi(b.Math.toRadians(A))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=A})})));if(!e.viewer)return;const i=this.ad(c.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new Cd(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const a=[...r];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),this.position=a}})),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,a)=>r===this._opInfo.targetPosition.value[a])){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),a=this._createGrid(e),s=this._createHelpLine(e),l=this._createCircle(e);{const u=()=>{l.show=a.show=this.enabled&&this.showCircle,s.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};u();const A=this.ad(c.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(A.don(u))}{const u=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};u();const A=this.ad(c.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(A.don(u))}{const u=()=>{a.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],OS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),A=this._pickingZProcessing(e),h=this._pickingZAxisProcessing(e),f=()=>{const _=[...this.position??ho.defaults.position];e.editingHeightOffset&&(_[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=_},p=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,d=()=>this._opInfo.originDimensions.value=i.value,m={constraintMode:"none",startDragPos:[0,0,0]},v=_=>{const x={position:o.position??ho.defaults.position,heading:o.heading??ho.defaults.heading,dimensions:o.dimensions??ho.defaults.dimensions};e.viewer&&Ad(_,e.viewer.scene,x,this.axisSnapPixelSize,m,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=m.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=m.startDragPos},y=this.ad(c.createProcessingFromAsyncFunc(async _=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",_.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(_,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((p(),this.headingChanged.don(p))),x.disposer.dispose((d(),i.changed.don(d))),x.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&v(E.pointerEvent)})),await c.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(I=>{I.pointerEvent&&v(I.pointerEvent),I.pointerEvent&&I.pointerEvent.button===0&&m.constraintMode!=="none"&&B()}))}))}),this._opInfo.step.value=!1,await c.step(_,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const E=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),B=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,E,B),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(A.restart(),x.disposer.dispose(()=>A.cancel())):this._opInfo.constraintMode.value==="zAxis"?(h.restart(),x.disposer.dispose(()=>h.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await c.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerUpEvent.don(()=>{B()})),E.disposer.dispose(e.pointerOutEvent.don(()=>B()))}))}),y.restart()})),g=()=>{this.enabled?y.restart():y.isRunning&&y.cancel()};g(),this.ad(this.enabledChanged.don(g))}}}};L(ho,"defaults",{...Qn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let lr=ho;(t=>{t.createDefaultProps=()=>({...Qn.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})})(lr||(lr={})),c.extendClassProps(lr.prototype,lr.createDefaultProps);function OS(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 yv extends c.HasOwner{constructor(e){super(e);L(this,"_valid",!1);L(this,"_normal",new b.Cartesian3(0,0,0));L(this,"_origin",new b.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=oi(e);return r0(this.scene,i,this.normal,o)}}class GV extends yv{constructor(n){super(n);{const e=()=>{const o=lt({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(c.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class WV extends yv{constructor(n){super(n);const e=()=>{const i=lt({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=lt({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:b.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 jV extends yv{constructor(n){super(n);const e=()=>{const i=lt({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=lt({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:b.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 Oa extends c.Destroyable{constructor(e){super();L(this,"_czmTexture");L(this,"_customPrimitiveForCircle");L(this,"_circleCanvas");L(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ft(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(c.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const a=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,A=this.color,h=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, ${A[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${A[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=h,u.stroke();{u.lineWidth=1,u.beginPath();let d=b.Math.zeroToTwoPi(l.startRotation),m=b.Math.zeroToTwoPi(l.endRotation);m<d&&(m+=b.Math.TWO_PI),(d!==m||d!==0)&&(u.moveTo(128,128),u.arc(128,128,64,d,m,m-d>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=b.Math.negativePiToPi(l.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,b.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const v=`${(b.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var p=u.measureText(v).width;u.translate(128,128),u.rotate(Math.PI*.5),f=b.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(i.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(v,128-p*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};a();const s=this.ad(c.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(s.don(a)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(a))}{const r=()=>{const s=lt({rotation:this.selfRotation});if(!s)return;const l=lt({position:this.position,rotation:this.rotation,localModelMatrix:b.Matrix4.toArray(s)});if(!l)return;const{viewer:u}=e;if(!u)return;const A=b.Cartesian3.dot(u.scene.camera.directionWC,new b.Cartesian3(l[8],l[9],l[10]));i.value=A>0};r();const a=this.ad(c.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(a.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(qV(e)),this.dispose(c.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(c.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(c.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(c.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=lt({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&b.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(KV(e)),this.dispose(c.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([this._debugAxis,"position"],[this,"position"])),this.dispose(c.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(c.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=lt({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&b.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(Oa,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,color:c.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(Oa||(Oa={})),c.extendClassProps(Oa.prototype,Oa.createDefaultProps);function qV(t){return Td({type:"CzmCustomPrimitive",allowPicking:!0,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]},ut,t)}function KV(t){return Td({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
|
|
3766
3766
|
void main()
|
|
3767
3767
|
{
|
|
3768
3768
|
// 如果这一句注释,要相应地注释掉attribute中的normal,也就是说顶点属性要和shader中的一一匹配!
|
|
@@ -3773,7 +3773,7 @@ void main()
|
|
|
3773
3773
|
{
|
|
3774
3774
|
out_FragColor = u_color;
|
|
3775
3775
|
}
|
|
3776
|
-
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},ut,t)}class KV extends c.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 a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.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=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[di.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(c.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:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const h=A.pick(l);if(!h||!this.owner.cartesian)return;const f=b.Cartesian3.subtract(i.currentV,this.owner.cartesian,new b.Cartesian3);b.Cartesian3.normalize(f,f);const p=b.Cartesian3.subtract(h,this.owner.cartesian,new b.Cartesian3);if(b.Cartesian3.normalize(p,p),!A.normal||!A.origin)return;const d=vv(f,p,A.normal),m=vv(A.origin,f,A.normal),v=vv(A.origin,p,A.normal);{const y=[...this.owner.selfRotation];y[di.rotationNum[u]]=i.startRotation+d,this.owner.selfRotation=y,o.circleStartRotation=m,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 c.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=b.Cartesian3.distance(a,l),A=r/4,h=A*3/128;if(!(u>=A-h&&u<=A+h))return;const p=b.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=p||(n.currentPlaneType=i,n.currentD2c=p,n.currentV=l,n.startRotation=s[di.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Ni(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function vv(t,n,e){const i=b.Cartesian3.cross(n,t,new b.Cartesian3);if(i.equals(b.Cartesian3.ZERO))return 0;b.Cartesian3.normalize(i,i);const o=b.Cartesian3.dot(i,e);let r=Math.acos(b.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const ds=class ds extends Qn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(c.react("none")));L(this,"_movingPlaneType",this.disposeVar(c.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new HV(this)),pitch:this.disposeVar(new GV(this)),roll:this.disposeVar(new WV(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new KV(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&&rt(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 Wt(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(c.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(c.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(c.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=lt({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=b.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 Oa(e));this.dispose(c.track([o,"position"],[this,"position"])),this.dispose(c.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([o,"debug"],[this,"debug"])),this.dispose(c.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=ds.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[ds.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[ds.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(ds,"rotationNum",{heading:0,pitch:1,roll:2}),L(ds,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let di=ds;(t=>{t.createDefaultProps=()=>({...Qn.createDefaultProps(),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(di||(di={})),c.extendClassProps(di.prototype,di.createDefaultProps);const ps=class ps extends c.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??ps.defaults.positions[0],this.stopPosition??ps.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??ps.defaults.positions[0],n??ps.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Ye(n,e));o.arcType="RHUMB";const r=this.ad(new Wn(n,e));this.ad(c.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(c.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};L(ps,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let rs=ps;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(t.defaults.positions),width:10,color:c.reactArray([1,0,0,1])})})(rs||(rs={})),c.extendClassProps(rs.prototype,rs.createDefaultProps);class ur extends Qn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.disposeVar(c.react("none")),originPosition:this.disposeVar(c.reactArray([0,0,0])),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new b.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!ys(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;fo(s,a),this._opInfo.constraintMode.value==="x"?mo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?mo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let h=this.scale[0],f=this.scale[1];const p=c.geoDistance(A,this._opInfo.originPosition.value)-c.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const d=this._opInfo.originDimensions.value[0]/100;p!=0&&this._opInfo.constraintMode.value==="y"&&(p>0?h+=d:h-=d),p!=0&&this._opInfo.constraintMode.value==="x"&&(p>0?f+=d:f-=d),h<=0&&(h+=d),f<=0&&(f+=d),this.scale=[h??1,f??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new c.Processing(()=>{const i=new b.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!Sh(e.viewer.scene,rt(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(De(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const h=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=h:u-=h),u<=0&&(u+=h),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Cd(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 r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=ur.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[h,f,p]=s;l.stopPosition=[h,f,p+this._opInfo.originDimensions.value[2]];const d=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);d&&(A.stopPosition=d);const m=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);m&&(u.stopPosition=m)};r();const a=this.ad(c.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{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((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??ur.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const p={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Ad(f,o,p,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(c.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(f,async p=>{p.disposer.dispose((s(),this.positionChanged.disposableOn(s))),p.disposer.dispose(e.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&u(d.pointerEvent)})),await c.step(p,d=>new Promise((m,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&m()}))}))}),this._opInfo.step.value=!1,await c.step(f,async p=>{if(e.incrementDisabledInputStack(),p.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const d=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),m=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,d,m),p.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),p.disposer.dispose(()=>a.cancel()));await c.step(p,d=>new Promise((m,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerUpEvent.don(()=>{m()})),d.disposer.dispose(e.pointerOutEvent.don(()=>{m()}))})),this._lastPosition=void 0}),A.restart()})),h=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};h(),this.dispose(this.enabledChanged.disposableOn(h))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new rs(e));return o.width=10,this.ad(c.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Qn.createDefaultProps(),scale:c.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(ur||(ur={})),c.extendClassProps(ur.prototype,ur.createDefaultProps);const Ao=class Ao extends Fn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new c.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(c.react(!1)));L(this,"_status",this.disposeVar(c.react("None")));L(this,"_positionsChanged",this.ad(new c.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:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).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(()=>{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??Ao.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((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??Ao.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 Ye(e));this.ad(c.track([i,"color"],[this,"polylineColor"])),this.ad(c.track([i,"width"],[this,"polylineWidth"])),this.ad(c.track([i,"show"],[this,"polylineShow"])),this.ad(c.track([i,"arcType"],[this,"polylineArcType"])),this.ad(c.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new c.CursorInfo(e.container,c.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(Ao,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(Ao,"defaults",{...Fn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:Ao.baseImageUrl+"point-green.png",otherControlPointImageUrl:Ao.baseImageUrl+"point-yellow.png"});let ei=Ao;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:c.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})})(ei||(ei={})),c.extendClassProps(ei.prototype,ei.createDefaultProps);let ZV=0;class LS extends c.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_id",ZV++);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 Es(e.czmViewer));o.enabled=!1,this.ad(c.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??ei.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ei.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 zS extends LS{constructor(n,e){super(n,e)}}class Pt extends ei{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new c.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Li(e));i.enabled=!1,this.currentProcess=this.disposeVar(c.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(c.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.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 zS(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=c.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(c.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new $V(this,r)));const A=s.disposer.disposeVar(new YV(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(h=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,h(!0)):h(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,h(!0)):h(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>h(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps()})})(Pt||(Pt={})),c.extendClassProps(Pt.prototype,Pt.createDefaultProps);class $V extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));const{placeEditing:o}=e;let r=new zS(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Pt.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(c.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!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 XV(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 YV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_doEvent",this.disposeVar(new c.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(XV(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 kS extends Pt{constructor(n){super(n),this.loop=!1}}class QS extends Pt{constructor(n){super(n),this.loop=!0}}class Kf extends LS{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 yi(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=()=>{i.enabled=i.show=!1},r=()=>{var p;if(!(n.enabled??tt.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??tt.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(p=s.get((a+1)%l))==null?void 0:p.position;if(!A)return o();const h=md(u,A);if(!h)return o();h[2]-=n.czmViewer.editingHeightOffset??0,i.position=h;const f=l<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}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 a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new Kf(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class tt extends ei{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"translationEditing");{const r=this.ad(c.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new c.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new JV(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new lr(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(c.step(r,async s=>{const l=s.disposer,u=l.ad(new e3(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>u.modify(h))),await s.promise(new Promise(h=>{l.dispose(u.overEvent.disposableOnce(f=>{h(f)}))}))})),a===-1)(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");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 l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const h=this.editingPoints.get(u).position;if(!h)return;const f=md(l,h);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let p=new Kf(this,f);this.editingPoints.splice(a,0,p),await o(r,a)}};this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),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 Kf(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),c.extendClassProps(tt.prototype,tt.createDefaultProps);class JV extends c.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 a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class e3 extends c.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.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=a=>{o(),e.status="Modifying_Point",i=new t3(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),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 t3 extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.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(c.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class VS extends tt{constructor(n){super(n),this.loop=!1}}class NS extends tt{constructor(n){super(n),this.loop=!0}}class La 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=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,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=c.geoHeading(this.startPosition,this.endPosition),o=c.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],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([90,0,0]),distance:c.react(1)})})(La||(La={})),c.extendClassProps(La.prototype,La.createDefaultProps);class os 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=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,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=()=>{var s;if(!((s=this.positions)!=null&&s.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return 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;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=c.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=c.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),distance:c.react(0)})})(os||(os={})),c.extendClassProps(os.prototype,os.createDefaultProps);class HS extends Pt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class GS extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class za 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 ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(za||(za={})),c.extendClassProps(za.prototype,za.createDefaultProps);class ka 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 ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(ka||(ka={})),c.extendClassProps(ka.prototype,ka.createDefaultProps);class WS extends os{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 cn extends c.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_currentEditing",this.disposeVar(c.react(void 0)));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;else this.currentEditing instanceof Li&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const oh=class oh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Li(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),i.enabled=!i.position||c.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};L(oh,"type",oh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Place,oh));let wv=oh;const sh=class sh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new di(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(c.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};L(sh,"type",sh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Rotation,sh));let bv=sh;const ah=class ah extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ur(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};L(ah,"type",ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.Scale,ah));let xv=ah;const lh=class lh extends cn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new lr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=c.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=wn({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=wn({originPosition:a},[u.position])[0][0];u.position=_r({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=wn({originPosition:a},u.points)[0];u.points=_r({originPosition:a},A.map(h=>[h[0]+s[0],h[1]+s[1],h[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(c.bind([i,"position"],[n,"position"]));else if(n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=c.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=wn({originPosition:a},[r])[0][0];const l=wn({originPosition:a},o.points)[0];o.points=_r({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};L(lh,"type",lh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Translation,lh));let Zf=lh;const uh=class uh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new La(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(c.bind([i,"startPosition"],[o,"position"])),this.ad(Dt([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(c.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(c.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(c.bind([i,"distance"],[o,"distance"]));else{const r=rt(o.position);if(b.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Ni(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!c.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(uh,"type",uh.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsAppend,uh));let _v=uh;const ch=class ch extends cn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new os(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(c.bind([i,"startPosition"],[r,"position"])),this.ad(Dt([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(c.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(c.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(c.bind([i,"distance"],[r,"distance"]));else{const a=rt(r.position);if(b.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Ni(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(c.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(ch,"type",ch.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsModify,ch));let Cv=ch;const hh=class hh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new QS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};L(hh,"type",hh.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularAppend,hh));let Sv=hh;const Ah=class Ah extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new NS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};L(Ah,"type",Ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularInsert,Ah));let Ev=Ah;const fh=class fh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new kS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};L(fh,"type",fh.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringAppend,fh));let Pv=fh;const dh=class dh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new VS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};L(dh,"type",dh.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringInsert,dh));let Bv=dh;const ph=class ph extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new HS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};L(ph,"type",ph.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterAppend,ph));let Tv=ph;const mh=class mh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new GS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};L(mh,"type",mh.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterModify,mh));let Iv=mh;const gh=class gh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new za(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};L(gh,"type",gh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityAppend,gh));let Fv=gh;const yh=class yh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ka(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};L(yh,"type",yh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityModify,yh));let Mv=yh;const vh=class vh extends cn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new WS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof c.ESClassification||r instanceof c.ESPolygonFence;let A=c.getMinMaxCorner(r.points).center,h=[...A],f=u?r.points[0][2]:0;l?a?h[2]=r.extrudedHeight:h[2]=r.height+f:(s&&(A[2]=r.height),a&&(h[2]=r.extrudedHeight)),i.startPosition=A,i.distance=h[2]-A[2],i.moveWithFirstPosition=!1;let p=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(d=>[d[0],d[1],d[2]+i.positions[0][2]-p[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),p=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(vh,"type",vh.registerEditing("ESCesiumViewer",c.ESJEditingMode.HeightModify,vh));let Dv=vh;const Ht=class Ht extends c.Destroyable{constructor(e,i,o,r=!0){super();L(this,"czmViewer");L(this,"sceneObject");L(this,"editingModes",[]);L(this,"editingID");L(this,"useKeyToSwitch");L(this,"currentIndex",0);L(this,"currentEditingMode");L(this,"currentEditingWrapper");L(this,"_notSupportedEditCount",this.disposeVar(c.react(0)));L(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&c.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Ht.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Ht.KEY_ESCAPE&&Ht.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Ht.MOUSE_LEFT&&c.nextAnimateFrame(()=>{Ht.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Ht.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Ht.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const i=c.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Ht.stop(),Ht.esEditModeInstance=new Ht(e,i,o,r)}static stop(){const e=Ht.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Ht.esEditModeInstance=void 0}};L(Ht,"KEY_ESCAPE","Escape"),L(Ht,"KEY_SPACE","Space"),L(Ht,"MOUSE_LEFT",0),L(Ht,"esEditModeInstance");let $f=Ht;function jS(){const t=c.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new Zf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class n3 extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n,c.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof c.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(c.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class i3 extends c.Destroyable{constructor(e){super();L(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new c.ESSceneObjectWithId));this.dispose(c.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new c.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new n3(e,i)}))}}class r3 extends c.Destroyable{constructor(n){super(),this.dv(new c.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new o3(n)}))}}class o3 extends c.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(c.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new c.ObjResettingWithEvent(r,()=>{if(o)return new s3(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=c.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof c.ESExcavate?c.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof c.ESHole&&c.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class s3 extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=c.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof c.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof c.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class a3 extends c.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class l3 extends c.Destroyable{constructor(e){var a;super();L(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Vo(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},at.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},at.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function u3(t,n){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...n??{}},i=new b.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(b.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(b.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=b.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:b.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[b.CameraEventType.WHEEL,b.CameraEventType.PINCH,{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[b.CameraEventType.MIDDLE_DRAG,b.CameraEventType.PINCH,{eventType:b.CameraEventType.LEFT_DRAG,modifier:b.KeyboardEventModifier.CTRL},{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(b.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(b.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function c3(){b.Cesium3DTile.prototype.updateTransform=function(t,n){t=t??b.Matrix4.IDENTITY;const e=b.Matrix4.multiplyTransformation(t,this.transform,new b.Matrix4),i=!b.Matrix4.equals(e,this.computedTransform),o=b.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&b.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),b.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),b.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function h3(){Reflect.getOwnPropertyDescriptor(b.Camera.prototype,"_currentFlight")||Object.defineProperties(b.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new b.Event),this._vtxf_currentFlightEvent}}})}function A3(){const t=new b.Matrix4;function n(i,o){const r=i.positionWC;b.Matrix4.clone(i.transform,t),i.lookAtTransform(b.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;b.Camera.prototype.lookLeft=function(i){i=i??e,this._mode!==b.SceneMode.SCENE2D&&n(this,-i)},b.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function f3(){if(!b.DepthPlane.xbsjFixed){b.DepthPlane.xbsjFixed=!0;var t=b.DepthPlane.prototype.update;b.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:b.PrimitiveType.TRIANGLES});this._va=b.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:b.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function d3(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defined,o=t.OrientedBoundingBox,r=t.Rectangle,a=t.TaskProcessor,s=t.TerrainData,l=t.TerrainEncoding,u=t.TerrainMesh,A=t.GoogleEarthEnterpriseTerrainData,h="createVerticesFromGoogleEarthEnterpriseBuffer",f=new a(h),p=new a(h,s.maximumAsynchronousTasks),d=new r,m=new r;A.prototype.createMesh=function(v){v=v??Xe.Frozen.EMPTY_OBJECT;const y=v.tilingScheme,g=v.x,_=v.y,x=v.level,E=v.exaggeration??1,B=v.exaggerationRelativeHeight??0,P=v.throttle??!0,I=y.ellipsoid;y.tileXYToNativeRectangle(g,_,x,d),y.tileXYToRectangle(g,_,x,m);const D=I.cartographicToCartesian(r.center(m));this._skirtHeight=1.9134410999999999e6;const S=(P?p:f).scheduleTask({buffer:this._buffer,nativeRectangle:d,rectangle:r.clone(m),relativeToCenter:D,ellipsoid:I,skirtHeight:this._skirtHeight,exaggeration:E,exaggerationRelativeHeight:B,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!i(S))return;const T=this;return S.then(function(w){return T._mesh=new u(D,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,n.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),l.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),T._minimumHeight=w.minimumHeight,T._maximumHeight=w.maximumHeight,T._buffer=void 0,T._mesh})}}function p3(){return b.VERSION.split(".").map(n=>parseInt(n))}let Rv;function m3(){return Rv||(Rv=p3()),Rv}function g3(){const t=m3();t[0]===1&&t[1]>=92?d3(b):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function y3(){const t=b.Resource.prototype.fetchJson,n=b.Resource.prototype.fetchArrayBuffer;b.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},b.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function v3(){const t=b.ModelSceneGraph.prototype.buildDrawCommands;b.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=b.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function w3(){const t=b.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const b3=`#ifdef GL_OES_standard_derivatives
|
|
3776
|
+
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},ut,t)}class ZV extends c.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 a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.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=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[di.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(c.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:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const h=A.pick(l);if(!h||!this.owner.cartesian)return;const f=b.Cartesian3.subtract(i.currentV,this.owner.cartesian,new b.Cartesian3);b.Cartesian3.normalize(f,f);const p=b.Cartesian3.subtract(h,this.owner.cartesian,new b.Cartesian3);if(b.Cartesian3.normalize(p,p),!A.normal||!A.origin)return;const d=vv(f,p,A.normal),m=vv(A.origin,f,A.normal),v=vv(A.origin,p,A.normal);{const y=[...this.owner.selfRotation];y[di.rotationNum[u]]=i.startRotation+d,this.owner.selfRotation=y,o.circleStartRotation=m,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 c.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=b.Cartesian3.distance(a,l),A=r/4,h=A*3/128;if(!(u>=A-h&&u<=A+h))return;const p=b.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=p||(n.currentPlaneType=i,n.currentD2c=p,n.currentV=l,n.startRotation=s[di.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Ni(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function vv(t,n,e){const i=b.Cartesian3.cross(n,t,new b.Cartesian3);if(i.equals(b.Cartesian3.ZERO))return 0;b.Cartesian3.normalize(i,i);const o=b.Cartesian3.dot(i,e);let r=Math.acos(b.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const ds=class ds extends Qn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(c.react("none")));L(this,"_movingPlaneType",this.disposeVar(c.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new GV(this)),pitch:this.disposeVar(new WV(this)),roll:this.disposeVar(new jV(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new ZV(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&&rt(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 Wt(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(c.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(c.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(c.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=lt({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=b.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 Oa(e));this.dispose(c.track([o,"position"],[this,"position"])),this.dispose(c.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([o,"debug"],[this,"debug"])),this.dispose(c.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=ds.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[ds.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[ds.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(ds,"rotationNum",{heading:0,pitch:1,roll:2}),L(ds,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let di=ds;(t=>{t.createDefaultProps=()=>({...Qn.createDefaultProps(),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(di||(di={})),c.extendClassProps(di.prototype,di.createDefaultProps);const ps=class ps extends c.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??ps.defaults.positions[0],this.stopPosition??ps.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??ps.defaults.positions[0],n??ps.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Ye(n,e));o.arcType="RHUMB";const r=this.ad(new Wn(n,e));this.ad(c.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(c.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};L(ps,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let rs=ps;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(t.defaults.positions),width:10,color:c.reactArray([1,0,0,1])})})(rs||(rs={})),c.extendClassProps(rs.prototype,rs.createDefaultProps);class ur extends Qn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.disposeVar(c.react("none")),originPosition:this.disposeVar(c.reactArray([0,0,0])),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new b.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!ys(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;fo(s,a),this._opInfo.constraintMode.value==="x"?mo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?mo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let h=this.scale[0],f=this.scale[1];const p=c.geoDistance(A,this._opInfo.originPosition.value)-c.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const d=this._opInfo.originDimensions.value[0]/100;p!=0&&this._opInfo.constraintMode.value==="y"&&(p>0?h+=d:h-=d),p!=0&&this._opInfo.constraintMode.value==="x"&&(p>0?f+=d:f-=d),h<=0&&(h+=d),f<=0&&(f+=d),this.scale=[h??1,f??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new c.Processing(()=>{const i=new b.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!Sh(e.viewer.scene,rt(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(De(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const h=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=h:u-=h),u<=0&&(u+=h),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new Cd(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 r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=ur.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[h,f,p]=s;l.stopPosition=[h,f,p+this._opInfo.originDimensions.value[2]];const d=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);d&&(A.stopPosition=d);const m=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);m&&(u.stopPosition=m)};r();const a=this.ad(c.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{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((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??ur.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const p={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};Ad(f,o,p,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(c.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(f,async p=>{p.disposer.dispose((s(),this.positionChanged.disposableOn(s))),p.disposer.dispose(e.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&u(d.pointerEvent)})),await c.step(p,d=>new Promise((m,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&m()}))}))}),this._opInfo.step.value=!1,await c.step(f,async p=>{if(e.incrementDisabledInputStack(),p.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const d=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),m=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,d,m),p.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),p.disposer.dispose(()=>a.cancel()));await c.step(p,d=>new Promise((m,v)=>{d.disposer.dispose(v),d.disposer.dispose(e.pointerUpEvent.don(()=>{m()})),d.disposer.dispose(e.pointerOutEvent.don(()=>{m()}))})),this._lastPosition=void 0}),A.restart()})),h=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};h(),this.dispose(this.enabledChanged.disposableOn(h))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new rs(e));return o.width=10,this.ad(c.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Qn.createDefaultProps(),scale:c.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(ur||(ur={})),c.extendClassProps(ur.prototype,ur.createDefaultProps);const Ao=class Ao extends Fn{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new c.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(c.react(!1)));L(this,"_status",this.disposeVar(c.react("None")));L(this,"_positionsChanged",this.ad(new c.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:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).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(()=>{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??Ao.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((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??Ao.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 Ye(e));this.ad(c.track([i,"color"],[this,"polylineColor"])),this.ad(c.track([i,"width"],[this,"polylineWidth"])),this.ad(c.track([i,"show"],[this,"polylineShow"])),this.ad(c.track([i,"arcType"],[this,"polylineArcType"])),this.ad(c.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new c.CursorInfo(e.container,c.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(Ao,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(Ao,"defaults",{...Fn.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:Ao.baseImageUrl+"point-green.png",otherControlPointImageUrl:Ao.baseImageUrl+"point-yellow.png"});let ei=Ao;(t=>{t.createDefaultProps=()=>({...Fn.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:c.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})})(ei||(ei={})),c.extendClassProps(ei.prototype,ei.createDefaultProps);let $V=0;class LS extends c.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_id",$V++);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 Es(e.czmViewer));o.enabled=!1,this.ad(c.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??ei.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ei.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 zS extends LS{constructor(n,e){super(n,e)}}class Pt extends ei{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new c.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Li(e));i.enabled=!1,this.currentProcess=this.disposeVar(c.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(c.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.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 zS(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=c.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(c.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new XV(this,r)));const A=s.disposer.disposeVar(new JV(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(h=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,h(!0)):h(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,h(!0)):h(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>h(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps()})})(Pt||(Pt={})),c.extendClassProps(Pt.prototype,Pt.createDefaultProps);class XV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));const{placeEditing:o}=e;let r=new zS(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Pt.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(c.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!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 YV(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 JV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_doEvent",this.disposeVar(new c.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(YV(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 kS extends Pt{constructor(n){super(n),this.loop=!1}}class QS extends Pt{constructor(n){super(n),this.loop=!0}}class Kf extends LS{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 yi(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=()=>{i.enabled=i.show=!1},r=()=>{var p;if(!(n.enabled??tt.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??tt.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(p=s.get((a+1)%l))==null?void 0:p.position;if(!A)return o();const h=md(u,A);if(!h)return o();h[2]-=n.czmViewer.editingHeightOffset??0,i.position=h;const f=l<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}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 a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new Kf(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class tt extends ei{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"translationEditing");{const r=this.ad(c.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new c.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new e3(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new lr(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(c.step(r,async s=>{const l=s.disposer,u=l.ad(new t3(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>u.modify(h))),await s.promise(new Promise(h=>{l.dispose(u.overEvent.disposableOnce(f=>{h(f)}))}))})),a===-1)(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");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 l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const h=this.editingPoints.get(u).position;if(!h)return;const f=md(l,h);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let p=new Kf(this,f);this.editingPoints.splice(a,0,p),await o(r,a)}};this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),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 Kf(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),c.extendClassProps(tt.prototype,tt.createDefaultProps);class e3 extends c.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 a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class t3 extends c.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.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=a=>{o(),e.status="Modifying_Point",i=new n3(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),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 n3 extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.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(c.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class VS extends tt{constructor(n){super(n),this.loop=!1}}class NS extends tt{constructor(n){super(n),this.loop=!0}}class La 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=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,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=c.geoHeading(this.startPosition,this.endPosition),o=c.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],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([90,0,0]),distance:c.react(1)})})(La||(La={})),c.extendClassProps(La.prototype,La.createDefaultProps);class os 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=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,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=()=>{var s;if(!((s=this.positions)!=null&&s.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return 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;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=c.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=c.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),distance:c.react(0)})})(os||(os={})),c.extendClassProps(os.prototype,os.createDefaultProps);class HS extends Pt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class GS extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class za 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 ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Pt.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(za||(za={})),c.extendClassProps(za.prototype,za.createDefaultProps);class ka 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 ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(ka||(ka={})),c.extendClassProps(ka.prototype,ka.createDefaultProps);class WS extends os{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 cn extends c.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_currentEditing",this.disposeVar(c.react(void 0)));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;else this.currentEditing instanceof Li&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const oh=class oh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Li(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),i.enabled=!i.position||c.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};L(oh,"type",oh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Place,oh));let wv=oh;const sh=class sh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new di(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(c.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};L(sh,"type",sh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Rotation,sh));let bv=sh;const ah=class ah extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ur(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};L(ah,"type",ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.Scale,ah));let xv=ah;const lh=class lh extends cn{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new lr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=c.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=wn({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=wn({originPosition:a},[u.position])[0][0];u.position=_r({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=wn({originPosition:a},u.points)[0];u.points=_r({originPosition:a},A.map(h=>[h[0]+s[0],h[1]+s[1],h[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(c.bind([i,"position"],[n,"position"]));else if(n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=c.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=wn({originPosition:a},[r])[0][0];const l=wn({originPosition:a},o.points)[0];o.points=_r({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};L(lh,"type",lh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Translation,lh));let Zf=lh;const uh=class uh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new La(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(c.bind([i,"startPosition"],[o,"position"])),this.ad(Dt([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(c.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(c.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(c.bind([i,"distance"],[o,"distance"]));else{const r=rt(o.position);if(b.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Ni(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!c.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(uh,"type",uh.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsAppend,uh));let _v=uh;const ch=class ch extends cn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new os(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(c.bind([i,"startPosition"],[r,"position"])),this.ad(Dt([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(c.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(c.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(c.bind([i,"distance"],[r,"distance"]));else{const a=rt(r.position);if(b.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Ni(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(c.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(ch,"type",ch.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsModify,ch));let Cv=ch;const hh=class hh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new QS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};L(hh,"type",hh.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularAppend,hh));let Sv=hh;const Ah=class Ah extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new NS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};L(Ah,"type",Ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularInsert,Ah));let Ev=Ah;const fh=class fh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new kS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};L(fh,"type",fh.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringAppend,fh));let Pv=fh;const dh=class dh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new VS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};L(dh,"type",dh.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringInsert,dh));let Bv=dh;const ph=class ph extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new HS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};L(ph,"type",ph.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterAppend,ph));let Tv=ph;const mh=class mh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new GS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};L(mh,"type",mh.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterModify,mh));let Iv=mh;const gh=class gh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new za(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};L(gh,"type",gh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityAppend,gh));let Fv=gh;const yh=class yh extends cn{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ka(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};L(yh,"type",yh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityModify,yh));let Mv=yh;const vh=class vh extends cn{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new WS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof c.ESClassification||r instanceof c.ESPolygonFence;let A=c.getMinMaxCorner(r.points).center,h=[...A],f=u?r.points[0][2]:0;l?a?h[2]=r.extrudedHeight:h[2]=r.height+f:(s&&(A[2]=r.height),a&&(h[2]=r.extrudedHeight)),i.startPosition=A,i.distance=h[2]-A[2],i.moveWithFirstPosition=!1;let p=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(d=>[d[0],d[1],d[2]+i.positions[0][2]-p[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),p=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(vh,"type",vh.registerEditing("ESCesiumViewer",c.ESJEditingMode.HeightModify,vh));let Dv=vh;const Ht=class Ht extends c.Destroyable{constructor(e,i,o,r=!0){super();L(this,"czmViewer");L(this,"sceneObject");L(this,"editingModes",[]);L(this,"editingID");L(this,"useKeyToSwitch");L(this,"currentIndex",0);L(this,"currentEditingMode");L(this,"currentEditingWrapper");L(this,"_notSupportedEditCount",this.disposeVar(c.react(0)));L(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&c.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Ht.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Ht.KEY_ESCAPE&&Ht.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Ht.MOUSE_LEFT&&c.nextAnimateFrame(()=>{Ht.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Ht.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Ht.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const i=c.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Ht.stop(),Ht.esEditModeInstance=new Ht(e,i,o,r)}static stop(){const e=Ht.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Ht.esEditModeInstance=void 0}};L(Ht,"KEY_ESCAPE","Escape"),L(Ht,"KEY_SPACE","Space"),L(Ht,"MOUSE_LEFT",0),L(Ht,"esEditModeInstance");let $f=Ht;function jS(){const t=c.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new Zf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class i3 extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n,c.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof c.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(c.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class r3 extends c.Destroyable{constructor(e){super();L(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new c.ESSceneObjectWithId));this.dispose(c.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new c.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new i3(e,i)}))}}class o3 extends c.Destroyable{constructor(n){super(),this.dv(new c.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new s3(n)}))}}class s3 extends c.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(c.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new c.ObjResettingWithEvent(r,()=>{if(o)return new a3(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=c.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof c.ESExcavate?c.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof c.ESHole&&c.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class a3 extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=c.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof c.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof c.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class l3 extends c.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class u3 extends c.Destroyable{constructor(e){var a;super();L(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Vo(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},at.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},at.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function c3(t,n){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...n??{}},i=new b.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(b.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(b.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=b.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:b.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[b.CameraEventType.WHEEL,b.CameraEventType.PINCH,{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[b.CameraEventType.MIDDLE_DRAG,b.CameraEventType.PINCH,{eventType:b.CameraEventType.LEFT_DRAG,modifier:b.KeyboardEventModifier.CTRL},{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(b.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(b.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function h3(){b.Cesium3DTile.prototype.updateTransform=function(t,n){t=t??b.Matrix4.IDENTITY;const e=b.Matrix4.multiplyTransformation(t,this.transform,new b.Matrix4),i=!b.Matrix4.equals(e,this.computedTransform),o=b.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&b.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),b.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),b.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function A3(){Reflect.getOwnPropertyDescriptor(b.Camera.prototype,"_currentFlight")||Object.defineProperties(b.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new b.Event),this._vtxf_currentFlightEvent}}})}function f3(){const t=new b.Matrix4;function n(i,o){const r=i.positionWC;b.Matrix4.clone(i.transform,t),i.lookAtTransform(b.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;b.Camera.prototype.lookLeft=function(i){i=i??e,this._mode!==b.SceneMode.SCENE2D&&n(this,-i)},b.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function d3(){if(!b.DepthPlane.xbsjFixed){b.DepthPlane.xbsjFixed=!0;var t=b.DepthPlane.prototype.update;b.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new b.Geometry({attributes:{position:new b.GeometryAttribute({componentDatatype:b.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:b.PrimitiveType.TRIANGLES});this._va=b.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:b.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function p3(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defined,o=t.OrientedBoundingBox,r=t.Rectangle,a=t.TaskProcessor,s=t.TerrainData,l=t.TerrainEncoding,u=t.TerrainMesh,A=t.GoogleEarthEnterpriseTerrainData,h="createVerticesFromGoogleEarthEnterpriseBuffer",f=new a(h),p=new a(h,s.maximumAsynchronousTasks),d=new r,m=new r;A.prototype.createMesh=function(v){v=v??Xe.Frozen.EMPTY_OBJECT;const y=v.tilingScheme,g=v.x,_=v.y,x=v.level,E=v.exaggeration??1,B=v.exaggerationRelativeHeight??0,P=v.throttle??!0,I=y.ellipsoid;y.tileXYToNativeRectangle(g,_,x,d),y.tileXYToRectangle(g,_,x,m);const D=I.cartographicToCartesian(r.center(m));this._skirtHeight=1.9134410999999999e6;const S=(P?p:f).scheduleTask({buffer:this._buffer,nativeRectangle:d,rectangle:r.clone(m),relativeToCenter:D,ellipsoid:I,skirtHeight:this._skirtHeight,exaggeration:E,exaggerationRelativeHeight:B,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!i(S))return;const T=this;return S.then(function(w){return T._mesh=new u(D,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,n.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),l.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),T._minimumHeight=w.minimumHeight,T._maximumHeight=w.maximumHeight,T._buffer=void 0,T._mesh})}}function m3(){return b.VERSION.split(".").map(n=>parseInt(n))}let Rv;function g3(){return Rv||(Rv=m3()),Rv}function y3(){const t=g3();t[0]===1&&t[1]>=92?p3(b):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function v3(){const t=b.Resource.prototype.fetchJson,n=b.Resource.prototype.fetchArrayBuffer;b.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},b.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function w3(){const t=b.ModelSceneGraph.prototype.buildDrawCommands;b.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=b.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function b3(){const t=b.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const x3=`#ifdef GL_OES_standard_derivatives
|
|
3777
3777
|
#extension GL_OES_standard_derivatives : enable
|
|
3778
3778
|
#endif
|
|
3779
3779
|
|
|
@@ -3807,7 +3807,7 @@ material.alpha = materialInput.color.a;
|
|
|
3807
3807
|
|
|
3808
3808
|
return material;
|
|
3809
3809
|
}
|
|
3810
|
-
`;b.Material.GlobeLevelMaterialType="GlobelLevel",b.Material._materialCache.addMaterial(b.Material.GlobeLevelMaterialType,{fabric:{type:b.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new b.Cartesian3(0,0,0),input_highlights:new b.Cartesian3(1,1,1),midtones:new b.Cartesian3(.5,.5,.5),output_shadows:new b.Cartesian3(0,0,0),output_highlights:new b.Cartesian3(1,1,1)},source:b3},translucent:!1});const{PrimitiveRenderResources:x3,ModelUtility:_3,Cartesian3:ti,Matrix4:Qa,ModelRenderResources:C3,defined:S3,NodeRenderResources:E3,BoundingSphere:cr,ModelDrawCommands:P3}=b,B3=new ti,T3=new ti,qS=new ti,KS=new ti;class I3 extends x3{constructor(n,e,i){if(super(n,e),!n.runtimeNode.instancingTranslationMin||!n.runtimeNode.instancingTranslationMax)return;const o=Qa.inverse(i,new Qa),r=_3.getPositionMinMax(e.primitive,Qa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMin,qS),Qa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMax,KS));this.positionMin=ti.clone(r.min,new ti),this.positionMax=ti.clone(r.max,new ti),this.boundingSphere=cr.fromCornerPoints(this.positionMin,this.positionMax,new cr)}}function F3(){b.ModelSceneGraph.prototype.buildDrawCommands=function(t){const n=this._model,e=new C3(n);n.statistics.clear(),this.configurePipeline(t);const i=this.modelPipelineStages;let o,r,a;for(o=0;o<i.length;o++)i[o].process(e,n,t);const s=ti.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,B3),l=ti.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,T3);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!S3(u))continue;u.configurePipeline();const A=u.pipelineStages,h=new E3(e,u);for(r=0;r<A.length;r++)A[r].process(h,u.node,t);const f=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){const p=u.runtimePrimitives[r];p.configurePipeline(t);const d=p.pipelineStages,m=new I3(h,p,f);for(a=0;a<d.length;a++)d[a].process(m,p.primitive,t);p.boundingSphere=cr.clone(m.boundingSphere,new cr);const v=Qa.multiplyByPoint(f,m.positionMin,qS),y=Qa.multiplyByPoint(f,m.positionMax,KS);ti.minimumByComponent(s,v,s),ti.maximumByComponent(l,y,l);const g=P3.buildModelDrawCommand(m,t);p.drawCommand=g}}this._boundingSphere=cr.fromCornerPoints(s,l,new cr),this._boundingSphere=cr.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=cr.transform(this._boundingSphere,this._components.transform,this._boundingSphere),n._boundingSphere=cr.transform(this._boundingSphere,n.modelMatrix,n._boundingSphere),n._initialRadius=n._boundingSphere.radius,n._boundingSphere.radius*=n._clampedScale}}const wh=class wh extends c.Destroyable{constructor(){super(),b.ParticleSystem.prototype.update=function(n){const e=n.time;n.time=this._falseTime;try{wh.oldUpdate.call(this,n),this._particles.forEach(i=>{b.Billboard.prototype&&(i._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}n.time=e},this.d(()=>{b.ParticleSystem.prototype.update=wh.oldUpdate})}};L(wh,"oldUpdate",b.ParticleSystem.prototype.update);let Uv=wh;function M3(){if(b.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(b.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,b.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=b.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class D3{constructor(n){L(this,"index");L(this,"image");L(this,"resolve");L(this,"reject");L(this,"rectangle");this.index=n.index,this.image=n.image,this.resolve=n.resolve,this.reject=n.reject,this.rectangle=void 0}}function R3(){b.TextureAtlas.prototype._resize=function(t,n=0){const e=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture;let a=r.width,s=r.height;const l=this._subRegions,u=i.map((y,g)=>new D3({index:g,image:y})).filter((y,g)=>b.defined(y.image)&&!b.defined(l.get(g)));let A=0,h=0,f=0;for(let y=n;y<o.length;++y){const{width:g,height:_}=o[y].image;A=Math.max(A,g),h=Math.max(h,_),f+=g*_,u.push(o[y])}a=Math.max(A,a),s=Math.max(h,s),t.webgl2||(a=b.Math.nextPowerOfTwo(a),s=b.Math.nextPowerOfTwo(s));const p=Math.sqrt(f);s*=Math.ceil(p/s),a*=Math.ceil(p/a),u.sort(({image:y},{image:g})=>g.height*g.width-y.height*y.width);const d=new Array(this._nextIndex);for(const y of this._subRegions.keys())b.defined(l.get(y))&&(d[y]=i[y]);let m,v=!1;for(;!v;){m=new b.TexturePacker({height:s,width:a,borderPadding:e});let y;for(y=0;y<u.length;++y){const{index:g,image:_}=u[y];if(!b.defined(_))continue;const x=m.pack(g,_);if(!b.defined(x)){a>s?s*=2:a*=2;break}d[g]=x.rectangle}v=y===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(t,a,s,d),r.destroy(),this._rectangles=d,this._guid=b.createGuid()}}const oo={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:U3,Indices:O3,FeatureIdAttribute:ZS,FeatureIdTexture:$S,FeatureIdImplicitRange:XS,MorphTarget:L3,Primitive:z3,Instances:k3,Skin:Q3,Node:V3,AnimatedPropertyType:N3,AnimationSampler:H3,AnimationTarget:G3,AnimationChannel:W3,Animation:j3,ArticulationStage:q3,Articulation:K3,Asset:Z3,Scene:$3,Components:X3,MetallicRoughness:Y3,SpecularGlossiness:J3,Specular:eN,Anisotropy:Ov,Clearcoat:Lv,Material:tN}=b.ModelComponents;function nN(){b.GltfLoader.prototype.process=function(t){if(b.Check.typeOf.object("frameState",t),this._state===oo.LOADED&&!b.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=iN(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),b.defined(this._processError)){this._state=oo.FAILED;const o=this._processError;this._processError=void 0,zv(this,o)}const n=this._textureErrors.pop();if(b.defined(n)){const o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===oo.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=oo.FAILED,zv(this,o)}let i=!1;try{i=this._processTextures(t)}catch(o){this._textureState=oo.FAILED,zv(this,o)}return this._incrementallyLoadTextures?e:e&&i}}async function iN(t,n){b.FeatureDetection.supportsWebP.initialized||await b.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new b.SupportedImageFormats({webp:b.FeatureDetection.supportsWebP(),basis:n.context.supportsBasis});const e=oN(t,n);return t._state=oo.PROCESSING,t._textureState=oo.PROCESSING,b.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(b.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const rN=new b.Cartesian3;function oN(t,n){const e=t.gltfJson,i=e.extensions??b.Frozen.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(b.defined(r)){const g=r.featureTables,_=r.featureTextures,x=b.defined(g)?g:[],E=b.defined(_)?_:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(E).sort()}const s=sN(t,n),l=hN(t,s),u=AN(t,s),A=fN(e),h=dN(e,s),f=new X3,p=new Z3,d=e.asset.copyright;if(b.defined(d)){const g=d.split(";").map(function(_){return new b.Credit(_.trim())});p.credits=g}if(f.asset=p,f.scene=h,f.nodes=s,f.skins=l,f.animations=u,f.articulations=A,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,b.defined(a)){const g=b.Cartesian3.fromArray(a.center,0,rN);f.transform=b.Matrix4.fromTranslation(g,f.transform)}if(t._components=f,b.defined(o)||b.defined(r)){const g=pN(t,o,r,n);t._loaderPromises.push(g)}const m=i.NGA_gpm_local;if(b.defined(m)){const g=b.GltfGpmLoader.load(m);t._components.extensions.NGA_gpm_local=g}const v=e.meshes;if(b.defined(v))for(const g of v){const _=g.primitives;if(b.defined(_))for(const x of _){const E=x.extensions;if(b.defined(E)){const B=E.NGA_gpm_local;if(b.defined(B)){const P=mN(t,e,B,n);t._loaderPromises.push(P)}}}}const y=[];return sE(y,t._loaderPromises),t._incrementallyLoadTextures||sE(y,t._texturesPromises),Promise.all(y)}function sN(t,n){const e=t.gltfJson.nodes;if(!b.defined(e))return[];const i=e.map(function(o,r){const a=aN(t,o,n);return a.index=r,a});for(let o=0;o<i.length;++o){const r=e[o].children;if(b.defined(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function aN(t,n,e){const i=new V3;i.name=n.name,i.matrix=Vn(b.Matrix4,n.matrix),i.translation=Vn(b.Cartesian3,n.translation),i.rotation=Vn(b.Quaternion,n.rotation),i.scale=Vn(b.Cartesian3,n.scale);const o=n.extensions??b.Frozen.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations;if(b.defined(r)){if(t._loadForClassification)throw new b.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=gN(t,o,e)}b.defined(a)&&(i.articulationName=a.articulationName);const s=n.mesh;if(b.defined(s)){const l=t.gltfJson.meshes[s],u=l.primitives;for(let f=0;f<u.length;++f)i.primitives.push(lN(t,u[f],b.defined(i.instances),e));const A=n.weights??l.weights,h=i.primitives[0].morphTargets;i.morphWeights=b.defined(A)?A.slice():new Array(h.length).fill(0)}return i}function lN(t,n,e,i){const o=new z3,r=new b.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(r);const a=n.material;b.defined(a)&&(o.material=uN(t,t.gltfJson.materials[a],i));const s=n.extensions??b.Frozen.EMPTY_OBJECT;let l=!1;const u=s.CESIUM_primitive_outline;t._loadPrimitiveOutline&&b.defined(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=yN(t,u));const A=s.KHR_spz_gaussian_splats_compression;b.defined(A)&&(l=!0,r.needsGaussianSplats=!0);const h=t._loadForClassification,f=s.KHR_draco_mesh_compression;let p=!1;const d=n.attributes;if(b.defined(d))for(const B in d){if(!d.hasOwnProperty(B))continue;const P=d[B],I=kv(t,b.VertexAttributeSemantic,B),D=I.modelSemantic;if(h&&!wN(D))continue;D===b.VertexAttributeSemantic.FEATURE_ID&&(p=!0);const F=YS(t,P,I,n,f,A,e,l,i);r.attributePlans.push(F),o.attributes.push(F.attribute)}const m=n.targets;if(b.defined(m)&&!h)for(let B=0;B<m.length;++B)o.morphTargets.push(bN(t,m[B],l,r,i));const v=n.indices;if(b.defined(v)){const B=xN(t,v,n,f,p,l,i);b.defined(B)&&(r.indicesPlan=B,o.indices=B.indices)}const y=s.EXT_structural_metadata,g=s.EXT_mesh_features,_=s.EXT_feature_metadata,x=b.defined(_);b.defined(g)?_N(t,o,g,i):x&&CN(t,o,_,i),b.defined(y)?SN(o,y):x&&EN(t,o,_);const E=n.mode;if(h&&E!==b.PrimitiveType.TRIANGLES)throw new b.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function uN(t,n,e){const i=new tN,o=n.extensions??b.Frozen.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=n.pbrMetallicRoughness;return i.unlit=b.defined(o.KHR_materials_unlit),b.defined(r)?i.specularGlossiness=cN(t,r,e):(b.defined(u)&&(i.metallicRoughness=PN(t,u,e)),b.defined(a)&&!i.unlit&&(i.specular=BN(t,a,e)),b.defined(s)&&!i.unlit&&(i.anisotropy=TN(t,s,e)),b.defined(l)&&!i.unlit&&(i.clearcoat=IN(t,l,e))),b.defined(n.emissiveTexture)&&(i.emissiveTexture=dn(t,n.emissiveTexture,e,void 0)),b.defined(n.normalTexture)&&!t._loadForClassification&&(i.normalTexture=dn(t,n.normalTexture,e,void 0)),b.defined(n.occlusionTexture)&&(i.occlusionTexture=dn(t,n.occlusionTexture,e,void 0)),i.emissiveFactor=Vn(b.Cartesian3,n.emissiveFactor),i.alphaMode=n.alphaMode,i.alphaCutoff=n.alphaCutoff,i.doubleSided=n.doubleSided,i.name=n.name,i}function cN(t,n,e){const{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=n,l=new J3;return b.defined(i)&&(l.diffuseTexture=dn(t,i,e,void 0)),b.defined(o)&&(l.specularGlossinessTexture=dn(t,o,e,void 0)),l.diffuseFactor=Vn(b.Cartesian4,r),l.specularFactor=Vn(b.Cartesian3,a),l.glossinessFactor=s,l}function zv(t,n){throw t.unload(),t.getError("Failed to load glTF",n)}function hN(t,n){const e=t.gltfJson.skins;if(t._loadForClassification||!b.defined(e))return[];const i=e.map(function(r,a){const s=FN(t,r,n);return s.index=a,s}),o=t.gltfJson.nodes;for(let r=0;r<n.length;++r){const a=o[r].skin;b.defined(a)&&(n[r].skin=i[a])}return i}function AN(t,n){const e=t.gltfJson.animations;return t._loadForClassification||!b.defined(e)?[]:e.map(function(o,r){const a=MN(t,o,n);return a.index=r,a})}function fN(t){var i;const e=(i=(t.extensions??b.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:i.articulations;return b.defined(e)?e.map(DN):[]}function dN(t,n){const e=new $3,i=RN(t);return e.nodes=i.map(function(o){return n[o]}),e}async function pN(t,n,e,i){const o=new b.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:n,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function mN(t,n,e,i){const o=new b.GltfMeshPrimitiveGpmLoader({gltf:n,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Vn(t,n){if(b.defined(n))return t===Number?n[0]:t.unpack(n)}function gN(t,n,e){const i=n.EXT_mesh_gpu_instancing,o=new k3,r=i.attributes;if(b.defined(r))for(const u in r){if(!r.hasOwnProperty(u))continue;const A=r[u];o.attributes.push(UN(t,A,r,u,e))}const a=i.extensions??b.Frozen.EMPTY_OBJECT,s=n.EXT_instance_features,l=a.EXT_feature_metadata;return b.defined(s)?ON(o,s):b.defined(l)&&LN(t.gltfJson,o,l,t._sortedPropertyTableIds),o}function yN(t,n){const e=n.indices,i=t.gltfJson.accessors[e];return Xf(t,i,!1)}const vN={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function kv(t,n,e){let i=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(i="_FEATURE_ID_0");const o=n.fromGltfSemantic(i),r=vN;return r.gltfSemantic=e,r.renamedSemantic=i,r.modelSemantic=o,r}function wN(t){const n=t===b.VertexAttributeSemantic.POSITION,e=t===b.VertexAttributeSemantic.FEATURE_ID,i=t===b.VertexAttributeSemantic.TEXCOORD;return n||e||i}function YS(t,n,e,i,o,r,a,s,l){const u=e.modelSemantic,A=u===b.VertexAttributeSemantic.POSITION,h=u===b.VertexAttributeSemantic.FEATURE_ID,f=A&&!a&&t._loadAttributesFor2D&&!l.scene3DOnly,p=A&&t._enablePick&&!l.context.webgl2,d=t._loadForClassification&&h,m=t._loadAttributesAsTypedArray,v=!m,y=m||f||p||d,x=JS(t,n,e,i,o,r,s?!1:v,s?!0:y,l),E=new b.PrimitiveLoadPlan.AttributeLoadPlan(x);return E.loadBuffer=v,E.loadTypedArray=y,E}function bN(t,n,e,i,o){const r=new L3,a=void 0,s=void 0,l=void 0,u=!1;for(const A in n){if(!n.hasOwnProperty(A))continue;const h=n[A],f=kv(t,VertexAttributeSemantic,A),p=YS(t,h,f,a,s,l,u,e,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function xN(t,n,e,i,o,r,a){const s=t.gltfJson.accessors[n],l=s.bufferView;if(!b.defined(i)&&!b.defined(l))return;const u=new O3;u.count=s.count;const A=t._loadAttributesAsTypedArray,h=(t._loadIndicesForWireframe||t._enablePick)&&!a.context.webgl2,f=t._loadForClassification&&o,d=!A,m=A||h||f,g=zN(t,n,e,i,r?!1:d,r?!0:m,a),_=t._geometryLoaders.length;t._geometryLoaders.push(g);const x=g.load();t._loaderPromises.push(x),t._geometryCallbacks[_]=()=>{u.indexDatatype=g.indexDatatype,u.buffer=g.buffer,u.typedArray=g.typedArray};const E=new b.PrimitiveLoadPlan.IndicesLoadPlan(u);return E.loadBuffer=d,E.loadTypedArray=m,E}function _N(t,n,e,i){let o;b.defined(e)&&b.defined(e.featureIds)?o=e.featureIds:o=[];for(let r=0;r<o.length;r++){const a=o[r],s=`featureId_${r}`;let l;b.defined(a.texture)?l=kN(t,a,i,s):b.defined(a.attribute)?l=eE(a,s):l=tE(a,s),n.featureIds.push(l)}}function CN(t,n,e,i){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let r=0;const a=e.featureIdAttributes;if(b.defined(a))for(let l=0;l<a.length;++l){const u=a[l],A=u.featureTable,h=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,p=`featureId_${r}`;r++;let d;b.defined(u.featureIds.attribute)?d=nE(u,h,f,p):d=iE(u,h,f,p),n.featureIds.push(d)}const s=e.featureIdTextures;if(b.defined(s))for(let l=0;l<s.length;++l){const u=s[l],A=u.featureTable,h=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,p=`featureId_${r}`;r++;const d=QN(t,u,h,i,f,p);n.featureIds.push(d)}}function SN(t,n){if(!b.defined(n))return;const{propertyTextures:e,propertyAttributes:i}=n;b.defined(e)&&(t.propertyTextureIds=e),b.defined(i)&&(t.propertyAttributeIds=i)}function EN(t,n,e){b.defined(e.featureTextures)&&(n.propertyTextureIds=e.featureTextures.map(function(i){return t._sortedFeatureTextureIds.indexOf(i)}))}function PN(t,n,e){const{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=n,l=new Y3;return b.defined(i)&&(l.baseColorTexture=dn(t,i,e,void 0)),b.defined(o)&&(l.metallicRoughnessTexture=dn(t,o,e,void 0)),l.baseColorFactor=Vn(b.Cartesian4,r),l.metallicFactor=a,l.roughnessFactor=s,l}function BN(t,n,e){const{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=n,s=new eN;return b.defined(o)&&(s.specularTexture=dn(t,o,e,void 0)),b.defined(a)&&(s.specularColorTexture=dn(t,a,e,void 0)),s.specularFactor=i,s.specularColorFactor=Vn(b.Cartesian3,r),s}function TN(t,n,e){const{anisotropyStrength:i=Ov.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Ov.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=n,a=new Ov;return b.defined(r)&&(a.anisotropyTexture=dn(t,r,e,void 0)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function IN(t,n,e){const{clearcoatFactor:i=Lv.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Lv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=n,l=new Lv;return b.defined(o)&&(l.clearcoatTexture=dn(t,o,e,void 0)),b.defined(a)&&(l.clearcoatRoughnessTexture=dn(t,a,e,void 0)),b.defined(s)&&(l.clearcoatNormalTexture=dn(t,s,e,void 0)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function dn(t,n,e,i){const o=t.gltfJson,r=b.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:n.index,supportedImageFormats:t._supportedImageFormats});if(!b.defined(r))return;const a=b.ResourceCache.getTextureLoader({gltf:o,textureInfo:n,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),s=b.GltfLoaderUtil.createModelTextureReader({textureInfo:n}),l=t._textureLoaders.length;t._textureLoaders.push(a);const u=a.load().catch(A=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw A;t._textureState=oo.FAILED,t._textureErrors.push(A)}});return t._texturesPromises.push(u),t._textureCallbacks[l]=()=>{s.texture=a.texture,b.defined(i)&&(s.texture.sampler=i)},s}function FN(t,n,e){const i=new Q3,o=n.joints;i.joints=o.map(a=>e[a]);const r=n.inverseBindMatrices;if(b.defined(r)){const a=t.gltfJson.accessors[r];i.inverseBindMatrices=Xf(t,a,void 0)}else i.inverseBindMatrices=new Array(o.length).fill(b.Matrix4.IDENTITY);return i}function MN(t,n,e){const i=new j3;i.name=n.name;const o=n.samplers.map(function(a,s){const l=VN(t,a);return l.index=s,l}),r=n.channels.map(function(a){return NN(a,o,e)});return i.samplers=o,i.channels=r,i}function DN(t){const n=new K3;return n.name=t.name,n.stages=t.stages.map(GN),n}function RN(t){let n;return b.defined(t.scenes)&&b.defined(t.scene)&&(n=t.scenes[t.scene].nodes),n=n??t.nodes,n=b.defined(n)?n:[],n}function UN(t,n,e,i,o){const r=t.gltfJson.accessors,a=b.defined(e.ROTATION),s=b.defined(e.TRANSLATION)&&b.defined(r[e.TRANSLATION].min)&&b.defined(r[e.TRANSLATION].max),l=kv(t,b.InstanceAttributeSemantic,i),u=l.modelSemantic,A=u===b.InstanceAttributeSemantic.TRANSLATION||u===b.InstanceAttributeSemantic.ROTATION||u===b.InstanceAttributeSemantic.SCALE,h=u===b.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||a&&A||!o.context.instancedArrays,p=t._enablePick&&!o.context.webgl2,d=!f,m=t._loadAttributesFor2D&&!o.scene3DOnly;return JS(t,n,l,void 0,void 0,void 0,d,f||h&&(!s||m||p),o)}function ON(t,n){const e=n.featureIds;for(let i=0;i<e.length;i++){const o=e[i],r=`instanceFeatureId_${i}`;let a;b.defined(o.attribute)?a=eE(o,r):a=tE(o,r),t.featureIds.push(a)}}function LN(t,n,e,i){const o=t.extensions.EXT_feature_metadata.featureTables,r=e.featureIdAttributes;if(b.defined(r))for(let a=0;a<r.length;++a){const s=r[a],l=s.featureTable,u=i.indexOf(l),A=o[l].count,h=`instanceFeatureId_${a}`;let f;b.defined(s.featureIds.attribute)?f=nE(s,u,A,h):f=iE(s,u,A,h),n.featureIds.push(f)}}function Xf(t,n,e){const i=new Array(n.count),o=n.bufferView;if(b.defined(o)){const r=HN(t,o),a=WN(t,r,n,e,i);return t._loaderPromises.push(a),i}return jN(n,i)}function JS(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,A=u.accessors[n],h=A.bufferView,f=e.gltfSemantic,p=e.renamedSemantic,d=e.modelSemantic,m=b.defined(d)?rE(p):void 0,y=qN(u,n,f,d,m);if(!b.defined(o)&&!b.defined(h)&&!b.defined(r))return y;const g=KN(t,n,f,i,o,r,a,s,l),_=t._geometryLoaders.length;t._geometryLoaders.push(g);const x=g.load();return t._loaderPromises.push(x),t._geometryCallbacks[_]=()=>{b.defined(o)&&b.defined(o.attributes)&&b.defined(o.attributes[f])?ZN(y,g,a,s):b.defined(r)?$N(y,g,a,s):XN(u,A,y,g,a,s)},y}function zN(t,n,e,i,o,r,a){return b.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:n,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:a,primitive:e,draco:i,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:r})}function kN(t,n,e,i){const o=new $S;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=i;const r=n.texture;o.textureReader=dn(t,r,e,b.Sampler.NEAREST);const s=(b.defined(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=s,o}function eE(t,n){const e=new ZS;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=n,e}function tE(t,n){const e=new XS;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=n,e.offset=0,e.repeat=1,e}function nE(t,n,e,i){const o=new ZS,r=t.featureIds;return o.featureCount=e,o.propertyTableId=n,o.setIndex=rE(r.attribute),o.positionalLabel=i,o}function iE(t,n,e,i){const o=new XS,r=t.featureIds;o.propertyTableId=n,o.featureCount=e,o.offset=r.constant??0;const a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function QN(t,n,e,i,o,r){const a=new $S,s=n.featureIds,l=s.texture;return a.featureCount=o,a.propertyTableId=e,a.textureReader=dn(t,l,i,b.Sampler.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function VN(t,n){const e=new H3,i=t.gltfJson.accessors,o=i[n.input];e.input=Xf(t,o,void 0);const r=n.interpolation;e.interpolation=b.InterpolationType[r]??b.InterpolationType.LINEAR;const a=i[n.output];return e.output=Xf(t,a,!0),e}function NN(t,n,e){const i=new W3,o=t.sampler;return i.sampler=n[o],i.target=YN(t.target,e),i}function HN(t,n){const e=b.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:n,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function GN(t){const n=new q3;n.name=t.name;const e=t.type.toUpperCase();return n.type=b.ArticulationStageType[e],n.minimumValue=t.minimumValue,n.maximumValue=t.maximumValue,n.initialValue=t.initialValue,n}async function WN(t,n,e,i,o){const{gltfJson:r}=t;if(await n.load(),t.isDestroyed())return;const a=oE(r,e,n.typedArray);i=i??!1,JN(e,a,o,i)}function jN(t,n){const e=t.type;if(e===b.AttributeType.SCALAR)return n.fill(0);const i=b.AttributeType.getMathType(e);return n.fill(i.clone(i.ZERO))}function rE(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function qN(t,n,e,i,o){var h;const r=t.accessors[n],a=b.AttributeType.getMathType(r.type),s=r.normalized??!1,l=new U3;l.name=e,l.semantic=i,l.setIndex=o,l.constant=eH(a),l.componentDatatype=r.componentType,l.normalized=s,l.count=r.count,l.type=r.type,l.min=Vn(a,r.min),l.max=Vn(a,r.max),l.byteOffset=r.byteOffset,l.byteStride=b.getAccessorByteStride(t,r),b.hasExtension(r,"WEB3D_quantized_attributes")&&tH(r.extensions.WEB3D_quantized_attributes,l,a);const u=l.semantic===b.VertexAttributeSemantic.POSITION||l.semantic===b.VertexAttributeSemantic.NORMAL||l.semantic===b.VertexAttributeSemantic.TANGENT||l.semantic===b.VertexAttributeSemantic.TEXCOORD||l.semantic===b.VertexAttributeSemantic.FEATURE_ID||l.semantic===b.VertexAttributeSemantic.SCALE||l.semantic===b.VertexAttributeSemantic.ROTATION;return((h=t.extensionsRequired)==null?void 0:h.includes("KHR_mesh_quantization"))&&s&&u&&iH(l,a),l}function KN(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,h=u.accessors[n].bufferView;return b.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:l,bufferViewId:h,primitive:i,draco:o,spz:r,attributeSemantic:e,accessorId:n,asynchronous:t._asynchronous,loadBuffer:a,loadTypedArray:s})}function ZN(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=n.quantization,e&&(t.buffer=n.buffer),i){const o=b.defined(n.quantization)?n.quantization.componentDatatype:t.componentDatatype;t.typedArray=b.ComponentDatatype.createArrayBufferView(o,n.typedArray.buffer)}}function $N(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=n.buffer),i&&b.defined(n.typedArray)&&(t.typedArray=b.ComponentDatatype.createArrayBufferView(t.componentDatatype,n.typedArray.buffer)),t.semantic===b.VertexAttributeSemantic.POSITION){const o=a=>{let s=1/0,l=-1/0,u=1/0,A=-1/0,h=1/0,f=-1/0;for(let p=0;p<a.length;p+=3){const d=a[p],m=a[p+1],v=a[p+2];s=Math.min(s,d),l=Math.max(l,d),u=Math.min(u,m),A=Math.max(A,m),h=Math.min(h,v),f=Math.max(f,v)}return[new b.Cartesian3(s,u,h),new b.Cartesian3(l,A,f)]},r=t.typedArray;[t.min,t.max]=o(r)}}function XN(t,n,e,i,o,r){if(o&&(e.buffer=i.buffer),r){const a=i.typedArray;e.typedArray=oE(t,n,a),o||(e.byteOffset=0,e.byteStride=void 0)}}function YN(t,n){const e=new G3,i=t.node;if(!b.defined(i))return;e.node=n[i];const o=t.path.toUpperCase();return e.path=N3[o],e}function oE(t,n,e){let i=n.byteOffset;const o=b.getAccessorByteStride(t,n),r=n.count,a=b.numberOfComponentsForType(n.type),s=n.componentType,l=b.ComponentDatatype.getSizeInBytes(s),u=l*a,A=r*a;if(o===u)return e=new Uint8Array(e),b.ComponentDatatype.createArrayBufferView(s,e.buffer,e.byteOffset+i,A);const h=b.ComponentDatatype.createTypedArray(s,A),f=new DataView(e.buffer),p=new Array(a),d=b.getComponentReader(n.componentType);i=e.byteOffset+i;for(let m=0;m<r;++m){d(f,i,a,l,p);for(let v=0;v<a;++v)h[m*a+v]=p[v];i+=o}return h}function JN(t,n,e,i){const o=t.type,r=t.count;if(o===b.AttributeType.SCALAR)for(let a=0;a<r;a++)e[a]=n[a];else if(o===b.AttributeType.VEC4&&i)for(let a=0;a<r;a++)e[a]=b.Quaternion.unpack(n,a*4);else{const a=b.AttributeType.getMathType(o),s=b.AttributeType.getNumberOfComponents(o);for(let l=0;l<r;l++)e[l]=a.unpack(n,l*s)}return e}function eH(t){return t===Number?0:new t}function tH(t,n,e){const i=t.decodeMatrix,o=Vn(e,t.decodedMin),r=Vn(e,t.decodedMax);b.defined(o)&&b.defined(r)&&(n.min=o,n.max=r);const a=new b.ModelComponents.Quantization;a.componentDatatype=n.componentDatatype,a.type=n.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new b.Cartesian2(i[6],i[7]),a.quantizedVolumeStepSize=new b.Cartesian2(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new b.Cartesian3(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new b.Cartesian3(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new b.Cartesian4(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new b.Cartesian4(i[0],i[6],i[12],i[18])),n.quantization=a}const nH={VEC2:new b.Cartesian2(-1,-1),VEC3:new b.Cartesian3(-1,-1,-1),VEC4:new b.Cartesian4(-1,-1,-1,-1)};function iH(t,n){const e=rH(t.componentDatatype),i=nH[t.type];let o=t.min;b.defined(o)&&(o=n.divideByScalar(o,e,o),o=n.maximumByComponent(o,i,o));let r=t.max;b.defined(r)&&(r=n.divideByScalar(r,e,r),r=n.maximumByComponent(r,i,r)),t.min=o,t.max=r}function rH(t){switch(t){case b.ComponentDatatype.BYTE:return 127;case b.ComponentDatatype.UNSIGNED_BYTE:return 255;case b.ComponentDatatype.SHORT:return 32767;case b.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function sE(t,n){if(!b.defined(n))return;const e=n.length;if(e===0)return;const i=t.length;t.length+=e;for(let o=0;o<e;o++)t[i+o]=n[o]}b.Material.XbsjPolylineArrow="XbsjPolylineArrow",b.Material._materialCache.addMaterial(b.Material.XbsjPolylineArrow,{fabric:{type:b.Material.XbsjPolylineArrow,uniforms:{color:new b.Color(1,1,1,1),image:c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/signal.png"),speed:1,repeat:60},source:`
|
|
3810
|
+
`;b.Material.GlobeLevelMaterialType="GlobelLevel",b.Material._materialCache.addMaterial(b.Material.GlobeLevelMaterialType,{fabric:{type:b.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new b.Cartesian3(0,0,0),input_highlights:new b.Cartesian3(1,1,1),midtones:new b.Cartesian3(.5,.5,.5),output_shadows:new b.Cartesian3(0,0,0),output_highlights:new b.Cartesian3(1,1,1)},source:x3},translucent:!1});const{PrimitiveRenderResources:_3,ModelUtility:C3,Cartesian3:ti,Matrix4:Qa,ModelRenderResources:S3,defined:E3,NodeRenderResources:P3,BoundingSphere:cr,ModelDrawCommands:B3}=b,T3=new ti,I3=new ti,qS=new ti,KS=new ti;class F3 extends _3{constructor(n,e,i){if(super(n,e),!n.runtimeNode.instancingTranslationMin||!n.runtimeNode.instancingTranslationMax)return;const o=Qa.inverse(i,new Qa),r=C3.getPositionMinMax(e.primitive,Qa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMin,qS),Qa.multiplyByPoint(o,n.runtimeNode.instancingTranslationMax,KS));this.positionMin=ti.clone(r.min,new ti),this.positionMax=ti.clone(r.max,new ti),this.boundingSphere=cr.fromCornerPoints(this.positionMin,this.positionMax,new cr)}}function M3(){b.ModelSceneGraph.prototype.buildDrawCommands=function(t){const n=this._model,e=new S3(n);n.statistics.clear(),this.configurePipeline(t);const i=this.modelPipelineStages;let o,r,a;for(o=0;o<i.length;o++)i[o].process(e,n,t);const s=ti.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,T3),l=ti.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,I3);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!E3(u))continue;u.configurePipeline();const A=u.pipelineStages,h=new P3(e,u);for(r=0;r<A.length;r++)A[r].process(h,u.node,t);const f=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){const p=u.runtimePrimitives[r];p.configurePipeline(t);const d=p.pipelineStages,m=new F3(h,p,f);for(a=0;a<d.length;a++)d[a].process(m,p.primitive,t);p.boundingSphere=cr.clone(m.boundingSphere,new cr);const v=Qa.multiplyByPoint(f,m.positionMin,qS),y=Qa.multiplyByPoint(f,m.positionMax,KS);ti.minimumByComponent(s,v,s),ti.maximumByComponent(l,y,l);const g=B3.buildModelDrawCommand(m,t);p.drawCommand=g}}this._boundingSphere=cr.fromCornerPoints(s,l,new cr),this._boundingSphere=cr.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=cr.transform(this._boundingSphere,this._components.transform,this._boundingSphere),n._boundingSphere=cr.transform(this._boundingSphere,n.modelMatrix,n._boundingSphere),n._initialRadius=n._boundingSphere.radius,n._boundingSphere.radius*=n._clampedScale}}const wh=class wh extends c.Destroyable{constructor(){super(),b.ParticleSystem.prototype.update=function(n){const e=n.time;n.time=this._falseTime;try{wh.oldUpdate.call(this,n),this._particles.forEach(i=>{b.Billboard.prototype&&(i._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}n.time=e},this.d(()=>{b.ParticleSystem.prototype.update=wh.oldUpdate})}};L(wh,"oldUpdate",b.ParticleSystem.prototype.update);let Uv=wh;function D3(){if(b.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(b.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,b.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=b.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class R3{constructor(n){L(this,"index");L(this,"image");L(this,"resolve");L(this,"reject");L(this,"rectangle");this.index=n.index,this.image=n.image,this.resolve=n.resolve,this.reject=n.reject,this.rectangle=void 0}}function U3(){b.TextureAtlas.prototype._resize=function(t,n=0){const e=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture;let a=r.width,s=r.height;const l=this._subRegions,u=i.map((y,g)=>new R3({index:g,image:y})).filter((y,g)=>b.defined(y.image)&&!b.defined(l.get(g)));let A=0,h=0,f=0;for(let y=n;y<o.length;++y){const{width:g,height:_}=o[y].image;A=Math.max(A,g),h=Math.max(h,_),f+=g*_,u.push(o[y])}a=Math.max(A,a),s=Math.max(h,s),t.webgl2||(a=b.Math.nextPowerOfTwo(a),s=b.Math.nextPowerOfTwo(s));const p=Math.sqrt(f);s*=Math.ceil(p/s),a*=Math.ceil(p/a),u.sort(({image:y},{image:g})=>g.height*g.width-y.height*y.width);const d=new Array(this._nextIndex);for(const y of this._subRegions.keys())b.defined(l.get(y))&&(d[y]=i[y]);let m,v=!1;for(;!v;){m=new b.TexturePacker({height:s,width:a,borderPadding:e});let y;for(y=0;y<u.length;++y){const{index:g,image:_}=u[y];if(!b.defined(_))continue;const x=m.pack(g,_);if(!b.defined(x)){a>s?s*=2:a*=2;break}d[g]=x.rectangle}v=y===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(t,a,s,d),r.destroy(),this._rectangles=d,this._guid=b.createGuid()}}const oo={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:O3,Indices:L3,FeatureIdAttribute:ZS,FeatureIdTexture:$S,FeatureIdImplicitRange:XS,MorphTarget:z3,Primitive:k3,Instances:Q3,Skin:V3,Node:N3,AnimatedPropertyType:H3,AnimationSampler:G3,AnimationTarget:W3,AnimationChannel:j3,Animation:q3,ArticulationStage:K3,Articulation:Z3,Asset:$3,Scene:X3,Components:Y3,MetallicRoughness:J3,SpecularGlossiness:eN,Specular:tN,Anisotropy:Ov,Clearcoat:Lv,Material:nN}=b.ModelComponents;function iN(){b.GltfLoader.prototype.process=function(t){if(b.Check.typeOf.object("frameState",t),this._state===oo.LOADED&&!b.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=rN(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),b.defined(this._processError)){this._state=oo.FAILED;const o=this._processError;this._processError=void 0,zv(this,o)}const n=this._textureErrors.pop();if(b.defined(n)){const o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===oo.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=oo.FAILED,zv(this,o)}let i=!1;try{i=this._processTextures(t)}catch(o){this._textureState=oo.FAILED,zv(this,o)}return this._incrementallyLoadTextures?e:e&&i}}async function rN(t,n){b.FeatureDetection.supportsWebP.initialized||await b.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new b.SupportedImageFormats({webp:b.FeatureDetection.supportsWebP(),basis:n.context.supportsBasis});const e=sN(t,n);return t._state=oo.PROCESSING,t._textureState=oo.PROCESSING,b.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(b.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const oN=new b.Cartesian3;function sN(t,n){const e=t.gltfJson,i=e.extensions??b.Frozen.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(b.defined(r)){const g=r.featureTables,_=r.featureTextures,x=b.defined(g)?g:[],E=b.defined(_)?_:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(E).sort()}const s=aN(t,n),l=AN(t,s),u=fN(t,s),A=dN(e),h=pN(e,s),f=new Y3,p=new $3,d=e.asset.copyright;if(b.defined(d)){const g=d.split(";").map(function(_){return new b.Credit(_.trim())});p.credits=g}if(f.asset=p,f.scene=h,f.nodes=s,f.skins=l,f.animations=u,f.articulations=A,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,b.defined(a)){const g=b.Cartesian3.fromArray(a.center,0,oN);f.transform=b.Matrix4.fromTranslation(g,f.transform)}if(t._components=f,b.defined(o)||b.defined(r)){const g=mN(t,o,r,n);t._loaderPromises.push(g)}const m=i.NGA_gpm_local;if(b.defined(m)){const g=b.GltfGpmLoader.load(m);t._components.extensions.NGA_gpm_local=g}const v=e.meshes;if(b.defined(v))for(const g of v){const _=g.primitives;if(b.defined(_))for(const x of _){const E=x.extensions;if(b.defined(E)){const B=E.NGA_gpm_local;if(b.defined(B)){const P=gN(t,e,B,n);t._loaderPromises.push(P)}}}}const y=[];return sE(y,t._loaderPromises),t._incrementallyLoadTextures||sE(y,t._texturesPromises),Promise.all(y)}function aN(t,n){const e=t.gltfJson.nodes;if(!b.defined(e))return[];const i=e.map(function(o,r){const a=lN(t,o,n);return a.index=r,a});for(let o=0;o<i.length;++o){const r=e[o].children;if(b.defined(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function lN(t,n,e){const i=new N3;i.name=n.name,i.matrix=Vn(b.Matrix4,n.matrix),i.translation=Vn(b.Cartesian3,n.translation),i.rotation=Vn(b.Quaternion,n.rotation),i.scale=Vn(b.Cartesian3,n.scale);const o=n.extensions??b.Frozen.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations;if(b.defined(r)){if(t._loadForClassification)throw new b.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=yN(t,o,e)}b.defined(a)&&(i.articulationName=a.articulationName);const s=n.mesh;if(b.defined(s)){const l=t.gltfJson.meshes[s],u=l.primitives;for(let f=0;f<u.length;++f)i.primitives.push(uN(t,u[f],b.defined(i.instances),e));const A=n.weights??l.weights,h=i.primitives[0].morphTargets;i.morphWeights=b.defined(A)?A.slice():new Array(h.length).fill(0)}return i}function uN(t,n,e,i){const o=new k3,r=new b.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(r);const a=n.material;b.defined(a)&&(o.material=cN(t,t.gltfJson.materials[a],i));const s=n.extensions??b.Frozen.EMPTY_OBJECT;let l=!1;const u=s.CESIUM_primitive_outline;t._loadPrimitiveOutline&&b.defined(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=vN(t,u));const A=s.KHR_spz_gaussian_splats_compression;b.defined(A)&&(l=!0,r.needsGaussianSplats=!0);const h=t._loadForClassification,f=s.KHR_draco_mesh_compression;let p=!1;const d=n.attributes;if(b.defined(d))for(const B in d){if(!d.hasOwnProperty(B))continue;const P=d[B],I=kv(t,b.VertexAttributeSemantic,B),D=I.modelSemantic;if(h&&!bN(D))continue;D===b.VertexAttributeSemantic.FEATURE_ID&&(p=!0);const F=YS(t,P,I,n,f,A,e,l,i);r.attributePlans.push(F),o.attributes.push(F.attribute)}const m=n.targets;if(b.defined(m)&&!h)for(let B=0;B<m.length;++B)o.morphTargets.push(xN(t,m[B],l,r,i));const v=n.indices;if(b.defined(v)){const B=_N(t,v,n,f,p,l,i);b.defined(B)&&(r.indicesPlan=B,o.indices=B.indices)}const y=s.EXT_structural_metadata,g=s.EXT_mesh_features,_=s.EXT_feature_metadata,x=b.defined(_);b.defined(g)?CN(t,o,g,i):x&&SN(t,o,_,i),b.defined(y)?EN(o,y):x&&PN(t,o,_);const E=n.mode;if(h&&E!==b.PrimitiveType.TRIANGLES)throw new b.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function cN(t,n,e){const i=new nN,o=n.extensions??b.Frozen.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=n.pbrMetallicRoughness;return i.unlit=b.defined(o.KHR_materials_unlit),b.defined(r)?i.specularGlossiness=hN(t,r,e):(b.defined(u)&&(i.metallicRoughness=BN(t,u,e)),b.defined(a)&&!i.unlit&&(i.specular=TN(t,a,e)),b.defined(s)&&!i.unlit&&(i.anisotropy=IN(t,s,e)),b.defined(l)&&!i.unlit&&(i.clearcoat=FN(t,l,e))),b.defined(n.emissiveTexture)&&(i.emissiveTexture=dn(t,n.emissiveTexture,e,void 0)),b.defined(n.normalTexture)&&!t._loadForClassification&&(i.normalTexture=dn(t,n.normalTexture,e,void 0)),b.defined(n.occlusionTexture)&&(i.occlusionTexture=dn(t,n.occlusionTexture,e,void 0)),i.emissiveFactor=Vn(b.Cartesian3,n.emissiveFactor),i.alphaMode=n.alphaMode,i.alphaCutoff=n.alphaCutoff,i.doubleSided=n.doubleSided,i.name=n.name,i}function hN(t,n,e){const{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=n,l=new eN;return b.defined(i)&&(l.diffuseTexture=dn(t,i,e,void 0)),b.defined(o)&&(l.specularGlossinessTexture=dn(t,o,e,void 0)),l.diffuseFactor=Vn(b.Cartesian4,r),l.specularFactor=Vn(b.Cartesian3,a),l.glossinessFactor=s,l}function zv(t,n){throw t.unload(),t.getError("Failed to load glTF",n)}function AN(t,n){const e=t.gltfJson.skins;if(t._loadForClassification||!b.defined(e))return[];const i=e.map(function(r,a){const s=MN(t,r,n);return s.index=a,s}),o=t.gltfJson.nodes;for(let r=0;r<n.length;++r){const a=o[r].skin;b.defined(a)&&(n[r].skin=i[a])}return i}function fN(t,n){const e=t.gltfJson.animations;return t._loadForClassification||!b.defined(e)?[]:e.map(function(o,r){const a=DN(t,o,n);return a.index=r,a})}function dN(t){var i;const e=(i=(t.extensions??b.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:i.articulations;return b.defined(e)?e.map(RN):[]}function pN(t,n){const e=new X3,i=UN(t);return e.nodes=i.map(function(o){return n[o]}),e}async function mN(t,n,e,i){const o=new b.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:n,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function gN(t,n,e,i){const o=new b.GltfMeshPrimitiveGpmLoader({gltf:n,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Vn(t,n){if(b.defined(n))return t===Number?n[0]:t.unpack(n)}function yN(t,n,e){const i=n.EXT_mesh_gpu_instancing,o=new Q3,r=i.attributes;if(b.defined(r))for(const u in r){if(!r.hasOwnProperty(u))continue;const A=r[u];o.attributes.push(ON(t,A,r,u,e))}const a=i.extensions??b.Frozen.EMPTY_OBJECT,s=n.EXT_instance_features,l=a.EXT_feature_metadata;return b.defined(s)?LN(o,s):b.defined(l)&&zN(t.gltfJson,o,l,t._sortedPropertyTableIds),o}function vN(t,n){const e=n.indices,i=t.gltfJson.accessors[e];return Xf(t,i,!1)}const wN={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function kv(t,n,e){let i=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(i="_FEATURE_ID_0");const o=n.fromGltfSemantic(i),r=wN;return r.gltfSemantic=e,r.renamedSemantic=i,r.modelSemantic=o,r}function bN(t){const n=t===b.VertexAttributeSemantic.POSITION,e=t===b.VertexAttributeSemantic.FEATURE_ID,i=t===b.VertexAttributeSemantic.TEXCOORD;return n||e||i}function YS(t,n,e,i,o,r,a,s,l){const u=e.modelSemantic,A=u===b.VertexAttributeSemantic.POSITION,h=u===b.VertexAttributeSemantic.FEATURE_ID,f=A&&!a&&t._loadAttributesFor2D&&!l.scene3DOnly,p=A&&t._enablePick&&!l.context.webgl2,d=t._loadForClassification&&h,m=t._loadAttributesAsTypedArray,v=!m,y=m||f||p||d,x=JS(t,n,e,i,o,r,s?!1:v,s?!0:y,l),E=new b.PrimitiveLoadPlan.AttributeLoadPlan(x);return E.loadBuffer=v,E.loadTypedArray=y,E}function xN(t,n,e,i,o){const r=new z3,a=void 0,s=void 0,l=void 0,u=!1;for(const A in n){if(!n.hasOwnProperty(A))continue;const h=n[A],f=kv(t,VertexAttributeSemantic,A),p=YS(t,h,f,a,s,l,u,e,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function _N(t,n,e,i,o,r,a){const s=t.gltfJson.accessors[n],l=s.bufferView;if(!b.defined(i)&&!b.defined(l))return;const u=new L3;u.count=s.count;const A=t._loadAttributesAsTypedArray,h=(t._loadIndicesForWireframe||t._enablePick)&&!a.context.webgl2,f=t._loadForClassification&&o,d=!A,m=A||h||f,g=kN(t,n,e,i,r?!1:d,r?!0:m,a),_=t._geometryLoaders.length;t._geometryLoaders.push(g);const x=g.load();t._loaderPromises.push(x),t._geometryCallbacks[_]=()=>{u.indexDatatype=g.indexDatatype,u.buffer=g.buffer,u.typedArray=g.typedArray};const E=new b.PrimitiveLoadPlan.IndicesLoadPlan(u);return E.loadBuffer=d,E.loadTypedArray=m,E}function CN(t,n,e,i){let o;b.defined(e)&&b.defined(e.featureIds)?o=e.featureIds:o=[];for(let r=0;r<o.length;r++){const a=o[r],s=`featureId_${r}`;let l;b.defined(a.texture)?l=QN(t,a,i,s):b.defined(a.attribute)?l=eE(a,s):l=tE(a,s),n.featureIds.push(l)}}function SN(t,n,e,i){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let r=0;const a=e.featureIdAttributes;if(b.defined(a))for(let l=0;l<a.length;++l){const u=a[l],A=u.featureTable,h=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,p=`featureId_${r}`;r++;let d;b.defined(u.featureIds.attribute)?d=nE(u,h,f,p):d=iE(u,h,f,p),n.featureIds.push(d)}const s=e.featureIdTextures;if(b.defined(s))for(let l=0;l<s.length;++l){const u=s[l],A=u.featureTable,h=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,p=`featureId_${r}`;r++;const d=VN(t,u,h,i,f,p);n.featureIds.push(d)}}function EN(t,n){if(!b.defined(n))return;const{propertyTextures:e,propertyAttributes:i}=n;b.defined(e)&&(t.propertyTextureIds=e),b.defined(i)&&(t.propertyAttributeIds=i)}function PN(t,n,e){b.defined(e.featureTextures)&&(n.propertyTextureIds=e.featureTextures.map(function(i){return t._sortedFeatureTextureIds.indexOf(i)}))}function BN(t,n,e){const{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=n,l=new J3;return b.defined(i)&&(l.baseColorTexture=dn(t,i,e,void 0)),b.defined(o)&&(l.metallicRoughnessTexture=dn(t,o,e,void 0)),l.baseColorFactor=Vn(b.Cartesian4,r),l.metallicFactor=a,l.roughnessFactor=s,l}function TN(t,n,e){const{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=n,s=new tN;return b.defined(o)&&(s.specularTexture=dn(t,o,e,void 0)),b.defined(a)&&(s.specularColorTexture=dn(t,a,e,void 0)),s.specularFactor=i,s.specularColorFactor=Vn(b.Cartesian3,r),s}function IN(t,n,e){const{anisotropyStrength:i=Ov.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Ov.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=n,a=new Ov;return b.defined(r)&&(a.anisotropyTexture=dn(t,r,e,void 0)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function FN(t,n,e){const{clearcoatFactor:i=Lv.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Lv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=n,l=new Lv;return b.defined(o)&&(l.clearcoatTexture=dn(t,o,e,void 0)),b.defined(a)&&(l.clearcoatRoughnessTexture=dn(t,a,e,void 0)),b.defined(s)&&(l.clearcoatNormalTexture=dn(t,s,e,void 0)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function dn(t,n,e,i){const o=t.gltfJson,r=b.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:n.index,supportedImageFormats:t._supportedImageFormats});if(!b.defined(r))return;const a=b.ResourceCache.getTextureLoader({gltf:o,textureInfo:n,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),s=b.GltfLoaderUtil.createModelTextureReader({textureInfo:n}),l=t._textureLoaders.length;t._textureLoaders.push(a);const u=a.load().catch(A=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw A;t._textureState=oo.FAILED,t._textureErrors.push(A)}});return t._texturesPromises.push(u),t._textureCallbacks[l]=()=>{s.texture=a.texture,b.defined(i)&&(s.texture.sampler=i)},s}function MN(t,n,e){const i=new V3,o=n.joints;i.joints=o.map(a=>e[a]);const r=n.inverseBindMatrices;if(b.defined(r)){const a=t.gltfJson.accessors[r];i.inverseBindMatrices=Xf(t,a,void 0)}else i.inverseBindMatrices=new Array(o.length).fill(b.Matrix4.IDENTITY);return i}function DN(t,n,e){const i=new q3;i.name=n.name;const o=n.samplers.map(function(a,s){const l=NN(t,a);return l.index=s,l}),r=n.channels.map(function(a){return HN(a,o,e)});return i.samplers=o,i.channels=r,i}function RN(t){const n=new Z3;return n.name=t.name,n.stages=t.stages.map(WN),n}function UN(t){let n;return b.defined(t.scenes)&&b.defined(t.scene)&&(n=t.scenes[t.scene].nodes),n=n??t.nodes,n=b.defined(n)?n:[],n}function ON(t,n,e,i,o){const r=t.gltfJson.accessors,a=b.defined(e.ROTATION),s=b.defined(e.TRANSLATION)&&b.defined(r[e.TRANSLATION].min)&&b.defined(r[e.TRANSLATION].max),l=kv(t,b.InstanceAttributeSemantic,i),u=l.modelSemantic,A=u===b.InstanceAttributeSemantic.TRANSLATION||u===b.InstanceAttributeSemantic.ROTATION||u===b.InstanceAttributeSemantic.SCALE,h=u===b.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||a&&A||!o.context.instancedArrays,p=t._enablePick&&!o.context.webgl2,d=!f,m=t._loadAttributesFor2D&&!o.scene3DOnly;return JS(t,n,l,void 0,void 0,void 0,d,f||h&&(!s||m||p),o)}function LN(t,n){const e=n.featureIds;for(let i=0;i<e.length;i++){const o=e[i],r=`instanceFeatureId_${i}`;let a;b.defined(o.attribute)?a=eE(o,r):a=tE(o,r),t.featureIds.push(a)}}function zN(t,n,e,i){const o=t.extensions.EXT_feature_metadata.featureTables,r=e.featureIdAttributes;if(b.defined(r))for(let a=0;a<r.length;++a){const s=r[a],l=s.featureTable,u=i.indexOf(l),A=o[l].count,h=`instanceFeatureId_${a}`;let f;b.defined(s.featureIds.attribute)?f=nE(s,u,A,h):f=iE(s,u,A,h),n.featureIds.push(f)}}function Xf(t,n,e){const i=new Array(n.count),o=n.bufferView;if(b.defined(o)){const r=GN(t,o),a=jN(t,r,n,e,i);return t._loaderPromises.push(a),i}return qN(n,i)}function JS(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,A=u.accessors[n],h=A.bufferView,f=e.gltfSemantic,p=e.renamedSemantic,d=e.modelSemantic,m=b.defined(d)?rE(p):void 0,y=KN(u,n,f,d,m);if(!b.defined(o)&&!b.defined(h)&&!b.defined(r))return y;const g=ZN(t,n,f,i,o,r,a,s,l),_=t._geometryLoaders.length;t._geometryLoaders.push(g);const x=g.load();return t._loaderPromises.push(x),t._geometryCallbacks[_]=()=>{b.defined(o)&&b.defined(o.attributes)&&b.defined(o.attributes[f])?$N(y,g,a,s):b.defined(r)?XN(y,g,a,s):YN(u,A,y,g,a,s)},y}function kN(t,n,e,i,o,r,a){return b.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:n,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:a,primitive:e,draco:i,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:r})}function QN(t,n,e,i){const o=new $S;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=i;const r=n.texture;o.textureReader=dn(t,r,e,b.Sampler.NEAREST);const s=(b.defined(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=s,o}function eE(t,n){const e=new ZS;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=n,e}function tE(t,n){const e=new XS;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=n,e.offset=0,e.repeat=1,e}function nE(t,n,e,i){const o=new ZS,r=t.featureIds;return o.featureCount=e,o.propertyTableId=n,o.setIndex=rE(r.attribute),o.positionalLabel=i,o}function iE(t,n,e,i){const o=new XS,r=t.featureIds;o.propertyTableId=n,o.featureCount=e,o.offset=r.constant??0;const a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function VN(t,n,e,i,o,r){const a=new $S,s=n.featureIds,l=s.texture;return a.featureCount=o,a.propertyTableId=e,a.textureReader=dn(t,l,i,b.Sampler.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function NN(t,n){const e=new G3,i=t.gltfJson.accessors,o=i[n.input];e.input=Xf(t,o,void 0);const r=n.interpolation;e.interpolation=b.InterpolationType[r]??b.InterpolationType.LINEAR;const a=i[n.output];return e.output=Xf(t,a,!0),e}function HN(t,n,e){const i=new j3,o=t.sampler;return i.sampler=n[o],i.target=JN(t.target,e),i}function GN(t,n){const e=b.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:n,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function WN(t){const n=new K3;n.name=t.name;const e=t.type.toUpperCase();return n.type=b.ArticulationStageType[e],n.minimumValue=t.minimumValue,n.maximumValue=t.maximumValue,n.initialValue=t.initialValue,n}async function jN(t,n,e,i,o){const{gltfJson:r}=t;if(await n.load(),t.isDestroyed())return;const a=oE(r,e,n.typedArray);i=i??!1,eH(e,a,o,i)}function qN(t,n){const e=t.type;if(e===b.AttributeType.SCALAR)return n.fill(0);const i=b.AttributeType.getMathType(e);return n.fill(i.clone(i.ZERO))}function rE(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function KN(t,n,e,i,o){var h;const r=t.accessors[n],a=b.AttributeType.getMathType(r.type),s=r.normalized??!1,l=new O3;l.name=e,l.semantic=i,l.setIndex=o,l.constant=tH(a),l.componentDatatype=r.componentType,l.normalized=s,l.count=r.count,l.type=r.type,l.min=Vn(a,r.min),l.max=Vn(a,r.max),l.byteOffset=r.byteOffset,l.byteStride=b.getAccessorByteStride(t,r),b.hasExtension(r,"WEB3D_quantized_attributes")&&nH(r.extensions.WEB3D_quantized_attributes,l,a);const u=l.semantic===b.VertexAttributeSemantic.POSITION||l.semantic===b.VertexAttributeSemantic.NORMAL||l.semantic===b.VertexAttributeSemantic.TANGENT||l.semantic===b.VertexAttributeSemantic.TEXCOORD||l.semantic===b.VertexAttributeSemantic.FEATURE_ID||l.semantic===b.VertexAttributeSemantic.SCALE||l.semantic===b.VertexAttributeSemantic.ROTATION;return((h=t.extensionsRequired)==null?void 0:h.includes("KHR_mesh_quantization"))&&s&&u&&rH(l,a),l}function ZN(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,h=u.accessors[n].bufferView;return b.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:l,bufferViewId:h,primitive:i,draco:o,spz:r,attributeSemantic:e,accessorId:n,asynchronous:t._asynchronous,loadBuffer:a,loadTypedArray:s})}function $N(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=n.quantization,e&&(t.buffer=n.buffer),i){const o=b.defined(n.quantization)?n.quantization.componentDatatype:t.componentDatatype;t.typedArray=b.ComponentDatatype.createArrayBufferView(o,n.typedArray.buffer)}}function XN(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=n.buffer),i&&b.defined(n.typedArray)&&(t.typedArray=b.ComponentDatatype.createArrayBufferView(t.componentDatatype,n.typedArray.buffer)),t.semantic===b.VertexAttributeSemantic.POSITION){const o=a=>{let s=1/0,l=-1/0,u=1/0,A=-1/0,h=1/0,f=-1/0;for(let p=0;p<a.length;p+=3){const d=a[p],m=a[p+1],v=a[p+2];s=Math.min(s,d),l=Math.max(l,d),u=Math.min(u,m),A=Math.max(A,m),h=Math.min(h,v),f=Math.max(f,v)}return[new b.Cartesian3(s,u,h),new b.Cartesian3(l,A,f)]},r=t.typedArray;[t.min,t.max]=o(r)}}function YN(t,n,e,i,o,r){if(o&&(e.buffer=i.buffer),r){const a=i.typedArray;e.typedArray=oE(t,n,a),o||(e.byteOffset=0,e.byteStride=void 0)}}function JN(t,n){const e=new W3,i=t.node;if(!b.defined(i))return;e.node=n[i];const o=t.path.toUpperCase();return e.path=H3[o],e}function oE(t,n,e){let i=n.byteOffset;const o=b.getAccessorByteStride(t,n),r=n.count,a=b.numberOfComponentsForType(n.type),s=n.componentType,l=b.ComponentDatatype.getSizeInBytes(s),u=l*a,A=r*a;if(o===u)return e=new Uint8Array(e),b.ComponentDatatype.createArrayBufferView(s,e.buffer,e.byteOffset+i,A);const h=b.ComponentDatatype.createTypedArray(s,A),f=new DataView(e.buffer),p=new Array(a),d=b.getComponentReader(n.componentType);i=e.byteOffset+i;for(let m=0;m<r;++m){d(f,i,a,l,p);for(let v=0;v<a;++v)h[m*a+v]=p[v];i+=o}return h}function eH(t,n,e,i){const o=t.type,r=t.count;if(o===b.AttributeType.SCALAR)for(let a=0;a<r;a++)e[a]=n[a];else if(o===b.AttributeType.VEC4&&i)for(let a=0;a<r;a++)e[a]=b.Quaternion.unpack(n,a*4);else{const a=b.AttributeType.getMathType(o),s=b.AttributeType.getNumberOfComponents(o);for(let l=0;l<r;l++)e[l]=a.unpack(n,l*s)}return e}function tH(t){return t===Number?0:new t}function nH(t,n,e){const i=t.decodeMatrix,o=Vn(e,t.decodedMin),r=Vn(e,t.decodedMax);b.defined(o)&&b.defined(r)&&(n.min=o,n.max=r);const a=new b.ModelComponents.Quantization;a.componentDatatype=n.componentDatatype,a.type=n.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new b.Cartesian2(i[6],i[7]),a.quantizedVolumeStepSize=new b.Cartesian2(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new b.Cartesian3(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new b.Cartesian3(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new b.Cartesian4(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new b.Cartesian4(i[0],i[6],i[12],i[18])),n.quantization=a}const iH={VEC2:new b.Cartesian2(-1,-1),VEC3:new b.Cartesian3(-1,-1,-1),VEC4:new b.Cartesian4(-1,-1,-1,-1)};function rH(t,n){const e=oH(t.componentDatatype),i=iH[t.type];let o=t.min;b.defined(o)&&(o=n.divideByScalar(o,e,o),o=n.maximumByComponent(o,i,o));let r=t.max;b.defined(r)&&(r=n.divideByScalar(r,e,r),r=n.maximumByComponent(r,i,r)),t.min=o,t.max=r}function oH(t){switch(t){case b.ComponentDatatype.BYTE:return 127;case b.ComponentDatatype.UNSIGNED_BYTE:return 255;case b.ComponentDatatype.SHORT:return 32767;case b.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function sE(t,n){if(!b.defined(n))return;const e=n.length;if(e===0)return;const i=t.length;t.length+=e;for(let o=0;o<e;o++)t[i+o]=n[o]}b.Material.XbsjPolylineArrow="XbsjPolylineArrow",b.Material._materialCache.addMaterial(b.Material.XbsjPolylineArrow,{fabric:{type:b.Material.XbsjPolylineArrow,uniforms:{color:new b.Color(1,1,1,1),image:c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/signal.png"),speed:1,repeat:60},source:`
|
|
3811
3811
|
uniform vec4 color; // 叠加颜色
|
|
3812
3812
|
uniform sampler2D image; // 箭头贴图
|
|
3813
3813
|
uniform float repeat; // 重复像素
|
|
@@ -3842,8 +3842,8 @@ return material;
|
|
|
3842
3842
|
material.alpha = fragColor.a;
|
|
3843
3843
|
|
|
3844
3844
|
return material;
|
|
3845
|
-
}`},translucent:!0}),h3(),A3(),f3(),g3(),y3(),v3(),w3(),c3(),F3(),M3(),R3(),nN(),b.Camera.DEFAULT_VIEW_RECTANGLE=b.Rectangle.fromDegrees(70,5,140,55);function oH(){return new Promise((t,n)=>b.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class sH extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Ot(s);if(l&&(l.destroy(),Qv(s,void 0)),b.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=u3;await s.promise(oH());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=b.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=b.JulianDate.fromDate(new Date(e.currentTime));b.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=b.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new dE(A,e);Qv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const aH=new b.EllipsoidTerrainProvider;class aE extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??aH}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class lE extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof bt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof bt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof bt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof bt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class lH extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class uH extends c.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class cH extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new uH(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class hH extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new cH(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class uE extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new lH(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new hH(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class cE extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,p]=u;try{(async()=>{const{scene:d,camera:m}=i,v=Ze(A),y=m.getPickRay(v);if(y){let E;if(h?E=await d.pickFromRayMostDetailed(y,this.objectsToExclude):E=d.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=De(E.position);return B?f(B):p(new Error("positionFromCartesian failed"))}if(!(d.terrainProvider instanceof b.EllipsoidTerrainProvider)){const B=d.globe.pick(y,d);if(!B)return p(new Error("scene.globe.pick failed"));const P=De(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):p(new Error("positionFromCartesian failed"))}}const g=d.terrainProvider instanceof b.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,_=i.camera.pickEllipsoid(Ze(A),g);if(!_)return p(new Error("Pick failed"));const x=De(_);return x?f(x):p(new Error("positionFromCartesian failed"))})()}catch(d){p(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,p,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let m=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!m&&b.defined(i.scene.globe)&&(m=await AH(i,Ze(A)));let v;if(m&&m instanceof b.Cesium3DTileFeature){v={};try{m&&m.getPropertyIds().forEach(F=>{v&&(v[F]=m.getProperty(F))})}catch(D){console.warn(D)}}if(!m){const{left:D,top:F}=e.container.getBoundingClientRect();m=(E=document.elementFromPoint(A[0]+D,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;m&&(m.id&&m.id instanceof b.Entity&&m.id.ESSceneObjectID?y=m.id.ESSceneObjectID:m.collection&&m.collection.ESSceneObjectID?y=m.collection.ESSceneObjectID:m.primitive&&m.primitive.ESSceneObjectID?y=m.primitive.ESSceneObjectID:Array.isArray(m)&&m[0]instanceof b.ImageryLayerFeatureInfo?y=m[0].imageryLayer.ESSceneObjectID:m instanceof HTMLElement&&(y=m.dataset.esSceneObjectId));let g=y?c.ESSceneObject.getSceneObject(y):void 0;g&&g.parentID&&(g=c.ESSceneObject.getSceneObject(g.parentID));let _={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){if(g instanceof c.ESEntityCluster){const D=new b.JulianDate;_=m.id instanceof b.Entity?{name:m.id.label.text.getValue(D),properties:(B=m.id.properties)==null?void 0:B.getValue(D),coordinates:Ya(m.id.position.getValue(D))}:(P=m.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(D),coordinates:Ya(F.position.getValue(D))}})}else if(g instanceof c.ESGeoJson){const D=new b.JulianDate;if(!m.id.entityCollection)return;const F=m.id.polygon?"Polygon":m.id.polyline?"LineString":"Point",S=((I=m.id.properties)==null?void 0:I.getValue(D))??{},T=F=="Point"?De(m.id.position.getValue(D)):F=="LineString"?m.id.polyline.positions.getValue(D).map(w=>De(w)):_d(m.id.polygon.hierarchy.getValue(D));_=g.pickedInfoType=="FeatureCollection"||g.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:F,coordinates:T},properties:S}:{type:F,coordinates:T,properties:S}}else if(g instanceof c.ESGltfModel){let D;Reflect.has(m,"featureId")?D=m.featureId:Reflect.has(m,"instanceId")&&(D=m.instanceId),D&&(m.id=m.primitive.structuralMetadata.getPropertyTable(0).getProperty(m.instanceId,"id"))}g.pickedEvent.emit(new c.ESJPickedResult(m,g,v,_,f,A))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&p(new c.ESJPickedResult);const x=new c.ESJPickedResult(m,g,v,_,f,A);p(x)})()}catch(m){d(m)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function AH(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(b.defined(o))return o}class fH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Ot(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function dH(t){const n=t.cloneNode(!0);n.style.position="absolute",n.style.top="0",n.style.zIndex="-1",document.body.appendChild(n);const e=n.getBoundingClientRect();return document.body.removeChild(n),{width:e.width,height:e.height}}const hE=["label","billboard","rectangle"];class pH extends c.Destroyable{constructor(e,i){super();L(this,"id",c.createGuid());L(this,"position",b.Cartesian3.ZERO);L(this,"label");L(this,"billboard");L(this,"rectangle");L(this,"zOrder");L(this,"_showEvent",this.disposeVar(new c.Event));this.id=e,this.position=i,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class mH extends c.Destroyable{constructor(e){super();L(this,"objects",new Map);L(this,"screenManager");L(this,"czmViewer");L(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.label)return r;const l=this.screenManager.labelCollection.add({...i,position:a,id:r,text:o.name});return l.ESSceneObjectID=e,s.label=l,s.zOrder=o.zOrder,r}addImage(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.billboard)return r;const l=this.screenManager.billboardCollection.add({...i,position:a,id:r});return l.ESSceneObjectID=e,s.billboard=l,s.zOrder=o.zOrder,r}addRectangle(e,i,o,r){const a=this.makeScreenObjectId(e,o.index??c.createGuid()),s=rt(o.position),l=this.getOrCreateObject(a,s);if(l.rectangle)return a;const u=this.screenManager.rectangleCollection.add({...dH(i.element),...i,id:a,position:s,callback:r});return r(!0),l.rectangle=u,l.zOrder=o.zOrder,a}update(e,i){const o=Array.isArray(e)?e:[e];for(const r of o){const a=this.objects.get(r);if(a)for(const s of hE){const l=Object.assign({},i[s],(i==null?void 0:i.all)??{});if(!l)continue;const u=a[s];if(u)for(const A in l)A!=="position"&&A!=="id"&&(u[A]=l[A])}}return!0}remove(e){const i=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(i)){for(const o of i){const r=this.objects.get(o);r&&(r.label&&(this.screenManager.labelCollection.remove(r.label),r.label=void 0),r.billboard&&(this.screenManager.billboardCollection.remove(r.billboard),r.billboard=void 0),r.rectangle&&(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(i)){const r=Array.isArray(i[o])?i[o]:[i[o]];for(const a of r){if(!a)continue;const s=this.objects.get(a);if(!s)continue;const l=s[o];l&&(this.screenManager.collectionMap[o].remove(l),s[o]=void 0),this.tryDeleteEmpty(a)}}return!0}}makeScreenObjectId(e,i){return`${e}_${i}`}getOrCreateObject(e,i){let o=this.objects.get(e);return o||(o=new pH(e,i),this.objects.set(e,o)),o}tryDeleteEmpty(e){const i=this.objects.get(e);i&&!i.label&&!i.billboard&&!i.rectangle&&this.objects.delete(e)}}function gH(t,n){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&hE.includes(i)){const o=n[i];if(!o)continue;const r=o.computeScreenSpacePosition(t.scene);let a=b[o instanceof b.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,r),{x:s,y:l,width:u,height:A}=a;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],l),e[2]=Math.max(e[2],s+u),e[3]=Math.max(e[3],l+A)}return new b.Rectangle(...e)}class yH extends c.Destroyable{constructor(e){super();L(this,"rectangleCollisionCheck",new b.RectangleCollisionChecker);L(this,"screenManager");L(this,"enable",!1);L(this,"forceRebuildNext",!1);L(this,"avoidanceLayers",[]);L(this,"_processingQueue",[]);L(this,"_isProcessing",!1);L(this,"BATCH_SIZE",1e3);L(this,"_cache",new Map);L(this,"_lastCameraState",{});L(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const i=this.screenManager.getLayer(this.avoidanceLayers[e]);i.layerIsEffective()&&i.objects.forEach((o,r)=>{o.show(!0)})}this.forceRebuildNext=!0,this.update()}updateAvoidanceLayer(e,i){this.enable=(e==null?void 0:e.enabled)??!1,i?e!=null&&e.enabled?this.avoidanceLayers.includes(i)||this.avoidanceLayers.push(i):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=i):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,i=e.positionWC,o=e.directionWC,r=this._lastCameraState.position,a=this._lastCameraState.direction;if(!r||!a)return this._updateLastCameraState(),!0;const s=b.Cartesian3.distanceSquared(i,r),l=b.Cartesian3.distanceSquared(o,a);return s>this.CAMERA_MOVE_THRESHOLD||l>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=b.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=b.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let i=0;i<this.avoidanceLayers.length;i++){const o=this.screenManager.getLayer(this.avoidanceLayers[i]);o.layerIsEffective()&&o.objects.forEach((r,a)=>{this._processingQueue.push(r)})}this._processingQueue.sort((i,o)=>(o.zOrder||0)-(i.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,i=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<i;){const r=e.shift();this._updateSingleObject(r),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const i=e.id.toString(),o=this._cache.get(i),r=b.Cartesian3.clone(e.position);let a;if(o&&b.Cartesian3.equalsEpsilon(o.worldPos,r,1e-6))a=o.rect,this.rectangleCollisionCheck.remove(i,a);else{if(a=gH(this.screenManager.viewer,e),isNaN(a.width)||isNaN(a.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(i,{rect:a,worldPos:r,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(a)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),a))}catch(i){console.error("ScreenManager update object error",i)}}}class AE extends c.Destroyable{constructor(){super();L(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class fE extends c.Destroyable{constructor(e){super();L(this,"layers",new Map);L(this,"czmViewer");L(this,"viewer");L(this,"avoidanceManager");L(this,"labelCollection");L(this,"billboardCollection");L(this,"rectangleCollection",this.ad(new AE));L(this,"canvasCollection",this.ad(new AE));L(this,"collectionMap");L(this,"_refreshEvent",this.ad(new c.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new yH(this)),this.labelCollection=new b.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new b.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(c.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(i=>i.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let i=this.layers.get(e);return i||(i=new mH(this),this.layers.set(e,i),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),i}addLabel(e,i,o,r){const s=this.getLayer(i).addLabel(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addImage(e,i,o,r){const s=this.getLayer(i).addImage(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addRectangle(e,i,o,r,a){const l=this.getLayer(i).addRectangle(e,o,r,a);return this.refresh(),{layer:i,id:e,screenObjectId:l}}update(e,i,o,r){const a=this.getLayer(e);return!o||o.length===0?!1:(a.update(o,r),this.refresh(),!0)}remove(e,i,o){const r=this.getLayer(e);if(!r.remove(o)){console.warn(`屏幕管理器,删除${i}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,i){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,i),this.refresh()}}function Ot(t){return c.getExtProp(t,"_viewerExtensions")}function Qv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class dE extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");L(this,"_screenManager");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new uE(this.viewer)),this._terrainManager=this.dv(new aE(this.viewer)),this._labelManager=this.dv(new lE(this.viewer)),this._poiContext=this.disposeVar(new N0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new fH(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new cE(i)),this._screenManager=this.ad(new fE(i)),this.ad(c.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var pE=new b.Cartesian3,mE=new b.Cartesian3;function gE(t,n,e){let i=b.Matrix4.clone(t.transform);t.lookAtTransform(b.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=b.Cartesian3.normalize(r,pE),s=b.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=b.Cartesian3.cross(t.direction,a,mE);else var l=b.Cartesian3.cross(t.up,a,mE);var u=l;if(e){var A=b.Cartesian3.cross(a,l,pE);u=A}var h=b.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,p=f.longitude,d=f.latitude;b.Cartesian3.fromRadians(p,d,o,void 0,t.position),t.lookAtTransform(i)}function yE(t,n){gE(t,n,!1)}function vE(t,n){gE(t,-n,!0)}class vH extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&yE(r,A*h),a.MoveBackword&&yE(r,-A*h),a.MoveLeft&&vE(r,-A*h),a.MoveRight&&vE(r,A*h));{const{rotateSpeed:f}=this.controller,p=b.Math.toRadians(f*A);a.RotateRight?r.lookRight(p):a.RotateLeft?r.lookRight(-p):a.RotateUp?r.lookDown(-p):a.RotateDown&&r.lookDown(p)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class Yf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
3846
|
-
`))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=Yf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=Yf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class wH extends c.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Yf(this)),this._cameraOp=this.dv(new vH(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const od=class od extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"_keyStatusMap",this.dv(c.react(od.defaultKeyStatusMap)));L(this,"_speed",this.dv(c.react(1)));L(this,"_rotateSpeed",this.dv(c.react(.01)));L(this,"_alwaysWithCamera",this.dv(c.react(!1)));L(this,"_keyDownEvent",this.dv(new c.Event));L(this,"_keyUpEvent",this.dv(new c.Event));L(this,"_abortEvent",this.dv(new c.Event));this._firstPersonController=e,this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new wH(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};L(od,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let Jf=od;function bH(t,n){t.lookRight(b.Math.toRadians(n.movementX)*.1),t.lookDown(b.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=b.Math.clamp(e,-b.Math.PI_OVER_TWO,b.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class xH extends c.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;bH(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const sd=class sd extends c.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new xH(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=sd.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(sd,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Vv=sd;class _H extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Vv(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class CH extends c.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new _H(this)));L(this,"_keyboardCameraController",this.dv(new Jf(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function wE(t){t.removeInputAction(b.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(b.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(b.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(b.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(b.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(b.ScreenSpaceEventType.MIDDLE_UP)}function Nv(t,n,e,i=void 0){const r=t.camera,a=new b.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new b.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new b.Ray),u=r.getPickRay(s,new b.Ray),A=0,h,f;if(!l||!u)return;r.frustum instanceof b.OrthographicFrustum?(h=l.origin,f=u.origin,b.Cartesian3.add(r.direction,h,h),b.Cartesian3.add(r.direction,f,f),b.Cartesian3.subtract(h,r.position,h),b.Cartesian3.subtract(f,r.position,f),b.Cartesian3.normalize(h,h),b.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction);let p=b.Cartesian3.dot(h,f);p<1&&(A=Math.acos(p)),A=n.startPosition.x>n.endPosition.x?A:-A;const d=e._horizontalRotationAxis;if(b.defined(i)?r.look(i,-A):b.defined(d)?r.look(d,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new b.Ray),u=r.getPickRay(s,new b.Ray),A=0,!(!l||!u))if(r.frustum instanceof b.OrthographicFrustum?(h=l.origin,f=u.origin,b.Cartesian3.add(r.direction,h,h),b.Cartesian3.add(r.direction,f,f),b.Cartesian3.subtract(h,r.position,h),b.Cartesian3.subtract(f,r.position,f),b.Cartesian3.normalize(h,h),b.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction),p=b.Cartesian3.dot(h,f),p<1&&(A=Math.acos(p)),A=n.startPosition.y>n.endPosition.y?A:-A,i=i??d,b.defined(i)){const m=r.direction,v=b.Cartesian3.negate(i,new b.Cartesian3),y=b.Cartesian3.equalsEpsilon(m,i,b.Math.EPSILON2),g=b.Cartesian3.equalsEpsilon(m,v,b.Math.EPSILON2);if(!y&&!g){p=b.Cartesian3.dot(m,i);let _=b.Math.acosClamped(p);A>0&&A>_&&(A=_-b.Math.EPSILON4),p=b.Cartesian3.dot(m,v),_=b.Math.acosClamped(p),A<0&&-A>_&&(A=-_+b.Math.EPSILON4);const x=b.Cartesian3.cross(i,m,new b.Cartesian3);r.look(x,A)}else(y&&A<0||g&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class SH extends c.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const h=rt(n.position),f=i.camera.positionWC,p=b.Cartesian3.distance(h,f);n.viewDistance=p}c.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=zi.defaults.offsetRotation}=n,u=[...l];c.Vector.set(r,0,0,0),s&&(n.relativeRotation??zi.defaults.relativeRotation)&&(c.Vector.add(s,r,r),u[0]+=90),c.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=c.Vector.add(n.offsetRotation??zi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class zi extends c.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new c.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new SH(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=gs(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(zi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(zi||(zi={})),c.extendClassProps(zi.prototype,zi.createDefaultProps);class xu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new zi(e)),this._geoPolylinePath=this.dv(new aa(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(c.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(c.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(c.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(c.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(c.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new c.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new EH(this,e);if(this.lineMode==="manual")return new PH(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(xu||(xu={})),c.extendClassProps(xu.prototype,xu.createDefaultProps);class EH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class PH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class BH extends c.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class TH extends c.Destroyable{constructor(n,e){super();const i=this.dv(new c.ESSceneObjectWithId);i.id=n;const o=this.dv(c.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new c.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new BH(r,e)}))}}class _u extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new zi(e)),this.d(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new c.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new TH(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(_u||(_u={})),c.extendClassProps(_u.prototype,_u.createDefaultProps);class IH extends c.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new b.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},b.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:b.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*b.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*b.Math.PI*2/this.cycle;e.setView({destination:b.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*b.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class FH extends c.Destroyable{constructor(e){super();L(this,"_height",this.dv(c.react(1e7)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_latitude",this.dv(c.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new IH(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class MH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new b.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new b.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=b.Cartesian3.fromDegrees(...this.position);a&&(this._transform=b.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=b.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=b.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new b.Cartesian3(0,i,o);e.flyTo({destination:b.Matrix4.multiplyByPoint(this._transform,r,new b.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*b.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new b.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(b.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class DH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new MH(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class RH extends c.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new CH(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=Jf.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new FH(e)),this._rotatePoint=this.dv(new DH(e)),this._followController=this.dv(new _u(e)),this._pathCameraController=this.dv(new xu(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=b.Cartesian3.fromDegrees(e[0],e[1],(l??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=c.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const h=c.getDistancesFromPositions(A,"NONE"),f=h[h.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const p=x0(A);this._pathCameraController.polylinePath.rotationRadius=!l||p==!1?[0]:p.map(d=>d/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new b.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&wE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.LEFT_UP)},b.ScreenSpaceEventType.LEFT_UP)},b.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.RIGHT_UP)},b.ScreenSpaceEventType.RIGHT_UP)},b.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.MIDDLE_UP)},b.ScreenSpaceEventType.MIDDLE_UP)},b.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&wE(o),r.lookEventTypes=b.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=b.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[b.CameraEventType.MIDDLE_DRAG,b.CameraEventType.PINCH,{eventType:b.CameraEventType.LEFT_DRAG,modifier:b.KeyboardEventModifier.CTRL},{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.CTRL}],r.translateEventTypes=b.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[b.CameraEventType.WHEEL,b.CameraEventType.PINCH,{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.SHIFT}])}}const UH=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class OH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new b.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ze(s.scale),maximumSize:ri(s.maximumSize),color:Be(s.color),position:rt(s.position)});(()=>{o.removeAll();for(let s of UH)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class Cu extends c.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(b.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(Cu||(Cu={})),c.extendClassProps(Cu.prototype,Cu.createDefaultProps);const LH=`
|
|
3845
|
+
}`},translucent:!0}),A3(),f3(),d3(),y3(),v3(),w3(),b3(),h3(),M3(),D3(),U3(),iN(),b.Camera.DEFAULT_VIEW_RECTANGLE=b.Rectangle.fromDegrees(70,5,140,55);function sH(){return new Promise((t,n)=>b.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class aH extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Ot(s);if(l&&(l.destroy(),Qv(s,void 0)),b.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=c3;await s.promise(sH());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=b.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=b.JulianDate.fromDate(new Date(e.currentTime));b.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=b.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new dE(A,e);Qv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const lH=new b.EllipsoidTerrainProvider;class aE extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??lH}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class lE extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof bt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof bt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof bt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof bt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class uH extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class cH extends c.Destroyable{constructor(e){super();L(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:i}=this,o=i.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class hH extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new cH(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class AH extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new hH(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class uE extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new uH(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new AH(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class cE extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,p]=u;try{(async()=>{const{scene:d,camera:m}=i,v=Ze(A),y=m.getPickRay(v);if(y){let E;if(h?E=await d.pickFromRayMostDetailed(y,this.objectsToExclude):E=d.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=De(E.position);return B?f(B):p(new Error("positionFromCartesian failed"))}if(!(d.terrainProvider instanceof b.EllipsoidTerrainProvider)){const B=d.globe.pick(y,d);if(!B)return p(new Error("scene.globe.pick failed"));const P=De(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):p(new Error("positionFromCartesian failed"))}}const g=d.terrainProvider instanceof b.EllipsoidTerrainProvider?d.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,_=i.camera.pickEllipsoid(Ze(A),g);if(!_)return p(new Error("Pick failed"));const x=De(_);return x?f(x):p(new Error("positionFromCartesian failed"))})()}catch(d){p(d)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,p,d]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let m=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!m&&b.defined(i.scene.globe)&&(m=await fH(i,Ze(A)));let v;if(m&&m instanceof b.Cesium3DTileFeature){v={};try{m&&m.getPropertyIds().forEach(F=>{v&&(v[F]=m.getProperty(F))})}catch(D){console.warn(D)}}if(!m){const{left:D,top:F}=e.container.getBoundingClientRect();m=(E=document.elementFromPoint(A[0]+D,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;m&&(m.id&&m.id instanceof b.Entity&&m.id.ESSceneObjectID?y=m.id.ESSceneObjectID:m.collection&&m.collection.ESSceneObjectID?y=m.collection.ESSceneObjectID:m.primitive&&m.primitive.ESSceneObjectID?y=m.primitive.ESSceneObjectID:Array.isArray(m)&&m[0]instanceof b.ImageryLayerFeatureInfo?y=m[0].imageryLayer.ESSceneObjectID:m instanceof HTMLElement&&(y=m.dataset.esSceneObjectId));let g=y?c.ESSceneObject.getSceneObject(y):void 0;g&&g.parentID&&(g=c.ESSceneObject.getSceneObject(g.parentID));let _={};if(g&&Reflect.has(g,"allowPicking")&&Reflect.has(g,"pickedEvent")&&(g.allowPicking??!1)){if(g instanceof c.ESEntityCluster){const D=new b.JulianDate;_=m.id instanceof b.Entity?{name:m.id.label.text.getValue(D),properties:(B=m.id.properties)==null?void 0:B.getValue(D),coordinates:Ya(m.id.position.getValue(D))}:(P=m.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(D),coordinates:Ya(F.position.getValue(D))}})}else if(g instanceof c.ESGeoJson){const D=new b.JulianDate;if(!m.id.entityCollection)return;const F=m.id.polygon?"Polygon":m.id.polyline?"LineString":"Point",S=((I=m.id.properties)==null?void 0:I.getValue(D))??{},T=F=="Point"?De(m.id.position.getValue(D)):F=="LineString"?m.id.polyline.positions.getValue(D).map(w=>De(w)):_d(m.id.polygon.hierarchy.getValue(D));_=g.pickedInfoType=="FeatureCollection"||g.pickedInfoType=="Feature"?{type:"Feature",geometry:{type:F,coordinates:T},properties:S}:{type:F,coordinates:T,properties:S}}else if(g instanceof c.ESGltfModel){let D;Reflect.has(m,"featureId")?D=m.featureId:Reflect.has(m,"instanceId")&&(D=m.instanceId),D&&(m.id=m.primitive.structuralMetadata.getPropertyTable(0).getProperty(m.instanceId,"id"))}g.pickedEvent.emit(new c.ESJPickedResult(m,g,v,_,f,A))}g&&Reflect.has(g,"allowPicking")&&!g.allowPicking&&p(new c.ESJPickedResult);const x=new c.ESJPickedResult(m,g,v,_,f,A);p(x)})()}catch(m){d(m)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function fH(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(b.defined(o))return o}class dH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Ot(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function pH(t){const n=t.cloneNode(!0);n.style.position="absolute",n.style.top="0",n.style.zIndex="-1",document.body.appendChild(n);const e=n.getBoundingClientRect();return document.body.removeChild(n),{width:e.width,height:e.height}}const hE=["label","billboard","rectangle"];class mH extends c.Destroyable{constructor(e,i){super();L(this,"id",c.createGuid());L(this,"position",b.Cartesian3.ZERO);L(this,"label");L(this,"billboard");L(this,"rectangle");L(this,"zOrder");L(this,"labelRefCount",1);L(this,"billboardRefCount",1);L(this,"rectangleRefCount",1);L(this,"_showEvent",this.disposeVar(new c.Event));this.id=e,this.position=i,this.ad(this.showEvent.don(o=>{this.updateShow(o)}))}get showEvent(){return this._showEvent}show(e){this._showEvent.emit(e)}updateShow(e){this.label&&(this.label.show=e),this.billboard&&(this.billboard.show=e),this.rectangle&&(this.rectangle.show=e)}}class gH extends c.Destroyable{constructor(e){super();L(this,"objects",new Map);L(this,"screenManager");L(this,"czmViewer");L(this,"viewer");this.screenManager=e,this.czmViewer=e.czmViewer,this.viewer=e.viewer,this.ad(()=>{this.objects.clear()})}layerIsEffective(){return this.objects.size>0}addLabel(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.label)return s.labelRefCount++,r;const l=this.screenManager.labelCollection.add({...i,position:a,id:r,text:o.name});return l.ESSceneObjectID=e,s.label=l,s.zOrder=o.zOrder,r}addImage(e,i,o){const r=this.makeScreenObjectId(e,o.index??c.createGuid()),a=rt(o.position),s=this.getOrCreateObject(r,a);if(s.billboard)return s.billboardRefCount++,r;const l=this.screenManager.billboardCollection.add({...i,position:a,id:r});return l.ESSceneObjectID=e,s.billboard=l,s.zOrder=o.zOrder,r}addRectangle(e,i,o,r){const a=this.makeScreenObjectId(e,o.index??c.createGuid()),s=rt(o.position),l=this.getOrCreateObject(a,s);if(l.rectangle)return l.rectangleRefCount++,a;const u=this.screenManager.rectangleCollection.add({...pH(i.element),...i,id:a,position:s,callback:r});return r(!0),l.rectangle=u,l.zOrder=o.zOrder,a}update(e,i){const o=Array.isArray(e)?e:[e];for(const r of o){const a=this.objects.get(r);if(a)for(const s of hE){const l=Object.assign({},i[s],(i==null?void 0:i.all)??{});if(!l)continue;const u=a[s];if(u)for(const A in l)A!=="position"&&A!=="id"&&(u[A]=l[A])}}return!0}remove(e){const i=Array.isArray(e)?e:typeof e=="string"?[e]:e;if(Array.isArray(i)){for(const o of i){const r=this.objects.get(o);r&&(r.label&&(r.labelRefCount>1?r.labelRefCount--:(this.screenManager.labelCollection.remove(r.label),r.label=void 0)),r.billboard&&(r.billboardRefCount>1?r.billboardRefCount--:(this.screenManager.billboardCollection.remove(r.billboard),r.billboard=void 0)),r.rectangle&&(r.rectangleRefCount>1?r.rectangleRefCount--:(this.screenManager.rectangleCollection.remove(r.rectangle),r.rectangle=void 0)),this.tryDeleteEmpty(o))}return!0}else{for(const o of Object.keys(i)){const r=Array.isArray(i[o])?i[o]:[i[o]];for(const a of r){if(!a)continue;const s=this.objects.get(a);if(!s)continue;const l=s[o];l&&(this.screenManager.collectionMap[o].remove(l),s[o]=void 0),this.tryDeleteEmpty(a)}}return!0}}makeScreenObjectId(e,i){return`${e}_${i}`}getOrCreateObject(e,i){let o=this.objects.get(e);return o||(o=new mH(e,i),this.objects.set(e,o)),o}tryDeleteEmpty(e){const i=this.objects.get(e);i&&!i.label&&!i.billboard&&!i.rectangle&&this.objects.delete(e)}}function yH(t,n){const e=[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER];for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&hE.includes(i)){const o=n[i];if(!o)continue;const r=o.computeScreenSpacePosition(t.scene);let a=b[o instanceof b.Label?"Label":"Billboard"].getScreenSpaceBoundingBox(o,r),{x:s,y:l,width:u,height:A}=a;e[0]=Math.min(e[0],s),e[1]=Math.min(e[1],l),e[2]=Math.max(e[2],s+u),e[3]=Math.max(e[3],l+A)}return new b.Rectangle(...e)}class vH extends c.Destroyable{constructor(e){super();L(this,"rectangleCollisionCheck",new b.RectangleCollisionChecker);L(this,"screenManager");L(this,"enable",!1);L(this,"forceRebuildNext",!1);L(this,"avoidanceLayers",[]);L(this,"_processingQueue",[]);L(this,"_isProcessing",!1);L(this,"BATCH_SIZE",1e3);L(this,"_cache",new Map);L(this,"_lastCameraState",{});L(this,"CAMERA_MOVE_THRESHOLD",5e-4);this.screenManager=e,this.ad(()=>{this.rectangleCollisionCheck._tree.clear(),this._cache.clear(),this._processingQueue.length=0})}update(){if(this.avoidanceLayers.length==0)return;const e=this._shouldForceRebuild();this._buildProcessingQueue(e),this._isProcessing||(this._isProcessing=!0,requestAnimationFrame(()=>this._processBatch()))}setAvoidanceLayer(){for(let e=0;e<this.avoidanceLayers.length;e++){const i=this.screenManager.getLayer(this.avoidanceLayers[e]);i.layerIsEffective()&&i.objects.forEach((o,r)=>{o.show(!0)})}this.forceRebuildNext=!0}updateAvoidanceLayer(e,i){this.enable=(e==null?void 0:e.enabled)??!1,i?e!=null&&e.enabled?this.avoidanceLayers.includes(i)||this.avoidanceLayers.push(i):this.avoidanceLayers=this.avoidanceLayers.filter(o=>o!=i):e!=null&&e.enabled?this.avoidanceLayers=Array.from(this.screenManager.layers.keys()):(this.setAvoidanceLayer(),this.avoidanceLayers=[]),this.setAvoidanceLayer()}_shouldForceRebuild(){if(this.forceRebuildNext)return this.forceRebuildNext=!1,this._updateLastCameraState(),!0;const e=this.screenManager.viewer.camera,i=e.positionWC,o=e.directionWC,r=this._lastCameraState.position,a=this._lastCameraState.direction;if(!r||!a)return this._updateLastCameraState(),!0;const s=b.Cartesian3.distanceSquared(i,r),l=b.Cartesian3.distanceSquared(o,a);return s>this.CAMERA_MOVE_THRESHOLD||l>this.CAMERA_MOVE_THRESHOLD?(this._updateLastCameraState(),!0):!1}_updateLastCameraState(){const e=this.screenManager.viewer.camera;this._lastCameraState.position=b.Cartesian3.clone(e.positionWC),this._lastCameraState.direction=b.Cartesian3.clone(e.directionWC)}_buildProcessingQueue(e){e&&(this.rectangleCollisionCheck._tree.clear(),this._cache.clear()),this._processingQueue.length=0;for(let i=0;i<this.avoidanceLayers.length;i++){const o=this.screenManager.getLayer(this.avoidanceLayers[i]);o.layerIsEffective()&&o.objects.forEach((r,a)=>{this._processingQueue.push(r)})}this._processingQueue.sort((i,o)=>(o.zOrder||0)-(i.zOrder||0))}_processBatch(){performance.now();const e=this._processingQueue,i=this.BATCH_SIZE;let o=0;for(;e.length>0&&o<i;){const r=e.shift();this._updateSingleObject(r),o++}e.length>0?requestAnimationFrame(()=>this._processBatch()):this._isProcessing=!1}_updateSingleObject(e){try{if(!this.screenManager.czmViewer.isPointVisible(e.position)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}const i=e.id.toString(),o=this._cache.get(i),r=b.Cartesian3.clone(e.position);let a;if(o&&b.Cartesian3.equalsEpsilon(o.worldPos,r,1e-6))a=o.rect,this.rectangleCollisionCheck.remove(i,a);else{if(a=yH(this.screenManager.viewer,e),isNaN(a.width)||isNaN(a.height)){e.show(!1),this._cache.has(e.id.toString())&&this._cache.delete(e.id.toString());return}this._cache.set(i,{rect:a,worldPos:r,lastFrame:Date.now()})}this.rectangleCollisionCheck.collides(a)?e.show(!1):(e.show(!0),this.rectangleCollisionCheck.insert(e.id.toString(),a))}catch(i){console.error("ScreenManager update object error",i)}}}class AE extends c.Destroyable{constructor(){super();L(this,"_collection",[]);this.ad(()=>this._collection=[])}get length(){return this._collection.length}add(e){return this._collection.push(e),e._index=this._collection.length,e}remove(e){this._collection[e._index]=void 0}}class fE extends c.Destroyable{constructor(e){super();L(this,"layers",new Map);L(this,"czmViewer");L(this,"viewer");L(this,"avoidanceManager");L(this,"labelCollection");L(this,"billboardCollection");L(this,"rectangleCollection",this.ad(new AE));L(this,"canvasCollection",this.ad(new AE));L(this,"collectionMap");L(this,"_refreshEvent",this.ad(new c.Event));this.czmViewer=e,this.viewer=e.viewer,this.avoidanceManager=this.ad(new vH(this)),this.labelCollection=new b.LabelCollection({scene:this.viewer.scene}),this.billboardCollection=new b.BillboardCollection({scene:this.viewer.scene}),this.viewer.scene.primitives.add(this.labelCollection),this.viewer.scene.primitives.add(this.billboardCollection),this.collectionMap={label:this.labelCollection,billboard:this.billboardCollection,rectangle:this.rectangleCollection},this.ad(c.createEventsCallFunc([this.czmViewer.cameraChanged,this.refreshEvent],()=>{this.avoidanceManager.update()},{immediate:!0})),this.ad(()=>{this.layers.forEach(i=>i.destroy()),this.layers.clear(),this.labelCollection.removeAll(),this.billboardCollection.removeAll(),this.viewer.scene.primitives.remove(this.labelCollection),this.viewer.scene.primitives.remove(this.billboardCollection)})}get refreshEvent(){return this._refreshEvent}refresh(){this._refreshEvent.emit()}getLayer(e){let i=this.layers.get(e);return i||(i=new gH(this),this.layers.set(e,i),this.avoidanceManager.enable&&this.avoidanceManager.updateAvoidanceLayer({enabled:!0})),i}addLabel(e,i,o,r){const s=this.getLayer(i).addLabel(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addImage(e,i,o,r){const s=this.getLayer(i).addImage(e,o,r);return this.refresh(),{layer:i,id:e,screenObjectId:s}}addRectangle(e,i,o,r,a){const l=this.getLayer(i).addRectangle(e,o,r,a);return this.refresh(),{layer:i,id:e,screenObjectId:l}}update(e,i,o,r){const a=this.getLayer(e);return!o||o.length===0?!1:(a.update(o,r),this.refresh(),!0)}remove(e,i,o){const r=this.getLayer(e);if(!r.remove(o)){console.warn(`屏幕管理器,删除${i}下的内容失败!`);return}!r.layerIsEffective()&&!r.isDestroyed()&&(r.destroy(),this.layers.delete(e)),this.refresh()}setRules(e,i){Reflect.has(e,"avoidance")&&this.avoidanceManager.updateAvoidanceLayer(e.avoidance,i),this.refresh()}}function Ot(t){return c.getExtProp(t,"_viewerExtensions")}function Qv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class dE extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");L(this,"_screenManager");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new uE(this.viewer)),this._terrainManager=this.dv(new aE(this.viewer)),this._labelManager=this.dv(new lE(this.viewer)),this._poiContext=this.disposeVar(new N0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new dH(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new cE(i)),this._screenManager=this.ad(new fE(i)),this.ad(c.createEventsCallFunc(this.czmViewer.textAvoidanceChanged,()=>{this.screenManager.setRules({avoidance:{enabled:this.czmViewer.textAvoidance}})},{immediate:!0}))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}get screenManager(){return this._screenManager}}var pE=new b.Cartesian3,mE=new b.Cartesian3;function gE(t,n,e){let i=b.Matrix4.clone(t.transform);t.lookAtTransform(b.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=b.Cartesian3.normalize(r,pE),s=b.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=b.Cartesian3.cross(t.direction,a,mE);else var l=b.Cartesian3.cross(t.up,a,mE);var u=l;if(e){var A=b.Cartesian3.cross(a,l,pE);u=A}var h=b.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,p=f.longitude,d=f.latitude;b.Cartesian3.fromRadians(p,d,o,void 0,t.position),t.lookAtTransform(i)}function yE(t,n){gE(t,n,!1)}function vE(t,n){gE(t,-n,!0)}class wH extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&yE(r,A*h),a.MoveBackword&&yE(r,-A*h),a.MoveLeft&&vE(r,-A*h),a.MoveRight&&vE(r,A*h));{const{rotateSpeed:f}=this.controller,p=b.Math.toRadians(f*A);a.RotateRight?r.lookRight(p):a.RotateLeft?r.lookRight(-p):a.RotateUp?r.lookDown(-p):a.RotateDown&&r.lookDown(p)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class Yf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
|
|
3846
|
+
`))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=Yf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=Yf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class bH extends c.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Yf(this)),this._cameraOp=this.dv(new wH(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const od=class od extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"_keyStatusMap",this.dv(c.react(od.defaultKeyStatusMap)));L(this,"_speed",this.dv(c.react(1)));L(this,"_rotateSpeed",this.dv(c.react(.01)));L(this,"_alwaysWithCamera",this.dv(c.react(!1)));L(this,"_keyDownEvent",this.dv(new c.Event));L(this,"_keyUpEvent",this.dv(new c.Event));L(this,"_abortEvent",this.dv(new c.Event));this._firstPersonController=e,this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new bH(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};L(od,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let Jf=od;function xH(t,n){t.lookRight(b.Math.toRadians(n.movementX)*.1),t.lookDown(b.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=b.Math.clamp(e,-b.Math.PI_OVER_TWO,b.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class _H extends c.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;xH(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const sd=class sd extends c.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new _H(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=sd.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(sd,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Vv=sd;class CH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Vv(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class SH extends c.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new CH(this)));L(this,"_keyboardCameraController",this.dv(new Jf(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function wE(t){t.removeInputAction(b.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(b.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(b.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(b.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(b.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(b.ScreenSpaceEventType.MIDDLE_UP)}function Nv(t,n,e,i=void 0){const r=t.camera,a=new b.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new b.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new b.Ray),u=r.getPickRay(s,new b.Ray),A=0,h,f;if(!l||!u)return;r.frustum instanceof b.OrthographicFrustum?(h=l.origin,f=u.origin,b.Cartesian3.add(r.direction,h,h),b.Cartesian3.add(r.direction,f,f),b.Cartesian3.subtract(h,r.position,h),b.Cartesian3.subtract(f,r.position,f),b.Cartesian3.normalize(h,h),b.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction);let p=b.Cartesian3.dot(h,f);p<1&&(A=Math.acos(p)),A=n.startPosition.x>n.endPosition.x?A:-A;const d=e._horizontalRotationAxis;if(b.defined(i)?r.look(i,-A):b.defined(d)?r.look(d,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new b.Ray),u=r.getPickRay(s,new b.Ray),A=0,!(!l||!u))if(r.frustum instanceof b.OrthographicFrustum?(h=l.origin,f=u.origin,b.Cartesian3.add(r.direction,h,h),b.Cartesian3.add(r.direction,f,f),b.Cartesian3.subtract(h,r.position,h),b.Cartesian3.subtract(f,r.position,f),b.Cartesian3.normalize(h,h),b.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction),p=b.Cartesian3.dot(h,f),p<1&&(A=Math.acos(p)),A=n.startPosition.y>n.endPosition.y?A:-A,i=i??d,b.defined(i)){const m=r.direction,v=b.Cartesian3.negate(i,new b.Cartesian3),y=b.Cartesian3.equalsEpsilon(m,i,b.Math.EPSILON2),g=b.Cartesian3.equalsEpsilon(m,v,b.Math.EPSILON2);if(!y&&!g){p=b.Cartesian3.dot(m,i);let _=b.Math.acosClamped(p);A>0&&A>_&&(A=_-b.Math.EPSILON4),p=b.Cartesian3.dot(m,v),_=b.Math.acosClamped(p),A<0&&-A>_&&(A=-_+b.Math.EPSILON4);const x=b.Cartesian3.cross(i,m,new b.Cartesian3);r.look(x,A)}else(y&&A<0||g&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class EH extends c.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const h=rt(n.position),f=i.camera.positionWC,p=b.Cartesian3.distance(h,f);n.viewDistance=p}c.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=zi.defaults.offsetRotation}=n,u=[...l];c.Vector.set(r,0,0,0),s&&(n.relativeRotation??zi.defaults.relativeRotation)&&(c.Vector.add(s,r,r),u[0]+=90),c.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=c.Vector.add(n.offsetRotation??zi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class zi extends c.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new c.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new EH(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=gs(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(zi,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(zi||(zi={})),c.extendClassProps(zi.prototype,zi.createDefaultProps);class xu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new zi(e)),this._geoPolylinePath=this.dv(new aa(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(c.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(c.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(c.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(c.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(c.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new c.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new PH(this,e);if(this.lineMode==="manual")return new BH(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(xu||(xu={})),c.extendClassProps(xu.prototype,xu.createDefaultProps);class PH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class BH extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class TH extends c.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class IH extends c.Destroyable{constructor(n,e){super();const i=this.dv(new c.ESSceneObjectWithId);i.id=n;const o=this.dv(c.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new c.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new TH(r,e)}))}}class _u extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new zi(e)),this.d(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new c.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new IH(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(_u||(_u={})),c.extendClassProps(_u.prototype,_u.createDefaultProps);class FH extends c.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new b.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},b.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,i=e.positionCartographic;e.flyTo({destination:b.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*b.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*b.Math.PI*2/this.cycle;e.setView({destination:b.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*b.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class MH extends c.Destroyable{constructor(e){super();L(this,"_height",this.dv(c.react(1e7)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_latitude",this.dv(c.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new FH(i)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class DH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new b.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new b.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=b.Cartesian3.fromDegrees(...this.position);a&&(this._transform=b.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=b.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=b.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new b.Cartesian3(0,i,o);e.flyTo({destination:b.Matrix4.multiplyByPoint(this._transform,r,new b.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*b.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new b.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(b.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class RH extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new DH(i));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class UH extends c.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new SH(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=Jf.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new MH(e)),this._rotatePoint=this.dv(new RH(e)),this._followController=this.dv(new _u(e)),this._pathCameraController=this.dv(new xu(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=b.Cartesian3.fromDegrees(e[0],e[1],(l??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=c.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const h=c.getDistancesFromPositions(A,"NONE"),f=h[h.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const p=x0(A);this._pathCameraController.polylinePath.rotationRadius=!l||p==!1?[0]:p.map(d=>d/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new b.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&wE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.LEFT_UP)},b.ScreenSpaceEventType.LEFT_UP)},b.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.RIGHT_UP)},b.ScreenSpaceEventType.RIGHT_UP)},b.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Nv(i.scene,s,r)},b.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(b.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(b.ScreenSpaceEventType.MIDDLE_UP)},b.ScreenSpaceEventType.MIDDLE_UP)},b.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&wE(o),r.lookEventTypes=b.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=b.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[b.CameraEventType.MIDDLE_DRAG,b.CameraEventType.PINCH,{eventType:b.CameraEventType.LEFT_DRAG,modifier:b.KeyboardEventModifier.CTRL},{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.CTRL}],r.translateEventTypes=b.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[b.CameraEventType.WHEEL,b.CameraEventType.PINCH,{eventType:b.CameraEventType.RIGHT_DRAG,modifier:b.KeyboardEventModifier.SHIFT}])}}const OH=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class LH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new b.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ze(s.scale),maximumSize:ri(s.maximumSize),color:Be(s.color),position:rt(s.position)});(()=>{o.removeAll();for(let s of OH)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class Cu extends c.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(b.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(Cu||(Cu={})),c.extendClassProps(Cu.prototype,Cu.createDefaultProps);const zH=`
|
|
3847
3847
|
float getDistance(sampler2D depthTexture, vec2 texCoords)
|
|
3848
3848
|
{
|
|
3849
3849
|
float depth = czm_unpackDepth(texture(depthTexture, texCoords));
|
|
@@ -3879,7 +3879,7 @@ return material;
|
|
|
3879
3879
|
vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
|
|
3880
3880
|
out_FragColor = alphaBlend(finalFogColor, sceneColor);
|
|
3881
3881
|
}
|
|
3882
|
-
`;class
|
|
3882
|
+
`;class kH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"postProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(i.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new b.PostProcessStage({name:"earthsdk3_fog",fragmentShader:zH,uniforms:{fogByDistance:new b.Cartesian4(10,0,1e3,.9),fogColor:b.Color.WHITE}}),i.scene.postProcessStages.add(this.postProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const QH=`
|
|
3883
3883
|
uniform sampler2D colorTexture;
|
|
3884
3884
|
in vec2 v_textureCoordinates;
|
|
3885
3885
|
|
|
@@ -3906,7 +3906,7 @@ void main(void){
|
|
|
3906
3906
|
|
|
3907
3907
|
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), 0.5);
|
|
3908
3908
|
}
|
|
3909
|
-
`;class
|
|
3909
|
+
`;class VH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"rainPostProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(i.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new b.PostProcessStage({name:"earthsdk3_rain",fragmentShader:QH}),i.scene.postProcessStages.add(this.rainPostProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const NH=`
|
|
3910
3910
|
uniform sampler2D colorTexture; //输入的场景渲染照片
|
|
3911
3911
|
in vec2 v_textureCoordinates;
|
|
3912
3912
|
|
|
@@ -3937,7 +3937,7 @@ void main(void){
|
|
|
3937
3937
|
finalColor=(vec3(c)); //屏幕上雪的颜色
|
|
3938
3938
|
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5); //将雪和三维场景融合
|
|
3939
3939
|
}
|
|
3940
|
-
`,
|
|
3940
|
+
`,HH=`
|
|
3941
3941
|
#extension GL_OES_standard_derivatives : enable
|
|
3942
3942
|
uniform sampler2D colorTexture;
|
|
3943
3943
|
uniform sampler2D depthTexture;
|
|
@@ -3977,7 +3977,7 @@ void main() {
|
|
|
3977
3977
|
}
|
|
3978
3978
|
out_FragColor = mix(color, vec4(1.0), dotNumWC*alpha);
|
|
3979
3979
|
}
|
|
3980
|
-
`;class
|
|
3980
|
+
`;class GH extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"_alpha",this.dv(c.react(0)));L(this,"snow");L(this,"snowCover");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}let{snow:o,snowCover:r}=this;const a=()=>{o&&(i.scene.postProcessStages.remove(o),o=void 0)};this.d(a);const s=()=>{r&&(i.scene.postProcessStages.remove(r),r=void 0)};this.d(s);const l=()=>{if(!r)return;const A=b.Math.clamp(this.alpha,0,1);r.uniforms.alpha=A};l(),this.d(this.alphaChanged.don(l));const u=()=>{a(),s(),(this.show??!0)&&(o=new b.PostProcessStage({name:"earthsdk3_snow",fragmentShader:NH}),i.scene.postProcessStages.add(o),r=new b.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:HH,uniforms:{alpha:this.alpha}}),i.scene.postProcessStages.add(r),l())};u(),this.d(this.showChanged.don(u))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get alpha(){return this._alpha.value}set alpha(e){this._alpha.value=e}get alphaChanged(){return this._alpha.changed}}class WH extends c.Destroyable{constructor(e){super();L(this,"rain");L(this,"cloud");L(this,"snow");L(this,"fog");L(this,"depthOfField");const i=e.viewer;if(!i)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new VH(e)),r=this.dv(new LH(e)),a=this.dv(new GH(e)),s=this.dv(new kH(e)),l=this.dv(new Cu(e));this.rain=o,this.cloud=r,this.snow=a,this.fog=s,this.depthOfField=l;{const{scene:u}=i,A=()=>{u.sun&&(u.sun.show=e.sun??at.defaults.sun),u.globe.enableLighting=e.sun??at.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?r.show=!0:r.show=!1,e.snow>0&&e.snow<=1?(a.show=!0,a.alpha=e.snow):a.show=!1,e.fog>0&&e.fog<=1?s.show=!0:s.show=!1,e.depthOfField>0&&e.depthOfField<=1?l.show=!0:l.show=!1};A();const h=this.dv(c.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(h.don(A))}}}const Hv=b.BoundingRectangle,jH=b.Color,so=b.defined,qH=b.destroyObject,bE=b.DeveloperError,KH=b.RenderState,ZH=b.ShaderSource,$H=b._shadersViewportQuadFS,XH=b.BlendingState,xE=b.Material;function ed(t){this.show=!0;let n;so(n)||(n=new Hv),this.rectangle=Hv.clone(n),so(t)||(t=xE.fromType(xE.ColorType,{color:new jH(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}ed.prototype.update=function(t){if(this.show){if(!so(this.material))throw new bE("this.material must be defined.");if(!so(this.rectangle))throw new bE("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var n=this._rs;(!so(n)||!Hv.equals(n.viewport,this.rectangle))&&(this._rs=KH.fromCache({blending:XH.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var i=t.context;if(this._material!==this.material||!so(this._overlayCommand)){this._material=this.material,so(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new ZH({sources:[this._material.shaderSource,$H]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(i),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},ed.prototype.isDestroyed=function(){return!1},ed.prototype.destroy=function(){return so(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),qH(this)};function _E(t){const{positiveX:n,negativeX:e,positiveY:i,negativeY:o,positiveZ:r,negativeZ:a}=t;if(!n||!e||!i||!o||!r||!a){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:c.ESSceneObject.context.getStrFromEnv(n),negativeX:c.ESSceneObject.context.getStrFromEnv(e),positiveY:c.ESSceneObject.context.getStrFromEnv(i),negativeY:c.ESSceneObject.context.getStrFromEnv(o),positiveZ:c.ESSceneObject.context.getStrFromEnv(r),negativeZ:c.ESSceneObject.context.getStrFromEnv(a)}}const YH=`in vec3 v_outerPositionWC;
|
|
3981
3981
|
|
|
3982
3982
|
uniform vec3 u_hsbShift;
|
|
3983
3983
|
|
|
@@ -4056,7 +4056,7 @@ void main (void)
|
|
|
4056
4056
|
out_FragColor = color;
|
|
4057
4057
|
// ------------------ skybox vtxf end -------------------
|
|
4058
4058
|
}
|
|
4059
|
-
`,ao=b.Cartesian3,hr=b.defined,YH=b.destroyObject,JH=b.Ellipsoid,CE=b.EllipsoidGeometry,e7=b.GeometryPipeline,Va=b.Math,Ar=b.Matrix4,t7=b.VertexFormat,n7=b.BufferUsage,i7=b.DrawCommand,r7=b.RenderState,o7=b.ShaderProgram,SE=b.ShaderSource,s7=b.VertexArray,EE=b._shadersAtmosphereCommon,PE=b._shadersSkyAtmosphereCommon,a7=b._shadersSkyAtmosphereVS,l7=b.Axis,u7=b.BlendingState,c7=b.CullFace,BE=b.SceneMode,td=b.Transforms,h7=b.Matrix3,TE=b.DeveloperError,A7=b.loadCubeMap,f7=b.CubeMap;function Na(t,n){t=t??JH.WGS84,this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=ao.multiplyByScalar(t.radii,e,new ao);this._scaleMatrix=Ar.fromScale(i),this._modelMatrix=new Ar,this._command=new i7({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new ao(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new ao(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new ao;const o=new ao;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new h7,Ar.getMatrix3(r._eunMatrix||Ar.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(Na.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Na.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Gv=new Ar;Na.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==BE.SCENE3D&&e!==BE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const d=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!hr(o.positiveX)||!hr(o.negativeX)||!hr(o.positiveY)||!hr(o.negativeY)||!hr(o.positiveZ)||!hr(o.negativeZ))throw new TE("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new TE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?A7(d,this._sources).then(function(m){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=m}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new f7({context:d,source:o}))}const r=Ar.fromRotationTranslation(t.context.uniformState.inverseViewRotation,ao.ZERO,Gv),a=Ar.multiplyTransformation(r,l7.Y_UP_TO_Z_UP,Gv),s=Ar.multiply(this._scaleMatrix,a,Gv);Ar.clone(s,this._modelMatrix);const l=t.context,u=d7(this),A=t.globeTranslucencyState.translucent,h=this.perFragmentAtmosphere||A||!hr(n)||!n.show,f=this._command;if(td.eastUpNorthToFixedFrame=td.eastUpNorthToFixedFrame||td.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=td.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!hr(f.vertexArray)){const d=CE.createGeometry(new CE({radii:new ao(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:t7.POSITION_ONLY}));f.vertexArray=s7.fromGeometry({context:l,geometry:d,attributeLocations:e7.createAttributeLocations(d),bufferUsage:n7.STATIC_DRAW}),f.renderState=r7.fromCache({cull:{enabled:!0,face:c7.FRONT},blending:u7.ALPHA_BLEND,depthMask:!1})}const p=u|h<<2|A<<3;if(p!==this._flags){this._flags=p;const d=[];u&&d.push("COLOR_CORRECT"),h&&d.push("PER_FRAGMENT_ATMOSPHERE"),A&&d.push("GLOBE_TRANSLUCENT");const m=new SE({defines:d,sources:[EE,PE,a7]}),v=new SE({defines:d,sources:[EE,PE,XH]});this._spSkyAtmosphere=o7.fromCache({context:l,vertexShaderSource:m,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(hr(this._cubeMap))return f};function d7(t){return!(Va.equalsEpsilon(t.hueShift,0,Va.EPSILON7)&&Va.equalsEpsilon(t.saturationShift,0,Va.EPSILON7)&&Va.equalsEpsilon(t.brightnessShift,0,Va.EPSILON7))}Na.prototype.isDestroyed=function(){return!1},Na.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),YH(this)};const Xa=class Xa extends c.Destroyable{constructor(e,i){super();L(this,"_navigationManager");L(this,"_envManager");L(this,"_reu",(e,i)=>c.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new RH(r)),this._envManager=this.dv(new GH(r)),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Xa.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=_E(this._czmViewer.xbsjLocalBoxSources);if(s)return new Xa.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends c.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new c.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=at.latestDefaultAccessToken??at.currentDefaultAccessToken;b.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=b.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(c.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=b.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=b.JulianDate.fromDate(new Date(r.currentTime));b.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(gi(o.clockViewModel,"currentTime",s=>{const l=b.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=b.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=b.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new b.SunLight,l=new b.DirectionalLight({direction:o.scene.camera.directionWC});class u extends c.Destroyable{constructor(){super();const h=r.flashLighting??!1;o.scene.light=h?l:s,h&&this.dispose(o.scene.preRender.addEventListener(function(f,p){l.direction=b.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new c.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(d,m)=>c.registerEventUpdate(this,d,m),h=at.defaults,f=(d,m)=>A(r[d+"Changed"],()=>{if(!Reflect.has(r,d))throw new Error(`!Reflect.has(czmViewer, ${d})`);if(!Reflect.has(h,d))throw new Error(`!Reflect.has(CzmViewer.defaults, ${d})`);m(r[d]??h[d])}),p=(d,m)=>A(r[d+"Changed"],()=>{if(!Reflect.has(r,d))throw new Error(`!Reflect.has(czmViewer, ${d})`);m(r[d])});f("splitPosition",d=>o.scene.splitPosition=d),f("resolutionScale",d=>o.resolutionScale=d),f("msaaSamples",d=>o.scene.msaaSamples=d),p("shadows",d=>o.shadows=d),f("scenePpsfxaaEnabled",d=>s.postProcessStages.fxaa.enabled=d),p("scenePpsAmbientOcclusionEnabled",d=>s.postProcessStages.ambientOcclusion.enabled=d),p("scenePpsAmbientOcclusionAmbientOcclusionOnly",d=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=d),p("scenePpsAmbientOcclusionIntensity",d=>s.postProcessStages.ambientOcclusion.uniforms.intensity=d),p("scenePpsAmbientOcclusionBias",d=>s.postProcessStages.ambientOcclusion.uniforms.bias=d),p("scenePpsAmbientOcclusionLengthCap",d=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=d),p("scenePpsAmbientOcclusionStepSize",d=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=d),p("scenePpsAmbientOcclusionBlurStepSize",d=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=d),p("scenePpsBloomEnabled",d=>s.postProcessStages.bloom.enabled=d),p("scenePpsBloomGlowOnly",d=>s.postProcessStages.bloom.uniforms.glowOnly=d),p("scenePpsBloomContrast",d=>s.postProcessStages.bloom.uniforms.contrast=d),p("scenePpsBloomBrightness",d=>s.postProcessStages.bloom.uniforms.brightness=d),p("scenePpsBloomDelta",d=>s.postProcessStages.bloom.uniforms.delta=d),p("scenePpsBloomSigma",d=>s.postProcessStages.bloom.uniforms.sigma=d),p("scenePpsBloomStepSize",d=>s.postProcessStages.bloom.uniforms.stepSize=d),f("globeShow",d=>s.globe.show=d),f("depthTestAgainstTerrain",d=>{s.globe.depthTestAgainstTerrain=d}),s.globe.translucency.enabled=!0,f("terrainOpacity",d=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=c.clamp(d,0,1)}),f("sceneGlobeShadows",d=>s.globe.shadows=b.ShadowMode[d]),p("sceneGlobeTerrainExaggeration",d=>s.globe.terrainExaggeration=d),p("sceneGlobeTerrainExaggerationRelativeHeight",d=>s.globe.terrainExaggerationRelativeHeight=d),p("sceneGlobeVerticalExaggeration",d=>s.globe.verticalExaggeration=d),p("sceneGlobeVerticalExaggerationRelativeHeight",d=>s.globe.verticalExaggerationRelativeHeight=d),p("sceneGlobeBackFaceCulling",d=>s.globe.backFaceCulling=d),p("sceneGlobeShowSkirts",d=>s.globe.showSkirts=d),p("sceneGlobeShowWaterEffect",d=>s.globe.showWaterEffect=d),p("sceneGlobeBaseColor",d=>s.globe.baseColor=Be(d)),p("sceneGlobeCartographicLimitRectangle",d=>s.globe.cartographicLimitRectangle=gt(d)),p("sceneGlobeClippingPlanes",d=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=el(d??{enabled:!1});return}bh(s.globe.clippingPlanes,d)}),p("sceneGlobeClippingPolygons",d=>{s.globe.clippingPolygons=d?xh(d):void 0}),f("sceneSunGlowFactor",d=>s.sun&&(s.sun.glowFactor=d)),f("moon",d=>s.moon&&(s.moon.show=d)),f("sceneMoonOnlySunLighting",d=>s.moon&&(s.moon.onlySunLighting=d)),f("sceneMoonTextureUrl",d=>s.moon&&(s.moon.textureUrl=c.ESSceneObject.context.getStrFromEnv(d))),p("sceneSkyBoxShow",d=>s._xbsjOriginSkyBox.show=d),f("sceneSkyBoxSources",d=>s._xbsjOriginSkyBox.sources=d&&_E(d)),p("atmosphere",d=>o.scene._xbsjOriginSkyAtmosphere.show=d),p("sceneBackgroundColor",d=>o.scene.backgroundColor=Be(d)),f("sceneFogEnabled",d=>s.fog.enabled=d),f("sceneFogDensity",d=>s.fog.density=d),f("sceneFogScreenSpaceErrorFactor",d=>s.fog.screenSpaceErrorFactor=d),f("sceneFogMinimumBrightness",d=>s.fog.minimumBrightness=d),f("sceneDebugShowFramesPerSecond",d=>s.debugShowFramesPerSecond=d),f("sceneDebugShowCommands",d=>s.debugShowCommands=d),f("sceneDebugShowFrustums",d=>s.debugShowFrustums=d),f("sceneDebugShowFrustumPlanes",d=>s.debugShowFrustumPlanes=d),f("sceneDebugShowDepthFrustum",d=>s.debugShowDepthFrustum=d),f("sceneGlobeUndergroundColor",d=>u.undergroundColor=Be(d)),f("sceneGlobeUndergroundColorAlphaByDistance",d=>u.undergroundColorAlphaByDistance=gr(d)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",d=>u.translucency.backFaceAlphaByDistance=d&&gr(d)),p("sceneGlobeTranslucencyFrontFaceAlphaByDistance",d=>u.translucency.frontFaceAlphaByDistance=d&&gr(d)),f("sceneGlobeTranslucencyRectangle",d=>u.translucency.rectangle=gt(d)),f("sceneSplitPosition",d=>s.splitPosition=c.clamp(d,0,1)),f("sceneSsccEnableCollisionDetection",d=>s.screenSpaceCameraController.enableCollisionDetection=d),f("sceneSsccZoomFactor",d=>s.screenSpaceCameraController._zoomFactor=d);{const d=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};d(),this.d(r.showCesiumInspectorChanged.don(d))}f("cesiumInspectorWireframe",d=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=d)});{const d=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};d(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(d))}this.ad(new c.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Uv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};L(Xa,"BackGroundResetting",class extends c.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new ed;r.material=b.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),L(Xa,"LocalSkyBoxResetting",class extends c.Destroyable{constructor(o,r,a){super();L(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new Na(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let Wv=Xa;function p7(t,n,e,i,o){var r=b.Cartesian3.subtract(t,e,new b.Cartesian3),a=b.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function m7(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=b.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[p7(a,l,s,u,A),r]}const g7=b.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function y7(t){return-Math.log2(t/g7)}var jv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function v7(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=jv[++e];);const i=n/jv[e-1]|0;return[i*jv[e-1],i,e]}class w7 extends c.Destroyable{constructor(){super();L(this,"_lengthInPixels",this.disposeVar(c.react(100)));L(this,"_resolution",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInPixels",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInMeters",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInStr",this.disposeVar(c.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=v7(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class b7 extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!0)));L(this,"_resolution",this.dv(c.react(void 0)));L(this,"_center",this.dv(c.react(void 0)));L(this,"_zoom",this.dv(c.react(void 0)));L(this,"_legend",this.dv(new w7));this._czmViewer=e;{const i=this.dv(c.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(c.sleep(1e3));const l=await o.promise(m7(this._czmViewer));if(l){const[u,A]=l;r=u,a=y7(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(c.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function x7(t,n){try{const e=b.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=b.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return b.Matrix4.clone(b.Matrix4.IDENTITY,n)}}const{combine:_7}=b,{ShaderDestination:ss}=b,IE={name:"FlattenedPipelineStage"};IE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,ss.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",ss.BOTH),i.addUniform("vec4","u_flattenedBound",ss.BOTH),i.addUniform("bool","u_flattened",ss.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",ss.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",ss.BOTH),i.addUniform("bool","u_flattenDiscard",ss.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??b.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??b.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=b.Matrix4.multiply(r,n.xbsjElevationMatrix??b.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new b.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??b.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=b.Matrix4.multiply(n.xbsjElevationMatrixInv??b.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new b.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=_7(o,t.uniformMap)}};function FE(){Object.defineProperties(b.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&b.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new b.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function ME(){Object.defineProperties(b.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function DE(){const t=b.Model3DTileContent.prototype.update;b.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function RE(){const t=b.ModelSceneGraph.prototype.configurePipeline;b.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(IE),i}}FE(),ME(),DE(),RE();const C7=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:c.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:c.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:c.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:c.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:c.reactArray([]),sceneGlobeUndergroundColor:c.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:c.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:c.reactJson(at.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:c.reactArray([1,1,1,1]),xbsjLocalBoxSources:c.reactJsonWithUndefined(void 0),sceneBackgroundColor:c.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),S7=`
|
|
4059
|
+
`,ao=b.Cartesian3,hr=b.defined,JH=b.destroyObject,e7=b.Ellipsoid,CE=b.EllipsoidGeometry,t7=b.GeometryPipeline,Va=b.Math,Ar=b.Matrix4,n7=b.VertexFormat,i7=b.BufferUsage,r7=b.DrawCommand,o7=b.RenderState,s7=b.ShaderProgram,SE=b.ShaderSource,a7=b.VertexArray,EE=b._shadersAtmosphereCommon,PE=b._shadersSkyAtmosphereCommon,l7=b._shadersSkyAtmosphereVS,u7=b.Axis,c7=b.BlendingState,h7=b.CullFace,BE=b.SceneMode,td=b.Transforms,A7=b.Matrix3,TE=b.DeveloperError,f7=b.loadCubeMap,d7=b.CubeMap;function Na(t,n){t=t??e7.WGS84,this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=ao.multiplyByScalar(t.radii,e,new ao);this._scaleMatrix=Ar.fromScale(i),this._modelMatrix=new Ar,this._command=new r7({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new ao(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new ao(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new ao;const o=new ao;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new A7,Ar.getMatrix3(r._eunMatrix||Ar.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(Na.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Na.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Gv=new Ar;Na.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==BE.SCENE3D&&e!==BE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const d=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!hr(o.positiveX)||!hr(o.negativeX)||!hr(o.positiveY)||!hr(o.negativeY)||!hr(o.positiveZ)||!hr(o.negativeZ))throw new TE("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new TE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?f7(d,this._sources).then(function(m){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=m}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new d7({context:d,source:o}))}const r=Ar.fromRotationTranslation(t.context.uniformState.inverseViewRotation,ao.ZERO,Gv),a=Ar.multiplyTransformation(r,u7.Y_UP_TO_Z_UP,Gv),s=Ar.multiply(this._scaleMatrix,a,Gv);Ar.clone(s,this._modelMatrix);const l=t.context,u=p7(this),A=t.globeTranslucencyState.translucent,h=this.perFragmentAtmosphere||A||!hr(n)||!n.show,f=this._command;if(td.eastUpNorthToFixedFrame=td.eastUpNorthToFixedFrame||td.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=td.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!hr(f.vertexArray)){const d=CE.createGeometry(new CE({radii:new ao(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:n7.POSITION_ONLY}));f.vertexArray=a7.fromGeometry({context:l,geometry:d,attributeLocations:t7.createAttributeLocations(d),bufferUsage:i7.STATIC_DRAW}),f.renderState=o7.fromCache({cull:{enabled:!0,face:h7.FRONT},blending:c7.ALPHA_BLEND,depthMask:!1})}const p=u|h<<2|A<<3;if(p!==this._flags){this._flags=p;const d=[];u&&d.push("COLOR_CORRECT"),h&&d.push("PER_FRAGMENT_ATMOSPHERE"),A&&d.push("GLOBE_TRANSLUCENT");const m=new SE({defines:d,sources:[EE,PE,l7]}),v=new SE({defines:d,sources:[EE,PE,YH]});this._spSkyAtmosphere=s7.fromCache({context:l,vertexShaderSource:m,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(hr(this._cubeMap))return f};function p7(t){return!(Va.equalsEpsilon(t.hueShift,0,Va.EPSILON7)&&Va.equalsEpsilon(t.saturationShift,0,Va.EPSILON7)&&Va.equalsEpsilon(t.brightnessShift,0,Va.EPSILON7))}Na.prototype.isDestroyed=function(){return!1},Na.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),JH(this)};const Xa=class Xa extends c.Destroyable{constructor(e,i){super();L(this,"_navigationManager");L(this,"_envManager");L(this,"_reu",(e,i)=>c.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new UH(r)),this._envManager=this.dv(new WH(r)),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Xa.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=_E(this._czmViewer.xbsjLocalBoxSources);if(s)return new Xa.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends c.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new c.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=at.latestDefaultAccessToken??at.currentDefaultAccessToken;b.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=b.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(c.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=b.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=b.JulianDate.fromDate(new Date(r.currentTime));b.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(gi(o.clockViewModel,"currentTime",s=>{const l=b.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=b.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=b.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new b.SunLight,l=new b.DirectionalLight({direction:o.scene.camera.directionWC});class u extends c.Destroyable{constructor(){super();const h=r.flashLighting??!1;o.scene.light=h?l:s,h&&this.dispose(o.scene.preRender.addEventListener(function(f,p){l.direction=b.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new c.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(d,m)=>c.registerEventUpdate(this,d,m),h=at.defaults,f=(d,m)=>A(r[d+"Changed"],()=>{if(!Reflect.has(r,d))throw new Error(`!Reflect.has(czmViewer, ${d})`);if(!Reflect.has(h,d))throw new Error(`!Reflect.has(CzmViewer.defaults, ${d})`);m(r[d]??h[d])}),p=(d,m)=>A(r[d+"Changed"],()=>{if(!Reflect.has(r,d))throw new Error(`!Reflect.has(czmViewer, ${d})`);m(r[d])});f("splitPosition",d=>o.scene.splitPosition=d),f("resolutionScale",d=>o.resolutionScale=d),f("msaaSamples",d=>o.scene.msaaSamples=d),p("shadows",d=>o.shadows=d),f("scenePpsfxaaEnabled",d=>s.postProcessStages.fxaa.enabled=d),p("scenePpsAmbientOcclusionEnabled",d=>s.postProcessStages.ambientOcclusion.enabled=d),p("scenePpsAmbientOcclusionAmbientOcclusionOnly",d=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=d),p("scenePpsAmbientOcclusionIntensity",d=>s.postProcessStages.ambientOcclusion.uniforms.intensity=d),p("scenePpsAmbientOcclusionBias",d=>s.postProcessStages.ambientOcclusion.uniforms.bias=d),p("scenePpsAmbientOcclusionLengthCap",d=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=d),p("scenePpsAmbientOcclusionStepSize",d=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=d),p("scenePpsAmbientOcclusionBlurStepSize",d=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=d),p("scenePpsBloomEnabled",d=>s.postProcessStages.bloom.enabled=d),p("scenePpsBloomGlowOnly",d=>s.postProcessStages.bloom.uniforms.glowOnly=d),p("scenePpsBloomContrast",d=>s.postProcessStages.bloom.uniforms.contrast=d),p("scenePpsBloomBrightness",d=>s.postProcessStages.bloom.uniforms.brightness=d),p("scenePpsBloomDelta",d=>s.postProcessStages.bloom.uniforms.delta=d),p("scenePpsBloomSigma",d=>s.postProcessStages.bloom.uniforms.sigma=d),p("scenePpsBloomStepSize",d=>s.postProcessStages.bloom.uniforms.stepSize=d),f("globeShow",d=>s.globe.show=d),f("depthTestAgainstTerrain",d=>{s.globe.depthTestAgainstTerrain=d}),s.globe.translucency.enabled=!0,f("terrainOpacity",d=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=c.clamp(d,0,1)}),f("sceneGlobeShadows",d=>s.globe.shadows=b.ShadowMode[d]),p("sceneGlobeTerrainExaggeration",d=>s.globe.terrainExaggeration=d),p("sceneGlobeTerrainExaggerationRelativeHeight",d=>s.globe.terrainExaggerationRelativeHeight=d),p("sceneGlobeVerticalExaggeration",d=>s.globe.verticalExaggeration=d),p("sceneGlobeVerticalExaggerationRelativeHeight",d=>s.globe.verticalExaggerationRelativeHeight=d),p("sceneGlobeBackFaceCulling",d=>s.globe.backFaceCulling=d),p("sceneGlobeShowSkirts",d=>s.globe.showSkirts=d),p("sceneGlobeShowWaterEffect",d=>s.globe.showWaterEffect=d),p("sceneGlobeBaseColor",d=>s.globe.baseColor=Be(d)),p("sceneGlobeCartographicLimitRectangle",d=>s.globe.cartographicLimitRectangle=gt(d)),p("sceneGlobeClippingPlanes",d=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=el(d??{enabled:!1});return}bh(s.globe.clippingPlanes,d)}),p("sceneGlobeClippingPolygons",d=>{s.globe.clippingPolygons=d?xh(d):void 0}),f("sceneSunGlowFactor",d=>s.sun&&(s.sun.glowFactor=d)),f("moon",d=>s.moon&&(s.moon.show=d)),f("sceneMoonOnlySunLighting",d=>s.moon&&(s.moon.onlySunLighting=d)),f("sceneMoonTextureUrl",d=>s.moon&&(s.moon.textureUrl=c.ESSceneObject.context.getStrFromEnv(d))),p("sceneSkyBoxShow",d=>s._xbsjOriginSkyBox.show=d),f("sceneSkyBoxSources",d=>s._xbsjOriginSkyBox.sources=d&&_E(d)),p("atmosphere",d=>o.scene._xbsjOriginSkyAtmosphere.show=d),p("sceneBackgroundColor",d=>o.scene.backgroundColor=Be(d)),f("sceneFogEnabled",d=>s.fog.enabled=d),f("sceneFogDensity",d=>s.fog.density=d),f("sceneFogScreenSpaceErrorFactor",d=>s.fog.screenSpaceErrorFactor=d),f("sceneFogMinimumBrightness",d=>s.fog.minimumBrightness=d),f("sceneDebugShowFramesPerSecond",d=>s.debugShowFramesPerSecond=d),f("sceneDebugShowCommands",d=>s.debugShowCommands=d),f("sceneDebugShowFrustums",d=>s.debugShowFrustums=d),f("sceneDebugShowFrustumPlanes",d=>s.debugShowFrustumPlanes=d),f("sceneDebugShowDepthFrustum",d=>s.debugShowDepthFrustum=d),f("sceneGlobeUndergroundColor",d=>u.undergroundColor=Be(d)),f("sceneGlobeUndergroundColorAlphaByDistance",d=>u.undergroundColorAlphaByDistance=gr(d)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",d=>u.translucency.backFaceAlphaByDistance=d&&gr(d)),p("sceneGlobeTranslucencyFrontFaceAlphaByDistance",d=>u.translucency.frontFaceAlphaByDistance=d&&gr(d)),f("sceneGlobeTranslucencyRectangle",d=>u.translucency.rectangle=gt(d)),f("sceneSplitPosition",d=>s.splitPosition=c.clamp(d,0,1)),f("sceneSsccEnableCollisionDetection",d=>s.screenSpaceCameraController.enableCollisionDetection=d),f("sceneSsccZoomFactor",d=>s.screenSpaceCameraController._zoomFactor=d);{const d=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};d(),this.d(r.showCesiumInspectorChanged.don(d))}f("cesiumInspectorWireframe",d=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=d)});{const d=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};d(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(d))}this.ad(new c.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Uv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};L(Xa,"BackGroundResetting",class extends c.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new ed;r.material=b.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),L(Xa,"LocalSkyBoxResetting",class extends c.Destroyable{constructor(o,r,a){super();L(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new Na(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let Wv=Xa;function m7(t,n,e,i,o){var r=b.Cartesian3.subtract(t,e,new b.Cartesian3),a=b.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function g7(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=b.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[m7(a,l,s,u,A),r]}const y7=b.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function v7(t){return-Math.log2(t/y7)}var jv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function w7(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=jv[++e];);const i=n/jv[e-1]|0;return[i*jv[e-1],i,e]}class b7 extends c.Destroyable{constructor(){super();L(this,"_lengthInPixels",this.disposeVar(c.react(100)));L(this,"_resolution",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInPixels",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInMeters",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInStr",this.disposeVar(c.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=w7(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class x7 extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!0)));L(this,"_resolution",this.dv(c.react(void 0)));L(this,"_center",this.dv(c.react(void 0)));L(this,"_zoom",this.dv(c.react(void 0)));L(this,"_legend",this.dv(new b7));this._czmViewer=e;{const i=this.dv(c.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(c.sleep(1e3));const l=await o.promise(g7(this._czmViewer));if(l){const[u,A]=l;r=u,a=v7(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(c.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function _7(t,n){try{const e=b.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=b.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return b.Matrix4.clone(b.Matrix4.IDENTITY,n)}}const{combine:C7}=b,{ShaderDestination:ss}=b,IE={name:"FlattenedPipelineStage"};IE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,ss.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",ss.BOTH),i.addUniform("vec4","u_flattenedBound",ss.BOTH),i.addUniform("bool","u_flattened",ss.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",ss.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",ss.BOTH),i.addUniform("bool","u_flattenDiscard",ss.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??b.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??b.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=b.Matrix4.multiply(r,n.xbsjElevationMatrix??b.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new b.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??b.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=b.Matrix4.multiply(n.xbsjElevationMatrixInv??b.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new b.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=C7(o,t.uniformMap)}};function FE(){Object.defineProperties(b.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&b.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new b.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function ME(){Object.defineProperties(b.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function DE(){const t=b.Model3DTileContent.prototype.update;b.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function RE(){const t=b.ModelSceneGraph.prototype.configurePipeline;b.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(IE),i}}FE(),ME(),DE(),RE();const S7=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:c.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:c.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:c.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:c.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:c.reactArray([]),sceneGlobeUndergroundColor:c.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:c.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:c.reactJson(at.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:c.reactArray([1,1,1,1]),xbsjLocalBoxSources:c.reactJsonWithUndefined(void 0),sceneBackgroundColor:c.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),E7=`
|
|
4060
4060
|
#### 示例代码1
|
|
4061
4061
|
\`\`\`
|
|
4062
4062
|
async function initCesiumViewer(container, czmViewer) {
|
|
@@ -4131,7 +4131,7 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4131
4131
|
return viewer;
|
|
4132
4132
|
}
|
|
4133
4133
|
\`\`\`
|
|
4134
|
-
`,
|
|
4134
|
+
`,P7=`async function initCesiumViewer(container, czmViewer) {
|
|
4135
4135
|
const viewer = await XE2.g.defaultCreateCesiumViewerFunc(container, czmViewer);
|
|
4136
4136
|
|
|
4137
4137
|
// 若原Czm版权信息展示位置遮挡重要信息,可将以下语句解注释,在别的位置展示
|
|
@@ -4139,13 +4139,13 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4139
4139
|
|
|
4140
4140
|
return viewer;
|
|
4141
4141
|
}
|
|
4142
|
-
`;function
|
|
4142
|
+
`;function B7(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
4143
4143
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
4144
4144
|
gitee地址:${t}
|
|
4145
|
-
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Gt=class Gt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",$f);L(this,"_moveObjectsProcess",this.ad(jS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new i3(this)),this.ad(new r3(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new l3(this)})),this._viewerLegend=this.dv(new b7(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new sH(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ot(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=b.Cartographic.fromDegrees(e[0],e[1],e[2],Gt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=b.Cartesian3.fromDegrees(...e),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,i.positionWC,new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=gs(i),f=h[0]-A,p=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:p}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&sl(s,a,r)}flyTo(e,i,o="default"){var p;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(p=this.viewer)==null?void 0:p.camera;return f&&sl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&sl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:b.VERSION},e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=b.Cartographic.fromDegrees(e,i,void 0,Gt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(rt(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Gt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Gt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Gt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return wn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=e instanceof b.Cartesian3?e:rt(e),o=new b.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Gt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",E7,S7,!0),new c.FunctionProperty([],()=>Gt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Gt,"type",Gt.register("ESCesiumViewer",Gt)),L(Gt,"getCesiumIonToken",P7),L(Gt,"currentDefaultAccessToken",b.Ion.defaultAccessToken),L(Gt,"latestDefaultAccessToken"),L(Gt,"ObjectsToExcludeWrapper",a3),L(Gt,"defaults",{...c.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:b.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),L(Gt,"getHeightsScartchCarto",new b.Cartographic);let at=Gt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...C7()})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps),ne.copyright=void 0;try{const t="earthsdk3-cesium",n="3.6.0-beta.119",e="2025-11-04T07:08:24.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="f414a145e6204a2d8a0b511ec4636c035d8718a6",s=((Date.now()-1762240104e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4145
|
+
`;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Gt=class Gt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",$f);L(this,"_moveObjectsProcess",this.ad(jS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new r3(this)),this.ad(new o3(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new u3(this)})),this._viewerLegend=this.dv(new x7(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Wv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new aH(this.subContainer,this,o=>this._viewer.value=o,i.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ot(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=b.Cartographic.fromDegrees(e[0],e[1],e[2],Gt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=b.Cartesian3.fromDegrees(...e),r=b.Transforms.eastNorthUpToFixedFrame(o),a=b.Matrix4.inverse(r,new b.Matrix4),s=b.Matrix4.multiplyByPoint(a,i.positionWC,new b.Cartesian3),l=b.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=b.Math.toDegrees(u);let A=b.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-b.Math.PI:b.Math.PI),A=b.Math.toDegrees(A);const h=gs(i),f=h[0]-A,p=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:p}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&sl(s,a,r)}flyTo(e,i,o="default"){var p;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(p=this.viewer)==null?void 0:p.camera;return f&&sl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&sl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Mn(e),rotation:gs(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:b.VERSION},e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=b.Cartographic.fromDegrees(e,i,void 0,Gt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await D0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(rt(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Gt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Gt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Gt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return wn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=e instanceof b.Cartesian3?e:rt(e),o=new b.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Gt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",P7,E7,!0),new c.FunctionProperty([],()=>Gt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Gt,"type",Gt.register("ESCesiumViewer",Gt)),L(Gt,"getCesiumIonToken",B7),L(Gt,"currentDefaultAccessToken",b.Ion.defaultAccessToken),L(Gt,"latestDefaultAccessToken"),L(Gt,"ObjectsToExcludeWrapper",l3),L(Gt,"defaults",{...c.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:b.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:b.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),L(Gt,"getHeightsScartchCarto",new b.Cartographic);let at=Gt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...S7()})})(at||(at={})),c.extendClassProps(at.prototype,at.createDefaultProps),ne.copyright=void 0;try{const t="earthsdk3-cesium",n="3.6.0-beta.121",e="2025-11-05T02:39:09.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="f37d1422a6b0b8a0489d1bcf153ee59a0a39c2d5",s=((Date.now()-1762310349e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
|
|
4146
4146
|
%c${o?o+`
|
|
4147
4147
|
`:""}当前网站正在使用${t},此软件版权归${i}所有
|
|
4148
|
-
`;ne.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4148
|
+
`;ne.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","f37d1422a6b0b8a0489d1bcf153ee59a0a39c2d5")},get info(){return l},get date(){return"2025-11-05T02:39:09.000Z"},get author(){return"suplyang"},get version(){return"3.6.0-beta.121"},get name(){return"earthsdk3-cesium"},get commitId(){return"f37d1422a6b0b8a0489d1bcf153ee59a0a39c2d5"},print(){console.info(this.info,`
|
|
4149
4149
|
font-size: 18px;
|
|
4150
4150
|
font-weight: 1000;
|
|
4151
4151
|
line-height: 1;
|
|
@@ -4162,4 +4162,4 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
4162
4162
|
color: rgb(0, 120, 215);
|
|
4163
4163
|
padding-bottom: 2px;
|
|
4164
4164
|
padding-left: 35px;
|
|
4165
|
-
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=ne.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&ne.copyright.print()}catch{}return OE(),ne.BaseEditingWrapper=cn,ne.CircularAppendEditing=QS,ne.CircularAppendEditingWrapper=Sv,ne.CircularInsertEditing=NS,ne.CircularInsertEditingWrapper=Ev,ne.CurrentPositionsCenter=Sd,ne.CurrentScale=Cd,ne.CurrentSceneScalePoi=T0,ne.CursorFloatDiv=ZP,ne.CursorInfo=$P,ne.Czm3DTiles=$e,ne.CzmCameraChanged=Ch,ne.CzmCanvasAndDivSwitchPoi=YP,ne.CzmCanvasPoi=Qd,ne.CzmCircle=Do,ne.CzmCircleGroundPrimitive=Qr,ne.CzmCircleOutlinePrimitive=Vr,ne.CzmCirclePrimitive=kr,ne.CzmClippingPlanes=la,ne.CzmClock=ze,ne.CzmCustomPrimitive=ut,ne.CzmDivPoi=Vd,ne.CzmES3DTileset=ua,ne.CzmESAlarm=Wm,ne.CzmESApertureEffect=jm,ne.CzmESAreaMeasurement=qm,ne.CzmESBlastParticleSystem=Km,ne.CzmESBoxClipping=Zm,ne.CzmESCameraView=$m,ne.CzmESCameraVisibleRange=Xm,ne.CzmESCar=Ym,ne.CzmESCityBasePoint=eg,ne.CzmESClassification=tg,ne.CzmESClippingPlane=Nm,ne.CzmESCustomPrimitive=qg,ne.CzmESCzml=ng,ne.CzmESDataMesh=ig,ne.CzmESDirectionMeasurement=rg,ne.CzmESDistanceMeasurement=og,ne.CzmESDynamicWater=Kg,ne.CzmESEntityCluster=Zg,ne.CzmESExcavate=sg,ne.CzmESFireParticleSystem=ag,ne.CzmESGeHistoryImagery=$g,ne.CzmESGeoBezierPath=ug,ne.CzmESGeoDiv=cg,ne.CzmESGeoDivTextPoi=hg,ne.CzmESGeoExtrudedPolygon=lv,ne.CzmESGeoJson=Ag,ne.CzmESGeoLineString=da,ne.CzmESGeoPoints=mv,ne.CzmESGeoPolygon=Ln,ne.CzmESGeoPolygonImpl=Ti,ne.CzmESGeoRectangle=fg,ne.CzmESGeoSmoothPolygon=dg,ne.CzmESGeoVector=sn,ne.CzmESGeoWater=Xg,ne.CzmESGltfModel=pg,ne.CzmESHeatMap=pv,ne.CzmESHeightMeasurement=mg,ne.CzmESHuman=yg,ne.CzmESHumanPoi=uv,ne.CzmESImageLabel=vg,ne.CzmESImageryLayer=wg,ne.CzmESKml=Rg,ne.CzmESLabel=jl,ne.CzmESLocalCircle=Ug,ne.CzmESLocalLineString=Og,ne.CzmESLocalLineStringZ=Lg,ne.CzmESLocalPolygon=zg,ne.CzmESLocalPolygonZ=kg,ne.CzmESLocalRectangle=Qg,ne.CzmESLocalSkyBox=bg,ne.CzmESLocalVector=df,ne.CzmESLocationMeasurement=xg,ne.CzmESMVTLayer=ey,ne.CzmESMsTileset=Av,ne.CzmESNavigator=Vg,ne.CzmESObjectWithLocation=He,ne.CzmESParticleSystemPrimitive=_g,ne.CzmESPath=Ng,ne.CzmESPipeFence=ty,ne.CzmESPipeline=ny,ne.CzmESPipeserTileset=ry,ne.CzmESPit=uy,ne.CzmESPoi2D=Cg,ne.CzmESPoi3D=Sg,ne.CzmESPolygonFence=Hg,ne.CzmESPolygonFlattenedPlane=Gm,ne.CzmESPolygonWithHole=cy,ne.CzmESRectangle=Gg,ne.CzmESRoad=Wg,ne.CzmESRtsFeatureEditing=hv,ne.CzmESRtsTileset=cv,ne.CzmESScale=jg,ne.CzmESSignalTransmission=wy,ne.CzmESSkylineAnalysis=dv,ne.CzmESStaticMesh=fv,ne.CzmESSubmergingAnalysis=Eg,ne.CzmESSunshineAnalysis=Jy,ne.CzmESSurfaceAreaMeasurement=iv,ne.CzmESTerrainLayer=Pg,ne.CzmESTextLabel=Bg,ne.CzmESUEWidget=Tg,ne.CzmESUnrealActor=Ig,ne.CzmESVideoFusion=Fg,ne.CzmESViewShed=Mg,ne.CzmESViewerStatusBar=rv,ne.CzmESViewerStatusBarScale=ov,ne.CzmESVisibilityAnalysis=sv,ne.CzmESVisualObject=Hn,ne.CzmESVolumeMeasurement=av,ne.CzmESWidget=Dg,ne.CzmFlattenedPlane=Xr,ne.CzmGlobeMaterial=Vo,ne.CzmImageModel=$i,ne.CzmImagery=Zr,ne.CzmModelPrimitive=Wt,ne.CzmParticleSystemPrimitive=wi,ne.CzmPicking=P0,ne.CzmPoint=Wn,ne.CzmPointPrimitiveCollection=Uo,ne.CzmPoisContext=N0,ne.CzmPolygon=Ss,ne.CzmPolygonClipping=pa,ne.CzmPolygonGroundPrimitive=Cs,ne.CzmPolygonGroundPrimitiveWithHeight=Ns,ne.CzmPolygonPrimitive=Sr,ne.CzmPolygonPrimitiveWithHeight=Lr,ne.CzmPolygonWithHeight=zr,ne.CzmPolyline=Ye,ne.CzmPolylineGroundPrimitive=Bs,ne.CzmPolylinePrimitive=Ts,ne.CzmPolylines=ai,ne.CzmPolylinesGroundPrimitive=_s,ne.CzmPolylinesPrimitive=Un,ne.CzmRectangle=Ci,ne.CzmSignalTransmission=Jr,ne.CzmTexture=ft,ne.CzmView=xn,ne.CzmViewDistanceRangeControl=po,ne.CzmWater=Ro,ne.CzmWaterPrimitive=Fl,ne.DoublePointsAppendEditing=La,ne.DoublePointsAppendEditingWrapper=_v,ne.DoublePointsModifyEditing=os,ne.DoublePointsModifyEditingWrapper=Cv,ne.ESCesiumViewer=at,ne.ESCustomPrimitive=wf,ne.ESGeHistoryImagery=gf,ne.ESGeoBezierPath=_f,ne.ESGeoSmoothPolygon=$l,ne.ESKml=yf,ne.ESLocalLineString=vf,ne.ESLocalLineStringZ=Zl,ne.ESMVTLayer=mf,ne.ESRoad=xf,ne.ESSignalTransmission=bf,ne.GeoCanvasImagePoi=yi,ne.GeoCanvasMenuPoi=Es,ne.GeoCanvasPoi=Wi,ne.GeoCanvasPointPoi=Er,ne.GeoCustomDivPoi=bt,ne.GeoDivSwitchPoi=Eo,ne.GeoDivTextPoi=vi,ne.GeoPolylinePath=ma,ne.HeightModifyEditing=WS,ne.HeightModifyEditingWrapper=Dv,ne.ImageLabel2D=Zx,ne.ImageLabel3D=$x,ne.ImageriesManager=uE,ne.LabelManager=lE,ne.LineStringAppendEditing=kS,ne.LineStringAppendEditingWrapper=Pv,ne.LineStringInsertEditing=VS,ne.LineStringInsertEditingWrapper=Bv,ne.PickingManager=cE,ne.PlaceEditing=Li,ne.PlaceEditingWrapper=wv,ne.PolylinePath=aa,ne.ResourceHandler=xs,ne.RotationEditing=di,ne.RotationEditingWrapper=bv,ne.ScaleEditing=ur,ne.ScaleEditingWrapper=xv,ne.ScatterAppendEditing=HS,ne.ScatterAppendEditingWrapper=Tv,ne.ScatterModifyEditing=GS,ne.ScatterModifyEditingWrapper=Iv,ne.ScreenManager=fE,ne.SharedTexturePool=Q0,ne.SmoothMoving=B0,ne.TerrainManager=aE,ne.TextLabel2D=Yx,ne.TextLabel3D=Jx,ne.ToGCJ02WebMercatorTilingScheme=dx,ne.ToWGS84WebMercatorTilingScheme=px,ne.TranslationEditing=lr,ne.TranslationEditingWrapper=Zf,ne.ViewerExtensions=dE,ne.VisibilityAppendEditing=za,ne.VisibilityAppendEditingWrapper=Fv,ne.VisibilityModifyEditing=ka,ne.VisibilityModifyEditingWrapper=Mv,ne.Widget2D=Pr,ne.Widget3D=FA,ne.WinPosFromCartesian=Eh,ne.XbsjGroundPolylinePrimitive=Bi,ne._ESEditModeInstance=$f,ne.angleToHumanStr=rl,ne.areaToHumanStr=Y2,ne.bindNorthRotation=Dt,ne.capture=D0,ne.checkAndConvertImage=X2,ne.computeCutPoint=RS,ne.computeCzmModelMatrix=lt,ne.computePickingInfoWithCoordinates=Ad,ne.createClippingPlaneCollection=el,ne.createClippingPolygonCollection=xh,ne.createGeoBoudingSphereReactFromPositions=M0,ne.createHelperLine=s2,ne.createInfoPoi=Dd,ne.createInnerClassFromJson=Td,ne.createInnerHtmlWithWhiteTextBlackBackground=_o,ne.createMaterialFromJson=o0,ne.createMaterialRef=si,ne.createMoveObjectsProcessing=jS,ne.createPolygonHierarchy=Hi,ne.createTexture=bo,ne.createTextureFromImage=zd,ne.createTilingSchema=mi,ne.czmEllipsoidWGS84=L0,ne.czmFlyTo=sl,ne.czmModelActiveAnimationsWithVisible=Ih,ne.czmSubscribeAndEvaluate=gi,ne.defaultFlyToRotation=Gn,ne.distanceToHumanStr=Mh,ne.extendComponentProps=J2,ne.flyTo=Fe,ne.flyWithPosition=Rn,ne.flyWithPositions=Me,ne.flyWithPrimitive=bn,ne.fromCartesian=zE,ne.fromCartesian2=qv,ne.fromCartesian3=Ya,ne.fromCartesian4=Kv,ne.fromCartographic=fo,ne.fromColor=QE,ne.fromDistanceDisplayCondition=HE,ne.fromEllipsoid=XE,ne.fromHeadingPitchRoll=NE,ne.fromNearFarScalar=VE,ne.fromQuaternion=WE,ne.fromRectangle=ZE,ne.generateCartesianArc=y0,ne.geoNeareastPointOnRhumbLine=mo,ne.geoNeareastPointOnRhumbLine2=a2,ne.geoPolylineToBezierSpline=Rd,ne.getCameraPosition=Mn,ne.getCameraRotation=gs,ne.getCameraTargetPos=Yv,ne.getCenterAndViewDistance=Ud,ne.getCzmCode=q2,ne.getDefaultComponentProps=eP,ne.getDefaultWinPosAndDepth=p2,ne.getDetailedTerrainDistance=O0,ne.getDirectionVectorFromRotation=u0,ne.getDistancesAndTimePosRotsFromPositions=bd,ne.getElevationMatrix=
|
|
4165
|
+
`)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=ne.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&ne.copyright.print()}catch{}return OE(),ne.BaseEditingWrapper=cn,ne.CircularAppendEditing=QS,ne.CircularAppendEditingWrapper=Sv,ne.CircularInsertEditing=NS,ne.CircularInsertEditingWrapper=Ev,ne.CurrentPositionsCenter=Sd,ne.CurrentScale=Cd,ne.CurrentSceneScalePoi=T0,ne.CursorFloatDiv=ZP,ne.CursorInfo=$P,ne.Czm3DTiles=$e,ne.CzmCameraChanged=Ch,ne.CzmCanvasAndDivSwitchPoi=YP,ne.CzmCanvasPoi=Qd,ne.CzmCircle=Do,ne.CzmCircleGroundPrimitive=Qr,ne.CzmCircleOutlinePrimitive=Vr,ne.CzmCirclePrimitive=kr,ne.CzmClippingPlanes=la,ne.CzmClock=ze,ne.CzmCustomPrimitive=ut,ne.CzmDivPoi=Vd,ne.CzmES3DTileset=ua,ne.CzmESAlarm=Wm,ne.CzmESApertureEffect=jm,ne.CzmESAreaMeasurement=qm,ne.CzmESBlastParticleSystem=Km,ne.CzmESBoxClipping=Zm,ne.CzmESCameraView=$m,ne.CzmESCameraVisibleRange=Xm,ne.CzmESCar=Ym,ne.CzmESCityBasePoint=eg,ne.CzmESClassification=tg,ne.CzmESClippingPlane=Nm,ne.CzmESCustomPrimitive=qg,ne.CzmESCzml=ng,ne.CzmESDataMesh=ig,ne.CzmESDirectionMeasurement=rg,ne.CzmESDistanceMeasurement=og,ne.CzmESDynamicWater=Kg,ne.CzmESEntityCluster=Zg,ne.CzmESExcavate=sg,ne.CzmESFireParticleSystem=ag,ne.CzmESGeHistoryImagery=$g,ne.CzmESGeoBezierPath=ug,ne.CzmESGeoDiv=cg,ne.CzmESGeoDivTextPoi=hg,ne.CzmESGeoExtrudedPolygon=lv,ne.CzmESGeoJson=Ag,ne.CzmESGeoLineString=da,ne.CzmESGeoPoints=mv,ne.CzmESGeoPolygon=Ln,ne.CzmESGeoPolygonImpl=Ti,ne.CzmESGeoRectangle=fg,ne.CzmESGeoSmoothPolygon=dg,ne.CzmESGeoVector=sn,ne.CzmESGeoWater=Xg,ne.CzmESGltfModel=pg,ne.CzmESHeatMap=pv,ne.CzmESHeightMeasurement=mg,ne.CzmESHuman=yg,ne.CzmESHumanPoi=uv,ne.CzmESImageLabel=vg,ne.CzmESImageryLayer=wg,ne.CzmESKml=Rg,ne.CzmESLabel=jl,ne.CzmESLocalCircle=Ug,ne.CzmESLocalLineString=Og,ne.CzmESLocalLineStringZ=Lg,ne.CzmESLocalPolygon=zg,ne.CzmESLocalPolygonZ=kg,ne.CzmESLocalRectangle=Qg,ne.CzmESLocalSkyBox=bg,ne.CzmESLocalVector=df,ne.CzmESLocationMeasurement=xg,ne.CzmESMVTLayer=ey,ne.CzmESMsTileset=Av,ne.CzmESNavigator=Vg,ne.CzmESObjectWithLocation=He,ne.CzmESParticleSystemPrimitive=_g,ne.CzmESPath=Ng,ne.CzmESPipeFence=ty,ne.CzmESPipeline=ny,ne.CzmESPipeserTileset=ry,ne.CzmESPit=uy,ne.CzmESPoi2D=Cg,ne.CzmESPoi3D=Sg,ne.CzmESPolygonFence=Hg,ne.CzmESPolygonFlattenedPlane=Gm,ne.CzmESPolygonWithHole=cy,ne.CzmESRectangle=Gg,ne.CzmESRoad=Wg,ne.CzmESRtsFeatureEditing=hv,ne.CzmESRtsTileset=cv,ne.CzmESScale=jg,ne.CzmESSignalTransmission=wy,ne.CzmESSkylineAnalysis=dv,ne.CzmESStaticMesh=fv,ne.CzmESSubmergingAnalysis=Eg,ne.CzmESSunshineAnalysis=Jy,ne.CzmESSurfaceAreaMeasurement=iv,ne.CzmESTerrainLayer=Pg,ne.CzmESTextLabel=Bg,ne.CzmESUEWidget=Tg,ne.CzmESUnrealActor=Ig,ne.CzmESVideoFusion=Fg,ne.CzmESViewShed=Mg,ne.CzmESViewerStatusBar=rv,ne.CzmESViewerStatusBarScale=ov,ne.CzmESVisibilityAnalysis=sv,ne.CzmESVisualObject=Hn,ne.CzmESVolumeMeasurement=av,ne.CzmESWidget=Dg,ne.CzmFlattenedPlane=Xr,ne.CzmGlobeMaterial=Vo,ne.CzmImageModel=$i,ne.CzmImagery=Zr,ne.CzmModelPrimitive=Wt,ne.CzmParticleSystemPrimitive=wi,ne.CzmPicking=P0,ne.CzmPoint=Wn,ne.CzmPointPrimitiveCollection=Uo,ne.CzmPoisContext=N0,ne.CzmPolygon=Ss,ne.CzmPolygonClipping=pa,ne.CzmPolygonGroundPrimitive=Cs,ne.CzmPolygonGroundPrimitiveWithHeight=Ns,ne.CzmPolygonPrimitive=Sr,ne.CzmPolygonPrimitiveWithHeight=Lr,ne.CzmPolygonWithHeight=zr,ne.CzmPolyline=Ye,ne.CzmPolylineGroundPrimitive=Bs,ne.CzmPolylinePrimitive=Ts,ne.CzmPolylines=ai,ne.CzmPolylinesGroundPrimitive=_s,ne.CzmPolylinesPrimitive=Un,ne.CzmRectangle=Ci,ne.CzmSignalTransmission=Jr,ne.CzmTexture=ft,ne.CzmView=xn,ne.CzmViewDistanceRangeControl=po,ne.CzmWater=Ro,ne.CzmWaterPrimitive=Fl,ne.DoublePointsAppendEditing=La,ne.DoublePointsAppendEditingWrapper=_v,ne.DoublePointsModifyEditing=os,ne.DoublePointsModifyEditingWrapper=Cv,ne.ESCesiumViewer=at,ne.ESCustomPrimitive=wf,ne.ESGeHistoryImagery=gf,ne.ESGeoBezierPath=_f,ne.ESGeoSmoothPolygon=$l,ne.ESKml=yf,ne.ESLocalLineString=vf,ne.ESLocalLineStringZ=Zl,ne.ESMVTLayer=mf,ne.ESRoad=xf,ne.ESSignalTransmission=bf,ne.GeoCanvasImagePoi=yi,ne.GeoCanvasMenuPoi=Es,ne.GeoCanvasPoi=Wi,ne.GeoCanvasPointPoi=Er,ne.GeoCustomDivPoi=bt,ne.GeoDivSwitchPoi=Eo,ne.GeoDivTextPoi=vi,ne.GeoPolylinePath=ma,ne.HeightModifyEditing=WS,ne.HeightModifyEditingWrapper=Dv,ne.ImageLabel2D=Zx,ne.ImageLabel3D=$x,ne.ImageriesManager=uE,ne.LabelManager=lE,ne.LineStringAppendEditing=kS,ne.LineStringAppendEditingWrapper=Pv,ne.LineStringInsertEditing=VS,ne.LineStringInsertEditingWrapper=Bv,ne.PickingManager=cE,ne.PlaceEditing=Li,ne.PlaceEditingWrapper=wv,ne.PolylinePath=aa,ne.ResourceHandler=xs,ne.RotationEditing=di,ne.RotationEditingWrapper=bv,ne.ScaleEditing=ur,ne.ScaleEditingWrapper=xv,ne.ScatterAppendEditing=HS,ne.ScatterAppendEditingWrapper=Tv,ne.ScatterModifyEditing=GS,ne.ScatterModifyEditingWrapper=Iv,ne.ScreenManager=fE,ne.SharedTexturePool=Q0,ne.SmoothMoving=B0,ne.TerrainManager=aE,ne.TextLabel2D=Yx,ne.TextLabel3D=Jx,ne.ToGCJ02WebMercatorTilingScheme=dx,ne.ToWGS84WebMercatorTilingScheme=px,ne.TranslationEditing=lr,ne.TranslationEditingWrapper=Zf,ne.ViewerExtensions=dE,ne.VisibilityAppendEditing=za,ne.VisibilityAppendEditingWrapper=Fv,ne.VisibilityModifyEditing=ka,ne.VisibilityModifyEditingWrapper=Mv,ne.Widget2D=Pr,ne.Widget3D=FA,ne.WinPosFromCartesian=Eh,ne.XbsjGroundPolylinePrimitive=Bi,ne._ESEditModeInstance=$f,ne.angleToHumanStr=rl,ne.areaToHumanStr=Y2,ne.bindNorthRotation=Dt,ne.capture=D0,ne.checkAndConvertImage=X2,ne.computeCutPoint=RS,ne.computeCzmModelMatrix=lt,ne.computePickingInfoWithCoordinates=Ad,ne.createClippingPlaneCollection=el,ne.createClippingPolygonCollection=xh,ne.createGeoBoudingSphereReactFromPositions=M0,ne.createHelperLine=s2,ne.createInfoPoi=Dd,ne.createInnerClassFromJson=Td,ne.createInnerHtmlWithWhiteTextBlackBackground=_o,ne.createMaterialFromJson=o0,ne.createMaterialRef=si,ne.createMoveObjectsProcessing=jS,ne.createPolygonHierarchy=Hi,ne.createTexture=bo,ne.createTextureFromImage=zd,ne.createTilingSchema=mi,ne.czmEllipsoidWGS84=L0,ne.czmFlyTo=sl,ne.czmModelActiveAnimationsWithVisible=Ih,ne.czmSubscribeAndEvaluate=gi,ne.defaultFlyToRotation=Gn,ne.distanceToHumanStr=Mh,ne.extendComponentProps=J2,ne.flyTo=Fe,ne.flyWithPosition=Rn,ne.flyWithPositions=Me,ne.flyWithPrimitive=bn,ne.fromCartesian=zE,ne.fromCartesian2=qv,ne.fromCartesian3=Ya,ne.fromCartesian4=Kv,ne.fromCartographic=fo,ne.fromColor=QE,ne.fromDistanceDisplayCondition=HE,ne.fromEllipsoid=XE,ne.fromHeadingPitchRoll=NE,ne.fromNearFarScalar=VE,ne.fromQuaternion=WE,ne.fromRectangle=ZE,ne.generateCartesianArc=y0,ne.geoNeareastPointOnRhumbLine=mo,ne.geoNeareastPointOnRhumbLine2=a2,ne.geoPolylineToBezierSpline=Rd,ne.getCameraPosition=Mn,ne.getCameraRotation=gs,ne.getCameraTargetPos=Yv,ne.getCenterAndViewDistance=Ud,ne.getCzmCode=q2,ne.getDefaultComponentProps=eP,ne.getDefaultWinPosAndDepth=p2,ne.getDetailedTerrainDistance=O0,ne.getDirectionVectorFromRotation=u0,ne.getDistancesAndTimePosRotsFromPositions=bd,ne.getElevationMatrix=_7,ne.getEllipsoidGeodesicCenter=md,ne.getFlyToCenterAndRotation=Dh,ne.getFoveatedInterpolationCallback=Ex,ne.getFuncFromStr=Id,ne.getGroundTerrainDistance=U0,ne.getGroundTerrainDistances=R0,ne.getIncludedAngleFromPositions=x0,ne.getInverseModelMatrix=w0,ne.getMinMaxPosition=F0,ne.getModelMatrixFromPosition=xd,ne.getObjectProperties=Co,ne.getPointerEventButton=Gi,ne.getPolygonPointsFromHierarchy=_d,ne.getQuaternion=ld,ne.getQuaternionWithXForwardZUp=$v,ne.getQuaternionWithYForwardZUp=_h,ne.getResource=Dn,ne.getSceneScaleForScreenPixelSize=Ni,ne.getSharedTexturePool=V0,ne.getTilingSchemeStr=D5,ne.getViewerExtensions=Ot,ne.getWinPos=l0,ne.getXbsjWaterMaterial=C0,ne.hackCesium3DTileset=ME,ne.hackCzmModel3DTileContent=DE,ne.hackModel=FE,ne.hackModelSceneGraph=RE,ne.imgUrlToBase64=So,ne.localPositionToPosition=xr,ne.localPositionsToPositions=_r,ne.merge3dTilesServer=Q2,ne.pickHeightPosition=Sh,ne.pickPosition=i0,ne.pickVirtualEarth=ys,ne.pickVirtualPlane=r0,ne.positionAndRotationToQuaternion=KE,ne.positionFromCartesian=De,ne.positionToCartesian=rt,ne.positionToHumanStr=Fd,ne.positionToLocalPosition=b0,ne.positionsToLocalPositions=wn,ne.positionsToUniqueCartesians=Yt,ne.rectangleIsGlobal=Bd,ne.rpToap=Fh,ne.setClippingPlaneCollection=bh,ne.setCylinderGeometry=Md,ne.setModelMaterial=il,ne.setRectangleGeometry=I0,ne.setViewerExtensions=Qv,ne.toCartesian=oi,ne.toCartesian2=Ze,ne.toCartesian3=ri,ne.toCartesian4=ad,ne.toCartographic=kE,ne.toCoefficients=Pd,ne.toColor=Be,ne.toDistanceDisplayCondition=Ja,ne.toEllipsoid=qe,ne.toHeadingPitchRoll=Zv,ne.toNearFarScalar=gr,ne.toQuaternion=GE,ne.toRectangle=gt,ne.toRgbaString=Cr,ne.updateEnvironmentMapManager=Ed,ne.updateMaterialFromJson=pd,ne.waterType=Rh,ne.winPosAndDepthEqual=a0,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"}),ne}({},Cesium,EarthSDK3);
|