earthsdk3-cesium 3.8.2 → 3.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -338,7 +338,7 @@ ${LB}
|
|
|
338
338
|
// out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
339
339
|
// #endif
|
|
340
340
|
}
|
|
341
|
-
`;r.vertexShaderSource=o,r.fragmentShaderSource=s;const a={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}};r.renderState=a;const l=()=>{this.czmTextureId?r.uniformMap={myImage:{type:"texture",id:this.czmTextureId},myColor:this.color??[1,1,1,1]}:r.uniformMap={myImage:{type:"image",uri:A.ESSceneObject.context.getStrFromEnv(this.uri??"${earthsdk3-assets-script-dir}/assets/img/location.png")},myColor:this.color??[1,1,1,1]}};l(),this.dispose(this.uriChanged.disposableOn(l)),this.dispose(this.czmTextureIdChanged.disposableOn(l)),this.dispose(this.colorChanged.disposableOn(l)),this.dispose(A.bind([r,"show"],[this,"show"])),this.dispose(A.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(A.bind([r,"position"],[this,"position"]));{const p=()=>{r.pixelSize=this.pixelSize};p(),this.dispose(this.pixelSizeChanged.disposableOn(p))}this.dispose(A.track([r,"maximumScale"],[this,"maximumScale"])),this.dispose(A.track([r,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(A.track([r,"viewDistanceDebug"],[this,"viewDistanceDebug"]));const u=()=>{const{scale:p=[1,1]}=this;r.scale=[this.useAxis.includes("X")?p[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?p[1]:1]};u(),this.dispose(this.scaleChanged.disposableOn(u));const h=()=>{const p=-(this.originRatioAndOffset[0]*this.size[0]+this.originRatioAndOffset[2]),d=this.originRatioAndOffset[1]*this.size[1]+this.originRatioAndOffset[3];r.localPosition=[this.useAxis.includes("X")?p:0,this.useAxis.includes("Y")?this.useAxis.includes("X")?d:p:0,this.useAxis.includes("Z")?d:0],r.localScale=[this.useAxis.includes("X")?this.size[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?this.size[1]:1]};{const p=()=>{const d={XY:[0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0,0],YZ:[0,0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0],XZ:[0,0,0,0,0,-1,1,0,-1,1,0,0,0,0,0,0,0,-1,1,0,-1,1,0,0]},g={XY:{min:[0,-1,0],max:[1,0,0]},YZ:{min:[0,0,-1],max:[0,1,0]},XZ:{min:[0,0,-1],max:[1,0,0]}};r.attributes={position:{typedArray:new Float32Array(d[this.useAxis??Vf.defaults.useAxis]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,1]),componentsPerAttribute:2}},r.boundingVolume={type:"LocalAxisedBoundingBox",data:g[this.useAxis??Vf.defaults.useAxis]},h()};p(),this.d(this.useAxisChanged.don(p))}this.dispose(this.originRatioAndOffsetChanged.disposableOn(h)),this.dispose(this.sizeChanged.disposableOn(h)),this.dispose(this.flyToEvent.disposableOn(p=>{r.flyTo(p)})),this.disposeVar(new A.ObjResettingWithEvent(this.rotationModeChanged,()=>new G5(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customPrimitive(){return this._customPrimitive}};y(Vf,"defaults",{position:[0,0,0],viewDistanceRange:[1e3,1e4,3e4,6e4],useAxis:"XY"});let Hs=Vf;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",czmTextureId:"",position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),rotationWithCamera:!1,rotationMode:"WithProp",useAxis:"XY",size:A.reactArray([1,1]),scale:[1,1],maximumScale:Number.MAX_VALUE,minimumScale:Number.MIN_VALUE,pixelSize:50,color:A.reactArray([1,1,1,1]),originRatioAndOffset:A.reactArray([.5,1,0,0]),viewDistanceRange:A.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Hs||(Hs={})),A.extendClassProps(Hs.prototype,Hs.createDefaultProps);class G5 extends A.Destroyable{constructor(t,e){super(),this._czmViewer=t,this._czmImageModel=e;const{customPrimitive:n,rotationMode:r}=this._czmImageModel;if(r==="WithProp")this.dispose(A.track([n,"rotation"],[this._czmImageModel,"rotation"]));else if(r==="WithCameraOnlyZ"){const o=()=>{const{rotation:s}=this._czmImageModel,a=this._czmViewer.getCameraInfo();a&&(n.rotation=[a.rotation[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),s[1],s[2]])};o(),this.dispose(this._czmViewer.cameraChanged.disposableOn(o)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(o))}else if(r==="WithCamera"){const o=()=>{const s=this._czmViewer.getCameraInfo();if(!s)return;const a=s.rotation;n.rotation=[a[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),a[1]+(this._czmImageModel.useAxis.includes("Z")?0:90),a[2]]};o(),this.dispose(this._czmViewer.cameraChanged.disposableOn(o)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(o))}}}class aA extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");y(this,"_id",this.disposeVar(A.react(A.createGuid())));n&&(this.id=n);const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}if(!li(e.viewer))return;const s=this.disposeVar(wo([this,"material"])),a=this.disposeVar(A.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,s.changed)),l=this.disposeVar(new A.ObjResettingWithEvent(a,()=>{if(s.value)return new W5(e,r,this,s.value)}));this.dispose(this.flyToEvent.disposableOn(u=>{e.actived&&(a.flush(),l.obj&&l.obj.flyTo(u))}))}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}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,arcType:"GEODESIC",material:A.reactJson({type:"Color"}),stRotation:0,polygonHierarchy:A.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:1,perPositionHeight:!1,closeTop:!0,closeBottom:!0})})(aA||(aA={})),A.extendClassProps(aA.prototype,aA.createDefaultProps);class W5 extends A.Destroyable{constructor(e,n,r,o){super();y(this,"_boundingSphere");this._czmViewer=e,this._viewer=n,this._sceneObject=r,this._material=o;const s=this._sceneObject,a=this._material,l=this._viewer;if(!s.polygonHierarchy)return;const u=new f.BoundingSphere,h=pn(s.polygonHierarchy.positions);h.length<3?(u.radius=-1,this._boundingSphere=void 0):(f.BoundingSphere.fromPoints(h,u),this._boundingSphere=u);const p=new f.MaterialAppearance({material:a}),d=[],g=new f.GeometryInstance({geometry:new f.PolygonGeometry({vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ms(s.polygonHierarchy),stRotation:s.stRotation&&f.Math.toRadians(s.stRotation),arcType:s.arcType&&f.ArcType[s.arcType],height:s.height,extrudedHeight:s.extrudedHeight,perPositionHeight:s.perPositionHeight,closeTop:s.closeTop,closeBottom:s.closeBottom,ellipsoid:s.ellipsoid&&Ye(s.ellipsoid),granularity:s.granularity!==void 0?f.Math.toRadians(s.granularity):void 0}),id:this});d.push(g);const m=new f.GroundPrimitive({geometryInstances:d,appearance:p,asynchronous:!1,allowPicking:s.allowPicking,compressVertices:!1});f.GroundPrimitive.prototype&&(m.ESSceneObjectID=r.id),l.scene.primitives.add(m),this.dispose(()=>l.scene.primitives.remove(m));{const v=()=>{m.show=s.show};v(),this.dispose(s.showChanged.disposableOn(v))}this.disposeVar(new ht.ObjectsToExcludeWrapper(this._czmViewer,m))}flyTo(e){const n=this._boundingSphere;if(n&&n.radius>0){const r=Be(n.center);r&&ye(this._viewer,r,n.radius*4,void 0,e)}}}class K5 extends A.Destroyable{constructor(e,n){super();y(this,"_groundPolygonPrimitive");this._groundPolygonPrimitive=this.disposeVar(new aA(n,e.id));const r=this._groundPolygonPrimitive;{const o=()=>{const a=e.show,l=e.fill;r.show=a&&l&&e.visibleAlpha>0,r.polygonHierarchy=r.show?{positions:e.positions||[]}:{positions:[]},r.material={type:"Color",color:e.color||[1,1,1,.5]}};o();const s=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(s.disposableOn(o))}this.dispose(A.track([r,"allowPicking"],[e,"allowPicking"]))}get groundPolygonPrimitive(){return this._groundPolygonPrimitive}}class q5 extends A.Destroyable{constructor(e,n,r){super();y(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new ut(n,e.id));const o=this._geoPolyline;o.arcType="GEODESIC",o.loop=!0;{const s=()=>{const l=e.show,u=e.outline;if(o.show=l&&u&&e.visibleAlpha>0,o.show&&e.positions&&e.positions.length>1){const h=e.positions[0][2];o.positions=e.positions.map(p=>[p[0],p[1],h])}else o.positions=void 0;o.color=e.outlineColor,o.width=e.outlineWidth};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"])),this.dispose(A.track([o,"ground"],[e,"strokeGround"]))}get geoPolyline(){return this._geoPolyline}}class X5 extends A.Destroyable{constructor(e,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=e.ground;this._innerPolygon=this.disposeVar(new K5(e,n)),this._bottomPolyline=this.disposeVar(new q5(e,n,r)),this.dispose(e.flyToEvent.disposableOn(o=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;ye(n.viewer,s,a,void 0,o)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],l=e.positionsCenter.radius*4;ye(n.viewer,a,l,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Ga extends A.Destroyable{constructor(e,n){super();y(this,"_positions",this.disposeVar(A.reactPositions(void 0)));y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");this.d(this.polygonHierarchyChanged.don(()=>{this.polygonHierarchy?this.positions=this.polygonHierarchy.positions:this.positions=void 0})),this.d(this.positionsChanged.don(()=>{this.positions?this.polygonHierarchy.positions=[...this.positions]:this.polygonHierarchy={positions:[]}}));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(wo([this,"material"])),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=g=>{if(!this.polygonHierarchy)return;const m=new f.MaterialAppearance({material:g}),v=[],w=new f.GeometryInstance({geometry:new f.PolygonGeometry({vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ms(this.polygonHierarchy),stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),arcType:this.arcType&&f.ArcType[this.arcType],height:this.height,extrudedHeight:this.extrudedHeight,perPositionHeight:this.perPositionHeight,closeTop:this.closeTop,closeBottom:this.closeBottom,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid),granularity:this.granularity!==void 0?f.Math.toRadians(this.granularity):void 0}),id:this});v.push(w);const C=new f.Primitive({geometryInstances:v,appearance:m,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return f.Primitive.prototype&&(C.ESSceneObjectID=n),C},l=new f.BoundingSphere,u=()=>{if(s(),!this.polygonHierarchy)return;const g=pn(this.polygonHierarchy.positions);if(g.length<3||!o.value){l.radius=-1;return}f.BoundingSphere.fromPoints(g,l),this._primitive=a(o.value),this._primitive&&r.scene.primitives.add(this._primitive)},h=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};u(),h();const p=this.disposeVar(A.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,o.changed));this.dispose(p.disposableOn(()=>{u(),h()}));const d=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(e.actived&&(p.flush(),d.flush(),l.radius>0)){const m=Be(l.center),v=this.height??0,w=this.extrudedHeight??0,C=Math.max(v,w),_=l.radius<C?C:l.radius;m&&ye(r,m,_*4,void 0,g)}}))}get positions(){return this._positions.value}get positionsChanged(){return this._positions.changed}set positions(e){this._positions.value=e}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}y(Ga,"defaults",{positions:[]}),(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,material:A.reactJson({type:"Color"}),stRotation:void 0,polygonHierarchy:A.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0})})(Ga||(Ga={})),A.extendClassProps(Ga.prototype,Ga.createDefaultProps);class GS extends A.Destroyable{constructor(e,n,r,o){super();y(this,"_czmInnerPolygonPrimitive");this._czmInnerPolygonPrimitive=this.disposeVar(new Ga(n,e.id));const s=this._czmInnerPolygonPrimitive;{const a=()=>{const u=e.show,h=e.fill;if(s.show=u&&h&&e.visibleAlpha>0,e.positions&&e.positions.length>0&&!o?s.height=e.positions[0][2]:s.height=void 0,s.polygonHierarchy=s.show?{positions:e.positions||[]}:{positions:[]},s.material={type:"Color",color:e.color||[1,1,1,.5]},r){if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");s.extrudedHeight=(s.height??0)+e.depth}};a();const l=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(l.disposableOn(a))}this.dispose(A.track([s,"allowPicking"],[e,"allowPicking"]))}get czmInnerPolygonPrimitive(){return this._czmInnerPolygonPrimitive}}class WS extends A.Destroyable{constructor(e,n,r){super();y(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new ut(n,e.id));const o=this._geoPolyline;o.arcType="GEODESIC",o.loop=!0,this.dispose(A.bind([o,"depthTest"],[e,"depthTest"])),this.dispose(A.bind([o,"ground"],[e,"strokeGround"]));{const s=()=>{const l=e.show,u=e.outline;if(o.show=l&&u&&e.visibleAlpha>0,o.show&&e.positions&&e.positions.length>1){const h=e.positions[0][2];o.positions=e.positions.map(p=>[p[0],p[1],h])}else o.positions=void 0;o.color=e.outlineColor,o.width=e.outlineWidth};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"]))}get geoPolyline(){return this._geoPolyline}}class k5 extends A.Destroyable{constructor(t,e){super();const n=this.disposeVar(new Ur(e,t.id));n.arcType="GEODESIC",this.dispose(A.track([n,"allowPicking"],[t,"allowPicking"])),this.dispose(A.bind([n,"depthTest"],[t,"depthTest"]));{const r=()=>{if(t.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=t.show,a=t.outline;n.show=s&&a&&t.visibleAlpha>0,n.color=t.outlineColor,n.width=t.outlineWidth;let l;if(n.show&&t.positions&&t.positions.length>1){const h=t.positions[0][2];l=t.positions.map(p=>[p[0],p[1],h])}let u;if(t.positions&&t.positions.length>0?u=t.positions[0][2]:u=void 0,n.show&&l){const h=u,p=(u??0)+t.depth;n.positions=l.map(d=>[[d[0],d[1],h],[d[0],d[1],p]])}else n.positions=void 0};r();const o=this.disposeVar(A.createNextAnimateFrameEvent(t.showChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.visibleAlphaChanged));this.dispose(o.disposableOn(r))}}}class Y5 extends A.Destroyable{constructor(t,e){super();const n=this.disposeVar(new ut(e,t.id));n.arcType="GEODESIC",n.loop=!0,this.dispose(A.track([n,"allowPicking"],[t,"allowPicking"])),this.dispose(A.bind([n,"depthTest"],[t,"depthTest"]));{const r=()=>{if(t.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=t.show,a=t.outline;n.show=s&&a&&t.visibleAlpha>0,n.color=t.outlineColor,n.width=t.outlineWidth;let l;if(n.show&&t.positions&&t.positions.length>1){const h=t.positions[0][2];l=t.positions.map(p=>[p[0],p[1],h])}let u;if(t.positions&&t.positions.length>0?u=t.positions[0][2]:u=void 0,n.show&&l){const h=(u??0)+t.depth;n.positions=l.map(p=>[p[0],p[1],h])}else n.positions=void 0};r();const o=this.disposeVar(A.createNextAnimateFrameEvent(t.showChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.visibleAlphaChanged));this.dispose(o.disposableOn(r))}}}class $5 extends A.Destroyable{constructor(e,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=e.ground;this._innerPolygon=this.disposeVar(new GS(e,n,!0,r)),this._bottomPolyline=this.disposeVar(new WS(e,n,r)),this.disposeVar(new k5(e,n)),this.disposeVar(new Y5(e,n)),this.dispose(e.flyToEvent.disposableOn(o=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;ye(n.viewer,s,a,void 0,o)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],l=e.positionsCenter.radius*4;ye(n.viewer,a,l,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}let Z5=class extends A.Destroyable{constructor(e,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=e.ground;this._innerPolygon=this.disposeVar(new GS(e,n,!1,r)),this._bottomPolyline=this.disposeVar(new WS(e,n,r)),this.dispose(e.flyToEvent.disposableOn(o=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;ye(n.viewer,s,a,void 0,o)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],l=e.positionsCenter.radius*4;ye(n.viewer,a,l,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}};class Wa extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_polygonOrGroundPolygonResetting");y(this,"_czmViewVisibleDistanceRangeControl");y(this,"_id",this.disposeVar(A.react(A.createGuid())));y(this,"_positionsCenter");this._positionsCenter=this.ad(new Jv(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Kl(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(A.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const r=this.disposeVar(A.createNextAnimateFrameEvent(this.groundChanged,this.depthChanged,this.strokeGroundChanged));this._polygonOrGroundPolygonResetting=this.disposeVar(new A.ObjResettingWithEvent(r,()=>this.ground?new X5(this,e):this.depth!==void 0&&this.depth>0?new $5(this,e):new Z5(this,e)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polygonOrGroundPolygonResetting(){return this._polygonOrGroundPolygonResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get positionsCenter(){return this._positionsCenter}}y(Wa,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,strokeGround:!1,outline:!0,outlineColor:A.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:A.reactArray([1,1,1,.5]),positions:A.reactPositions(void 0),depth:0,zIndex:0,viewDistanceRange:A.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(Wa||(Wa={})),A.extendClassProps(Wa.prototype,Wa.createDefaultProps);class pp extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(wo([this,"material"])),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(d,g)=>{const m=new f.MaterialAppearance({material:g}),v=[],w=new f.GeometryInstance({geometry:new f.RectangleGeometry({rectangle:d,height:this.height,rotation:this.rotation&&f.Math.toRadians(this.rotation),extrudedHeight:this.extrudedHeight,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});v.push(w);const C=new f.Primitive({geometryInstances:v,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return f.Primitive.prototype&&(C.ESSceneObjectID=n),C},l=()=>{if(s(),!this.positions)return;const d=ft(this.positions);!d||!o.value||(this._primitive=a(d,o.value),this._primitive&&r.scene.primitives.add(this._primitive))},u=()=>{const d=this.show??!0;this._primitive&&(this._primitive.show=d)};l(),u();const h=this.disposeVar(A.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.stRotationChanged,this.rotationChanged,o.changed,this.allowPickingChanged));this.dispose(h.disposableOn(()=>{l(),u()}));const p=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(d=>{if(!e.actived||!this.positions)return;const g=ft(this.positions),m=f.BoundingSphere.fromRectangle3D(g,void 0,this.height);if(m.radius>0){const v=Be(m.center);v&&ye(r,v,m.radius*4,void 0,d)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:A.reactJsonWithUndefined(void 0),positions:A.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,stRotation:void 0})})(pp||(pp={})),A.extendClassProps(pp.prototype,pp.createDefaultProps);const Tv=class Tv extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(wo([this,"material"],Tv.defaults.material)),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(d,g)=>{const m=new f.MaterialAppearance({material:g}),v=[],w=new f.GeometryInstance({geometry:new f.RectangleGeometry({rectangle:d,rotation:this.rotation&&f.Math.toRadians(this.rotation),stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});v.push(w);const C=new f.GroundPrimitive({geometryInstances:v,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return f.GroundPrimitive.prototype&&(C.ESSceneObjectID=n),C},l=()=>{if(s(),!this.positions)return;const d=ft(this.positions);!d||!o.value||(this._primitive=a(d,o.value),this._primitive&&r.scene.primitives.add(this._primitive))},u=()=>{const d=this.show??!0;this._primitive&&(this._primitive.show=d)};l(),u();const h=this.disposeVar(A.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.stRotationChanged,this.rotationChanged,o.changed,this.allowPickingChanged));this.dispose(h.disposableOn(()=>{l(),u()}));const p=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(d=>{if(!e.actived||!this.positions)return;const g=ft(this.positions),m=f.BoundingSphere.fromRectangle3D(g,void 0,0);if(m.radius>0){const v=Be(m.center);v&&ye(r,v,m.radius*4,void 0,d)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};y(Tv,"defaults",{material:{type:"Color",color:[1,1,1,.5]}});let lA=Tv;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:A.reactJsonWithUndefined(void 0),positions:A.reactArrayWithUndefined(void 0),rotation:void 0,stRotation:void 0})})(lA||(lA={})),A.extendClassProps(lA.prototype,lA.createDefaultProps);class fp extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(o);const s=new f.Color,a=d=>{const g=new f.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),m=[],v=new f.GeometryInstance({geometry:new f.RectangleOutlineGeometry({rectangle:d,height:this.height??0,extrudedHeight:this.extrudedHeight,rotation:this.rotation&&f.Math.toRadians(this.rotation)}),attributes:{color:this.color?f.ColorGeometryInstanceAttribute.fromColor(ce(this.color,s)):f.ColorGeometryInstanceAttribute.fromColor(new f.Color(1,1,1,1))},id:this});m.push(v);const w=new f.Primitive({geometryInstances:m,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return f.Primitive.prototype&&(w.ESSceneObjectID=n),w},l=()=>{if(o(),!this.positions)return;const d=ft(this.positions);d&&(this._primitive=a(d),this._primitive&&r.scene.primitives.add(this._primitive))},u=()=>{const d=this.show??!0;this._primitive&&(this._primitive.show=d)};l(),u();const h=this.disposeVar(A.createNextAnimateFrameEvent(this.positionsChanged,this.colorChanged,this.translucentChanged,this.extrudedHeightChanged,this.heightChanged,this.rotationChanged,this.allowPickingChanged));this.dispose(h.disposableOn(()=>{l(),u()}));const p=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(d=>{if(!e.actived||!this.positions)return;const g=ft(this.positions),m=f.BoundingSphere.fromRectangle3D(g,void 0,this.height);if(m.radius>0){const v=Be(m.center);v&&ye(r,v,m.radius*4,void 0,d)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,translucent:void 0,color:A.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,positions:A.reactArrayWithUndefined(void 0)})})(fp||(fp={})),A.extendClassProps(fp.prototype,fp.createDefaultProps);const Gf=class Gf extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));if(!e.viewer)return;const o=this.ad(new pp(e,n)),s=this.ad(new lA(e,n)),a=this.ad(new fp(e,n));this.dispose(A.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(A.track([s,"allowPicking"],[this,"allowPicking"]));{const l=()=>{const h=this.show??!0,p=this.ground??!1,d=this.outline??!1;a.show=h&&!p&&d,o.show=h&&!p,a.show?a.positions=this.rectangle:a.positions=void 0,o.show?o.positions=this.rectangle:o.positions=void 0,a.rotation=o.rotation=this.rotation,o.material=this.material??Gf.defaults.material,o.stRotation=this.stRotation,a.extrudedHeight=o.extrudedHeight=this.extrudedHeight,a.height=o.height=this.height,a.color=this.outlineColor,a.translucent=this.outlineTranslucent,s.show=h&&p,s.show?s.positions=this.rectangle:s.positions=void 0,s.rotation=this.rotation,s.material=this.material??Gf.defaults.material,s.stRotation=this.stRotation};l();const u=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.heightChanged,this.extrudedHeightChanged,this.materialChanged,this.rectangleChanged,this.outlineColorChanged,this.stRotationChanged,this.rotationChanged,this.outlineTranslucentChanged,this.groundChanged));this.dispose(u.disposableOn(()=>{l()})),this.dispose(this.flyToEvent.disposableOn(h=>{this.ground?s.flyTo(h):o.flyTo(h)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};y(Gf,"defaults",{material:{type:"Color",color:[1,1,1,.5]},rectangle:void 0,extrudedHeight:void 0});let Jo=Gf;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outlineTranslucent:!0,outline:!1,outlineColor:A.reactArray([1,1,1,1]),height:0,extrudedHeight:void 0,material:A.reactJsonWithUndefined(void 0),rectangle:A.reactArrayWithUndefined(void 0),rotation:0,stRotation:0})})(Jo||(Jo={})),A.extendClassProps(Jo.prototype,Jo.createDefaultProps);const Wf=class Wf extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");this.czmViewer=e,this.id=n;const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this.clear()});const o=this.disposeVar(wo([this,"material"])),s=()=>{this.clear(),!(!this.position||!o.value)&&(this._primitive=this.createPrimitive(o.value),this._primitive&&r.scene.primitives.add(this._primitive),this.updateShow())};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.ellipsoidChanged,this.granularityChanged,this.stRotationChanged,o.changed,this.instancesChanged,this.rotationChanged));this.dispose(a.disposableOn(()=>{s()})),this.dispose(this.showChanged.disposableOn(()=>{this.updateShow()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)ye(r,this.position,this.radius*4,void 0,1e3);else{const l=r.scene.camera.positionCartographic.height;ye(r,this.position,l,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}setGranularity(){let e=this.granularity??Wf.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),e=e|0,e=Math.max(1,e),f.Math.toRadians(e)}createPrimitive(e){if(!this.position||!this.radius)return;const n=new f.MaterialAppearance({material:e}),r=[],o=this.setGranularity();if(this.instances&&this.instances.length>0)for(let a=0;a<this.instances.length;a++){const l=this.instances[a];r.push(this.createGeometry(l.position,l.rotation??this.rotation,l.radius??this.radius,l.id??this,l.position[2]??this.height,o))}else r.push(this.createGeometry(this.position,this.rotation,this.radius,this,this.height,o));const s=new f.Primitive({geometryInstances:r,appearance:n,asynchronous:!1,allowPicking:this.allowPicking??Wf.defaults.allowPicking,compressVertices:!1});return f.Primitive.prototype&&(s.ESSceneObjectID=this.id),s}createGeometry(e,n,r,o,s,a){const l=ke(e),u=new f.GeometryInstance({geometry:new f.CircleGeometry({center:l,height:s,extrudedHeight:this.extrudedHeight,radius:r,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),vertexFormat:f.VertexFormat.ALL,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid),granularity:a}),id:o}),h=f.Transforms.eastNorthUpToFixedFrame(l),p=f.Matrix4.inverseTransformation(h,new f.Matrix4),d=f.Matrix4.multiplyByMatrix3(h,f.Matrix3.fromHeadingPitchRoll(f.HeadingPitchRoll.fromDegrees(n[0],n[1],n[2],new f.HeadingPitchRoll)),new f.Matrix4);return f.Matrix4.multiply(d,p,u.modelMatrix),u}updateShow(){this._primitive&&(this._primitive.show=!!this.show)}clear(){var e;this._primitive&&((e=this.czmViewer.viewer)==null||e.scene.primitives.remove(this._primitive),this._primitive=void 0)}};y(Wf,"defaults",{show:!0,allowPicking:!1,translucent:!0,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Ka=Wf;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:A.reactJson({type:"Color"}),position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,stRotation:void 0,ellipsoid:void 0,granularity:void 0,instances:A.reactArrayWithUndefined([])})})(Ka||(Ka={})),A.extendClassProps(Ka.prototype,Ka.createDefaultProps);const lu=class lu extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");this.czmViewer=e,this.id=n;const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this.clear()});const o=this.disposeVar(wo([this,"material"],lu.defaults.material)),s=()=>{if(this.clear(),!this.position||!this.radius||!o.value)return;const l=ke(this.position);this._primitive=this.createPrimitive(l,o.value),this._primitive&&r.scene.groundPrimitives.add(this._primitive),this.updateShow()};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.stRotationChanged,this.granularityChanged,this.ellipsoidChanged,this.materialChanged,this.instancesChanged,o.changed));this.dispose(a.disposableOn(()=>{s()})),this.dispose(this.showChanged.disposableOn(()=>{this.updateShow()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)ye(r,this.position,this.radius*4,void 0,1e3);else{const l=r.scene.camera.positionCartographic.height;ye(r,this.position,l,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}clear(){var e;this._primitive&&((e=this.czmViewer.viewer)==null||e.scene.groundPrimitives.remove(this._primitive)),this._primitive=void 0}updateShow(){this._primitive&&(this._primitive.show=this.show??lu.defaults.show)}createPrimitive(e,n){if(!e||!this.radius)return;const r=new f.MaterialAppearance({material:n}),o=[],s=this.setGranularity();if(this.instances&&this.instances.length>0)for(let l=0;l<this.instances.length;l++){const u=this.instances[l],h=new f.GeometryInstance({geometry:new f.CircleGeometry({center:ke(u.position),radius:u.radius??this.radius,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),granularity:s,vertexFormat:f.VertexFormat.ALL,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid)}),id:u.id??this});o.push(h)}else{const l=new f.GeometryInstance({geometry:new f.CircleGeometry({center:e,radius:this.radius,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),granularity:s,vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid)}),id:this});o.push(l)}const a=new f.GroundPrimitive({geometryInstances:o,appearance:r,asynchronous:!1,allowPicking:this.allowPicking??lu.defaults.allowPicking,compressVertices:!1});return f.GroundPrimitive.prototype&&(a.ESSceneObjectID=this.id),a}setGranularity(){let e=this.granularity??lu.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),e=e|0,e=Math.max(1,e),f.Math.toRadians(e)}};y(lu,"defaults",{show:!0,allowPicking:!1,material:{type:"Color",color:[1,1,1,.5]},radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let qa=lu;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:A.reactJsonWithUndefined(void 0),granularity:void 0,position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),radius:void 0,stRotation:void 0,ellipsoid:void 0,instances:A.reactArrayWithUndefined([])})})(qa||(qa={})),A.extendClassProps(qa.prototype,qa.createDefaultProps);const Kf=class Kf extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0});const o=new f.Color,s=p=>{if(!p||!this.radius)return;const d=new f.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),g=[],m=f.ColorGeometryInstanceAttribute.fromColor(f.Color.WHITE),v=()=>{let P=this.granularity??Kf.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),P=P|0,P=Math.max(1,P),f.Math.toRadians(P)},w=new f.GeometryInstance({geometry:new f.CircleOutlineGeometry({center:p,radius:this.radius,height:this.height,extrudedHeight:this.extrudedHeight,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid),granularity:v(),numberOfVerticalLines:this.numberOfVerticalLines}),attributes:{color:this.outlineColor?f.ColorGeometryInstanceAttribute.fromColor(ce(this.outlineColor,o)):m},id:this}),C=It({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),_=It({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!_||!C){console.warn("modelMatrix is undefined!");return}const x=f.Matrix4.inverseTransformation(C,new f.Matrix4);f.Matrix4.multiply(_,x,w.modelMatrix),g.push(w);const E=new f.Primitive({geometryInstances:g,appearance:d,asynchronous:!1,allowPicking:this.allowPicking??Kf.defaults.allowPicking,compressVertices:!1});return f.Primitive.prototype&&(E.ESSceneObjectID=n),E},a=()=>{if(this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=ke(this.position);p&&(this._primitive=s(p),this._primitive&&r.scene.primitives.add(this._primitive))},l=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};a(),l();const u=this.disposeVar(A.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.outlineColorChanged,this.translucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.rotationChanged));this.dispose(u.disposableOn(()=>{a(),l()}));const h=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(h.disposableOn(()=>{l()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}const p=r.scene.camera.positionCartographic.height;ye(r,this.position,p,void 0,1e3)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};y(Kf,"defaults",{show:!0,translucent:!0,allowPicking:!1,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1,numberOfVerticalLines:0});let Xa=Kf;(i=>{i.createDefaultProps=()=>({show:!0,translucent:void 0,allowPicking:void 0,outlineColor:A.reactArrayWithUndefined(void 0),position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,ellipsoid:void 0,granularity:void 0,numberOfVerticalLines:void 0})})(Xa||(Xa={})),A.extendClassProps(Xa.prototype,Xa.createDefaultProps);class AA extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));if(!e.viewer)return;const o=this.ad(new Ka(e,n)),s=this.ad(new qa(e,n)),a=this.ad(new Xa(e,n));this.dispose(A.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(A.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(A.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(A.track([o,"instances"],[this,"instances"])),this.dispose(A.track([s,"instances"],[this,"instances"]));{const l=()=>{const h=this.show??!0,p=this.ground??!1,d=this.outline??!1;a.show=h&&!p&&d,o.show=h&&!p,a.show?a.position=this.position:a.position=void 0,o.show?o.position=this.position:o.position=void 0,o.rotation=a.rotation=this.rotation,a.radius=o.radius=this.radius,a.extrudedHeight=o.extrudedHeight=this.extrudedHeight,this.position&&(a.height=o.height=this.position[2]),this.granularity===0&&(console.error("granularity不能设置为0"),this.granularity=1),o.granularity=a.granularity=this.granularity,o.ellipsoid=a.ellipsoid=this.ellipsoid,o.material=this.material,o.stRotation=this.stRotation,a.outlineColor=this.outlineColor,a.translucent=this.outlineTranslucent,a.numberOfVerticalLines=this.numberOfVerticalLines,s.show=h&&p,s.show?s.position=this.position:s.position=void 0,s.radius=this.radius,this.granularity===0?(console.error("granularity不能设置为0"),s.granularity=1):s.granularity=this.granularity,s.rotation=this.rotation,s.ellipsoid=this.ellipsoid,s.material=this.material,s.stRotation=this.stRotation};l();const u=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged,this.radiusChanged,this.outlineChanged,this.extrudedHeightChanged,this.materialChanged,this.positionChanged,this.outlineColorChanged,this.stRotationChanged,this.outlineTranslucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.groundChanged,this.rotationChanged));this.dispose(u.disposableOn(l)),this.dispose(this.flyToEvent.disposableOn(h=>{this.ground?s.flyTo(h):o.flyTo(h)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}y(AA,"defaults",{extrudedHeight:void 0}),(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,outline:!0,outlineTranslucent:!0,extrudedHeight:void 0,outlineColor:A.reactArray([1,1,1,1]),material:A.reactJson({type:"Color",color:[1,1,1,.5]}),position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),radius:0,stRotation:0,ellipsoid:A.reactArray([6378137,6378137,6356752314245179e-9]),granularity:1,numberOfVerticalLines:0,instances:A.reactArrayWithUndefined([])})})(AA||(AA={})),A.extendClassProps(AA.prototype,AA.createDefaultProps);class dp extends A.Destroyable{constructor(e,n){super();y(this,"_primitive");y(this,"_flyToEvent",this.dv(new A.Event));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}if(!li(e.viewer))return;const s=f.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),a=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.d(a);const l=()=>{const x={baseWaterColor:ce(this.waterColor),normalMap:s,frequency:this.frequency,animationSpeed:this.waveVelocity,amplitude:this.amplitude,specularIntensity:this.specularIntensity};return new f.Material({fabric:{type:"Water",uniforms:x}})},u=()=>{if(!this.points)return;const x={positions:this.points},E=new f.PolygonGeometry({polygonHierarchy:Ms(x),vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat,height:this.height});return new f.GeometryInstance({geometry:E,id:this})},h=()=>{if(!this.points)return;const x=new f.EllipsoidSurfaceAppearance({material:l(),aboveGround:!0}),E=u();let P;return this.ground??!1?P=new f.GroundPrimitive({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}):P=new f.Primitive({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}),f.Primitive.prototype&&f.GroundPrimitive.prototype&&(P.ESSceneObjectID=n),P},p=new f.BoundingSphere,d=()=>{a(),g(p),this._primitive=h(),this._primitive&&r.scene.primitives.add(this._primitive)},g=x=>{if(!this.points)return;const E=pn(this.points);if(E.length<3){x.radius=-1;return}f.BoundingSphere.fromPoints(E,x)},m=()=>{const x=this.show??!0;this._primitive&&(this._primitive.show=x)},v=()=>{d(),m()};v();let w=A.debounce(v,500);const C=this.dv(A.createNextAnimateFrameEvent(this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.specularIntensityChanged,this.waveVelocityChanged,this.groundChanged,this.allowPickingChanged));this.d(C.don(v));const _=this.dv(A.createNextAnimateFrameEvent(this.pointsChanged,this.heightChanged));this.d(_.don(()=>{if(!this.points){a();return}this._primitive&&!this.ground?(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=u(),g(p),w&&w[0]()):v()})),this.d(this.showChanged.don(m)),this.d(this.flyToEvent.don(x=>{if(p.radius>0){const E=Be(p.center);E&&ye(r,E,p.radius*4,void 0,x)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:!0,points:A.reactPositions(void 0),height:void 0,allowPicking:!0,ground:!1,waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,baseWaterImage:A.reactJsonWithUndefined(void 0),flowSpeed:0})})(dp||(dp={})),A.extendClassProps(dp.prototype,dp.createDefaultProps);class uA extends A.Destroyable{constructor(e,n){super();y(this,"_primitive");y(this,"_flyToEvent",this.dv(new A.Event));y(this,"_updateBoundingSphereEvent",this.ad(new A.Event));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=new f.BoundingSphere,s=()=>{this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0};this.d(s);const a=x=>A.ESSceneObject.context.getStrFromEnv(x),l=()=>{this._primitive=new f[this.ground?"GroundPrimitive":"Primitive"]({compressVertices:!1,asynchronous:!1,allowPicking:this.allowPicking,geometryInstances:d()}),f.Primitive.prototype&&(this._primitive.ESSceneObjectID=n),r.scene.primitives.add(this._primitive)},u=()=>{var S;const x=a(this.normalMap??f.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")),E={baseWaterColor:ce(this.waterColor??[.25,.6,1,.7]),normalMap:x,frequency:this.frequency,animationSpeed:this.animationSpeed,amplitude:this.amplitude,specularIntensity:this.specularIntensity};if(this.blendColor&&(E.blendColor=ce(this.blendColor)),this.specularMap&&(E.specularMap=a(this.specularMap)),this.points&&this.points.length>=1){const{maxPos:F,minPos:D}=A.getMinMaxCorner(this.points),U=A.getDistancesFromPositions([D,[F[0],F[1],D[2]]],"GEODESIC")[0],O=A.getDistancesFromPositions([D,[D[0],F[1],F[2]]],"GEODESIC")[0];this.baseWaterImage&&(this.baseWaterImage.url&&(E.baseWaterImage=a(this.baseWaterImage.url)),this.baseWaterImage.uDis&&(E.repeatX=U/this.baseWaterImage.uDis),this.baseWaterImage.vDis&&(E.repeatY=O/this.baseWaterImage.vDis)),E.flowSpeed=this.flowSpeed/(((S=this.baseWaterImage)==null?void 0:S.uDis)??U)}if(this._primitive&&this._primitive.appearance){this._primitive.appearance.material.uniforms=Object.assign({},this._primitive.appearance.material.uniforms,E);return}const P=new f.EllipsoidSurfaceAppearance({material:dB(E),aboveGround:!0});this._primitive&&(this._primitive.appearance=P)},h=this.ad(A.createNextAnimateFrameEvent(this.baseWaterImageChanged,this.waterColorChanged,this.blendColorChanged,this.specularMapChanged,this.flowSpeedChanged,this.normalMapChanged,this.frequencyChanged,this.animationSpeedChanged,this.amplitudeChanged,this.specularIntensityChanged));this.ad(h.don(u));const p=x=>{if(!this.points)return;const E=pn(this.points);if(E.length<3){x.radius=-1;return}f.BoundingSphere.fromPoints(E,x)},d=()=>{if(!this.points||this.points.length<3)return;const{minPos:x}=A.getMinMaxCorner(this.points),[E]=Di({originPosition:x},this.points),{minPos:P,maxPos:S}=A.getMinMaxCorner(E),F=S[0]-P[0],D=S[1]-P[1],U={positions:this.points},O=new f.PolygonGeometry({polygonHierarchy:Ms(U),vertexFormat:f.VertexFormat.DEFAULT,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),perPositionHeight:!0,attributes:{st:new f.GeometryAttribute({componentDatatype:f.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(E.map(N=>[f.Math.clamp(N[0]/F,0,1),f.Math.clamp(N[1]/D,0,1)]).flat())})}});return new f.GeometryInstance({id:this,geometry:O})},g=()=>{this._primitive&&(this._primitive.show=this.show??!0)},m=this.ad(A.createNextAnimateFrameEvent(this.showChanged));this.ad(m.don(g));const v=this.ad(()=>{s(),l(),g(),u(),p(o)});v();const w=this.ad(A.createNextAnimateFrameEvent(this.allowPickingChanged,this.groundChanged));this.ad(w.don(v)),this.ad(new A.ObjResettingWithEvent(this.updateBoundingSphereEvent,x=>{const E=new A.Destroyable;return x?E.ad(r.scene.preUpdate.addEventListener(()=>{const P=r.camera;r.camera.frustum.computeCullingVolume(P.position,P.direction,P.up).computeVisibility(o)===f.Intersect.OUTSIDE&&v()})):(v(),E.ad(this.pointsChanged.don(v))),E}));const C=()=>{if(!this.points||this.points.length<3){v();return}this._primitive instanceof f.Primitive?(this._primitive._state=3,this._primitive._appearance=void 0):this._primitive._primitive=void 0,this._primitive.geometryInstances=d(),this._primitive._recomputeBoundingSpheres=!0},_=this.dv(A.createNextAnimateFrameEvent(this.pointsChanged,this.stRotationChanged));this.d(_.don(C)),this.d(this.flyToEvent.don(x=>{if(o.radius>0){const E=Be(o.center);E&&ye(r,E,o.radius*4,void 0,x)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get updateBoundingSphereEvent(){return this._updateBoundingSphereEvent}updateBoundingSphere(e){this._updateBoundingSphereEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:!0,points:A.reactPositions(void 0),allowPicking:!0,waterColor:[.1497,.165,.0031,1],blendColor:A.reactArrayWithUndefined(void 0),specularMap:void 0,normalMap:f.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),frequency:1e3,animationSpeed:.005,amplitude:10,specularIntensity:.3,baseWaterImage:A.reactJsonWithUndefined(void 0),flowSpeed:0,stRotation:void 0,ground:void 0})})(uA||(uA={})),A.extendClassProps(uA.prototype,uA.createDefaultProps);class cA extends A.Destroyable{constructor(e,n){super();y(this,"pointPrimitives");y(this,"_flyToEvent",this.dv(new A.Event));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}if(!li(e.viewer))return;let{pointPrimitives:s}=this;const a=()=>{s&&(s.removeAll(),r.scene.primitives.remove(s),s=void 0)};this.d(a);const l=()=>{const m=new f.PointPrimitiveCollection({show:this.show??!0,debugShowBoundingVolume:this.debugShowBoundingVolume??!1,blendOption:(this.blendOption&&M.czmPropMaps.blendOptionType[this.blendOption])??f.BlendOption.OPAQUE_AND_TRANSLUCENT});return this.pointPrimitiveOptions&&(this.pointPrimitiveOptions.forEach(w=>{m.add({show:w.show??!0,color:w.color&&ce(w.color),disableDepthTestDistance:w.disableDepthTestDistance,distanceDisplayCondition:w.distanceDisplayCondition&&Rh(w.distanceDisplayCondition),outlineColor:w.outlineColor&&ce(w.outlineColor),outlineWidth:w.outlineWidth,pixelSize:w.pixelSize,position:w.position&&ke(w.position),scaleByDistance:w.scaleByDistance&&xa(w.scaleByDistance),translucencyByDistance:w.translucencyByDistance&&xa(w.translucencyByDistance)})}),f.PointPrimitiveCollection.prototype&&(m.ESSceneObjectID=n)),m},u=()=>{a(),s=l(),r.scene.primitives.add(s)};u();const h=this.dv(A.createNextAnimateFrameEvent(this.showChanged,this.debugShowBoundingVolumeChanged,this.blendOptionChanged)),p=()=>{s&&(s.show=this.show??!0,s.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,s.blendOption=(this.blendOption&&M.czmPropMaps.blendOptionType[this.blendOption])??f.BlendOption.OPAQUE_AND_TRANSLUCENT)};this.d(h.don(p));const d=this.dv(A.createNextAnimateFrameEvent(this.pointPrimitiveOptionsChanged));this.d(d.don(u));const g=new f.BoundingSphere;this.d(this.flyToEvent.don(m=>{if(!(!e.actived||!this.pointPrimitiveOptions))if(h.flush(),d.flush(),this.pointPrimitiveOptions.length===1){const v=this.pointPrimitiveOptions[0].position;if(!v)return;const w=r.scene.camera.positionCartographic.height;ye(r,v,w,void 0,m)}else{const v=this.pointPrimitiveOptions,w=[];v.forEach(_=>{_.position&&w.push(_.position)});const C=pn(w);if(f.BoundingSphere.fromPoints(C,g),g.radius>0){const _=Be(g.center);_&&ye(r,_,g.radius*4,void 0,m)}}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:void 0,debugShowBoundingVolume:void 0,blendOption:void 0,pointPrimitiveOptions:void 0,position:A.reactArrayWithUndefined(void 0),rotation:A.reactArrayWithUndefined(void 0),scale:A.reactArrayWithUndefined(void 0),localPosition:A.reactArrayWithUndefined(void 0),localRotation:A.reactArrayWithUndefined(void 0),localScale:A.reactArrayWithUndefined(void 0),localModelMatrix:A.reactArrayWithUndefined(void 0),modelMatrix:A.reactArrayWithUndefined(void 0)})})(cA||(cA={})),A.extendClassProps(cA.prototype,cA.createDefaultProps);class J5 extends A.Destroyable{constructor(t,e){super();const n=e.viewer;if(!n)throw new Error("!viewer");const r=De.czmJulianDateToTimeStamp,o=De.getClockRange,s=De.getClockStep;{const a=()=>n.clockViewModel.startTime=f.JulianDate.fromDate(new Date(t.startTime??A.getDefaultValue(De.defaults.startTime)));a(),this.dispose(Ko(n.clockViewModel,"startTime",l=>t.startTime=r(l))),this.dispose(t.startTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.stopTime=f.JulianDate.fromDate(new Date(t.stopTime??A.getDefaultValue(De.defaults.stopTime)));a(),this.dispose(Ko(n.clockViewModel,"stopTime",l=>t.stopTime=r(l))),this.dispose(t.stopTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.currentTime=f.JulianDate.fromDate(new Date(t.currentTime??A.getDefaultValue(De.defaults.currentTime)));a(),this.dispose(Ko(n.clockViewModel,"currentTime",l=>t.currentTime=r(l))),this.dispose(t.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.multiplier=t.multiplier??De.defaults.multiplier;a(),this.dispose(Ko(n.clockViewModel,"multiplier",l=>{(t.multiplier??De.defaults.multiplier!==l)&&(t.multiplier=l)})),this.dispose(t.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockStep=f.ClockStep[t.clockStep??De.defaults.clockStep];a(),this.dispose(Ko(n.clockViewModel,"clockStep",l=>{const u=s(l);(t.clockStep??De.defaults.clockStep!==u)&&(t.clockStep=u)})),this.dispose(t.clockStepChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockRange=f.ClockRange[t.clockRange??De.defaults.clockRange];a(),this.dispose(Ko(n.clockViewModel,"clockRange",l=>{const u=o(l);(t.clockRange??De.defaults.clockRange!==u)&&(t.clockRange=u)})),this.dispose(t.clockRangeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.shouldAnimate=t.shouldAnimate??De.defaults.shouldAnimate;a(),this.dispose(Ko(n.clockViewModel,"shouldAnimate",l=>{(t.shouldAnimate??De.defaults.shouldAnimate!==l)&&(t.shouldAnimate=l)})),this.dispose(t.shouldAnimateChanged.disposableOn(a))}}}const Au=class Au extends A.Destroyable{constructor(t){super(),this.disposeVar(new A.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled??Au.defaults.enabled)return new J5(this,t)}))}};y(Au,"czmJulianDateToTimeStamp",j5),y(Au,"getClockRange",eV),y(Au,"getClockStep",tV),y(Au,"defaults",{enabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+864e5,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1});let De=Au;(i=>{i.createDefaultProps=()=>({enabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0})})(De||(De={})),A.extendClassProps(De.prototype,De.createDefaultProps);function j5(i){return f.JulianDate.toDate(i).getTime()}function eV(i){if(i===f.ClockRange.CLAMPED)return"CLAMPED";if(i===f.ClockRange.LOOP_STOP)return"LOOP_STOP";if(i===f.ClockRange.UNBOUNDED)return"UNBOUNDED";throw new Error(`getClockRange error: ${i}`)}function tV(i){if(i===f.ClockStep.SYSTEM_CLOCK)return"SYSTEM_CLOCK";if(i===f.ClockStep.SYSTEM_CLOCK_MULTIPLIER)return"SYSTEM_CLOCK_MULTIPLIER";if(i===f.ClockStep.TICK_DEPENDENT)return"TICK_DEPENDENT";throw new Error(`clockStep未知类型: ${i}`)}function T(i){return i!=null}function q(i){this.name="DeveloperError",this.message=i;let t;try{throw new Error}catch(e){t=e.stack}this.stack=t}T(Object.create)&&(q.prototype=Object.create(Error.prototype),q.prototype.constructor=q),q.prototype.toString=function(){let i=`${this.name}: ${this.message}`;return T(this.stack)&&(i+=`
|
|
341
|
+
`;r.vertexShaderSource=o,r.fragmentShaderSource=s;const a={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}};r.renderState=a;const l=()=>{this.czmTextureId?r.uniformMap={myImage:{type:"texture",id:this.czmTextureId},myColor:this.color??[1,1,1,1]}:r.uniformMap={myImage:{type:"image",uri:A.ESSceneObject.context.getStrFromEnv(this.uri??"${earthsdk3-assets-script-dir}/assets/img/location.png")},myColor:this.color??[1,1,1,1]}};l(),this.dispose(this.uriChanged.disposableOn(l)),this.dispose(this.czmTextureIdChanged.disposableOn(l)),this.dispose(this.colorChanged.disposableOn(l)),this.dispose(A.bind([r,"show"],[this,"show"])),this.dispose(A.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(A.bind([r,"position"],[this,"position"]));{const p=()=>{r.pixelSize=this.pixelSize};p(),this.dispose(this.pixelSizeChanged.disposableOn(p))}this.dispose(A.track([r,"maximumScale"],[this,"maximumScale"])),this.dispose(A.track([r,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(A.track([r,"viewDistanceDebug"],[this,"viewDistanceDebug"]));const u=()=>{const{scale:p=[1,1]}=this;r.scale=[this.useAxis.includes("X")?p[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?p[1]:1]};u(),this.dispose(this.scaleChanged.disposableOn(u));const h=()=>{const p=-(this.originRatioAndOffset[0]*this.size[0]+this.originRatioAndOffset[2]),d=this.originRatioAndOffset[1]*this.size[1]+this.originRatioAndOffset[3];r.localPosition=[this.useAxis.includes("X")?p:0,this.useAxis.includes("Y")?this.useAxis.includes("X")?d:p:0,this.useAxis.includes("Z")?d:0],r.localScale=[this.useAxis.includes("X")?this.size[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?this.size[1]:1]};{const p=()=>{const d={XY:[0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0,0],YZ:[0,0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0],XZ:[0,0,0,0,0,-1,1,0,-1,1,0,0,0,0,0,0,0,-1,1,0,-1,1,0,0]},g={XY:{min:[0,-1,0],max:[1,0,0]},YZ:{min:[0,0,-1],max:[0,1,0]},XZ:{min:[0,0,-1],max:[1,0,0]}};r.attributes={position:{typedArray:new Float32Array(d[this.useAxis??Vf.defaults.useAxis]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,1]),componentsPerAttribute:2}},r.boundingVolume={type:"LocalAxisedBoundingBox",data:g[this.useAxis??Vf.defaults.useAxis]},h()};p(),this.d(this.useAxisChanged.don(p))}this.dispose(this.originRatioAndOffsetChanged.disposableOn(h)),this.dispose(this.sizeChanged.disposableOn(h)),this.dispose(this.flyToEvent.disposableOn(p=>{r.flyTo(p)})),this.disposeVar(new A.ObjResettingWithEvent(this.rotationModeChanged,()=>new G5(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customPrimitive(){return this._customPrimitive}};y(Vf,"defaults",{position:[0,0,0],viewDistanceRange:[1e3,1e4,3e4,6e4],useAxis:"XY"});let Hs=Vf;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",czmTextureId:"",position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),rotationWithCamera:!1,rotationMode:"WithProp",useAxis:"XY",size:A.reactArray([1,1]),scale:[1,1],maximumScale:Number.MAX_VALUE,minimumScale:Number.MIN_VALUE,pixelSize:50,color:A.reactArray([1,1,1,1]),originRatioAndOffset:A.reactArray([.5,1,0,0]),viewDistanceRange:A.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Hs||(Hs={})),A.extendClassProps(Hs.prototype,Hs.createDefaultProps);class G5 extends A.Destroyable{constructor(t,e){super(),this._czmViewer=t,this._czmImageModel=e;const{customPrimitive:n,rotationMode:r}=this._czmImageModel;if(r==="WithProp")this.dispose(A.track([n,"rotation"],[this._czmImageModel,"rotation"]));else if(r==="WithCameraOnlyZ"){const o=()=>{const{rotation:s}=this._czmImageModel,a=this._czmViewer.getCameraInfo();a&&(n.rotation=[a.rotation[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),s[1],s[2]])};o(),this.dispose(this._czmViewer.cameraChanged.disposableOn(o)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(o))}else if(r==="WithCamera"){const o=()=>{const s=this._czmViewer.getCameraInfo();if(!s)return;const a=s.rotation;n.rotation=[a[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),a[1]+(this._czmImageModel.useAxis.includes("Z")?0:90),a[2]]};o(),this.dispose(this._czmViewer.cameraChanged.disposableOn(o)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(o))}}}class aA extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");y(this,"_id",this.disposeVar(A.react(A.createGuid())));n&&(this.id=n);const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}if(!li(e.viewer))return;const s=this.disposeVar(wo([this,"material"])),a=this.disposeVar(A.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,s.changed)),l=this.disposeVar(new A.ObjResettingWithEvent(a,()=>{if(s.value)return new W5(e,r,this,s.value)}));this.dispose(this.flyToEvent.disposableOn(u=>{e.actived&&(a.flush(),l.obj&&l.obj.flyTo(u))}))}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}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,arcType:"GEODESIC",material:A.reactJson({type:"Color"}),stRotation:0,polygonHierarchy:A.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:1,perPositionHeight:!1,closeTop:!0,closeBottom:!0})})(aA||(aA={})),A.extendClassProps(aA.prototype,aA.createDefaultProps);class W5 extends A.Destroyable{constructor(e,n,r,o){super();y(this,"_boundingSphere");this._czmViewer=e,this._viewer=n,this._sceneObject=r,this._material=o;const s=this._sceneObject,a=this._material,l=this._viewer;if(!s.polygonHierarchy)return;const u=new f.BoundingSphere,h=pn(s.polygonHierarchy.positions);h.length<3?(u.radius=-1,this._boundingSphere=void 0):(f.BoundingSphere.fromPoints(h,u),this._boundingSphere=u);const p=new f.MaterialAppearance({material:a}),d=[],g=new f.GeometryInstance({geometry:new f.PolygonGeometry({vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ms(s.polygonHierarchy),stRotation:s.stRotation&&f.Math.toRadians(s.stRotation),arcType:s.arcType&&f.ArcType[s.arcType],height:s.height,extrudedHeight:s.extrudedHeight,perPositionHeight:s.perPositionHeight,closeTop:s.closeTop,closeBottom:s.closeBottom,ellipsoid:s.ellipsoid&&Ye(s.ellipsoid),granularity:s.granularity!==void 0?f.Math.toRadians(s.granularity):void 0}),id:this});d.push(g);const m=new f.GroundPrimitive({geometryInstances:d,appearance:p,asynchronous:!1,allowPicking:s.allowPicking,compressVertices:!1});f.GroundPrimitive.prototype&&(m.ESSceneObjectID=r.id),l.scene.primitives.add(m),this.dispose(()=>l.scene.primitives.remove(m));{const v=()=>{m.show=s.show};v(),this.dispose(s.showChanged.disposableOn(v))}this.disposeVar(new ht.ObjectsToExcludeWrapper(this._czmViewer,m))}flyTo(e){const n=this._boundingSphere;if(n&&n.radius>0){const r=Be(n.center);r&&ye(this._viewer,r,n.radius*4,void 0,e)}}}class K5 extends A.Destroyable{constructor(e,n){super();y(this,"_groundPolygonPrimitive");this._groundPolygonPrimitive=this.disposeVar(new aA(n,e.id));const r=this._groundPolygonPrimitive;{const o=()=>{const a=e.show,l=e.fill;r.show=a&&l&&e.visibleAlpha>0,r.polygonHierarchy=r.show?{positions:e.positions||[]}:{positions:[]},r.material={type:"Color",color:e.color||[1,1,1,.5]}};o();const s=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(s.disposableOn(o))}this.dispose(A.track([r,"allowPicking"],[e,"allowPicking"]))}get groundPolygonPrimitive(){return this._groundPolygonPrimitive}}class q5 extends A.Destroyable{constructor(e,n,r){super();y(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new ut(n,e.id));const o=this._geoPolyline;o.arcType="GEODESIC",o.loop=!0;{const s=()=>{const l=e.show,u=e.outline;if(o.show=l&&u&&e.visibleAlpha>0,o.show&&e.positions&&e.positions.length>1){const h=e.positions[0][2];o.positions=e.positions.map(p=>[p[0],p[1],h])}else o.positions=void 0;o.color=e.outlineColor,o.width=e.outlineWidth};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"])),this.dispose(A.track([o,"ground"],[e,"strokeGround"]))}get geoPolyline(){return this._geoPolyline}}class X5 extends A.Destroyable{constructor(e,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=e.ground;this._innerPolygon=this.disposeVar(new K5(e,n)),this._bottomPolyline=this.disposeVar(new q5(e,n,r)),this.dispose(e.flyToEvent.disposableOn(o=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;ye(n.viewer,s,a,void 0,o)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],l=e.positionsCenter.radius*4;ye(n.viewer,a,l,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Ga extends A.Destroyable{constructor(e,n){super();y(this,"_positions",this.disposeVar(A.reactPositions(void 0)));y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");this.d(this.polygonHierarchyChanged.don(()=>{this.polygonHierarchy?this.positions=this.polygonHierarchy.positions:this.positions=void 0})),this.d(this.positionsChanged.don(()=>{this.positions?this.polygonHierarchy.positions=[...this.positions]:this.polygonHierarchy={positions:[]}}));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(wo([this,"material"])),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=g=>{if(!this.polygonHierarchy)return;const m=new f.MaterialAppearance({material:g}),v=[],w=new f.GeometryInstance({geometry:new f.PolygonGeometry({vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Ms(this.polygonHierarchy),stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),arcType:this.arcType&&f.ArcType[this.arcType],height:this.height,extrudedHeight:this.extrudedHeight,perPositionHeight:this.perPositionHeight,closeTop:this.closeTop,closeBottom:this.closeBottom,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid),granularity:this.granularity!==void 0?f.Math.toRadians(this.granularity):void 0}),id:this});v.push(w);const C=new f.Primitive({geometryInstances:v,appearance:m,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return f.Primitive.prototype&&(C.ESSceneObjectID=n),C},l=new f.BoundingSphere,u=()=>{if(s(),!this.polygonHierarchy)return;const g=pn(this.polygonHierarchy.positions);if(g.length<3||!o.value){l.radius=-1;return}f.BoundingSphere.fromPoints(g,l),this._primitive=a(o.value),this._primitive&&r.scene.primitives.add(this._primitive)},h=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};u(),h();const p=this.disposeVar(A.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,o.changed));this.dispose(p.disposableOn(()=>{u(),h()}));const d=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(e.actived&&(p.flush(),d.flush(),l.radius>0)){const m=Be(l.center),v=this.height??0,w=this.extrudedHeight??0,C=Math.max(v,w),_=l.radius<C?C:l.radius;m&&ye(r,m,_*4,void 0,g)}}))}get positions(){return this._positions.value}get positionsChanged(){return this._positions.changed}set positions(e){this._positions.value=e}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}y(Ga,"defaults",{positions:[]}),(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,material:A.reactJson({type:"Color"}),stRotation:void 0,polygonHierarchy:A.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0})})(Ga||(Ga={})),A.extendClassProps(Ga.prototype,Ga.createDefaultProps);class GS extends A.Destroyable{constructor(e,n,r,o){super();y(this,"_czmInnerPolygonPrimitive");this._czmInnerPolygonPrimitive=this.disposeVar(new Ga(n,e.id));const s=this._czmInnerPolygonPrimitive;{const a=()=>{const u=e.show,h=e.fill;if(s.show=u&&h&&e.visibleAlpha>0,e.positions&&e.positions.length>0&&!o?s.height=e.positions[0][2]:s.height=void 0,s.polygonHierarchy=s.show?{positions:e.positions||[]}:{positions:[]},s.material={type:"Color",color:e.color||[1,1,1,.5]},r){if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");s.extrudedHeight=(s.height??0)+e.depth}};a();const l=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.visibleAlphaChanged));this.dispose(l.disposableOn(a))}this.dispose(A.track([s,"allowPicking"],[e,"allowPicking"]))}get czmInnerPolygonPrimitive(){return this._czmInnerPolygonPrimitive}}class WS extends A.Destroyable{constructor(e,n,r){super();y(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new ut(n,e.id));const o=this._geoPolyline;o.arcType="GEODESIC",o.loop=!0,this.dispose(A.bind([o,"depthTest"],[e,"depthTest"])),this.dispose(A.bind([o,"ground"],[e,"strokeGround"]));{const s=()=>{const l=e.show,u=e.outline;if(o.show=l&&u&&e.visibleAlpha>0,o.show&&e.positions&&e.positions.length>1){const h=e.positions[0][2];o.positions=e.positions.map(p=>[p[0],p[1],h])}else o.positions=void 0;o.color=e.outlineColor,o.width=e.outlineWidth};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(A.track([o,"allowPicking"],[e,"allowPicking"]))}get geoPolyline(){return this._geoPolyline}}class k5 extends A.Destroyable{constructor(t,e){super();const n=this.disposeVar(new Ur(e,t.id));n.arcType="GEODESIC",this.dispose(A.track([n,"allowPicking"],[t,"allowPicking"])),this.dispose(A.bind([n,"depthTest"],[t,"depthTest"]));{const r=()=>{if(t.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=t.show,a=t.outline;n.show=s&&a&&t.visibleAlpha>0,n.color=t.outlineColor,n.width=t.outlineWidth;let l;if(n.show&&t.positions&&t.positions.length>1){const h=t.positions[0][2];l=t.positions.map(p=>[p[0],p[1],h])}let u;if(t.positions&&t.positions.length>0?u=t.positions[0][2]:u=void 0,n.show&&l){const h=u,p=(u??0)+t.depth;n.positions=l.map(d=>[[d[0],d[1],h],[d[0],d[1],p]])}else n.positions=void 0};r();const o=this.disposeVar(A.createNextAnimateFrameEvent(t.showChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.visibleAlphaChanged));this.dispose(o.disposableOn(r))}}}class Y5 extends A.Destroyable{constructor(t,e){super();const n=this.disposeVar(new ut(e,t.id));n.arcType="GEODESIC",n.loop=!0,this.dispose(A.track([n,"allowPicking"],[t,"allowPicking"])),this.dispose(A.bind([n,"depthTest"],[t,"depthTest"]));{const r=()=>{if(t.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=t.show,a=t.outline;n.show=s&&a&&t.visibleAlpha>0,n.color=t.outlineColor,n.width=t.outlineWidth;let l;if(n.show&&t.positions&&t.positions.length>1){const h=t.positions[0][2];l=t.positions.map(p=>[p[0],p[1],h])}let u;if(t.positions&&t.positions.length>0?u=t.positions[0][2]:u=void 0,n.show&&l){const h=(u??0)+t.depth;n.positions=l.map(p=>[p[0],p[1],h])}else n.positions=void 0};r();const o=this.disposeVar(A.createNextAnimateFrameEvent(t.showChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.visibleAlphaChanged));this.dispose(o.disposableOn(r))}}}class $5 extends A.Destroyable{constructor(e,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=e.ground;this._innerPolygon=this.disposeVar(new GS(e,n,!0,r)),this._bottomPolyline=this.disposeVar(new WS(e,n,r)),this.disposeVar(new k5(e,n)),this.disposeVar(new Y5(e,n)),this.dispose(e.flyToEvent.disposableOn(o=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;ye(n.viewer,s,a,void 0,o)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],l=e.positionsCenter.radius*4;ye(n.viewer,a,l,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}let Z5=class extends A.Destroyable{constructor(e,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=e.ground;this._innerPolygon=this.disposeVar(new GS(e,n,!1,r)),this._bottomPolyline=this.disposeVar(new WS(e,n,r)),this.dispose(e.flyToEvent.disposableOn(o=>{if(e.viewDistanceRange){const s=e.positionsCenter.center,a=(e.viewDistanceRange[1]+e.viewDistanceRange[2])/2;ye(n.viewer,s,a,void 0,o)}else{const s=e.positionsCenter.center;if(!e.positions)return;const a=[s[0],s[1],e.positions[0][2]],l=e.positionsCenter.radius*4;ye(n.viewer,a,l,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}};class Wa extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_polygonOrGroundPolygonResetting");y(this,"_czmViewVisibleDistanceRangeControl");y(this,"_id",this.disposeVar(A.react(A.createGuid())));y(this,"_positionsCenter");this._positionsCenter=this.ad(new Jv(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Kl(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(A.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const r=this.disposeVar(A.createNextAnimateFrameEvent(this.groundChanged,this.depthChanged,this.strokeGroundChanged));this._polygonOrGroundPolygonResetting=this.disposeVar(new A.ObjResettingWithEvent(r,()=>this.ground?new X5(this,e):this.depth!==void 0&&this.depth>0?new $5(this,e):new Z5(this,e)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polygonOrGroundPolygonResetting(){return this._polygonOrGroundPolygonResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get positionsCenter(){return this._positionsCenter}}y(Wa,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,strokeGround:!1,outline:!0,outlineColor:A.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:A.reactArray([1,1,1,.5]),positions:A.reactPositions(void 0),depth:0,zIndex:0,viewDistanceRange:A.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(Wa||(Wa={})),A.extendClassProps(Wa.prototype,Wa.createDefaultProps);class pp extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(wo([this,"material"])),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(d,g)=>{const m=new f.MaterialAppearance({material:g}),v=[],w=new f.GeometryInstance({geometry:new f.RectangleGeometry({rectangle:d,height:this.height,rotation:this.rotation&&f.Math.toRadians(this.rotation),extrudedHeight:this.extrudedHeight,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});v.push(w);const C=new f.Primitive({geometryInstances:v,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return f.Primitive.prototype&&(C.ESSceneObjectID=n),C},l=()=>{if(s(),!this.positions)return;const d=ft(this.positions);!d||!o.value||(this._primitive=a(d,o.value),this._primitive&&r.scene.primitives.add(this._primitive))},u=()=>{const d=this.show??!0;this._primitive&&(this._primitive.show=d)};l(),u();const h=this.disposeVar(A.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.stRotationChanged,this.rotationChanged,o.changed,this.allowPickingChanged));this.dispose(h.disposableOn(()=>{l(),u()}));const p=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(d=>{if(!e.actived||!this.positions)return;const g=ft(this.positions),m=f.BoundingSphere.fromRectangle3D(g,void 0,this.height);if(m.radius>0){const v=Be(m.center);v&&ye(r,v,m.radius*4,void 0,d)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:A.reactJsonWithUndefined(void 0),positions:A.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,stRotation:void 0})})(pp||(pp={})),A.extendClassProps(pp.prototype,pp.createDefaultProps);const Tv=class Tv extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(wo([this,"material"],Tv.defaults.material)),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(d,g)=>{const m=new f.MaterialAppearance({material:g}),v=[],w=new f.GeometryInstance({geometry:new f.RectangleGeometry({rectangle:d,rotation:this.rotation&&f.Math.toRadians(this.rotation),stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});v.push(w);const C=new f.GroundPrimitive({geometryInstances:v,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return f.GroundPrimitive.prototype&&(C.ESSceneObjectID=n),C},l=()=>{if(s(),!this.positions)return;const d=ft(this.positions);!d||!o.value||(this._primitive=a(d,o.value),this._primitive&&r.scene.primitives.add(this._primitive))},u=()=>{const d=this.show??!0;this._primitive&&(this._primitive.show=d)};l(),u();const h=this.disposeVar(A.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.stRotationChanged,this.rotationChanged,o.changed,this.allowPickingChanged));this.dispose(h.disposableOn(()=>{l(),u()}));const p=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(d=>{if(!e.actived||!this.positions)return;const g=ft(this.positions),m=f.BoundingSphere.fromRectangle3D(g,void 0,0);if(m.radius>0){const v=Be(m.center);v&&ye(r,v,m.radius*4,void 0,d)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};y(Tv,"defaults",{material:{type:"Color",color:[1,1,1,.5]}});let lA=Tv;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:A.reactJsonWithUndefined(void 0),positions:A.reactArrayWithUndefined(void 0),rotation:void 0,stRotation:void 0})})(lA||(lA={})),A.extendClassProps(lA.prototype,lA.createDefaultProps);class fp extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(o);const s=new f.Color,a=d=>{const g=new f.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),m=[],v=new f.GeometryInstance({geometry:new f.RectangleOutlineGeometry({rectangle:d,height:this.height??0,extrudedHeight:this.extrudedHeight,rotation:this.rotation&&f.Math.toRadians(this.rotation)}),attributes:{color:this.color?f.ColorGeometryInstanceAttribute.fromColor(ce(this.color,s)):f.ColorGeometryInstanceAttribute.fromColor(new f.Color(1,1,1,1))},id:this});m.push(v);const w=new f.Primitive({geometryInstances:m,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return f.Primitive.prototype&&(w.ESSceneObjectID=n),w},l=()=>{if(o(),!this.positions)return;const d=ft(this.positions);d&&(this._primitive=a(d),this._primitive&&r.scene.primitives.add(this._primitive))},u=()=>{const d=this.show??!0;this._primitive&&(this._primitive.show=d)};l(),u();const h=this.disposeVar(A.createNextAnimateFrameEvent(this.positionsChanged,this.colorChanged,this.translucentChanged,this.extrudedHeightChanged,this.heightChanged,this.rotationChanged,this.allowPickingChanged));this.dispose(h.disposableOn(()=>{l(),u()}));const p=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{u()})),this.dispose(this.flyToEvent.disposableOn(d=>{if(!e.actived||!this.positions)return;const g=ft(this.positions),m=f.BoundingSphere.fromRectangle3D(g,void 0,this.height);if(m.radius>0){const v=Be(m.center);v&&ye(r,v,m.radius*4,void 0,d)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,translucent:void 0,color:A.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,positions:A.reactArrayWithUndefined(void 0)})})(fp||(fp={})),A.extendClassProps(fp.prototype,fp.createDefaultProps);const Gf=class Gf extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));if(!e.viewer)return;const o=this.ad(new pp(e,n)),s=this.ad(new lA(e,n)),a=this.ad(new fp(e,n));this.dispose(A.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(A.track([s,"allowPicking"],[this,"allowPicking"]));{const l=()=>{const h=this.show??!0,p=this.ground??!1,d=this.outline??!1;a.show=h&&!p&&d,o.show=h&&!p,a.show?a.positions=this.rectangle:a.positions=void 0,o.show?o.positions=this.rectangle:o.positions=void 0,a.rotation=o.rotation=this.rotation,o.material=this.material??Gf.defaults.material,o.stRotation=this.stRotation,a.extrudedHeight=o.extrudedHeight=this.extrudedHeight,a.height=o.height=this.height,a.color=this.outlineColor,a.translucent=this.outlineTranslucent,s.show=h&&p,s.show?s.positions=this.rectangle:s.positions=void 0,s.rotation=this.rotation,s.material=this.material??Gf.defaults.material,s.stRotation=this.stRotation};l();const u=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.heightChanged,this.extrudedHeightChanged,this.materialChanged,this.rectangleChanged,this.outlineColorChanged,this.stRotationChanged,this.rotationChanged,this.outlineTranslucentChanged,this.groundChanged));this.dispose(u.disposableOn(()=>{l()})),this.dispose(this.flyToEvent.disposableOn(h=>{this.ground?s.flyTo(h):o.flyTo(h)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};y(Gf,"defaults",{material:{type:"Color",color:[1,1,1,.5]},rectangle:void 0,extrudedHeight:void 0});let Jo=Gf;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outlineTranslucent:!0,outline:!1,outlineColor:A.reactArray([1,1,1,1]),height:0,extrudedHeight:void 0,material:A.reactJsonWithUndefined(void 0),rectangle:A.reactArrayWithUndefined(void 0),rotation:0,stRotation:0})})(Jo||(Jo={})),A.extendClassProps(Jo.prototype,Jo.createDefaultProps);const Wf=class Wf extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");this.czmViewer=e,this.id=n;const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this.clear()});const o=this.disposeVar(wo([this,"material"])),s=()=>{this.clear(),!(!this.position||!o.value)&&(this._primitive=this.createPrimitive(o.value),this._primitive&&r.scene.primitives.add(this._primitive),this.updateShow())};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.ellipsoidChanged,this.granularityChanged,this.stRotationChanged,o.changed,this.instancesChanged,this.rotationChanged));this.dispose(a.disposableOn(()=>{s()})),this.dispose(this.showChanged.disposableOn(()=>{this.updateShow()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)ye(r,this.position,this.radius*4,void 0,1e3);else{const l=r.scene.camera.positionCartographic.height;ye(r,this.position,l,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}setGranularity(){let e=this.granularity??Wf.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),e=e|0,e=Math.max(1,e),f.Math.toRadians(e)}createPrimitive(e){if(!this.position||!this.radius)return;const n=new f.MaterialAppearance({material:e}),r=[],o=this.setGranularity();if(this.instances&&this.instances.length>0)for(let a=0;a<this.instances.length;a++){const l=this.instances[a];r.push(this.createGeometry(l.position,l.rotation??this.rotation,l.radius??this.radius,l.id??this,l.position[2]??this.height,o))}else r.push(this.createGeometry(this.position,this.rotation,this.radius,this,this.height,o));const s=new f.Primitive({geometryInstances:r,appearance:n,asynchronous:r.length>1,allowPicking:this.allowPicking??Wf.defaults.allowPicking,compressVertices:!1});return f.Primitive.prototype&&(s.ESSceneObjectID=this.id),s}createGeometry(e,n,r,o,s,a){const l=ke(e),u=new f.GeometryInstance({geometry:new f.CircleGeometry({center:l,height:s,extrudedHeight:this.extrudedHeight,radius:r,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),vertexFormat:f.VertexFormat.ALL,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid),granularity:a}),id:o}),h=f.Transforms.eastNorthUpToFixedFrame(l),p=f.Matrix4.inverseTransformation(h,new f.Matrix4),d=f.Matrix4.multiplyByMatrix3(h,f.Matrix3.fromHeadingPitchRoll(f.HeadingPitchRoll.fromDegrees(n[0],n[1],n[2],new f.HeadingPitchRoll)),new f.Matrix4);return f.Matrix4.multiply(d,p,u.modelMatrix),u}updateShow(){this._primitive&&(this._primitive.show=!!this.show)}clear(){var e;this._primitive&&((e=this.czmViewer.viewer)==null||e.scene.primitives.remove(this._primitive),this._primitive=void 0)}};y(Wf,"defaults",{show:!0,allowPicking:!1,translucent:!0,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Ka=Wf;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:A.reactJson({type:"Color"}),position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,stRotation:void 0,ellipsoid:void 0,granularity:void 0,instances:A.reactArrayWithUndefined([])})})(Ka||(Ka={})),A.extendClassProps(Ka.prototype,Ka.createDefaultProps);const lu=class lu extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");this.czmViewer=e,this.id=n;const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this.clear()});const o=this.disposeVar(wo([this,"material"],lu.defaults.material)),s=()=>{if(this.clear(),!this.position||!this.radius||!o.value)return;const l=ke(this.position);this._primitive=this.createPrimitive(l,o.value),this._primitive&&r.scene.groundPrimitives.add(this._primitive),this.updateShow()};s();const a=this.disposeVar(A.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.stRotationChanged,this.granularityChanged,this.ellipsoidChanged,this.materialChanged,this.instancesChanged,o.changed));this.dispose(a.disposableOn(()=>{s()})),this.dispose(this.showChanged.disposableOn(()=>{this.updateShow()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)ye(r,this.position,this.radius*4,void 0,1e3);else{const l=r.scene.camera.positionCartographic.height;ye(r,this.position,l,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}clear(){var e;this._primitive&&((e=this.czmViewer.viewer)==null||e.scene.groundPrimitives.remove(this._primitive)),this._primitive=void 0}updateShow(){this._primitive&&(this._primitive.show=this.show??lu.defaults.show)}createPrimitive(e,n){if(!e||!this.radius)return;const r=new f.MaterialAppearance({material:n}),o=[],s=this.setGranularity();if(this.instances&&this.instances.length>0)for(let l=0;l<this.instances.length;l++){const u=this.instances[l],h=new f.GeometryInstance({geometry:new f.CircleGeometry({center:ke(u.position),radius:u.radius??this.radius,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),granularity:s,vertexFormat:f.VertexFormat.ALL,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid)}),id:u.id??this});o.push(h)}else{const l=new f.GeometryInstance({geometry:new f.CircleGeometry({center:e,radius:this.radius,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),granularity:s,vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid)}),id:this});o.push(l)}const a=new f.GroundPrimitive({geometryInstances:o,appearance:r,asynchronous:o.length>1,allowPicking:this.allowPicking??lu.defaults.allowPicking,compressVertices:!1});return f.GroundPrimitive.prototype&&(a.ESSceneObjectID=this.id),a}setGranularity(){let e=this.granularity??lu.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),e=e|0,e=Math.max(1,e),f.Math.toRadians(e)}};y(lu,"defaults",{show:!0,allowPicking:!1,material:{type:"Color",color:[1,1,1,.5]},radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let qa=lu;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:A.reactJsonWithUndefined(void 0),granularity:void 0,position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),radius:void 0,stRotation:void 0,ellipsoid:void 0,instances:A.reactArrayWithUndefined([])})})(qa||(qa={})),A.extendClassProps(qa.prototype,qa.createDefaultProps);const Kf=class Kf extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));y(this,"_primitive");const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0});const o=new f.Color,s=p=>{if(!p||!this.radius)return;const d=new f.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),g=[],m=f.ColorGeometryInstanceAttribute.fromColor(f.Color.WHITE),v=()=>{let P=this.granularity??Kf.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),P=P|0,P=Math.max(1,P),f.Math.toRadians(P)},w=new f.GeometryInstance({geometry:new f.CircleOutlineGeometry({center:p,radius:this.radius,height:this.height,extrudedHeight:this.extrudedHeight,ellipsoid:this.ellipsoid&&Ye(this.ellipsoid),granularity:v(),numberOfVerticalLines:this.numberOfVerticalLines}),attributes:{color:this.outlineColor?f.ColorGeometryInstanceAttribute.fromColor(ce(this.outlineColor,o)):m},id:this}),C=It({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),_=It({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!_||!C){console.warn("modelMatrix is undefined!");return}const x=f.Matrix4.inverseTransformation(C,new f.Matrix4);f.Matrix4.multiply(_,x,w.modelMatrix),g.push(w);const E=new f.Primitive({geometryInstances:g,appearance:d,asynchronous:g.length>1,allowPicking:this.allowPicking??Kf.defaults.allowPicking,compressVertices:!1});return f.Primitive.prototype&&(E.ESSceneObjectID=n),E},a=()=>{if(this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const p=ke(this.position);p&&(this._primitive=s(p),this._primitive&&r.scene.primitives.add(this._primitive))},l=()=>{const p=this.show??!0;this._primitive&&(this._primitive.show=p)};a(),l();const u=this.disposeVar(A.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.outlineColorChanged,this.translucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.rotationChanged));this.dispose(u.disposableOn(()=>{a(),l()}));const h=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged));this.dispose(h.disposableOn(()=>{l()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}const p=r.scene.camera.positionCartographic.height;ye(r,this.position,p,void 0,1e3)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};y(Kf,"defaults",{show:!0,translucent:!0,allowPicking:!1,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1,numberOfVerticalLines:0});let Xa=Kf;(i=>{i.createDefaultProps=()=>({show:!0,translucent:void 0,allowPicking:void 0,outlineColor:A.reactArrayWithUndefined(void 0),position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,ellipsoid:void 0,granularity:void 0,numberOfVerticalLines:void 0})})(Xa||(Xa={})),A.extendClassProps(Xa.prototype,Xa.createDefaultProps);class AA extends A.Destroyable{constructor(e,n){super();y(this,"_flyToEvent",this.disposeVar(new A.Event));if(!e.viewer)return;const o=this.ad(new Ka(e,n)),s=this.ad(new qa(e,n)),a=this.ad(new Xa(e,n));this.dispose(A.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(A.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(A.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(A.track([o,"instances"],[this,"instances"])),this.dispose(A.track([s,"instances"],[this,"instances"]));{const l=()=>{const h=this.show??!0,p=this.ground??!1,d=this.outline??!1;a.show=h&&!p&&d,o.show=h&&!p,a.show?a.position=this.position:a.position=void 0,o.show?o.position=this.position:o.position=void 0,o.rotation=a.rotation=this.rotation,a.radius=o.radius=this.radius,a.extrudedHeight=o.extrudedHeight=this.extrudedHeight,this.position&&(a.height=o.height=this.position[2]),this.granularity===0&&(console.error("granularity不能设置为0"),this.granularity=1),o.granularity=a.granularity=this.granularity,o.ellipsoid=a.ellipsoid=this.ellipsoid,o.material=this.material,o.stRotation=this.stRotation,a.outlineColor=this.outlineColor,a.translucent=this.outlineTranslucent,a.numberOfVerticalLines=this.numberOfVerticalLines,s.show=h&&p,s.show?s.position=this.position:s.position=void 0,s.radius=this.radius,this.granularity===0?(console.error("granularity不能设置为0"),s.granularity=1):s.granularity=this.granularity,s.rotation=this.rotation,s.ellipsoid=this.ellipsoid,s.material=this.material,s.stRotation=this.stRotation};l();const u=this.disposeVar(A.createNextAnimateFrameEvent(this.showChanged,this.radiusChanged,this.outlineChanged,this.extrudedHeightChanged,this.materialChanged,this.positionChanged,this.outlineColorChanged,this.stRotationChanged,this.outlineTranslucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.groundChanged,this.rotationChanged));this.dispose(u.disposableOn(l)),this.dispose(this.flyToEvent.disposableOn(h=>{this.ground?s.flyTo(h):o.flyTo(h)}))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}y(AA,"defaults",{extrudedHeight:void 0}),(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,outline:!0,outlineTranslucent:!0,extrudedHeight:void 0,outlineColor:A.reactArray([1,1,1,1]),material:A.reactJson({type:"Color",color:[1,1,1,.5]}),position:A.reactArrayWithUndefined(void 0),rotation:A.reactArray([0,0,0]),radius:0,stRotation:0,ellipsoid:A.reactArray([6378137,6378137,6356752314245179e-9]),granularity:1,numberOfVerticalLines:0,instances:A.reactArrayWithUndefined([])})})(AA||(AA={})),A.extendClassProps(AA.prototype,AA.createDefaultProps);class dp extends A.Destroyable{constructor(e,n){super();y(this,"_primitive");y(this,"_flyToEvent",this.dv(new A.Event));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}if(!li(e.viewer))return;const s=f.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),a=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.d(a);const l=()=>{const x={baseWaterColor:ce(this.waterColor),normalMap:s,frequency:this.frequency,animationSpeed:this.waveVelocity,amplitude:this.amplitude,specularIntensity:this.specularIntensity};return new f.Material({fabric:{type:"Water",uniforms:x}})},u=()=>{if(!this.points)return;const x={positions:this.points},E=new f.PolygonGeometry({polygonHierarchy:Ms(x),vertexFormat:f.MaterialAppearance.MaterialSupport.ALL.vertexFormat,height:this.height});return new f.GeometryInstance({geometry:E,id:this})},h=()=>{if(!this.points)return;const x=new f.EllipsoidSurfaceAppearance({material:l(),aboveGround:!0}),E=u();let P;return this.ground??!1?P=new f.GroundPrimitive({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}):P=new f.Primitive({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}),f.Primitive.prototype&&f.GroundPrimitive.prototype&&(P.ESSceneObjectID=n),P},p=new f.BoundingSphere,d=()=>{a(),g(p),this._primitive=h(),this._primitive&&r.scene.primitives.add(this._primitive)},g=x=>{if(!this.points)return;const E=pn(this.points);if(E.length<3){x.radius=-1;return}f.BoundingSphere.fromPoints(E,x)},m=()=>{const x=this.show??!0;this._primitive&&(this._primitive.show=x)},v=()=>{d(),m()};v();let w=A.debounce(v,500);const C=this.dv(A.createNextAnimateFrameEvent(this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.specularIntensityChanged,this.waveVelocityChanged,this.groundChanged,this.allowPickingChanged));this.d(C.don(v));const _=this.dv(A.createNextAnimateFrameEvent(this.pointsChanged,this.heightChanged));this.d(_.don(()=>{if(!this.points){a();return}this._primitive&&!this.ground?(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=u(),g(p),w&&w[0]()):v()})),this.d(this.showChanged.don(m)),this.d(this.flyToEvent.don(x=>{if(p.radius>0){const E=Be(p.center);E&&ye(r,E,p.radius*4,void 0,x)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:!0,points:A.reactPositions(void 0),height:void 0,allowPicking:!0,ground:!1,waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,baseWaterImage:A.reactJsonWithUndefined(void 0),flowSpeed:0})})(dp||(dp={})),A.extendClassProps(dp.prototype,dp.createDefaultProps);class uA extends A.Destroyable{constructor(e,n){super();y(this,"_primitive");y(this,"_flyToEvent",this.dv(new A.Event));y(this,"_updateBoundingSphereEvent",this.ad(new A.Event));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const o=new f.BoundingSphere,s=()=>{this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0};this.d(s);const a=x=>A.ESSceneObject.context.getStrFromEnv(x),l=()=>{this._primitive=new f[this.ground?"GroundPrimitive":"Primitive"]({compressVertices:!1,asynchronous:!1,allowPicking:this.allowPicking,geometryInstances:d()}),f.Primitive.prototype&&(this._primitive.ESSceneObjectID=n),r.scene.primitives.add(this._primitive)},u=()=>{var S;const x=a(this.normalMap??f.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")),E={baseWaterColor:ce(this.waterColor??[.25,.6,1,.7]),normalMap:x,frequency:this.frequency,animationSpeed:this.animationSpeed,amplitude:this.amplitude,specularIntensity:this.specularIntensity};if(this.blendColor&&(E.blendColor=ce(this.blendColor)),this.specularMap&&(E.specularMap=a(this.specularMap)),this.points&&this.points.length>=1){const{maxPos:F,minPos:D}=A.getMinMaxCorner(this.points),U=A.getDistancesFromPositions([D,[F[0],F[1],D[2]]],"GEODESIC")[0],O=A.getDistancesFromPositions([D,[D[0],F[1],F[2]]],"GEODESIC")[0];this.baseWaterImage&&(this.baseWaterImage.url&&(E.baseWaterImage=a(this.baseWaterImage.url)),this.baseWaterImage.uDis&&(E.repeatX=U/this.baseWaterImage.uDis),this.baseWaterImage.vDis&&(E.repeatY=O/this.baseWaterImage.vDis)),E.flowSpeed=this.flowSpeed/(((S=this.baseWaterImage)==null?void 0:S.uDis)??U)}if(this._primitive&&this._primitive.appearance){this._primitive.appearance.material.uniforms=Object.assign({},this._primitive.appearance.material.uniforms,E);return}const P=new f.EllipsoidSurfaceAppearance({material:dB(E),aboveGround:!0});this._primitive&&(this._primitive.appearance=P)},h=this.ad(A.createNextAnimateFrameEvent(this.baseWaterImageChanged,this.waterColorChanged,this.blendColorChanged,this.specularMapChanged,this.flowSpeedChanged,this.normalMapChanged,this.frequencyChanged,this.animationSpeedChanged,this.amplitudeChanged,this.specularIntensityChanged));this.ad(h.don(u));const p=x=>{if(!this.points)return;const E=pn(this.points);if(E.length<3){x.radius=-1;return}f.BoundingSphere.fromPoints(E,x)},d=()=>{if(!this.points||this.points.length<3)return;const{minPos:x}=A.getMinMaxCorner(this.points),[E]=Di({originPosition:x},this.points),{minPos:P,maxPos:S}=A.getMinMaxCorner(E),F=S[0]-P[0],D=S[1]-P[1],U={positions:this.points},O=new f.PolygonGeometry({polygonHierarchy:Ms(U),vertexFormat:f.VertexFormat.DEFAULT,stRotation:this.stRotation&&f.Math.toRadians(this.stRotation),perPositionHeight:!0,attributes:{st:new f.GeometryAttribute({componentDatatype:f.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(E.map(N=>[f.Math.clamp(N[0]/F,0,1),f.Math.clamp(N[1]/D,0,1)]).flat())})}});return new f.GeometryInstance({id:this,geometry:O})},g=()=>{this._primitive&&(this._primitive.show=this.show??!0)},m=this.ad(A.createNextAnimateFrameEvent(this.showChanged));this.ad(m.don(g));const v=this.ad(()=>{s(),l(),g(),u(),p(o)});v();const w=this.ad(A.createNextAnimateFrameEvent(this.allowPickingChanged,this.groundChanged));this.ad(w.don(v)),this.ad(new A.ObjResettingWithEvent(this.updateBoundingSphereEvent,x=>{const E=new A.Destroyable;return x?E.ad(r.scene.preUpdate.addEventListener(()=>{const P=r.camera;r.camera.frustum.computeCullingVolume(P.position,P.direction,P.up).computeVisibility(o)===f.Intersect.OUTSIDE&&v()})):(v(),E.ad(this.pointsChanged.don(v))),E}));const C=()=>{if(!this.points||this.points.length<3){v();return}this._primitive instanceof f.Primitive?(this._primitive._state=3,this._primitive._appearance=void 0):this._primitive._primitive=void 0,this._primitive.geometryInstances=d(),this._primitive._recomputeBoundingSpheres=!0},_=this.dv(A.createNextAnimateFrameEvent(this.pointsChanged,this.stRotationChanged));this.d(_.don(C)),this.d(this.flyToEvent.don(x=>{if(o.radius>0){const E=Be(o.center);E&&ye(r,E,o.radius*4,void 0,x)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get updateBoundingSphereEvent(){return this._updateBoundingSphereEvent}updateBoundingSphere(e){this._updateBoundingSphereEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:!0,points:A.reactPositions(void 0),allowPicking:!0,waterColor:[.1497,.165,.0031,1],blendColor:A.reactArrayWithUndefined(void 0),specularMap:void 0,normalMap:f.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),frequency:1e3,animationSpeed:.005,amplitude:10,specularIntensity:.3,baseWaterImage:A.reactJsonWithUndefined(void 0),flowSpeed:0,stRotation:void 0,ground:void 0})})(uA||(uA={})),A.extendClassProps(uA.prototype,uA.createDefaultProps);class cA extends A.Destroyable{constructor(e,n){super();y(this,"pointPrimitives");y(this,"_flyToEvent",this.dv(new A.Event));const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}if(!li(e.viewer))return;let{pointPrimitives:s}=this;const a=()=>{s&&(s.removeAll(),r.scene.primitives.remove(s),s=void 0)};this.d(a);const l=()=>{const m=new f.PointPrimitiveCollection({show:this.show??!0,debugShowBoundingVolume:this.debugShowBoundingVolume??!1,blendOption:(this.blendOption&&M.czmPropMaps.blendOptionType[this.blendOption])??f.BlendOption.OPAQUE_AND_TRANSLUCENT});return this.pointPrimitiveOptions&&(this.pointPrimitiveOptions.forEach(w=>{m.add({show:w.show??!0,color:w.color&&ce(w.color),disableDepthTestDistance:w.disableDepthTestDistance,distanceDisplayCondition:w.distanceDisplayCondition&&Rh(w.distanceDisplayCondition),outlineColor:w.outlineColor&&ce(w.outlineColor),outlineWidth:w.outlineWidth,pixelSize:w.pixelSize,position:w.position&&ke(w.position),scaleByDistance:w.scaleByDistance&&xa(w.scaleByDistance),translucencyByDistance:w.translucencyByDistance&&xa(w.translucencyByDistance)})}),f.PointPrimitiveCollection.prototype&&(m.ESSceneObjectID=n)),m},u=()=>{a(),s=l(),r.scene.primitives.add(s)};u();const h=this.dv(A.createNextAnimateFrameEvent(this.showChanged,this.debugShowBoundingVolumeChanged,this.blendOptionChanged)),p=()=>{s&&(s.show=this.show??!0,s.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,s.blendOption=(this.blendOption&&M.czmPropMaps.blendOptionType[this.blendOption])??f.BlendOption.OPAQUE_AND_TRANSLUCENT)};this.d(h.don(p));const d=this.dv(A.createNextAnimateFrameEvent(this.pointPrimitiveOptionsChanged));this.d(d.don(u));const g=new f.BoundingSphere;this.d(this.flyToEvent.don(m=>{if(!(!e.actived||!this.pointPrimitiveOptions))if(h.flush(),d.flush(),this.pointPrimitiveOptions.length===1){const v=this.pointPrimitiveOptions[0].position;if(!v)return;const w=r.scene.camera.positionCartographic.height;ye(r,v,w,void 0,m)}else{const v=this.pointPrimitiveOptions,w=[];v.forEach(_=>{_.position&&w.push(_.position)});const C=pn(w);if(f.BoundingSphere.fromPoints(C,g),g.radius>0){const _=Be(g.center);_&&ye(r,_,g.radius*4,void 0,m)}}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(i=>{i.createDefaultProps=()=>({show:void 0,debugShowBoundingVolume:void 0,blendOption:void 0,pointPrimitiveOptions:void 0,position:A.reactArrayWithUndefined(void 0),rotation:A.reactArrayWithUndefined(void 0),scale:A.reactArrayWithUndefined(void 0),localPosition:A.reactArrayWithUndefined(void 0),localRotation:A.reactArrayWithUndefined(void 0),localScale:A.reactArrayWithUndefined(void 0),localModelMatrix:A.reactArrayWithUndefined(void 0),modelMatrix:A.reactArrayWithUndefined(void 0)})})(cA||(cA={})),A.extendClassProps(cA.prototype,cA.createDefaultProps);class J5 extends A.Destroyable{constructor(t,e){super();const n=e.viewer;if(!n)throw new Error("!viewer");const r=De.czmJulianDateToTimeStamp,o=De.getClockRange,s=De.getClockStep;{const a=()=>n.clockViewModel.startTime=f.JulianDate.fromDate(new Date(t.startTime??A.getDefaultValue(De.defaults.startTime)));a(),this.dispose(Ko(n.clockViewModel,"startTime",l=>t.startTime=r(l))),this.dispose(t.startTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.stopTime=f.JulianDate.fromDate(new Date(t.stopTime??A.getDefaultValue(De.defaults.stopTime)));a(),this.dispose(Ko(n.clockViewModel,"stopTime",l=>t.stopTime=r(l))),this.dispose(t.stopTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.currentTime=f.JulianDate.fromDate(new Date(t.currentTime??A.getDefaultValue(De.defaults.currentTime)));a(),this.dispose(Ko(n.clockViewModel,"currentTime",l=>t.currentTime=r(l))),this.dispose(t.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.multiplier=t.multiplier??De.defaults.multiplier;a(),this.dispose(Ko(n.clockViewModel,"multiplier",l=>{(t.multiplier??De.defaults.multiplier!==l)&&(t.multiplier=l)})),this.dispose(t.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockStep=f.ClockStep[t.clockStep??De.defaults.clockStep];a(),this.dispose(Ko(n.clockViewModel,"clockStep",l=>{const u=s(l);(t.clockStep??De.defaults.clockStep!==u)&&(t.clockStep=u)})),this.dispose(t.clockStepChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockRange=f.ClockRange[t.clockRange??De.defaults.clockRange];a(),this.dispose(Ko(n.clockViewModel,"clockRange",l=>{const u=o(l);(t.clockRange??De.defaults.clockRange!==u)&&(t.clockRange=u)})),this.dispose(t.clockRangeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.shouldAnimate=t.shouldAnimate??De.defaults.shouldAnimate;a(),this.dispose(Ko(n.clockViewModel,"shouldAnimate",l=>{(t.shouldAnimate??De.defaults.shouldAnimate!==l)&&(t.shouldAnimate=l)})),this.dispose(t.shouldAnimateChanged.disposableOn(a))}}}const Au=class Au extends A.Destroyable{constructor(t){super(),this.disposeVar(new A.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled??Au.defaults.enabled)return new J5(this,t)}))}};y(Au,"czmJulianDateToTimeStamp",j5),y(Au,"getClockRange",eV),y(Au,"getClockStep",tV),y(Au,"defaults",{enabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+864e5,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1});let De=Au;(i=>{i.createDefaultProps=()=>({enabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0})})(De||(De={})),A.extendClassProps(De.prototype,De.createDefaultProps);function j5(i){return f.JulianDate.toDate(i).getTime()}function eV(i){if(i===f.ClockRange.CLAMPED)return"CLAMPED";if(i===f.ClockRange.LOOP_STOP)return"LOOP_STOP";if(i===f.ClockRange.UNBOUNDED)return"UNBOUNDED";throw new Error(`getClockRange error: ${i}`)}function tV(i){if(i===f.ClockStep.SYSTEM_CLOCK)return"SYSTEM_CLOCK";if(i===f.ClockStep.SYSTEM_CLOCK_MULTIPLIER)return"SYSTEM_CLOCK_MULTIPLIER";if(i===f.ClockStep.TICK_DEPENDENT)return"TICK_DEPENDENT";throw new Error(`clockStep未知类型: ${i}`)}function T(i){return i!=null}function q(i){this.name="DeveloperError",this.message=i;let t;try{throw new Error}catch(e){t=e.stack}this.stack=t}T(Object.create)&&(q.prototype=Object.create(Error.prototype),q.prototype.constructor=q),q.prototype.toString=function(){let i=`${this.name}: ${this.message}`;return T(this.stack)&&(i+=`
|
|
342
342
|
${this.stack.toString()}`),i},q.throwInstantiationError=function(){throw new q("This function defines an interface and should not be called directly.")};const B={};B.typeOf={};function iV(i){return`${i} is required, actual value was undefined`}function Gu(i,t,e){return`Expected ${e} to be typeof ${t}, actual typeof was ${i}`}B.defined=function(i,t){if(!T(t))throw new q(iV(i))},B.typeOf.func=function(i,t){if(typeof t!="function")throw new q(Gu(typeof t,"function",i))},B.typeOf.string=function(i,t){if(typeof t!="string")throw new q(Gu(typeof t,"string",i))},B.typeOf.number=function(i,t){if(typeof t!="number")throw new q(Gu(typeof t,"number",i))},B.typeOf.number.lessThan=function(i,t,e){if(B.typeOf.number(i,t),t>=e)throw new q(`Expected ${i} to be less than ${e}, actual value was ${t}`)},B.typeOf.number.lessThanOrEquals=function(i,t,e){if(B.typeOf.number(i,t),t>e)throw new q(`Expected ${i} to be less than or equal to ${e}, actual value was ${t}`)},B.typeOf.number.greaterThan=function(i,t,e){if(B.typeOf.number(i,t),t<=e)throw new q(`Expected ${i} to be greater than ${e}, actual value was ${t}`)},B.typeOf.number.greaterThanOrEquals=function(i,t,e){if(B.typeOf.number(i,t),t<e)throw new q(`Expected ${i} to be greater than or equal to ${e}, actual value was ${t}`)},B.typeOf.object=function(i,t){if(typeof t!="object")throw new q(Gu(typeof t,"object",i))},B.typeOf.bool=function(i,t){if(typeof t!="boolean")throw new q(Gu(typeof t,"boolean",i))},B.typeOf.bigint=function(i,t){if(typeof t!="bigint")throw new q(Gu(typeof t,"bigint",i))},B.typeOf.number.equals=function(i,t,e,n){if(B.typeOf.number(i,e),B.typeOf.number(t,n),e!==n)throw new q(`${i} must be equal to ${t}, the actual values are ${e} and ${n}`)};var hA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pA(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function KS(i){if(i.__esModule)return i;var t=i.default;if(typeof t=="function"){var e=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}),e}var Vs=function(i){i==null&&(i=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,i.constructor==Array?this.init_by_array(i,i.length):this.init_seed(i)};Vs.prototype.init_seed=function(i){for(this.mt[0]=i>>>0,this.mti=1;this.mti<this.N;this.mti++){var i=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((i&4294901760)>>>16)*1812433253<<16)+(i&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},Vs.prototype.init_by_array=function(i,t){var e,n,r;for(this.init_seed(19650218),e=1,n=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+i[n]+n,this.mt[e]>>>=0,e++,n++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1),n>=t&&(n=0)}for(r=this.N-1;r;r--){var o=this.mt[e-1]^this.mt[e-1]>>>30;this.mt[e]=(this.mt[e]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-e,this.mt[e]>>>=0,e++,e>=this.N&&(this.mt[0]=this.mt[this.N-1],e=1)}this.mt[0]=2147483648},Vs.prototype.random_int=function(){var i,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var e;for(this.mti==this.N+1&&this.init_seed(5489),e=0;e<this.N-this.M;e++)i=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+this.M]^i>>>1^t[i&1];for(;e<this.N-1;e++)i=this.mt[e]&this.UPPER_MASK|this.mt[e+1]&this.LOWER_MASK,this.mt[e]=this.mt[e+(this.M-this.N)]^i>>>1^t[i&1];i=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^i>>>1^t[i&1],this.mti=0}return i=this.mt[this.mti++],i^=i>>>11,i^=i<<7&2636928640,i^=i<<15&4022730752,i^=i>>>18,i>>>0},Vs.prototype.random_int31=function(){return this.random_int()>>>1},Vs.prototype.random_incl=function(){return this.random_int()*23283064370807974e-26},Vs.prototype.random=function(){return this.random_int()*23283064365386963e-26},Vs.prototype.random_excl=function(){return(this.random_int()+.5)*23283064365386963e-26},Vs.prototype.random_long=function(){var i=this.random_int()>>>5,t=this.random_int()>>>6;return(i*67108864+t)*11102230246251565e-32};var nV=Vs;const qS=pA(nV),z={};z.EPSILON1=.1,z.EPSILON2=.01,z.EPSILON3=.001,z.EPSILON4=1e-4,z.EPSILON5=1e-5,z.EPSILON6=1e-6,z.EPSILON7=1e-7,z.EPSILON8=1e-8,z.EPSILON9=1e-9,z.EPSILON10=1e-10,z.EPSILON11=1e-11,z.EPSILON12=1e-12,z.EPSILON13=1e-13,z.EPSILON14=1e-14,z.EPSILON15=1e-15,z.EPSILON16=1e-16,z.EPSILON17=1e-17,z.EPSILON18=1e-18,z.EPSILON19=1e-19,z.EPSILON20=1e-20,z.EPSILON21=1e-21,z.GRAVITATIONALPARAMETER=3986004418e5,z.SOLAR_RADIUS=6955e5,z.LUNAR_RADIUS=1737400,z.SIXTY_FOUR_KILOBYTES=65536,z.FOUR_GIGABYTES=4294967296,z.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1},z.signNotZero=function(i){return i<0?-1:1},z.toSNorm=function(i,t){return t=t??255,Math.round((z.clamp(i,-1,1)*.5+.5)*t)},z.fromSNorm=function(i,t){return t=t??255,z.clamp(i,0,t)/t*2-1},z.normalize=function(i,t,e){return e=Math.max(e-t,0),e===0?0:z.clamp((i-t)/e,0,1)},z.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2},z.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2},z.lerp=function(i,t,e){return(1-e)*i+e*t},z.PI=Math.PI,z.ONE_OVER_PI=1/Math.PI,z.PI_OVER_TWO=Math.PI/2,z.PI_OVER_THREE=Math.PI/3,z.PI_OVER_FOUR=Math.PI/4,z.PI_OVER_SIX=Math.PI/6,z.THREE_PI_OVER_TWO=3*Math.PI/2,z.TWO_PI=2*Math.PI,z.ONE_OVER_TWO_PI=1/(2*Math.PI),z.RADIANS_PER_DEGREE=Math.PI/180,z.DEGREES_PER_RADIAN=180/Math.PI,z.RADIANS_PER_ARCSECOND=z.RADIANS_PER_DEGREE/3600,z.toRadians=function(i){if(!T(i))throw new q("degrees is required.");return i*z.RADIANS_PER_DEGREE},z.toDegrees=function(i){if(!T(i))throw new q("radians is required.");return i*z.DEGREES_PER_RADIAN},z.convertLongitudeRange=function(i){if(!T(i))throw new q("angle is required.");const t=z.TWO_PI,e=i-Math.floor(i/t)*t;return e<-Math.PI?e+t:e>=Math.PI?e-t:e},z.clampToLatitudeRange=function(i){if(!T(i))throw new q("angle is required.");return z.clamp(i,-1*z.PI_OVER_TWO,z.PI_OVER_TWO)},z.negativePiToPi=function(i){if(!T(i))throw new q("angle is required.");return i>=-z.PI&&i<=z.PI?i:z.zeroToTwoPi(i+z.PI)-z.PI},z.zeroToTwoPi=function(i){if(!T(i))throw new q("angle is required.");if(i>=0&&i<=z.TWO_PI)return i;const t=z.mod(i,z.TWO_PI);return Math.abs(t)<z.EPSILON14&&Math.abs(i)>z.EPSILON14?z.TWO_PI:t},z.mod=function(i,t){if(!T(i))throw new q("m is required.");if(!T(t))throw new q("n is required.");if(t===0)throw new q("divisor cannot be 0.");return z.sign(i)===z.sign(t)&&Math.abs(i)<Math.abs(t)?i:(i%t+t)%t},z.equalsEpsilon=function(i,t,e,n){if(!T(i))throw new q("left is required.");if(!T(t))throw new q("right is required.");e=e??0,n=n??e;const r=Math.abs(i-t);return r<=n||r<=e*Math.max(Math.abs(i),Math.abs(t))},z.lessThan=function(i,t,e){if(!T(i))throw new q("first is required.");if(!T(t))throw new q("second is required.");if(!T(e))throw new q("absoluteEpsilon is required.");return i-t<-e},z.lessThanOrEquals=function(i,t,e){if(!T(i))throw new q("first is required.");if(!T(t))throw new q("second is required.");if(!T(e))throw new q("absoluteEpsilon is required.");return i-t<e},z.greaterThan=function(i,t,e){if(!T(i))throw new q("first is required.");if(!T(t))throw new q("second is required.");if(!T(e))throw new q("absoluteEpsilon is required.");return i-t>e},z.greaterThanOrEquals=function(i,t,e){if(!T(i))throw new q("first is required.");if(!T(t))throw new q("second is required.");if(!T(e))throw new q("absoluteEpsilon is required.");return i-t>-e};const i0=[1];z.factorial=function(i){if(typeof i!="number"||i<0)throw new q("A number greater than or equal to 0 is required.");const t=i0.length;if(i>=t){let e=i0[t-1];for(let n=t;n<=i;n++){const r=e*n;i0.push(r),e=r}}return i0[i]},z.incrementWrap=function(i,t,e){if(e=e??0,!T(i))throw new q("n is required.");if(t<=e)throw new q("maximumValue must be greater than minimumValue.");return++i,i>t&&(i=e),i},z.isPowerOfTwo=function(i){if(typeof i!="number"||i<0||i>4294967295)throw new q("A number between 0 and (2^32)-1 is required.");return i!==0&&(i&i-1)===0},z.nextPowerOfTwo=function(i){if(typeof i!="number"||i<0||i>2147483648)throw new q("A number between 0 and 2^31 is required.");return--i,i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i|=i>>16,++i,i},z.previousPowerOfTwo=function(i){if(typeof i!="number"||i<0||i>4294967295)throw new q("A number between 0 and (2^32)-1 is required.");return i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i|=i>>16,i|=i>>32,i=(i>>>0)-(i>>>1),i},z.clamp=function(i,t,e){return B.typeOf.number("value",i),B.typeOf.number("min",t),B.typeOf.number("max",e),i<t?t:i>e?e:i};let XS=new qS;z.setRandomNumberSeed=function(i){if(!T(i))throw new q("seed is required.");XS=new qS(i)},z.nextRandomNumber=function(){return XS.random()},z.randomBetween=function(i,t){return z.nextRandomNumber()*(t-i)+i},z.acosClamped=function(i){if(!T(i))throw new q("value is required.");return Math.acos(z.clamp(i,-1,1))},z.asinClamped=function(i){if(!T(i))throw new q("value is required.");return Math.asin(z.clamp(i,-1,1))},z.chordLength=function(i,t){if(!T(i))throw new q("angle is required.");if(!T(t))throw new q("radius is required.");return 2*t*Math.sin(i*.5)},z.logBase=function(i,t){if(!T(i))throw new q("number is required.");if(!T(t))throw new q("base is required.");return Math.log(i)/Math.log(t)},z.cbrt=Math.cbrt??function(t){const e=Math.pow(Math.abs(t),.3333333333333333);return t<0?-e:e},z.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E},z.fog=function(i,t){const e=i*t;return 1-Math.exp(-(e*e))},z.fastApproximateAtan=function(i){return B.typeOf.number("x",i),i*(-.1784*Math.abs(i)-.0663*i*i+1.0301)},z.fastApproximateAtan2=function(i,t){B.typeOf.number("x",i),B.typeOf.number("y",t);let e,n=Math.abs(i);e=Math.abs(t);const r=Math.max(n,e);e=Math.min(n,e);const o=e/r;if(isNaN(o))throw new q("either x or y must be nonzero");return n=z.fastApproximateAtan(o),n=Math.abs(t)>Math.abs(i)?z.PI_OVER_TWO-n:n,n=i<0?z.PI-n:n,n=t<0?-n:n,n};let H=class _e{constructor(t,e,n){this.x=t??0,this.y=e??0,this.z=n??0}static fromSpherical(t,e){B.typeOf.object("spherical",t),T(e)||(e=new _e);const n=t.clock,r=t.cone,o=t.magnitude??1,s=o*Math.sin(r);return e.x=s*Math.cos(n),e.y=s*Math.sin(n),e.z=o*Math.cos(r),e}static fromElements(t,e,n,r){return T(r)?(r.x=t,r.y=e,r.z=n,r):new _e(t,e,n)}static clone(t,e){if(T(t))return T(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new _e(t.x,t.y,t.z)}static pack(t,e,n){return B.typeOf.object("value",t),B.defined("array",e),n=n??0,e[n++]=t.x,e[n++]=t.y,e[n]=t.z,e}static unpack(t,e,n){return B.defined("array",t),e=e??0,T(n)||(n=new _e),n.x=t[e++],n.y=t[e++],n.z=t[e],n}static packArray(t,e){B.defined("array",t);const n=t.length,r=n*3;if(!T(e))e=new Array(r);else{if(!Array.isArray(e)&&e.length!==r)throw new q("If result is a typed array, it must have exactly array.length * 3 elements");e.length!==r&&(e.length=r)}for(let o=0;o<n;++o)_e.pack(t[o],e,o*3);return e}static unpackArray(t,e){if(B.defined("array",t),B.typeOf.number.greaterThanOrEquals("array.length",t.length,3),t.length%3!==0)throw new q("array length must be a multiple of 3.");const n=t.length;T(e)?e.length=n/3:e=new Array(n/3);for(let r=0;r<n;r+=3){const o=r/3;e[o]=_e.unpack(t,r,e[o])}return e}static maximumComponent(t){return B.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z)}static minimumComponent(t){return B.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z)}static minimumByComponent(t,e,n){return B.typeOf.object("first",t),B.typeOf.object("second",e),B.typeOf.object("result",n),n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n}static maximumByComponent(t,e,n){return B.typeOf.object("first",t),B.typeOf.object("second",e),B.typeOf.object("result",n),n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n}static clamp(t,e,n,r){B.typeOf.object("value",t),B.typeOf.object("min",e),B.typeOf.object("max",n),B.typeOf.object("result",r);const o=z.clamp(t.x,e.x,n.x),s=z.clamp(t.y,e.y,n.y),a=z.clamp(t.z,e.z,n.z);return r.x=o,r.y=s,r.z=a,r}static magnitudeSquared(t){return B.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(_e.magnitudeSquared(t))}static distance(t,e){return B.typeOf.object("left",t),B.typeOf.object("right",e),_e.subtract(t,e,n0),_e.magnitude(n0)}static distanceSquared(t,e){return B.typeOf.object("left",t),B.typeOf.object("right",e),_e.subtract(t,e,n0),_e.magnitudeSquared(n0)}static normalize(t,e){B.typeOf.object("cartesian",t),B.typeOf.object("result",e);const n=_e.magnitude(t);if(e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new q("normalized result is not a number");return e}static dot(t,e){return B.typeOf.object("left",t),B.typeOf.object("right",e),t.x*e.x+t.y*e.y+t.z*e.z}static multiplyComponents(t,e,n){return B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n),n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n}static divideComponents(t,e,n){return B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n),n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n}static add(t,e,n){return B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n),n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n}static subtract(t,e,n){return B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n),n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n}static multiplyByScalar(t,e,n){return B.typeOf.object("cartesian",t),B.typeOf.number("scalar",e),B.typeOf.object("result",n),n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n}static divideByScalar(t,e,n){return B.typeOf.object("cartesian",t),B.typeOf.number("scalar",e),B.typeOf.object("result",n),n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n}static negate(t,e){return B.typeOf.object("cartesian",t),B.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e.z=-t.z,e}static abs(t,e){return B.typeOf.object("cartesian",t),B.typeOf.object("result",e),e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e}static lerp(t,e,n,r){return B.typeOf.object("start",t),B.typeOf.object("end",e),B.typeOf.number("t",n),B.typeOf.object("result",r),_e.multiplyByScalar(e,n,kS),r=_e.multiplyByScalar(t,1-n,r),_e.add(kS,r,r)}static angleBetween(t,e){B.typeOf.object("left",t),B.typeOf.object("right",e),_e.normalize(t,r0),_e.normalize(e,dC);const n=_e.dot(r0,dC),r=_e.magnitude(_e.cross(r0,dC,r0));return Math.atan2(r,n)}static mostOrthogonalAxis(t,e){B.typeOf.object("cartesian",t),B.typeOf.object("result",e);const n=_e.normalize(t,rV);return _e.abs(n,n),n.x<=n.y?n.x<=n.z?e=_e.clone(_e.UNIT_X,e):e=_e.clone(_e.UNIT_Z,e):n.y<=n.z?e=_e.clone(_e.UNIT_Y,e):e=_e.clone(_e.UNIT_Z,e),e}static projectVector(t,e,n){B.defined("a",t),B.defined("b",e),B.defined("result",n);const r=_e.dot(t,e)/_e.dot(e,e);return _e.multiplyByScalar(e,r,n)}static equals(t,e){return t===e||T(t)&&T(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z}static equalsArray(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]}static equalsEpsilon(t,e,n,r){return t===e||T(t)&&T(e)&&z.equalsEpsilon(t.x,e.x,n,r)&&z.equalsEpsilon(t.y,e.y,n,r)&&z.equalsEpsilon(t.z,e.z,n,r)}static cross(t,e,n){B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n);const r=t.x,o=t.y,s=t.z,a=e.x,l=e.y,u=e.z,h=o*u-s*l,p=s*a-r*u,d=r*l-o*a;return n.x=h,n.y=p,n.z=d,n}static midpoint(t,e,n){return B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n),n.x=(t.x+e.x)*.5,n.y=(t.y+e.y)*.5,n.z=(t.z+e.z)*.5,n}static fromDegrees(t,e,n,r,o){return B.typeOf.number("longitude",t),B.typeOf.number("latitude",e),t=z.toRadians(t),e=z.toRadians(e),_e.fromRadians(t,e,n,r,o)}static fromRadians(t,e,n,r,o){B.typeOf.number("longitude",t),B.typeOf.number("latitude",e),n=n??0;const s=T(r)?r.radiiSquared:_e._ellipsoidRadiiSquared,a=Math.cos(e);Hr.x=a*Math.cos(t),Hr.y=a*Math.sin(t),Hr.z=Math.sin(e),Hr=_e.normalize(Hr,Hr),_e.multiplyComponents(s,Hr,Wu);const l=Math.sqrt(_e.dot(Hr,Wu));return Wu=_e.divideByScalar(Wu,l,Wu),Hr=_e.multiplyByScalar(Hr,n,Hr),T(o)||(o=new _e),_e.add(Wu,Hr,o)}static fromDegreesArray(t,e,n){if(B.defined("coordinates",t),t.length<2||t.length%2!==0)throw new q("the number of coordinates must be a multiple of 2 and at least 2");const r=t.length;T(n)?n.length=r/2:n=new Array(r/2);for(let o=0;o<r;o+=2){const s=t[o],a=t[o+1],l=o/2;n[l]=_e.fromDegrees(s,a,0,e,n[l])}return n}static fromRadiansArray(t,e,n){if(B.defined("coordinates",t),t.length<2||t.length%2!==0)throw new q("the number of coordinates must be a multiple of 2 and at least 2");const r=t.length;T(n)?n.length=r/2:n=new Array(r/2);for(let o=0;o<r;o+=2){const s=t[o],a=t[o+1],l=o/2;n[l]=_e.fromRadians(s,a,0,e,n[l])}return n}static fromDegreesArrayHeights(t,e,n){if(B.defined("coordinates",t),t.length<3||t.length%3!==0)throw new q("the number of coordinates must be a multiple of 3 and at least 3");const r=t.length;T(n)?n.length=r/3:n=new Array(r/3);for(let o=0;o<r;o+=3){const s=t[o],a=t[o+1],l=t[o+2],u=o/3;n[u]=_e.fromDegrees(s,a,l,e,n[u])}return n}static fromRadiansArrayHeights(t,e,n){if(B.defined("coordinates",t),t.length<3||t.length%3!==0)throw new q("the number of coordinates must be a multiple of 3 and at least 3");const r=t.length;T(n)?n.length=r/3:n=new Array(r/3);for(let o=0;o<r;o+=3){const s=t[o],a=t[o+1],l=t[o+2],u=o/3;n[u]=_e.fromRadians(s,a,l,e,n[u])}return n}clone(t){return _e.clone(this,t)}equals(t){return _e.equals(this,t)}equalsEpsilon(t,e,n){return _e.equalsEpsilon(this,t,e,n)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};H.fromCartesian4=H.clone,H.packedLength=3,H.fromArray=H.unpack;const n0=new H,kS=new H,r0=new H,dC=new H,rV=new H;let Hr=new H,Wu=new H;H._ellipsoidRadiiSquared=new H(40680631590769,40680631590769,40408299984661445e-3),H.ZERO=Object.freeze(new H(0,0,0)),H.ONE=Object.freeze(new H(1,1,1)),H.UNIT_X=Object.freeze(new H(1,0,0)),H.UNIT_Y=Object.freeze(new H(0,1,0)),H.UNIT_Z=Object.freeze(new H(0,0,1));class he{constructor(t,e,n,r){this.x=t??0,this.y=e??0,this.z=n??0,this.w=r??0}static fromElements(t,e,n,r,o){return T(o)?(o.x=t,o.y=e,o.z=n,o.w=r,o):new he(t,e,n,r)}static fromColor(t,e){return B.typeOf.object("color",t),T(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new he(t.red,t.green,t.blue,t.alpha)}static clone(t,e){if(T(t))return T(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new he(t.x,t.y,t.z,t.w)}static pack(t,e,n){return B.typeOf.object("value",t),B.defined("array",e),n=n??0,e[n++]=t.x,e[n++]=t.y,e[n++]=t.z,e[n]=t.w,e}static unpack(t,e,n){return B.defined("array",t),e=e??0,T(n)||(n=new he),n.x=t[e++],n.y=t[e++],n.z=t[e++],n.w=t[e],n}static packArray(t,e){B.defined("array",t);const n=t.length,r=n*4;if(!T(e))e=new Array(r);else{if(!Array.isArray(e)&&e.length!==r)throw new q("If result is a typed array, it must have exactly array.length * 4 elements");e.length!==r&&(e.length=r)}for(let o=0;o<n;++o)he.pack(t[o],e,o*4);return e}static unpackArray(t,e){if(B.defined("array",t),B.typeOf.number.greaterThanOrEquals("array.length",t.length,4),t.length%4!==0)throw new q("array length must be a multiple of 4.");const n=t.length;T(e)?e.length=n/4:e=new Array(n/4);for(let r=0;r<n;r+=4){const o=r/4;e[o]=he.unpack(t,r,e[o])}return e}static maximumComponent(t){return B.typeOf.object("cartesian",t),Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return B.typeOf.object("cartesian",t),Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,e,n){return B.typeOf.object("first",t),B.typeOf.object("second",e),B.typeOf.object("result",n),n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n}static maximumByComponent(t,e,n){return B.typeOf.object("first",t),B.typeOf.object("second",e),B.typeOf.object("result",n),n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n}static clamp(t,e,n,r){B.typeOf.object("value",t),B.typeOf.object("min",e),B.typeOf.object("max",n),B.typeOf.object("result",r);const o=z.clamp(t.x,e.x,n.x),s=z.clamp(t.y,e.y,n.y),a=z.clamp(t.z,e.z,n.z),l=z.clamp(t.w,e.w,n.w);return r.x=o,r.y=s,r.z=a,r.w=l,r}static magnitudeSquared(t){return B.typeOf.object("cartesian",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(he.magnitudeSquared(t))}static distance(t,e){return B.typeOf.object("left",t),B.typeOf.object("right",e),he.subtract(t,e,o0),he.magnitude(o0)}static distanceSquared(t,e){return B.typeOf.object("left",t),B.typeOf.object("right",e),he.subtract(t,e,o0),he.magnitudeSquared(o0)}static normalize(t,e){B.typeOf.object("cartesian",t),B.typeOf.object("result",e);const n=he.magnitude(t);if(e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,isNaN(e.x)||isNaN(e.y)||isNaN(e.z)||isNaN(e.w))throw new q("normalized result is not a number");return e}static dot(t,e){return B.typeOf.object("left",t),B.typeOf.object("right",e),t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w}static multiplyComponents(t,e,n){return B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n),n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n}static divideComponents(t,e,n){return B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n),n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n}static add(t,e,n){return B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n),n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n}static subtract(t,e,n){return B.typeOf.object("left",t),B.typeOf.object("right",e),B.typeOf.object("result",n),n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n}static multiplyByScalar(t,e,n){return B.typeOf.object("cartesian",t),B.typeOf.number("scalar",e),B.typeOf.object("result",n),n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n}static divideByScalar(t,e,n){return B.typeOf.object("cartesian",t),B.typeOf.number("scalar",e),B.typeOf.object("result",n),n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n}static negate(t,e){return B.typeOf.object("cartesian",t),B.typeOf.object("result",e),e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e}static abs(t,e){return B.typeOf.object("cartesian",t),B.typeOf.object("result",e),e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e}static lerp(t,e,n,r){return B.typeOf.object("start",t),B.typeOf.object("end",e),B.typeOf.number("t",n),B.typeOf.object("result",r),he.multiplyByScalar(e,n,YS),r=he.multiplyByScalar(t,1-n,r),he.add(YS,r,r)}static mostOrthogonalAxis(t,e){B.typeOf.object("cartesian",t),B.typeOf.object("result",e);const n=he.normalize(t,oV);return he.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?e=he.clone(he.UNIT_X,e):e=he.clone(he.UNIT_W,e):n.z<=n.w?e=he.clone(he.UNIT_Z,e):e=he.clone(he.UNIT_W,e):n.y<=n.z?n.y<=n.w?e=he.clone(he.UNIT_Y,e):e=he.clone(he.UNIT_W,e):n.z<=n.w?e=he.clone(he.UNIT_Z,e):e=he.clone(he.UNIT_W,e),e}static equals(t,e){return t===e||T(t)&&T(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w}static equalsArray(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]}static equalsEpsilon(t,e,n,r){return t===e||T(t)&&T(e)&&z.equalsEpsilon(t.x,e.x,n,r)&&z.equalsEpsilon(t.y,e.y,n,r)&&z.equalsEpsilon(t.z,e.z,n,r)&&z.equalsEpsilon(t.w,e.w,n,r)}clone(t){return he.clone(this,t)}equals(t){return he.equals(this,t)}equalsEpsilon(t,e,n){return he.equalsEpsilon(this,t,e,n)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,e){return B.typeOf.number("value",t),T(e)||(e=new he),gC[0]=t,$S?(e.x=mn[0],e.y=mn[1],e.z=mn[2],e.w=mn[3]):(e.x=mn[3],e.y=mn[2],e.z=mn[1],e.w=mn[0]),e}static unpackFloat(t){return B.typeOf.object("packedFloat",t),$S?(mn[0]=t.x,mn[1]=t.y,mn[2]=t.z,mn[3]=t.w):(mn[0]=t.w,mn[1]=t.z,mn[2]=t.y,mn[3]=t.x),gC[0]}}he.packedLength=4,he.fromArray=he.unpack;const o0=new he,YS=new he,oV=new he;he.ZERO=Object.freeze(new he(0,0,0,0)),he.ONE=Object.freeze(new he(1,1,1,1)),he.UNIT_X=Object.freeze(new he(1,0,0,0)),he.UNIT_Y=Object.freeze(new he(0,1,0,0)),he.UNIT_Z=Object.freeze(new he(0,0,1,0)),he.UNIT_W=Object.freeze(new he(0,0,0,1));const gC=new Float32Array(1),mn=new Uint8Array(gC.buffer),sV=new Uint32Array([287454020]),$S=new Uint8Array(sV.buffer)[0]===68,Gs={};Gs.EMPTY_OBJECT=Object.freeze({}),Gs.EMPTY_ARRAY=Object.freeze([]);function k(i,t,e,n,r,o,s,a,l){this[0]=i??0,this[1]=n??0,this[2]=s??0,this[3]=t??0,this[4]=r??0,this[5]=a??0,this[6]=e??0,this[7]=o??0,this[8]=l??0}k.packedLength=9,k.pack=function(i,t,e){return B.typeOf.object("value",i),B.defined("array",t),e=e??0,t[e++]=i[0],t[e++]=i[1],t[e++]=i[2],t[e++]=i[3],t[e++]=i[4],t[e++]=i[5],t[e++]=i[6],t[e++]=i[7],t[e++]=i[8],t},k.unpack=function(i,t,e){return B.defined("array",i),t=t??0,T(e)||(e=new k),e[0]=i[t++],e[1]=i[t++],e[2]=i[t++],e[3]=i[t++],e[4]=i[t++],e[5]=i[t++],e[6]=i[t++],e[7]=i[t++],e[8]=i[t++],e},k.packArray=function(i,t){B.defined("array",i);const e=i.length,n=e*9;if(!T(t))t=new Array(n);else{if(!Array.isArray(t)&&t.length!==n)throw new q("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==n&&(t.length=n)}for(let r=0;r<e;++r)k.pack(i[r],t,r*9);return t},k.unpackArray=function(i,t){if(B.defined("array",i),B.typeOf.number.greaterThanOrEquals("array.length",i.length,9),i.length%9!==0)throw new q("array length must be a multiple of 9.");const e=i.length;T(t)?t.length=e/9:t=new Array(e/9);for(let n=0;n<e;n+=9){const r=n/9;t[r]=k.unpack(i,n,t[r])}return t},k.clone=function(i,t){if(T(i))return T(t)?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t):new k(i[0],i[3],i[6],i[1],i[4],i[7],i[2],i[5],i[8])},k.fromArray=k.unpack,k.fromColumnMajorArray=function(i,t){return B.defined("values",i),k.clone(i,t)},k.fromRowMajorArray=function(i,t){return B.defined("values",i),T(t)?(t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],t):new k(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},k.fromQuaternion=function(i,t){B.typeOf.object("quaternion",i);const e=i.x*i.x,n=i.x*i.y,r=i.x*i.z,o=i.x*i.w,s=i.y*i.y,a=i.y*i.z,l=i.y*i.w,u=i.z*i.z,h=i.z*i.w,p=i.w*i.w,d=e-s-u+p,g=2*(n-h),m=2*(r+l),v=2*(n+h),w=-e+s-u+p,C=2*(a-o),_=2*(r-l),x=2*(a+o),E=-e-s+u+p;return T(t)?(t[0]=d,t[1]=v,t[2]=_,t[3]=g,t[4]=w,t[5]=x,t[6]=m,t[7]=C,t[8]=E,t):new k(d,g,m,v,w,C,_,x,E)},k.fromHeadingPitchRoll=function(i,t){B.typeOf.object("headingPitchRoll",i);const e=Math.cos(-i.pitch),n=Math.cos(-i.heading),r=Math.cos(i.roll),o=Math.sin(-i.pitch),s=Math.sin(-i.heading),a=Math.sin(i.roll),l=e*n,u=-r*s+a*o*n,h=a*s+r*o*n,p=e*s,d=r*n+a*o*s,g=-a*n+r*o*s,m=-o,v=a*e,w=r*e;return T(t)?(t[0]=l,t[1]=p,t[2]=m,t[3]=u,t[4]=d,t[5]=v,t[6]=h,t[7]=g,t[8]=w,t):new k(l,u,h,p,d,g,m,v,w)},k.fromScale=function(i,t){return B.typeOf.object("scale",i),T(t)?(t[0]=i.x,t[1]=0,t[2]=0,t[3]=0,t[4]=i.y,t[5]=0,t[6]=0,t[7]=0,t[8]=i.z,t):new k(i.x,0,0,0,i.y,0,0,0,i.z)},k.fromUniformScale=function(i,t){return B.typeOf.number("scale",i),T(t)?(t[0]=i,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=i,t):new k(i,0,0,0,i,0,0,0,i)},k.fromCrossProduct=function(i,t){return B.typeOf.object("vector",i),T(t)?(t[0]=0,t[1]=i.z,t[2]=-i.y,t[3]=-i.z,t[4]=0,t[5]=i.x,t[6]=i.y,t[7]=-i.x,t[8]=0,t):new k(0,-i.z,i.y,i.z,0,-i.x,-i.y,i.x,0)},k.fromRotationX=function(i,t){B.typeOf.number("angle",i);const e=Math.cos(i),n=Math.sin(i);return T(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=n,t[6]=0,t[7]=-n,t[8]=e,t):new k(1,0,0,0,e,-n,0,n,e)},k.fromRotationY=function(i,t){B.typeOf.number("angle",i);const e=Math.cos(i),n=Math.sin(i);return T(t)?(t[0]=e,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=e,t):new k(e,0,n,0,1,0,-n,0,e)},k.fromRotationZ=function(i,t){B.typeOf.number("angle",i);const e=Math.cos(i),n=Math.sin(i);return T(t)?(t[0]=e,t[1]=n,t[2]=0,t[3]=-n,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new k(e,-n,0,n,e,0,0,0,1)},k.toArray=function(i,t){return B.typeOf.object("matrix",i),T(t)?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t):[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8]]},k.getElementIndex=function(i,t){return B.typeOf.number.greaterThanOrEquals("row",t,0),B.typeOf.number.lessThanOrEquals("row",t,2),B.typeOf.number.greaterThanOrEquals("column",i,0),B.typeOf.number.lessThanOrEquals("column",i,2),i*3+t},k.getColumn=function(i,t,e){B.typeOf.object("matrix",i),B.typeOf.number.greaterThanOrEquals("index",t,0),B.typeOf.number.lessThanOrEquals("index",t,2),B.typeOf.object("result",e);const n=t*3,r=i[n],o=i[n+1],s=i[n+2];return e.x=r,e.y=o,e.z=s,e},k.setColumn=function(i,t,e,n){B.typeOf.object("matrix",i),B.typeOf.number.greaterThanOrEquals("index",t,0),B.typeOf.number.lessThanOrEquals("index",t,2),B.typeOf.object("cartesian",e),B.typeOf.object("result",n),n=k.clone(i,n);const r=t*3;return n[r]=e.x,n[r+1]=e.y,n[r+2]=e.z,n},k.getRow=function(i,t,e){B.typeOf.object("matrix",i),B.typeOf.number.greaterThanOrEquals("index",t,0),B.typeOf.number.lessThanOrEquals("index",t,2),B.typeOf.object("result",e);const n=i[t],r=i[t+3],o=i[t+6];return e.x=n,e.y=r,e.z=o,e},k.setRow=function(i,t,e,n){return B.typeOf.object("matrix",i),B.typeOf.number.greaterThanOrEquals("index",t,0),B.typeOf.number.lessThanOrEquals("index",t,2),B.typeOf.object("cartesian",e),B.typeOf.object("result",n),n=k.clone(i,n),n[t]=e.x,n[t+3]=e.y,n[t+6]=e.z,n};const aV=new H;k.setScale=function(i,t,e){B.typeOf.object("matrix",i),B.typeOf.object("scale",t),B.typeOf.object("result",e);const n=k.getScale(i,aV),r=t.x/n.x,o=t.y/n.y,s=t.z/n.z;return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=i[3]*o,e[4]=i[4]*o,e[5]=i[5]*o,e[6]=i[6]*s,e[7]=i[7]*s,e[8]=i[8]*s,e};const lV=new H;k.setUniformScale=function(i,t,e){B.typeOf.object("matrix",i),B.typeOf.number("scale",t),B.typeOf.object("result",e);const n=k.getScale(i,lV),r=t/n.x,o=t/n.y,s=t/n.z;return e[0]=i[0]*r,e[1]=i[1]*r,e[2]=i[2]*r,e[3]=i[3]*o,e[4]=i[4]*o,e[5]=i[5]*o,e[6]=i[6]*s,e[7]=i[7]*s,e[8]=i[8]*s,e};const mC=new H;k.getScale=function(i,t){return B.typeOf.object("matrix",i),B.typeOf.object("result",t),t.x=H.magnitude(H.fromElements(i[0],i[1],i[2],mC)),t.y=H.magnitude(H.fromElements(i[3],i[4],i[5],mC)),t.z=H.magnitude(H.fromElements(i[6],i[7],i[8],mC)),t};const ZS=new H;k.getMaximumScale=function(i){return k.getScale(i,ZS),H.maximumComponent(ZS)};const AV=new H;k.setRotation=function(i,t,e){B.typeOf.object("matrix",i),B.typeOf.object("result",e);const n=k.getScale(i,AV);return e[0]=t[0]*n.x,e[1]=t[1]*n.x,e[2]=t[2]*n.x,e[3]=t[3]*n.y,e[4]=t[4]*n.y,e[5]=t[5]*n.y,e[6]=t[6]*n.z,e[7]=t[7]*n.z,e[8]=t[8]*n.z,e};const uV=new H;k.getRotation=function(i,t){B.typeOf.object("matrix",i),B.typeOf.object("result",t);const e=k.getScale(i,uV);return t[0]=i[0]/e.x,t[1]=i[1]/e.x,t[2]=i[2]/e.x,t[3]=i[3]/e.y,t[4]=i[4]/e.y,t[5]=i[5]/e.y,t[6]=i[6]/e.z,t[7]=i[7]/e.z,t[8]=i[8]/e.z,t},k.multiply=function(i,t,e){B.typeOf.object("left",i),B.typeOf.object("right",t),B.typeOf.object("result",e);const n=i[0]*t[0]+i[3]*t[1]+i[6]*t[2],r=i[1]*t[0]+i[4]*t[1]+i[7]*t[2],o=i[2]*t[0]+i[5]*t[1]+i[8]*t[2],s=i[0]*t[3]+i[3]*t[4]+i[6]*t[5],a=i[1]*t[3]+i[4]*t[4]+i[7]*t[5],l=i[2]*t[3]+i[5]*t[4]+i[8]*t[5],u=i[0]*t[6]+i[3]*t[7]+i[6]*t[8],h=i[1]*t[6]+i[4]*t[7]+i[7]*t[8],p=i[2]*t[6]+i[5]*t[7]+i[8]*t[8];return e[0]=n,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=u,e[7]=h,e[8]=p,e},k.add=function(i,t,e){return B.typeOf.object("left",i),B.typeOf.object("right",t),B.typeOf.object("result",e),e[0]=i[0]+t[0],e[1]=i[1]+t[1],e[2]=i[2]+t[2],e[3]=i[3]+t[3],e[4]=i[4]+t[4],e[5]=i[5]+t[5],e[6]=i[6]+t[6],e[7]=i[7]+t[7],e[8]=i[8]+t[8],e},k.subtract=function(i,t,e){return B.typeOf.object("left",i),B.typeOf.object("right",t),B.typeOf.object("result",e),e[0]=i[0]-t[0],e[1]=i[1]-t[1],e[2]=i[2]-t[2],e[3]=i[3]-t[3],e[4]=i[4]-t[4],e[5]=i[5]-t[5],e[6]=i[6]-t[6],e[7]=i[7]-t[7],e[8]=i[8]-t[8],e},k.multiplyByVector=function(i,t,e){B.typeOf.object("matrix",i),B.typeOf.object("cartesian",t),B.typeOf.object("result",e);const n=t.x,r=t.y,o=t.z,s=i[0]*n+i[3]*r+i[6]*o,a=i[1]*n+i[4]*r+i[7]*o,l=i[2]*n+i[5]*r+i[8]*o;return e.x=s,e.y=a,e.z=l,e},k.multiplyByScalar=function(i,t,e){return B.typeOf.object("matrix",i),B.typeOf.number("scalar",t),B.typeOf.object("result",e),e[0]=i[0]*t,e[1]=i[1]*t,e[2]=i[2]*t,e[3]=i[3]*t,e[4]=i[4]*t,e[5]=i[5]*t,e[6]=i[6]*t,e[7]=i[7]*t,e[8]=i[8]*t,e},k.multiplyByScale=function(i,t,e){return B.typeOf.object("matrix",i),B.typeOf.object("scale",t),B.typeOf.object("result",e),e[0]=i[0]*t.x,e[1]=i[1]*t.x,e[2]=i[2]*t.x,e[3]=i[3]*t.y,e[4]=i[4]*t.y,e[5]=i[5]*t.y,e[6]=i[6]*t.z,e[7]=i[7]*t.z,e[8]=i[8]*t.z,e},k.multiplyByUniformScale=function(i,t,e){return B.typeOf.object("matrix",i),B.typeOf.number("scale",t),B.typeOf.object("result",e),e[0]=i[0]*t,e[1]=i[1]*t,e[2]=i[2]*t,e[3]=i[3]*t,e[4]=i[4]*t,e[5]=i[5]*t,e[6]=i[6]*t,e[7]=i[7]*t,e[8]=i[8]*t,e},k.negate=function(i,t){return B.typeOf.object("matrix",i),B.typeOf.object("result",t),t[0]=-i[0],t[1]=-i[1],t[2]=-i[2],t[3]=-i[3],t[4]=-i[4],t[5]=-i[5],t[6]=-i[6],t[7]=-i[7],t[8]=-i[8],t},k.transpose=function(i,t){B.typeOf.object("matrix",i),B.typeOf.object("result",t);const e=i[0],n=i[3],r=i[6],o=i[1],s=i[4],a=i[7],l=i[2],u=i[5],h=i[8];return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t[4]=s,t[5]=a,t[6]=l,t[7]=u,t[8]=h,t};function cV(i){let t=0;for(let e=0;e<9;++e){const n=i[e];t+=n*n}return Math.sqrt(t)}const yC=[1,0,0],vC=[2,2,1];function hV(i){let t=0;for(let e=0;e<3;++e){const n=i[k.getElementIndex(vC[e],yC[e])];t+=2*n*n}return Math.sqrt(t)}function pV(i,t){const e=z.EPSILON15;let n=0,r=1;for(let u=0;u<3;++u){const h=Math.abs(i[k.getElementIndex(vC[u],yC[u])]);h>n&&(r=u,n=h)}let o=1,s=0;const a=yC[r],l=vC[r];if(Math.abs(i[k.getElementIndex(l,a)])>e){const u=i[k.getElementIndex(l,l)],h=i[k.getElementIndex(a,a)],p=i[k.getElementIndex(l,a)],d=(u-h)/2/p;let g;d<0?g=-1/(-d+Math.sqrt(1+d*d)):g=1/(d+Math.sqrt(1+d*d)),o=1/Math.sqrt(1+g*g),s=g*o}return t=k.clone(k.IDENTITY,t),t[k.getElementIndex(a,a)]=t[k.getElementIndex(l,l)]=o,t[k.getElementIndex(l,a)]=s,t[k.getElementIndex(a,l)]=-s,t}const s0=new k,JS=new k;k.computeEigenDecomposition=function(i,t){B.typeOf.object("matrix",i);const e=z.EPSILON20,n=10;let r=0,o=0;T(t)||(t={});const s=t.unitary=k.clone(k.IDENTITY,t.unitary),a=t.diagonal=k.clone(i,t.diagonal),l=e*cV(a);for(;o<n&&hV(a)>l;)pV(a,s0),k.transpose(s0,JS),k.multiply(a,s0,a),k.multiply(JS,a,a),k.multiply(s,s0,s),++r>2&&(++o,r=0);return t},k.abs=function(i,t){return B.typeOf.object("matrix",i),B.typeOf.object("result",t),t[0]=Math.abs(i[0]),t[1]=Math.abs(i[1]),t[2]=Math.abs(i[2]),t[3]=Math.abs(i[3]),t[4]=Math.abs(i[4]),t[5]=Math.abs(i[5]),t[6]=Math.abs(i[6]),t[7]=Math.abs(i[7]),t[8]=Math.abs(i[8]),t},k.determinant=function(i){B.typeOf.object("matrix",i);const t=i[0],e=i[3],n=i[6],r=i[1],o=i[4],s=i[7],a=i[2],l=i[5],u=i[8];return t*(o*u-l*s)+r*(l*n-e*u)+a*(e*s-o*n)},k.inverse=function(i,t){B.typeOf.object("matrix",i),B.typeOf.object("result",t);const e=i[0],n=i[1],r=i[2],o=i[3],s=i[4],a=i[5],l=i[6],u=i[7],h=i[8],p=k.determinant(i);if(Math.abs(p)<=z.EPSILON15)throw new q("matrix is not invertible");t[0]=s*h-u*a,t[1]=u*r-n*h,t[2]=n*a-s*r,t[3]=l*a-o*h,t[4]=e*h-l*r,t[5]=o*r-e*a,t[6]=o*u-l*s,t[7]=l*n-e*u,t[8]=e*s-o*n;const d=1/p;return k.multiplyByScalar(t,d,t)};const fV=new k;k.inverseTranspose=function(i,t){return B.typeOf.object("matrix",i),B.typeOf.object("result",t),k.inverse(k.transpose(i,fV),t)},k.equals=function(i,t){return i===t||T(i)&&T(t)&&i[0]===t[0]&&i[1]===t[1]&&i[2]===t[2]&&i[3]===t[3]&&i[4]===t[4]&&i[5]===t[5]&&i[6]===t[6]&&i[7]===t[7]&&i[8]===t[8]},k.equalsEpsilon=function(i,t,e){return e=e??0,i===t||T(i)&&T(t)&&Math.abs(i[0]-t[0])<=e&&Math.abs(i[1]-t[1])<=e&&Math.abs(i[2]-t[2])<=e&&Math.abs(i[3]-t[3])<=e&&Math.abs(i[4]-t[4])<=e&&Math.abs(i[5]-t[5])<=e&&Math.abs(i[6]-t[6])<=e&&Math.abs(i[7]-t[7])<=e&&Math.abs(i[8]-t[8])<=e},k.IDENTITY=Object.freeze(new k(1,0,0,0,1,0,0,0,1)),k.ZERO=Object.freeze(new k(0,0,0,0,0,0,0,0,0)),k.COLUMN0ROW0=0,k.COLUMN0ROW1=1,k.COLUMN0ROW2=2,k.COLUMN1ROW0=3,k.COLUMN1ROW1=4,k.COLUMN1ROW2=5,k.COLUMN2ROW0=6,k.COLUMN2ROW1=7,k.COLUMN2ROW2=8,Object.defineProperties(k.prototype,{length:{get:function(){return k.packedLength}}}),k.prototype.clone=function(i){return k.clone(this,i)},k.prototype.equals=function(i){return k.equals(this,i)},k.equalsArray=function(i,t,e){return i[0]===t[e]&&i[1]===t[e+1]&&i[2]===t[e+2]&&i[3]===t[e+3]&&i[4]===t[e+4]&&i[5]===t[e+5]&&i[6]===t[e+6]&&i[7]===t[e+7]&&i[8]===t[e+8]},k.prototype.equalsEpsilon=function(i,t){return k.equalsEpsilon(this,i,t)},k.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
343
343
|
(${this[1]}, ${this[4]}, ${this[7]})
|
|
344
344
|
(${this[2]}, ${this[5]}, ${this[8]})`};function ji(i){this.name="RuntimeError",this.message=i;let t;try{throw new Error}catch(e){t=e.stack}this.stack=t}T(Object.create)&&(ji.prototype=Object.create(Error.prototype),ji.prototype.constructor=ji),ji.prototype.toString=function(){let i=`${this.name}: ${this.message}`;return T(this.stack)&&(i+=`
|
|
@@ -3727,10 +3727,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
3727
3727
|
`;function fie(){const i="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
3728
3728
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
3729
3729
|
gitee地址:${i}
|
|
3730
|
-
`;console.log(e);const n=window.prompt(e,i);n&&window.open(n,"_blank")}const Yi=class Yi extends A.ESViewer{constructor(e){super(e);y(this,"_disabledInputStack",this.disposeVar(A.react(0)));y(this,"_viewer",this.dv(A.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(A.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(A.react(0)));y(this,"_editingSystem",Yy);y(this,"_moveObjectsProcess",this.ad(K2()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new SY(this)),this.ad(new IY(this)),this.dv(new A.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new MY(this)})),this._viewerLegend=this.dv(new lie(this)),this._viewerInstance=this.dv(new A.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Ub(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=ce([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new A.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new AJ(this.subContainer,this,r=>this._viewer.value=r,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&li(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,r){if(!this.extensions)return;const{pickingManager:o}=this.extensions;return await o.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){var s;const{viewer:n}=this;if(!n)return;const r=f.Cartographic.fromDegrees(e[0],e[1],e[2],Yi.getHeightsScartchCarto),o=n.scene.globe.terrainProvider;return o instanceof f.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(s=(await f.sampleTerrainMostDetailed(o,[r]))[0])==null?void 0:s.height}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:cr(e),rotation:vu(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const r=f.Cartesian3.fromDegrees(...e),o=f.Transforms.eastNorthUpToFixedFrame(r),s=f.Matrix4.inverse(o,new f.Matrix4),a=f.Matrix4.multiplyByPoint(s,n.positionWC,new f.Cartesian3),l=f.Cartesian3.magnitude(a);let u=-Math.asin(a.z/l);u=f.Math.toDegrees(u);let h=f.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(h+=a.y<0?-f.Math.PI:f.Math.PI),h=f.Math.toDegrees(h);const p=vu(n),d=p[0]-h,g=p[1]-u;return{distance:l,heading:h,pitch:u,flyDuration:1,hDelta:d,pDelta:g}}flyIn(e,n,r,o="default"){var l;const s={position:e,rotation:n,duration:(r??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&Wh(a,s,o)}flyTo(e,n,r="default"){var g;const{distance:o,heading:s,pitch:a,flyDuration:l,hDelta:u,pDelta:h}=e,p={position:n,viewDistance:o,rotation:[s,a,0],duration:l*1e3,hdelta:u,pdelta:h},d=(g=this.viewer)==null?void 0:g.camera;return d&&Wh(d,p,r)}flyToBoundingSphere(e,n,r=1){var p;const o=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=A.getGeoBoundingSphereFromPositions(o);if(!s)return;const{center:a,radius:l}=s,u={position:a,viewDistance:n??l,rotation:[0,-90,0],duration:r*1e3},h=(p=this.viewer)==null?void 0:p.camera;return h&&Wh(h,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:cr(e),rotation:vu(e)}}transformFlyParam(e,n){if("position"in n){const r=f.Cartesian3.fromDegrees(...e),o=f.Transforms.eastNorthUpToFixedFrame(r),s=f.Matrix4.inverse(o,new f.Matrix4),a=f.Matrix4.multiplyByPoint(s,ke(n.position),new f.Cartesian3),l=f.Cartesian3.magnitude(a);let u=-Math.asin(a.z/l);u=f.Math.toDegrees(u);let h=f.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(h+=a.y<0?-f.Math.PI:f.Math.PI),h=f.Math.toDegrees(h);const p=n.rotation[0]-h,d=n.rotation[1]-u;return{distance:l,heading:h,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:d}}else{const r=ke(e);let o={heading:f.Math.toRadians(n.heading),pitch:f.Math.toRadians(n.pitch),roll:0};const s=new f.HeadingPitchRoll;if(n.distance){s.heading=o.heading,s.pitch=o.pitch,s.roll=0,s.heading-=f.Math.PI_OVER_TWO;const l=f.Transforms.headingPitchRollToFixedFrame(r,s,void 0,void 0),u=f.Matrix4.multiplyByPointAsVector(l,f.Cartesian3.UNIT_X,new f.Cartesian3);f.Cartesian3.multiplyByScalar(u,n.distance,u),f.Cartesian3.subtract(r,u,r)}n.hDelta&&(o.heading+=f.Math.toRadians(n.hDelta)),n.pDelta&&(o.pitch+=f.Math.toRadians(n.pDelta));const a=Be(r);return a?{position:a,rotation:[f.Math.toDegrees(o.heading),f.Math.toDegrees(o.pitch),f.Math.toDegrees(o.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,r=1.6){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToWalk(e,n,r),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,r){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToRotateGlobe(e,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,r,o,s,a){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,n,r,o,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,r,o,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,n,r,o,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,r,o,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,n,r,o,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:f.VERSION},e}async getHeightByLonLat(e,n,r){if(!this.viewer)return null;const o=f.Cartographic.fromDegrees(e,n,void 0,Yi.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(o)??null}async getHeightsByLonLats(e,n){const r=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(r)}async capture(e,n){if(this.viewer)return await EB(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(ke(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const o=e.components.main??e;o&&n!=null&&(o.editingID=`${r.callSource}_${A.createGuid()}`,this._editingSystem.create(this,o,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],r=A.createGuid();for(let o=0;o<e.length;o++){const s=e[o],a=s.components.main??s;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Yi.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Yi.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Yi.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Di(e,n)}localPositionsToPositions(e,n){return Ia(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof f.Cartesian3?e:ke(e),r=new f.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.isPointVisible(n))return!1;const o=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!o||o.x<0||o.y<0)}getESProperties(){const e={...super.getESProperties()},n=Yi.defaults;return{...e,more:[...e.more,new A.DivideProperty("通用"),new A.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",pie,hie,!0),new A.MethodProperty("获取Cesium官方TOKEN",()=>Yi.getCesiumIonToken(),[],"获取官方token"),new A.MethodProperty("重置为当前使用的Cesium版本的TOKEN",()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new A.MethodProperty("重置为当前Cesium官方的最新token",()=>this.setLatestDefaultAccessToken(),[],"重置为当前Cesium官方的最新token"),new A.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new A.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new A.DivideProperty("Viewer"),new A.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new A.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new A.BooleanProperty([this,"shadows"]),new A.DivideProperty("比例尺"),new A.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new A.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new A.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new A.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new A.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new A.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new A.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new A.DivideProperty("场景"),new A.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new A.DivideProperty("Globe"),new A.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new A.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new A.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new A.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new A.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new A.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new A.BooleanProperty([this,"sceneGlobeShowSkirts"]),new A.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new A.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new A.JsonProperty([this,"sceneGlobeClippingPlanes"]),new A.StringProperty([this,"sceneGlobeClippingPlanesId"]),new A.JsonArrayProperty([this,"sceneGlobeClippingPolygons"]),new A.JsonArrayProperty([this,"sceneGlobeClippingPolygonsId"]),new A.DivideProperty("underground"),new A.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new A.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new A.DivideProperty("Translucency"),new A.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new A.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new A.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new A.DivideProperty("Sun"),new A.BooleanProperty([this,"sun"],"sun",n.sun,!0),new A.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new A.DivideProperty("Moon"),new A.BooleanProperty([this,"moon"],"moon",n.moon,!0),new A.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new A.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new A.DivideProperty("SkyBox"),new A.BooleanProperty([this,"sceneSkyBoxShow"]),new A.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new A.DivideProperty("Background"),new A.BooleanProperty([this,"xbsjUseBackground"]),new A.StringProperty([this,"xbsjBackgroundImageUri"]),new A.ColorProperty([this,"xbsjBackgroundColor"]),new A.DivideProperty("SkyAtmosphere"),new A.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new A.DivideProperty("Fog"),new A.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new A.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new A.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new A.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new A.DivideProperty("Sscc"),new A.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new A.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new A.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new A.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new A.DivideProperty("后处理"),new A.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new A.DivideProperty("环境遮蔽"),new A.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new A.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new A.DivideProperty("Bloom"),new A.BooleanProperty([this,"scenePpsBloomEnabled"]),new A.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new A.NumberProperty([this,"scenePpsBloomContrast"]),new A.NumberProperty([this,"scenePpsBloomBrightness"]),new A.NumberProperty([this,"scenePpsBloomDelta"]),new A.NumberProperty([this,"scenePpsBloomSigma"]),new A.NumberProperty([this,"scenePpsBloomStepSize"]),new A.DivideProperty("调试"),new A.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new A.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new A.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new A.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new A.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new A.DivideProperty("Inspector"),new A.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new A.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new A.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(Yi,"type",Yi.register("ESCesiumViewer",Yi)),y(Yi,"getCesiumIonToken",fie),y(Yi,"currentDefaultAccessToken",f.Ion.defaultAccessToken),y(Yi,"latestDefaultAccessToken"),y(Yi,"ObjectsToExcludeWrapper",DY),y(Yi,"defaults",{...A.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:f.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:f.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}),y(Yi,"getHeightsScartchCarto",new f.Cartographic);let ht=Yi;(i=>{i.createDefaultProps=()=>({...A.ESViewer.createDefaultProps(),...cie()})})(ht||(ht={})),A.extendClassProps(ht.prototype,ht.createDefaultProps),M.copyright=void 0;try{const i="earthsdk3-cesium",t="3.8.2",e="2026-04-07T10:31:15.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="9512dc5fa41db879512c0c6f8a36c463d4b0f58c",a=((Date.now()-1775557875e3)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${o.slice(0,8)}.${e} (距今${a}个小时)
|
|
3730
|
+
`;console.log(e);const n=window.prompt(e,i);n&&window.open(n,"_blank")}const Yi=class Yi extends A.ESViewer{constructor(e){super(e);y(this,"_disabledInputStack",this.disposeVar(A.react(0)));y(this,"_viewer",this.dv(A.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(A.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(A.react(0)));y(this,"_editingSystem",Yy);y(this,"_moveObjectsProcess",this.ad(K2()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new SY(this)),this.ad(new IY(this)),this.dv(new A.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new MY(this)})),this._viewerLegend=this.dv(new lie(this)),this._viewerInstance=this.dv(new A.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Ub(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=ce([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new A.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new AJ(this.subContainer,this,r=>this._viewer.value=r,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&li(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,r){if(!this.extensions)return;const{pickingManager:o}=this.extensions;return await o.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){var s;const{viewer:n}=this;if(!n)return;const r=f.Cartographic.fromDegrees(e[0],e[1],e[2],Yi.getHeightsScartchCarto),o=n.scene.globe.terrainProvider;return o instanceof f.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(s=(await f.sampleTerrainMostDetailed(o,[r]))[0])==null?void 0:s.height}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:cr(e),rotation:vu(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const r=f.Cartesian3.fromDegrees(...e),o=f.Transforms.eastNorthUpToFixedFrame(r),s=f.Matrix4.inverse(o,new f.Matrix4),a=f.Matrix4.multiplyByPoint(s,n.positionWC,new f.Cartesian3),l=f.Cartesian3.magnitude(a);let u=-Math.asin(a.z/l);u=f.Math.toDegrees(u);let h=f.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(h+=a.y<0?-f.Math.PI:f.Math.PI),h=f.Math.toDegrees(h);const p=vu(n),d=p[0]-h,g=p[1]-u;return{distance:l,heading:h,pitch:u,flyDuration:1,hDelta:d,pDelta:g}}flyIn(e,n,r,o="default"){var l;const s={position:e,rotation:n,duration:(r??1)*1e3},a=(l=this.viewer)==null?void 0:l.camera;return a&&Wh(a,s,o)}flyTo(e,n,r="default"){var g;const{distance:o,heading:s,pitch:a,flyDuration:l,hDelta:u,pDelta:h}=e,p={position:n,viewDistance:o,rotation:[s,a,0],duration:l*1e3,hdelta:u,pdelta:h},d=(g=this.viewer)==null?void 0:g.camera;return d&&Wh(d,p,r)}flyToBoundingSphere(e,n,r=1){var p;const o=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=A.getGeoBoundingSphereFromPositions(o);if(!s)return;const{center:a,radius:l}=s,u={position:a,viewDistance:n??l,rotation:[0,-90,0],duration:r*1e3},h=(p=this.viewer)==null?void 0:p.camera;return h&&Wh(h,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:cr(e),rotation:vu(e)}}transformFlyParam(e,n){if("position"in n){const r=f.Cartesian3.fromDegrees(...e),o=f.Transforms.eastNorthUpToFixedFrame(r),s=f.Matrix4.inverse(o,new f.Matrix4),a=f.Matrix4.multiplyByPoint(s,ke(n.position),new f.Cartesian3),l=f.Cartesian3.magnitude(a);let u=-Math.asin(a.z/l);u=f.Math.toDegrees(u);let h=f.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(h+=a.y<0?-f.Math.PI:f.Math.PI),h=f.Math.toDegrees(h);const p=n.rotation[0]-h,d=n.rotation[1]-u;return{distance:l,heading:h,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:d}}else{const r=ke(e);let o={heading:f.Math.toRadians(n.heading),pitch:f.Math.toRadians(n.pitch),roll:0};const s=new f.HeadingPitchRoll;if(n.distance){s.heading=o.heading,s.pitch=o.pitch,s.roll=0,s.heading-=f.Math.PI_OVER_TWO;const l=f.Transforms.headingPitchRollToFixedFrame(r,s,void 0,void 0),u=f.Matrix4.multiplyByPointAsVector(l,f.Cartesian3.UNIT_X,new f.Cartesian3);f.Cartesian3.multiplyByScalar(u,n.distance,u),f.Cartesian3.subtract(r,u,r)}n.hDelta&&(o.heading+=f.Math.toRadians(n.hDelta)),n.pDelta&&(o.pitch+=f.Math.toRadians(n.pDelta));const a=Be(r);return a?{position:a,rotation:[f.Math.toDegrees(o.heading),f.Math.toDegrees(o.pitch),f.Math.toDegrees(o.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,r=1.6){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToWalk(e,n,r),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,r){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToRotateGlobe(e,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,r,o,s,a){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,n,r,o,s,a),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,r,o,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToRotatePoint(e,n,r,o,s),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,r,o,s){var a,l;(l=(a=this._viewerInstance)==null?void 0:a.obj)==null||l.navigationManager.changeToFollow(e,n,r,o,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium={version:f.VERSION},e}async getHeightByLonLat(e,n,r){if(!this.viewer)return null;const o=f.Cartographic.fromDegrees(e,n,void 0,Yi.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(o)??null}async getHeightsByLonLats(e,n){const r=e.map(s=>this.getHeightByLonLat(...s));return await Promise.all(r)}async capture(e,n){if(this.viewer)return await EB(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(ke(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const o=e.components.main??e;o&&n!=null&&(o.editingID=`${r.callSource}_${A.createGuid()}`,this._editingSystem.create(this,o,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],r=A.createGuid();for(let o=0;o<e.length;o++){const s=e[o],a=s.components.main??s;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Yi.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Yi.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Yi.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Di(e,n)}localPositionsToPositions(e,n){return Ia(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof f.Cartesian3?e:ke(e),r=new f.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.isPointVisible(n))return!1;const o=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!o||o.x<0||o.y<0)}getESProperties(){const e={...super.getESProperties()},n=Yi.defaults;return{...e,more:[...e.more,new A.DivideProperty("通用"),new A.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",pie,hie,!0),new A.MethodProperty("获取Cesium官方TOKEN",()=>Yi.getCesiumIonToken(),[],"获取官方token"),new A.MethodProperty("重置为当前使用的Cesium版本的TOKEN",()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new A.MethodProperty("重置为当前Cesium官方的最新token",()=>this.setLatestDefaultAccessToken(),[],"重置为当前Cesium官方的最新token"),new A.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new A.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new A.DivideProperty("Viewer"),new A.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new A.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new A.BooleanProperty([this,"shadows"]),new A.DivideProperty("比例尺"),new A.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new A.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new A.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new A.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new A.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new A.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new A.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new A.DivideProperty("场景"),new A.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new A.DivideProperty("Globe"),new A.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new A.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new A.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new A.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new A.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new A.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new A.BooleanProperty([this,"sceneGlobeShowSkirts"]),new A.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new A.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new A.JsonProperty([this,"sceneGlobeClippingPlanes"]),new A.StringProperty([this,"sceneGlobeClippingPlanesId"]),new A.JsonArrayProperty([this,"sceneGlobeClippingPolygons"]),new A.JsonArrayProperty([this,"sceneGlobeClippingPolygonsId"]),new A.DivideProperty("underground"),new A.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new A.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new A.DivideProperty("Translucency"),new A.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new A.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new A.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new A.DivideProperty("Sun"),new A.BooleanProperty([this,"sun"],"sun",n.sun,!0),new A.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new A.DivideProperty("Moon"),new A.BooleanProperty([this,"moon"],"moon",n.moon,!0),new A.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new A.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new A.DivideProperty("SkyBox"),new A.BooleanProperty([this,"sceneSkyBoxShow"]),new A.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new A.DivideProperty("Background"),new A.BooleanProperty([this,"xbsjUseBackground"]),new A.StringProperty([this,"xbsjBackgroundImageUri"]),new A.ColorProperty([this,"xbsjBackgroundColor"]),new A.DivideProperty("SkyAtmosphere"),new A.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new A.DivideProperty("Fog"),new A.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new A.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new A.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new A.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new A.DivideProperty("Sscc"),new A.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new A.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new A.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new A.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new A.DivideProperty("后处理"),new A.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new A.DivideProperty("环境遮蔽"),new A.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new A.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new A.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new A.DivideProperty("Bloom"),new A.BooleanProperty([this,"scenePpsBloomEnabled"]),new A.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new A.NumberProperty([this,"scenePpsBloomContrast"]),new A.NumberProperty([this,"scenePpsBloomBrightness"]),new A.NumberProperty([this,"scenePpsBloomDelta"]),new A.NumberProperty([this,"scenePpsBloomSigma"]),new A.NumberProperty([this,"scenePpsBloomStepSize"]),new A.DivideProperty("调试"),new A.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new A.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new A.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new A.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new A.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new A.DivideProperty("Inspector"),new A.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new A.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new A.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(Yi,"type",Yi.register("ESCesiumViewer",Yi)),y(Yi,"getCesiumIonToken",fie),y(Yi,"currentDefaultAccessToken",f.Ion.defaultAccessToken),y(Yi,"latestDefaultAccessToken"),y(Yi,"ObjectsToExcludeWrapper",DY),y(Yi,"defaults",{...A.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:f.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:f.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:f.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}),y(Yi,"getHeightsScartchCarto",new f.Cartographic);let ht=Yi;(i=>{i.createDefaultProps=()=>({...A.ESViewer.createDefaultProps(),...cie()})})(ht||(ht={})),A.extendClassProps(ht.prototype,ht.createDefaultProps),M.copyright=void 0;try{const i="earthsdk3-cesium",t="3.8.3",e="2026-04-08T02:51:44.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="d0b97d4259cdb0d69fb9f2148dd2d3da3bc752e3",a=((Date.now()-1775616704e3)/36e5).toFixed(1),l=`%c🌏 ${i}%c ${t}.${o.slice(0,8)}.${e} (距今${a}个小时)
|
|
3731
3731
|
%c${r?r+`
|
|
3732
3732
|
`:""}当前网站正在使用${i},此软件版权归${n}所有
|
|
3733
|
-
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
3733
|
+
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","d0b97d4259cdb0d69fb9f2148dd2d3da3bc752e3")},get info(){return l},get date(){return"2026-04-08T02:51:44.000Z"},get author(){return"suplyang"},get version(){return"3.8.3"},get name(){return"earthsdk3-cesium"},get commitId(){return"d0b97d4259cdb0d69fb9f2148dd2d3da3bc752e3"},print(){console.info(this.info,`
|
|
3734
3734
|
font-size: 18px;
|
|
3735
3735
|
font-weight: 1000;
|
|
3736
3736
|
line-height: 1;
|
package/dist/earthsdk3-cesium.js
CHANGED
|
@@ -9771,7 +9771,7 @@ const ed = class ed extends B {
|
|
|
9771
9771
|
const o = new d.Primitive({
|
|
9772
9772
|
geometryInstances: s,
|
|
9773
9773
|
appearance: n,
|
|
9774
|
-
asynchronous:
|
|
9774
|
+
asynchronous: s.length > 1,
|
|
9775
9775
|
// 防止闪烁
|
|
9776
9776
|
allowPicking: this.allowPicking ?? ed.defaults.allowPicking,
|
|
9777
9777
|
// 不允许拾取
|
|
@@ -9941,7 +9941,7 @@ const wl = class wl extends B {
|
|
|
9941
9941
|
const a = new d.GroundPrimitive({
|
|
9942
9942
|
geometryInstances: r,
|
|
9943
9943
|
appearance: s,
|
|
9944
|
-
asynchronous:
|
|
9944
|
+
asynchronous: r.length > 1,
|
|
9945
9945
|
// 防止闪烁
|
|
9946
9946
|
allowPicking: this.allowPicking ?? wl.defaults.allowPicking,
|
|
9947
9947
|
// 不允许拾取
|
|
@@ -10041,7 +10041,7 @@ const id = class id extends B {
|
|
|
10041
10041
|
const b = new d.Primitive({
|
|
10042
10042
|
geometryInstances: g,
|
|
10043
10043
|
appearance: f,
|
|
10044
|
-
asynchronous:
|
|
10044
|
+
asynchronous: g.length > 1,
|
|
10045
10045
|
// 防止闪烁
|
|
10046
10046
|
allowPicking: this.allowPicking ?? id.defaults.allowPicking,
|
|
10047
10047
|
// 不允许拾取
|
|
@@ -70388,7 +70388,7 @@ let we = Li;
|
|
|
70388
70388
|
ut(we.prototype, we.createDefaultProps);
|
|
70389
70389
|
let K0;
|
|
70390
70390
|
try {
|
|
70391
|
-
const i = "earthsdk3-cesium", e = "3.8.
|
|
70391
|
+
const i = "earthsdk3-cesium", e = "3.8.3", t = "2026-04-08T02:51:44.000Z", n = "北京西部世界科技有限公司", s = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", r = "d0b97d4259cdb0d69fb9f2148dd2d3da3bc752e3", a = ((Date.now() - 1775616704e3) / 36e5).toFixed(1), l = `%c🌏 ${i}%c ${e}.${r.slice(0, 8)}.${t} (距今${a}个小时)
|
|
70392
70392
|
%c${s ? s + `
|
|
70393
70393
|
` : ""}当前网站正在使用${i},此软件版权归${n}所有
|
|
70394
70394
|
`;
|
|
@@ -70402,7 +70402,7 @@ try {
|
|
|
70402
70402
|
},
|
|
70403
70403
|
// @ts-ignore
|
|
70404
70404
|
get gituri() {
|
|
70405
|
-
return GITURI_ && GITURI_.replace("${commitId}", "
|
|
70405
|
+
return GITURI_ && GITURI_.replace("${commitId}", "d0b97d4259cdb0d69fb9f2148dd2d3da3bc752e3");
|
|
70406
70406
|
},
|
|
70407
70407
|
// @ts-ignore
|
|
70408
70408
|
get info() {
|
|
@@ -70410,7 +70410,7 @@ try {
|
|
|
70410
70410
|
},
|
|
70411
70411
|
// @ts-ignore
|
|
70412
70412
|
get date() {
|
|
70413
|
-
return "2026-04-
|
|
70413
|
+
return "2026-04-08T02:51:44.000Z";
|
|
70414
70414
|
},
|
|
70415
70415
|
// @ts-ignore
|
|
70416
70416
|
get author() {
|
|
@@ -70418,7 +70418,7 @@ try {
|
|
|
70418
70418
|
},
|
|
70419
70419
|
// @ts-ignore
|
|
70420
70420
|
get version() {
|
|
70421
|
-
return "3.8.
|
|
70421
|
+
return "3.8.3";
|
|
70422
70422
|
},
|
|
70423
70423
|
// @ts-ignore
|
|
70424
70424
|
get name() {
|
|
@@ -70426,7 +70426,7 @@ try {
|
|
|
70426
70426
|
},
|
|
70427
70427
|
// @ts-ignore
|
|
70428
70428
|
get commitId() {
|
|
70429
|
-
return "
|
|
70429
|
+
return "d0b97d4259cdb0d69fb9f2148dd2d3da3bc752e3";
|
|
70430
70430
|
},
|
|
70431
70431
|
print() {
|
|
70432
70432
|
console.info(
|
|
@@ -317,7 +317,7 @@ ${kC}
|
|
|
317
317
|
// out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
318
318
|
// #endif
|
|
319
319
|
}
|
|
320
|
-
`;r.vertexShaderSource=o,r.fragmentShaderSource=s;const a={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}};r.renderState=a;const c=()=>{this.czmTextureId?r.uniformMap={myImage:{type:"texture",id:this.czmTextureId},myColor:this.color??[1,1,1,1]}:r.uniformMap={myImage:{type:"image",uri:l.ESSceneObject.context.getStrFromEnv(this.uri??"${earthsdk3-assets-script-dir}/assets/img/location.png")},myColor:this.color??[1,1,1,1]}};c(),this.dispose(this.uriChanged.disposableOn(c)),this.dispose(this.czmTextureIdChanged.disposableOn(c)),this.dispose(this.colorChanged.disposableOn(c)),this.dispose(l.bind([r,"show"],[this,"show"])),this.dispose(l.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([r,"position"],[this,"position"]));{const f=()=>{r.pixelSize=this.pixelSize};f(),this.dispose(this.pixelSizeChanged.disposableOn(f))}this.dispose(l.track([r,"maximumScale"],[this,"maximumScale"])),this.dispose(l.track([r,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(l.track([r,"viewDistanceDebug"],[this,"viewDistanceDebug"]));const h=()=>{const{scale:f=[1,1]}=this;r.scale=[this.useAxis.includes("X")?f[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?f[1]:1]};h(),this.dispose(this.scaleChanged.disposableOn(h));const p=()=>{const f=-(this.originRatioAndOffset[0]*this.size[0]+this.originRatioAndOffset[2]),g=this.originRatioAndOffset[1]*this.size[1]+this.originRatioAndOffset[3];r.localPosition=[this.useAxis.includes("X")?f:0,this.useAxis.includes("Y")?this.useAxis.includes("X")?g:f:0,this.useAxis.includes("Z")?g:0],r.localScale=[this.useAxis.includes("X")?this.size[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?this.size[1]:1]};{const f=()=>{const g={XY:[0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0,0],YZ:[0,0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0],XZ:[0,0,0,0,0,-1,1,0,-1,1,0,0,0,0,0,0,0,-1,1,0,-1,1,0,0]},m={XY:{min:[0,-1,0],max:[1,0,0]},YZ:{min:[0,0,-1],max:[0,1,0]},XZ:{min:[0,0,-1],max:[1,0,0]}};r.attributes={position:{typedArray:new Float32Array(g[this.useAxis??hp.defaults.useAxis]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,1]),componentsPerAttribute:2}},r.boundingVolume={type:"LocalAxisedBoundingBox",data:m[this.useAxis??hp.defaults.useAxis]},p()};f(),this.d(this.useAxisChanged.don(f))}this.dispose(this.originRatioAndOffsetChanged.disposableOn(p)),this.dispose(this.sizeChanged.disposableOn(p)),this.dispose(this.flyToEvent.disposableOn(f=>{r.flyTo(f)})),this.disposeVar(new l.ObjResettingWithEvent(this.rotationModeChanged,()=>new LD(t,this)))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get customPrimitive(){return this._customPrimitive}};y(hp,"defaults",{position:[0,0,0],viewDistanceRange:[1e3,1e4,3e4,6e4],useAxis:"XY"});let Go=hp;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",czmTextureId:"",position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),rotationWithCamera:!1,rotationMode:"WithProp",useAxis:"XY",size:l.reactArray([1,1]),scale:[1,1],maximumScale:Number.MAX_VALUE,minimumScale:Number.MIN_VALUE,pixelSize:50,color:l.reactArray([1,1,1,1]),originRatioAndOffset:l.reactArray([.5,1,0,0]),viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Go||(Go={})),l.extendClassProps(Go.prototype,Go.createDefaultProps);class LD extends l.Destroyable{constructor(e,t){super(),this._czmViewer=e,this._czmImageModel=t;const{customPrimitive:n,rotationMode:r}=this._czmImageModel;if(r==="WithProp")this.dispose(l.track([n,"rotation"],[this._czmImageModel,"rotation"]));else if(r==="WithCameraOnlyZ"){const o=()=>{const{rotation:s}=this._czmImageModel,a=this._czmViewer.getCameraInfo();a&&(n.rotation=[a.rotation[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),s[1],s[2]])};o(),this.dispose(this._czmViewer.cameraChanged.disposableOn(o)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(o))}else if(r==="WithCamera"){const o=()=>{const s=this._czmViewer.getCameraInfo();if(!s)return;const a=s.rotation;n.rotation=[a[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),a[1]+(this._czmImageModel.useAxis.includes("Z")?0:90),a[2]]};o(),this.dispose(this._czmViewer.cameraChanged.disposableOn(o)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(o))}}}class Wa extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");y(this,"_id",this.disposeVar(l.react(l.createGuid())));n&&(this.id=n);const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}if(!$e(t.viewer))return;const s=this.disposeVar(Nr([this,"material"])),a=this.disposeVar(l.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,s.changed)),c=this.disposeVar(new l.ObjResettingWithEvent(a,()=>{if(s.value)return new OD(t,r,this,s.value)}));this.dispose(this.flyToEvent.disposableOn(h=>{t.actived&&(a.flush(),c.obj&&c.obj.flyTo(h))}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get id(){return this._id.value}set id(t){this._id.value=t}get idChanged(){return this._id.changed}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,arcType:"GEODESIC",material:l.reactJson({type:"Color"}),stRotation:0,polygonHierarchy:l.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:1,perPositionHeight:!1,closeTop:!0,closeBottom:!0})})(Wa||(Wa={})),l.extendClassProps(Wa.prototype,Wa.createDefaultProps);class OD extends l.Destroyable{constructor(t,n,r,o){super();y(this,"_boundingSphere");this._czmViewer=t,this._viewer=n,this._sceneObject=r,this._material=o;const s=this._sceneObject,a=this._material,c=this._viewer;if(!s.polygonHierarchy)return;const h=new d.BoundingSphere,p=Wi(s.polygonHierarchy.positions);p.length<3?(h.radius=-1,this._boundingSphere=void 0):(d.BoundingSphere.fromPoints(p,h),this._boundingSphere=h);const f=new d.MaterialAppearance({material:a}),g=[],m=new d.GeometryInstance({geometry:new d.PolygonGeometry({vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Bo(s.polygonHierarchy),stRotation:s.stRotation&&d.Math.toRadians(s.stRotation),arcType:s.arcType&&d.ArcType[s.arcType],height:s.height,extrudedHeight:s.extrudedHeight,perPositionHeight:s.perPositionHeight,closeTop:s.closeTop,closeBottom:s.closeBottom,ellipsoid:s.ellipsoid&&Wt(s.ellipsoid),granularity:s.granularity!==void 0?d.Math.toRadians(s.granularity):void 0}),id:this});g.push(m);const v=new d.GroundPrimitive({geometryInstances:g,appearance:f,asynchronous:!1,allowPicking:s.allowPicking,compressVertices:!1});d.GroundPrimitive.prototype&&(v.ESSceneObjectID=r.id),c.scene.primitives.add(v),this.dispose(()=>c.scene.primitives.remove(v));{const _=()=>{v.show=s.show};_(),this.dispose(s.showChanged.disposableOn(_))}this.disposeVar(new ne.ObjectsToExcludeWrapper(this._czmViewer,v))}flyTo(t){const n=this._boundingSphere;if(n&&n.radius>0){const r=xt(n.center);r&&dt(this._viewer,r,n.radius*4,void 0,t)}}}class BD extends l.Destroyable{constructor(t,n){super();y(this,"_groundPolygonPrimitive");this._groundPolygonPrimitive=this.disposeVar(new Wa(n,t.id));const r=this._groundPolygonPrimitive;{const o=()=>{const a=t.show,c=t.fill;r.show=a&&c&&t.visibleAlpha>0,r.polygonHierarchy=r.show?{positions:t.positions||[]}:{positions:[]},r.material={type:"Color",color:t.color||[1,1,1,.5]}};o();const s=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.fillChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.depthChanged,t.visibleAlphaChanged));this.dispose(s.disposableOn(o))}this.dispose(l.track([r,"allowPicking"],[t,"allowPicking"]))}get groundPolygonPrimitive(){return this._groundPolygonPrimitive}}class zD extends l.Destroyable{constructor(t,n,r){super();y(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new ee(n,t.id));const o=this._geoPolyline;o.arcType="GEODESIC",o.loop=!0;{const s=()=>{const c=t.show,h=t.outline;if(o.show=c&&h&&t.visibleAlpha>0,o.show&&t.positions&&t.positions.length>1){const p=t.positions[0][2];o.positions=t.positions.map(f=>[f[0],f[1],p])}else o.positions=void 0;o.color=t.outlineColor,o.width=t.outlineWidth};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"])),this.dispose(l.track([o,"ground"],[t,"strokeGround"]))}get geoPolyline(){return this._geoPolyline}}class VD extends l.Destroyable{constructor(t,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=t.ground;this._innerPolygon=this.disposeVar(new BD(t,n)),this._bottomPolyline=this.disposeVar(new zD(t,n,r)),this.dispose(t.flyToEvent.disposableOn(o=>{if(t.viewDistanceRange){const s=t.positionsCenter.center,a=(t.viewDistanceRange[1]+t.viewDistanceRange[2])/2;dt(n.viewer,s,a,void 0,o)}else{const s=t.positionsCenter.center;if(!t.positions)return;const a=[s[0],s[1],t.positions[0][2]],c=t.positionsCenter.radius*4;dt(n.viewer,a,c,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Rs extends l.Destroyable{constructor(t,n){super();y(this,"_positions",this.disposeVar(l.reactPositions(void 0)));y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");this.d(this.polygonHierarchyChanged.don(()=>{this.polygonHierarchy?this.positions=this.polygonHierarchy.positions:this.positions=void 0})),this.d(this.positionsChanged.don(()=>{this.positions?this.polygonHierarchy.positions=[...this.positions]:this.polygonHierarchy={positions:[]}}));const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(Nr([this,"material"])),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=m=>{if(!this.polygonHierarchy)return;const v=new d.MaterialAppearance({material:m}),_=[],w=new d.GeometryInstance({geometry:new d.PolygonGeometry({vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Bo(this.polygonHierarchy),stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),arcType:this.arcType&&d.ArcType[this.arcType],height:this.height,extrudedHeight:this.extrudedHeight,perPositionHeight:this.perPositionHeight,closeTop:this.closeTop,closeBottom:this.closeBottom,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid),granularity:this.granularity!==void 0?d.Math.toRadians(this.granularity):void 0}),id:this});_.push(w);const C=new d.Primitive({geometryInstances:_,appearance:v,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return d.Primitive.prototype&&(C.ESSceneObjectID=n),C},c=new d.BoundingSphere,h=()=>{if(s(),!this.polygonHierarchy)return;const m=Wi(this.polygonHierarchy.positions);if(m.length<3||!o.value){c.radius=-1;return}d.BoundingSphere.fromPoints(m,c),this._primitive=a(o.value),this._primitive&&r.scene.primitives.add(this._primitive)},p=()=>{const m=this.show??!0;this._primitive&&(this._primitive.show=m)};h(),p();const f=this.disposeVar(l.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,o.changed));this.dispose(f.disposableOn(()=>{h(),p()}));const g=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(g.disposableOn(()=>{p()})),this.dispose(this.flyToEvent.disposableOn(m=>{if(t.actived&&(f.flush(),g.flush(),c.radius>0)){const v=xt(c.center),_=this.height??0,w=this.extrudedHeight??0,C=Math.max(_,w),x=c.radius<C?C:c.radius;v&&dt(r,v,x*4,void 0,m)}}))}get positions(){return this._positions.value}get positionsChanged(){return this._positions.changed}set positions(t){this._positions.value=t}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}y(Rs,"defaults",{positions:[]}),(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,material:l.reactJson({type:"Color"}),stRotation:void 0,polygonHierarchy:l.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0})})(Rs||(Rs={})),l.extendClassProps(Rs.prototype,Rs.createDefaultProps);class tx extends l.Destroyable{constructor(t,n,r,o){super();y(this,"_czmInnerPolygonPrimitive");this._czmInnerPolygonPrimitive=this.disposeVar(new Rs(n,t.id));const s=this._czmInnerPolygonPrimitive;{const a=()=>{const h=t.show,p=t.fill;if(s.show=h&&p&&t.visibleAlpha>0,t.positions&&t.positions.length>0&&!o?s.height=t.positions[0][2]:s.height=void 0,s.polygonHierarchy=s.show?{positions:t.positions||[]}:{positions:[]},s.material={type:"Color",color:t.color||[1,1,1,.5]},r){if(t.depth===void 0)throw new Error("sceneObject.depth === undefined");s.extrudedHeight=(s.height??0)+t.depth}};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.fillChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.depthChanged,t.visibleAlphaChanged));this.dispose(c.disposableOn(a))}this.dispose(l.track([s,"allowPicking"],[t,"allowPicking"]))}get czmInnerPolygonPrimitive(){return this._czmInnerPolygonPrimitive}}class ex extends l.Destroyable{constructor(t,n,r){super();y(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new ee(n,t.id));const o=this._geoPolyline;o.arcType="GEODESIC",o.loop=!0,this.dispose(l.bind([o,"depthTest"],[t,"depthTest"])),this.dispose(l.bind([o,"ground"],[t,"strokeGround"]));{const s=()=>{const c=t.show,h=t.outline;if(o.show=c&&h&&t.visibleAlpha>0,o.show&&t.positions&&t.positions.length>1){const p=t.positions[0][2];o.positions=t.positions.map(f=>[f[0],f[1],p])}else o.positions=void 0;o.color=t.outlineColor,o.width=t.outlineWidth};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"]))}get geoPolyline(){return this._geoPolyline}}class UD extends l.Destroyable{constructor(e,t){super();const n=this.disposeVar(new rr(t,e.id));n.arcType="GEODESIC",this.dispose(l.track([n,"allowPicking"],[e,"allowPicking"])),this.dispose(l.bind([n,"depthTest"],[e,"depthTest"]));{const r=()=>{if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=e.show,a=e.outline;n.show=s&&a&&e.visibleAlpha>0,n.color=e.outlineColor,n.width=e.outlineWidth;let c;if(n.show&&e.positions&&e.positions.length>1){const p=e.positions[0][2];c=e.positions.map(f=>[f[0],f[1],p])}let h;if(e.positions&&e.positions.length>0?h=e.positions[0][2]:h=void 0,n.show&&c){const p=h,f=(h??0)+e.depth;n.positions=c.map(g=>[[g[0],g[1],p],[g[0],g[1],f]])}else n.positions=void 0};r();const o=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(o.disposableOn(r))}}}class GD extends l.Destroyable{constructor(e,t){super();const n=this.disposeVar(new ee(t,e.id));n.arcType="GEODESIC",n.loop=!0,this.dispose(l.track([n,"allowPicking"],[e,"allowPicking"])),this.dispose(l.bind([n,"depthTest"],[e,"depthTest"]));{const r=()=>{if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=e.show,a=e.outline;n.show=s&&a&&e.visibleAlpha>0,n.color=e.outlineColor,n.width=e.outlineWidth;let c;if(n.show&&e.positions&&e.positions.length>1){const p=e.positions[0][2];c=e.positions.map(f=>[f[0],f[1],p])}let h;if(e.positions&&e.positions.length>0?h=e.positions[0][2]:h=void 0,n.show&&c){const p=(h??0)+e.depth;n.positions=c.map(f=>[f[0],f[1],p])}else n.positions=void 0};r();const o=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(o.disposableOn(r))}}}class WD extends l.Destroyable{constructor(t,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=t.ground;this._innerPolygon=this.disposeVar(new tx(t,n,!0,r)),this._bottomPolyline=this.disposeVar(new ex(t,n,r)),this.disposeVar(new UD(t,n)),this.disposeVar(new GD(t,n)),this.dispose(t.flyToEvent.disposableOn(o=>{if(t.viewDistanceRange){const s=t.positionsCenter.center,a=(t.viewDistanceRange[1]+t.viewDistanceRange[2])/2;dt(n.viewer,s,a,void 0,o)}else{const s=t.positionsCenter.center;if(!t.positions)return;const a=[s[0],s[1],t.positions[0][2]],c=t.positionsCenter.radius*4;dt(n.viewer,a,c,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}let HD=class extends l.Destroyable{constructor(t,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=t.ground;this._innerPolygon=this.disposeVar(new tx(t,n,!1,r)),this._bottomPolyline=this.disposeVar(new ex(t,n,r)),this.dispose(t.flyToEvent.disposableOn(o=>{if(t.viewDistanceRange){const s=t.positionsCenter.center,a=(t.viewDistanceRange[1]+t.viewDistanceRange[2])/2;dt(n.viewer,s,a,void 0,o)}else{const s=t.positionsCenter.center;if(!t.positions)return;const a=[s[0],s[1],t.positions[0][2]],c=t.positionsCenter.radius*4;dt(n.viewer,a,c,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}};class Fs extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_polygonOrGroundPolygonResetting");y(this,"_czmViewVisibleDistanceRangeControl");y(this,"_id",this.disposeVar(l.react(l.createGuid())));y(this,"_positionsCenter");this._positionsCenter=this.ad(new tv(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Ma(t,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(l.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const r=this.disposeVar(l.createNextAnimateFrameEvent(this.groundChanged,this.depthChanged,this.strokeGroundChanged));this._polygonOrGroundPolygonResetting=this.disposeVar(new l.ObjResettingWithEvent(r,()=>this.ground?new VD(this,t):this.depth!==void 0&&this.depth>0?new WD(this,t):new HD(this,t)))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get polygonOrGroundPolygonResetting(){return this._polygonOrGroundPolygonResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(t){this._id.value=t}get idChanged(){return this._id.changed}get positionsCenter(){return this._positionsCenter}}y(Fs,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,strokeGround:!1,outline:!0,outlineColor:l.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:l.reactArray([1,1,1,.5]),positions:l.reactPositions(void 0),depth:0,zIndex:0,viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(Fs||(Fs={})),l.extendClassProps(Fs.prototype,Fs.createDefaultProps);class Ju extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(Nr([this,"material"])),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(g,m)=>{const v=new d.MaterialAppearance({material:m}),_=[],w=new d.GeometryInstance({geometry:new d.RectangleGeometry({rectangle:g,height:this.height,rotation:this.rotation&&d.Math.toRadians(this.rotation),extrudedHeight:this.extrudedHeight,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});_.push(w);const C=new d.Primitive({geometryInstances:_,appearance:v,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return d.Primitive.prototype&&(C.ESSceneObjectID=n),C},c=()=>{if(s(),!this.positions)return;const g=oe(this.positions);!g||!o.value||(this._primitive=a(g,o.value),this._primitive&&r.scene.primitives.add(this._primitive))},h=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};c(),h();const p=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.stRotationChanged,this.rotationChanged,o.changed,this.allowPickingChanged));this.dispose(p.disposableOn(()=>{c(),h()}));const f=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(!t.actived||!this.positions)return;const m=oe(this.positions),v=d.BoundingSphere.fromRectangle3D(m,void 0,this.height);if(v.radius>0){const _=xt(v.center);_&&dt(r,_,v.radius*4,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),positions:l.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,stRotation:void 0})})(Ju||(Ju={})),l.extendClassProps(Ju.prototype,Ju.createDefaultProps);const Mm=class Mm extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(Nr([this,"material"],Mm.defaults.material)),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(g,m)=>{const v=new d.MaterialAppearance({material:m}),_=[],w=new d.GeometryInstance({geometry:new d.RectangleGeometry({rectangle:g,rotation:this.rotation&&d.Math.toRadians(this.rotation),stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});_.push(w);const C=new d.GroundPrimitive({geometryInstances:_,appearance:v,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return d.GroundPrimitive.prototype&&(C.ESSceneObjectID=n),C},c=()=>{if(s(),!this.positions)return;const g=oe(this.positions);!g||!o.value||(this._primitive=a(g,o.value),this._primitive&&r.scene.primitives.add(this._primitive))},h=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};c(),h();const p=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.stRotationChanged,this.rotationChanged,o.changed,this.allowPickingChanged));this.dispose(p.disposableOn(()=>{c(),h()}));const f=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(!t.actived||!this.positions)return;const m=oe(this.positions),v=d.BoundingSphere.fromRectangle3D(m,void 0,0);if(v.radius>0){const _=xt(v.center);_&&dt(r,_,v.radius*4,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}};y(Mm,"defaults",{material:{type:"Color",color:[1,1,1,.5]}});let Ha=Mm;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),positions:l.reactArrayWithUndefined(void 0),rotation:void 0,stRotation:void 0})})(Ha||(Ha={})),l.extendClassProps(Ha.prototype,Ha.createDefaultProps);class ju extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(o);const s=new d.Color,a=g=>{const m=new d.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),v=[],_=new d.GeometryInstance({geometry:new d.RectangleOutlineGeometry({rectangle:g,height:this.height??0,extrudedHeight:this.extrudedHeight,rotation:this.rotation&&d.Math.toRadians(this.rotation)}),attributes:{color:this.color?d.ColorGeometryInstanceAttribute.fromColor(at(this.color,s)):d.ColorGeometryInstanceAttribute.fromColor(new d.Color(1,1,1,1))},id:this});v.push(_);const w=new d.Primitive({geometryInstances:v,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return d.Primitive.prototype&&(w.ESSceneObjectID=n),w},c=()=>{if(o(),!this.positions)return;const g=oe(this.positions);g&&(this._primitive=a(g),this._primitive&&r.scene.primitives.add(this._primitive))},h=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};c(),h();const p=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.colorChanged,this.translucentChanged,this.extrudedHeightChanged,this.heightChanged,this.rotationChanged,this.allowPickingChanged));this.dispose(p.disposableOn(()=>{c(),h()}));const f=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(!t.actived||!this.positions)return;const m=oe(this.positions),v=d.BoundingSphere.fromRectangle3D(m,void 0,this.height);if(v.radius>0){const _=xt(v.center);_&&dt(r,_,v.radius*4,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,translucent:void 0,color:l.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,positions:l.reactArrayWithUndefined(void 0)})})(ju||(ju={})),l.extendClassProps(ju.prototype,ju.createDefaultProps);const pp=class pp extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));if(!t.viewer)return;const o=this.ad(new Ju(t,n)),s=this.ad(new Ha(t,n)),a=this.ad(new ju(t,n));this.dispose(l.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const p=this.show??!0,f=this.ground??!1,g=this.outline??!1;a.show=p&&!f&&g,o.show=p&&!f,a.show?a.positions=this.rectangle:a.positions=void 0,o.show?o.positions=this.rectangle:o.positions=void 0,a.rotation=o.rotation=this.rotation,o.material=this.material??pp.defaults.material,o.stRotation=this.stRotation,a.extrudedHeight=o.extrudedHeight=this.extrudedHeight,a.height=o.height=this.height,a.color=this.outlineColor,a.translucent=this.outlineTranslucent,s.show=p&&f,s.show?s.positions=this.rectangle:s.positions=void 0,s.rotation=this.rotation,s.material=this.material??pp.defaults.material,s.stRotation=this.stRotation};c();const h=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.heightChanged,this.extrudedHeightChanged,this.materialChanged,this.rectangleChanged,this.outlineColorChanged,this.stRotationChanged,this.rotationChanged,this.outlineTranslucentChanged,this.groundChanged));this.dispose(h.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(p=>{this.ground?s.flyTo(p):o.flyTo(p)}))}}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}};y(pp,"defaults",{material:{type:"Color",color:[1,1,1,.5]},rectangle:void 0,extrudedHeight:void 0});let oo=pp;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outlineTranslucent:!0,outline:!1,outlineColor:l.reactArray([1,1,1,1]),height:0,extrudedHeight:void 0,material:l.reactJsonWithUndefined(void 0),rectangle:l.reactArrayWithUndefined(void 0),rotation:0,stRotation:0})})(oo||(oo={})),l.extendClassProps(oo.prototype,oo.createDefaultProps);const dp=class dp extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");this.czmViewer=t,this.id=n;const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this.clear()});const o=this.disposeVar(Nr([this,"material"])),s=()=>{this.clear(),!(!this.position||!o.value)&&(this._primitive=this.createPrimitive(o.value),this._primitive&&r.scene.primitives.add(this._primitive),this.updateShow())};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.ellipsoidChanged,this.granularityChanged,this.stRotationChanged,o.changed,this.instancesChanged,this.rotationChanged));this.dispose(a.disposableOn(()=>{s()})),this.dispose(this.showChanged.disposableOn(()=>{this.updateShow()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)dt(r,this.position,this.radius*4,void 0,1e3);else{const c=r.scene.camera.positionCartographic.height;dt(r,this.position,c,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}setGranularity(){let t=this.granularity??dp.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),t=t|0,t=Math.max(1,t),d.Math.toRadians(t)}createPrimitive(t){if(!this.position||!this.radius)return;const n=new d.MaterialAppearance({material:t}),r=[],o=this.setGranularity();if(this.instances&&this.instances.length>0)for(let a=0;a<this.instances.length;a++){const c=this.instances[a];r.push(this.createGeometry(c.position,c.rotation??this.rotation,c.radius??this.radius,c.id??this,c.position[2]??this.height,o))}else r.push(this.createGeometry(this.position,this.rotation,this.radius,this,this.height,o));const s=new d.Primitive({geometryInstances:r,appearance:n,asynchronous:!1,allowPicking:this.allowPicking??dp.defaults.allowPicking,compressVertices:!1});return d.Primitive.prototype&&(s.ESSceneObjectID=this.id),s}createGeometry(t,n,r,o,s,a){const c=Gt(t),h=new d.GeometryInstance({geometry:new d.CircleGeometry({center:c,height:s,extrudedHeight:this.extrudedHeight,radius:r,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),vertexFormat:d.VertexFormat.ALL,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid),granularity:a}),id:o}),p=d.Transforms.eastNorthUpToFixedFrame(c),f=d.Matrix4.inverseTransformation(p,new d.Matrix4),g=d.Matrix4.multiplyByMatrix3(p,d.Matrix3.fromHeadingPitchRoll(d.HeadingPitchRoll.fromDegrees(n[0],n[1],n[2],new d.HeadingPitchRoll)),new d.Matrix4);return d.Matrix4.multiply(g,f,h.modelMatrix),h}updateShow(){this._primitive&&(this._primitive.show=!!this.show)}clear(){var t;this._primitive&&((t=this.czmViewer.viewer)==null||t.scene.primitives.remove(this._primitive),this._primitive=void 0)}};y(dp,"defaults",{show:!0,allowPicking:!1,translucent:!0,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Ns=dp;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJson({type:"Color"}),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,stRotation:void 0,ellipsoid:void 0,granularity:void 0,instances:l.reactArrayWithUndefined([])})})(Ns||(Ns={})),l.extendClassProps(Ns.prototype,Ns.createDefaultProps);const Ll=class Ll extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");this.czmViewer=t,this.id=n;const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this.clear()});const o=this.disposeVar(Nr([this,"material"],Ll.defaults.material)),s=()=>{if(this.clear(),!this.position||!this.radius||!o.value)return;const c=Gt(this.position);this._primitive=this.createPrimitive(c,o.value),this._primitive&&r.scene.groundPrimitives.add(this._primitive),this.updateShow()};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.stRotationChanged,this.granularityChanged,this.ellipsoidChanged,this.materialChanged,this.instancesChanged,o.changed));this.dispose(a.disposableOn(()=>{s()})),this.dispose(this.showChanged.disposableOn(()=>{this.updateShow()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)dt(r,this.position,this.radius*4,void 0,1e3);else{const c=r.scene.camera.positionCartographic.height;dt(r,this.position,c,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}clear(){var t;this._primitive&&((t=this.czmViewer.viewer)==null||t.scene.groundPrimitives.remove(this._primitive)),this._primitive=void 0}updateShow(){this._primitive&&(this._primitive.show=this.show??Ll.defaults.show)}createPrimitive(t,n){if(!t||!this.radius)return;const r=new d.MaterialAppearance({material:n}),o=[],s=this.setGranularity();if(this.instances&&this.instances.length>0)for(let c=0;c<this.instances.length;c++){const h=this.instances[c],p=new d.GeometryInstance({geometry:new d.CircleGeometry({center:Gt(h.position),radius:h.radius??this.radius,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),granularity:s,vertexFormat:d.VertexFormat.ALL,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid)}),id:h.id??this});o.push(p)}else{const c=new d.GeometryInstance({geometry:new d.CircleGeometry({center:t,radius:this.radius,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),granularity:s,vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid)}),id:this});o.push(c)}const a=new d.GroundPrimitive({geometryInstances:o,appearance:r,asynchronous:!1,allowPicking:this.allowPicking??Ll.defaults.allowPicking,compressVertices:!1});return d.GroundPrimitive.prototype&&(a.ESSceneObjectID=this.id),a}setGranularity(){let t=this.granularity??Ll.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),t=t|0,t=Math.max(1,t),d.Math.toRadians(t)}};y(Ll,"defaults",{show:!0,allowPicking:!1,material:{type:"Color",color:[1,1,1,.5]},radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Ls=Ll;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),granularity:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),radius:void 0,stRotation:void 0,ellipsoid:void 0,instances:l.reactArrayWithUndefined([])})})(Ls||(Ls={})),l.extendClassProps(Ls.prototype,Ls.createDefaultProps);const fp=class fp extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0});const o=new d.Color,s=f=>{if(!f||!this.radius)return;const g=new d.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),m=[],v=d.ColorGeometryInstanceAttribute.fromColor(d.Color.WHITE),_=()=>{let A=this.granularity??fp.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),A=A|0,A=Math.max(1,A),d.Math.toRadians(A)},w=new d.GeometryInstance({geometry:new d.CircleOutlineGeometry({center:f,radius:this.radius,height:this.height,extrudedHeight:this.extrudedHeight,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid),granularity:_(),numberOfVerticalLines:this.numberOfVerticalLines}),attributes:{color:this.outlineColor?d.ColorGeometryInstanceAttribute.fromColor(at(this.outlineColor,o)):v},id:this}),C=ve({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),x=ve({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!x||!C){console.warn("modelMatrix is undefined!");return}const P=d.Matrix4.inverseTransformation(C,new d.Matrix4);d.Matrix4.multiply(x,P,w.modelMatrix),m.push(w);const b=new d.Primitive({geometryInstances:m,appearance:g,asynchronous:!1,allowPicking:this.allowPicking??fp.defaults.allowPicking,compressVertices:!1});return d.Primitive.prototype&&(b.ESSceneObjectID=n),b},a=()=>{if(this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const f=Gt(this.position);f&&(this._primitive=s(f),this._primitive&&r.scene.primitives.add(this._primitive))},c=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};a(),c();const h=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.outlineColorChanged,this.translucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.rotationChanged));this.dispose(h.disposableOn(()=>{a(),c()}));const p=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}const f=r.scene.camera.positionCartographic.height;dt(r,this.position,f,void 0,1e3)}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}};y(fp,"defaults",{show:!0,translucent:!0,allowPicking:!1,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1,numberOfVerticalLines:0});let Os=fp;(i=>{i.createDefaultProps=()=>({show:!0,translucent:void 0,allowPicking:void 0,outlineColor:l.reactArrayWithUndefined(void 0),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,ellipsoid:void 0,granularity:void 0,numberOfVerticalLines:void 0})})(Os||(Os={})),l.extendClassProps(Os.prototype,Os.createDefaultProps);class qa extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));if(!t.viewer)return;const o=this.ad(new Ns(t,n)),s=this.ad(new Ls(t,n)),a=this.ad(new Os(t,n));this.dispose(l.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([o,"instances"],[this,"instances"])),this.dispose(l.track([s,"instances"],[this,"instances"]));{const c=()=>{const p=this.show??!0,f=this.ground??!1,g=this.outline??!1;a.show=p&&!f&&g,o.show=p&&!f,a.show?a.position=this.position:a.position=void 0,o.show?o.position=this.position:o.position=void 0,o.rotation=a.rotation=this.rotation,a.radius=o.radius=this.radius,a.extrudedHeight=o.extrudedHeight=this.extrudedHeight,this.position&&(a.height=o.height=this.position[2]),this.granularity===0&&(console.error("granularity不能设置为0"),this.granularity=1),o.granularity=a.granularity=this.granularity,o.ellipsoid=a.ellipsoid=this.ellipsoid,o.material=this.material,o.stRotation=this.stRotation,a.outlineColor=this.outlineColor,a.translucent=this.outlineTranslucent,a.numberOfVerticalLines=this.numberOfVerticalLines,s.show=p&&f,s.show?s.position=this.position:s.position=void 0,s.radius=this.radius,this.granularity===0?(console.error("granularity不能设置为0"),s.granularity=1):s.granularity=this.granularity,s.rotation=this.rotation,s.ellipsoid=this.ellipsoid,s.material=this.material,s.stRotation=this.stRotation};c();const h=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.radiusChanged,this.outlineChanged,this.extrudedHeightChanged,this.materialChanged,this.positionChanged,this.outlineColorChanged,this.stRotationChanged,this.outlineTranslucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.groundChanged,this.rotationChanged));this.dispose(h.disposableOn(c)),this.dispose(this.flyToEvent.disposableOn(p=>{this.ground?s.flyTo(p):o.flyTo(p)}))}}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}y(qa,"defaults",{extrudedHeight:void 0}),(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,outline:!0,outlineTranslucent:!0,extrudedHeight:void 0,outlineColor:l.reactArray([1,1,1,1]),material:l.reactJson({type:"Color",color:[1,1,1,.5]}),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),radius:0,stRotation:0,ellipsoid:l.reactArray([6378137,6378137,6356752314245179e-9]),granularity:1,numberOfVerticalLines:0,instances:l.reactArrayWithUndefined([])})})(qa||(qa={})),l.extendClassProps(qa.prototype,qa.createDefaultProps);class th extends l.Destroyable{constructor(t,n){super();y(this,"_primitive");y(this,"_flyToEvent",this.dv(new l.Event));const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}if(!$e(t.viewer))return;const s=d.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),a=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.d(a);const c=()=>{const P={baseWaterColor:at(this.waterColor),normalMap:s,frequency:this.frequency,animationSpeed:this.waveVelocity,amplitude:this.amplitude,specularIntensity:this.specularIntensity};return new d.Material({fabric:{type:"Water",uniforms:P}})},h=()=>{if(!this.points)return;const P={positions:this.points},b=new d.PolygonGeometry({polygonHierarchy:Bo(P),vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat,height:this.height});return new d.GeometryInstance({geometry:b,id:this})},p=()=>{if(!this.points)return;const P=new d.EllipsoidSurfaceAppearance({material:c(),aboveGround:!0}),b=h();let A;return this.ground??!1?A=new d.GroundPrimitive({geometryInstances:b,appearance:P,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}):A=new d.Primitive({geometryInstances:b,appearance:P,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}),d.Primitive.prototype&&d.GroundPrimitive.prototype&&(A.ESSceneObjectID=n),A},f=new d.BoundingSphere,g=()=>{a(),m(f),this._primitive=p(),this._primitive&&r.scene.primitives.add(this._primitive)},m=P=>{if(!this.points)return;const b=Wi(this.points);if(b.length<3){P.radius=-1;return}d.BoundingSphere.fromPoints(b,P)},v=()=>{const P=this.show??!0;this._primitive&&(this._primitive.show=P)},_=()=>{g(),v()};_();let w=l.debounce(_,500);const C=this.dv(l.createNextAnimateFrameEvent(this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.specularIntensityChanged,this.waveVelocityChanged,this.groundChanged,this.allowPickingChanged));this.d(C.don(_));const x=this.dv(l.createNextAnimateFrameEvent(this.pointsChanged,this.heightChanged));this.d(x.don(()=>{if(!this.points){a();return}this._primitive&&!this.ground?(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=h(),m(f),w&&w[0]()):_()})),this.d(this.showChanged.don(v)),this.d(this.flyToEvent.don(P=>{if(f.radius>0){const b=xt(f.center);b&&dt(r,b,f.radius*4,void 0,P)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:!0,points:l.reactPositions(void 0),height:void 0,allowPicking:!0,ground:!1,waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,baseWaterImage:l.reactJsonWithUndefined(void 0),flowSpeed:0})})(th||(th={})),l.extendClassProps(th.prototype,th.createDefaultProps);class $a extends l.Destroyable{constructor(t,n){super();y(this,"_primitive");y(this,"_flyToEvent",this.dv(new l.Event));y(this,"_updateBoundingSphereEvent",this.ad(new l.Event));const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=new d.BoundingSphere,s=()=>{this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0};this.d(s);const a=P=>l.ESSceneObject.context.getStrFromEnv(P),c=()=>{this._primitive=new d[this.ground?"GroundPrimitive":"Primitive"]({compressVertices:!1,asynchronous:!1,allowPicking:this.allowPicking,geometryInstances:g()}),d.Primitive.prototype&&(this._primitive.ESSceneObjectID=n),r.scene.primitives.add(this._primitive)},h=()=>{var T;const P=a(this.normalMap??d.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")),b={baseWaterColor:at(this.waterColor??[.25,.6,1,.7]),normalMap:P,frequency:this.frequency,animationSpeed:this.animationSpeed,amplitude:this.amplitude,specularIntensity:this.specularIntensity};if(this.blendColor&&(b.blendColor=at(this.blendColor)),this.specularMap&&(b.specularMap=a(this.specularMap)),this.points&&this.points.length>=1){const{maxPos:R,minPos:F}=l.getMinMaxCorner(this.points),B=l.getDistancesFromPositions([F,[R[0],R[1],F[2]]],"GEODESIC")[0],V=l.getDistancesFromPositions([F,[F[0],R[1],R[2]]],"GEODESIC")[0];this.baseWaterImage&&(this.baseWaterImage.url&&(b.baseWaterImage=a(this.baseWaterImage.url)),this.baseWaterImage.uDis&&(b.repeatX=B/this.baseWaterImage.uDis),this.baseWaterImage.vDis&&(b.repeatY=V/this.baseWaterImage.vDis)),b.flowSpeed=this.flowSpeed/(((T=this.baseWaterImage)==null?void 0:T.uDis)??B)}if(this._primitive&&this._primitive.appearance){this._primitive.appearance.material.uniforms=Object.assign({},this._primitive.appearance.material.uniforms,b);return}const A=new d.EllipsoidSurfaceAppearance({material:TC(b),aboveGround:!0});this._primitive&&(this._primitive.appearance=A)},p=this.ad(l.createNextAnimateFrameEvent(this.baseWaterImageChanged,this.waterColorChanged,this.blendColorChanged,this.specularMapChanged,this.flowSpeedChanged,this.normalMapChanged,this.frequencyChanged,this.animationSpeedChanged,this.amplitudeChanged,this.specularIntensityChanged));this.ad(p.don(h));const f=P=>{if(!this.points)return;const b=Wi(this.points);if(b.length<3){P.radius=-1;return}d.BoundingSphere.fromPoints(b,P)},g=()=>{if(!this.points||this.points.length<3)return;const{minPos:P}=l.getMinMaxCorner(this.points),[b]=pi({originPosition:P},this.points),{minPos:A,maxPos:T}=l.getMinMaxCorner(b),R=T[0]-A[0],F=T[1]-A[1],B={positions:this.points},V=new d.PolygonGeometry({polygonHierarchy:Bo(B),vertexFormat:d.VertexFormat.DEFAULT,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),perPositionHeight:!0,attributes:{st:new d.GeometryAttribute({componentDatatype:d.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(b.map(O=>[d.Math.clamp(O[0]/R,0,1),d.Math.clamp(O[1]/F,0,1)]).flat())})}});return new d.GeometryInstance({id:this,geometry:V})},m=()=>{this._primitive&&(this._primitive.show=this.show??!0)},v=this.ad(l.createNextAnimateFrameEvent(this.showChanged));this.ad(v.don(m));const _=this.ad(()=>{s(),c(),m(),h(),f(o)});_();const w=this.ad(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.groundChanged));this.ad(w.don(_)),this.ad(new l.ObjResettingWithEvent(this.updateBoundingSphereEvent,P=>{const b=new l.Destroyable;return P?b.ad(r.scene.preUpdate.addEventListener(()=>{const A=r.camera;r.camera.frustum.computeCullingVolume(A.position,A.direction,A.up).computeVisibility(o)===d.Intersect.OUTSIDE&&_()})):(_(),b.ad(this.pointsChanged.don(_))),b}));const C=()=>{if(!this.points||this.points.length<3){_();return}this._primitive instanceof d.Primitive?(this._primitive._state=3,this._primitive._appearance=void 0):this._primitive._primitive=void 0,this._primitive.geometryInstances=g(),this._primitive._recomputeBoundingSpheres=!0},x=this.dv(l.createNextAnimateFrameEvent(this.pointsChanged,this.stRotationChanged));this.d(x.don(C)),this.d(this.flyToEvent.don(P=>{if(o.radius>0){const b=xt(o.center);b&&dt(r,b,o.radius*4,void 0,P)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get updateBoundingSphereEvent(){return this._updateBoundingSphereEvent}updateBoundingSphere(t){this._updateBoundingSphereEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:!0,points:l.reactPositions(void 0),allowPicking:!0,waterColor:[.1497,.165,.0031,1],blendColor:l.reactArrayWithUndefined(void 0),specularMap:void 0,normalMap:d.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),frequency:1e3,animationSpeed:.005,amplitude:10,specularIntensity:.3,baseWaterImage:l.reactJsonWithUndefined(void 0),flowSpeed:0,stRotation:void 0,ground:void 0})})($a||($a={})),l.extendClassProps($a.prototype,$a.createDefaultProps);class Xa extends l.Destroyable{constructor(t,n){super();y(this,"pointPrimitives");y(this,"_flyToEvent",this.dv(new l.Event));const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}if(!$e(t.viewer))return;let{pointPrimitives:s}=this;const a=()=>{s&&(s.removeAll(),r.scene.primitives.remove(s),s=void 0)};this.d(a);const c=()=>{const v=new d.PointPrimitiveCollection({show:this.show??!0,debugShowBoundingVolume:this.debugShowBoundingVolume??!1,blendOption:(this.blendOption&&M.czmPropMaps.blendOptionType[this.blendOption])??d.BlendOption.OPAQUE_AND_TRANSLUCENT});return this.pointPrimitiveOptions&&(this.pointPrimitiveOptions.forEach(w=>{v.add({show:w.show??!0,color:w.color&&at(w.color),disableDepthTestDistance:w.disableDepthTestDistance,distanceDisplayCondition:w.distanceDisplayCondition&&Uu(w.distanceDisplayCondition),outlineColor:w.outlineColor&&at(w.outlineColor),outlineWidth:w.outlineWidth,pixelSize:w.pixelSize,position:w.position&&Gt(w.position),scaleByDistance:w.scaleByDistance&&Cs(w.scaleByDistance),translucencyByDistance:w.translucencyByDistance&&Cs(w.translucencyByDistance)})}),d.PointPrimitiveCollection.prototype&&(v.ESSceneObjectID=n)),v},h=()=>{a(),s=c(),r.scene.primitives.add(s)};h();const p=this.dv(l.createNextAnimateFrameEvent(this.showChanged,this.debugShowBoundingVolumeChanged,this.blendOptionChanged)),f=()=>{s&&(s.show=this.show??!0,s.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,s.blendOption=(this.blendOption&&M.czmPropMaps.blendOptionType[this.blendOption])??d.BlendOption.OPAQUE_AND_TRANSLUCENT)};this.d(p.don(f));const g=this.dv(l.createNextAnimateFrameEvent(this.pointPrimitiveOptionsChanged));this.d(g.don(h));const m=new d.BoundingSphere;this.d(this.flyToEvent.don(v=>{if(!(!t.actived||!this.pointPrimitiveOptions))if(p.flush(),g.flush(),this.pointPrimitiveOptions.length===1){const _=this.pointPrimitiveOptions[0].position;if(!_)return;const w=r.scene.camera.positionCartographic.height;dt(r,_,w,void 0,v)}else{const _=this.pointPrimitiveOptions,w=[];_.forEach(x=>{x.position&&w.push(x.position)});const C=Wi(w);if(d.BoundingSphere.fromPoints(C,m),m.radius>0){const x=xt(m.center);x&&dt(r,x,m.radius*4,void 0,v)}}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:void 0,debugShowBoundingVolume:void 0,blendOption:void 0,pointPrimitiveOptions:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArrayWithUndefined(void 0),scale:l.reactArrayWithUndefined(void 0),localPosition:l.reactArrayWithUndefined(void 0),localRotation:l.reactArrayWithUndefined(void 0),localScale:l.reactArrayWithUndefined(void 0),localModelMatrix:l.reactArrayWithUndefined(void 0),modelMatrix:l.reactArrayWithUndefined(void 0)})})(Xa||(Xa={})),l.extendClassProps(Xa.prototype,Xa.createDefaultProps);class qD extends l.Destroyable{constructor(e,t){super();const n=t.viewer;if(!n)throw new Error("!viewer");const r=St.czmJulianDateToTimeStamp,o=St.getClockRange,s=St.getClockStep;{const a=()=>n.clockViewModel.startTime=d.JulianDate.fromDate(new Date(e.startTime??l.getDefaultValue(St.defaults.startTime)));a(),this.dispose(eo(n.clockViewModel,"startTime",c=>e.startTime=r(c))),this.dispose(e.startTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.stopTime=d.JulianDate.fromDate(new Date(e.stopTime??l.getDefaultValue(St.defaults.stopTime)));a(),this.dispose(eo(n.clockViewModel,"stopTime",c=>e.stopTime=r(c))),this.dispose(e.stopTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.currentTime=d.JulianDate.fromDate(new Date(e.currentTime??l.getDefaultValue(St.defaults.currentTime)));a(),this.dispose(eo(n.clockViewModel,"currentTime",c=>e.currentTime=r(c))),this.dispose(e.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.multiplier=e.multiplier??St.defaults.multiplier;a(),this.dispose(eo(n.clockViewModel,"multiplier",c=>{(e.multiplier??St.defaults.multiplier!==c)&&(e.multiplier=c)})),this.dispose(e.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockStep=d.ClockStep[e.clockStep??St.defaults.clockStep];a(),this.dispose(eo(n.clockViewModel,"clockStep",c=>{const h=s(c);(e.clockStep??St.defaults.clockStep!==h)&&(e.clockStep=h)})),this.dispose(e.clockStepChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockRange=d.ClockRange[e.clockRange??St.defaults.clockRange];a(),this.dispose(eo(n.clockViewModel,"clockRange",c=>{const h=o(c);(e.clockRange??St.defaults.clockRange!==h)&&(e.clockRange=h)})),this.dispose(e.clockRangeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.shouldAnimate=e.shouldAnimate??St.defaults.shouldAnimate;a(),this.dispose(eo(n.clockViewModel,"shouldAnimate",c=>{(e.shouldAnimate??St.defaults.shouldAnimate!==c)&&(e.shouldAnimate=c)})),this.dispose(e.shouldAnimateChanged.disposableOn(a))}}}const Ol=class Ol extends l.Destroyable{constructor(e){super(),this.disposeVar(new l.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled??Ol.defaults.enabled)return new qD(this,e)}))}};y(Ol,"czmJulianDateToTimeStamp",$D),y(Ol,"getClockRange",XD),y(Ol,"getClockStep",YD),y(Ol,"defaults",{enabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+24*60*60*1e3,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1});let St=Ol;(i=>{i.createDefaultProps=()=>({enabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0})})(St||(St={})),l.extendClassProps(St.prototype,St.createDefaultProps);function $D(i){return d.JulianDate.toDate(i).getTime()}function XD(i){if(i===d.ClockRange.CLAMPED)return"CLAMPED";if(i===d.ClockRange.LOOP_STOP)return"LOOP_STOP";if(i===d.ClockRange.UNBOUNDED)return"UNBOUNDED";throw new Error(`getClockRange error: ${i}`)}function YD(i){if(i===d.ClockStep.SYSTEM_CLOCK)return"SYSTEM_CLOCK";if(i===d.ClockStep.SYSTEM_CLOCK_MULTIPLIER)return"SYSTEM_CLOCK_MULTIPLIER";if(i===d.ClockStep.TICK_DEPENDENT)return"TICK_DEPENDENT";throw new Error(`clockStep未知类型: ${i}`)}function D(i){return i!=null}function X(i){this.name="DeveloperError",this.message=i;let e;try{throw new Error}catch(t){e=t.stack}this.stack=e}D(Object.create)&&(X.prototype=Object.create(Error.prototype),X.prototype.constructor=X),X.prototype.toString=function(){let i=`${this.name}: ${this.message}`;return D(this.stack)&&(i+=`
|
|
320
|
+
`;r.vertexShaderSource=o,r.fragmentShaderSource=s;const a={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}};r.renderState=a;const c=()=>{this.czmTextureId?r.uniformMap={myImage:{type:"texture",id:this.czmTextureId},myColor:this.color??[1,1,1,1]}:r.uniformMap={myImage:{type:"image",uri:l.ESSceneObject.context.getStrFromEnv(this.uri??"${earthsdk3-assets-script-dir}/assets/img/location.png")},myColor:this.color??[1,1,1,1]}};c(),this.dispose(this.uriChanged.disposableOn(c)),this.dispose(this.czmTextureIdChanged.disposableOn(c)),this.dispose(this.colorChanged.disposableOn(c)),this.dispose(l.bind([r,"show"],[this,"show"])),this.dispose(l.bind([r,"allowPicking"],[this,"allowPicking"])),this.dispose(l.bind([r,"position"],[this,"position"]));{const f=()=>{r.pixelSize=this.pixelSize};f(),this.dispose(this.pixelSizeChanged.disposableOn(f))}this.dispose(l.track([r,"maximumScale"],[this,"maximumScale"])),this.dispose(l.track([r,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(l.track([r,"viewDistanceDebug"],[this,"viewDistanceDebug"]));const h=()=>{const{scale:f=[1,1]}=this;r.scale=[this.useAxis.includes("X")?f[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?f[1]:1]};h(),this.dispose(this.scaleChanged.disposableOn(h));const p=()=>{const f=-(this.originRatioAndOffset[0]*this.size[0]+this.originRatioAndOffset[2]),g=this.originRatioAndOffset[1]*this.size[1]+this.originRatioAndOffset[3];r.localPosition=[this.useAxis.includes("X")?f:0,this.useAxis.includes("Y")?this.useAxis.includes("X")?g:f:0,this.useAxis.includes("Z")?g:0],r.localScale=[this.useAxis.includes("X")?this.size[0]:1,this.useAxis.includes("Y")?this.useAxis.includes("X")?this.size[1]:this.size[0]:1,this.useAxis.includes("Z")?this.size[1]:1]};{const f=()=>{const g={XY:[0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0,0],YZ:[0,0,0,0,0,-1,0,1,-1,0,1,0,0,0,0,0,0,-1,0,1,-1,0,1,0],XZ:[0,0,0,0,0,-1,1,0,-1,1,0,0,0,0,0,0,0,-1,1,0,-1,1,0,0]},m={XY:{min:[0,-1,0],max:[1,0,0]},YZ:{min:[0,0,-1],max:[0,1,0]},XZ:{min:[0,0,-1],max:[1,0,0]}};r.attributes={position:{typedArray:new Float32Array(g[this.useAxis??hp.defaults.useAxis]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,1]),componentsPerAttribute:2}},r.boundingVolume={type:"LocalAxisedBoundingBox",data:m[this.useAxis??hp.defaults.useAxis]},p()};f(),this.d(this.useAxisChanged.don(f))}this.dispose(this.originRatioAndOffsetChanged.disposableOn(p)),this.dispose(this.sizeChanged.disposableOn(p)),this.dispose(this.flyToEvent.disposableOn(f=>{r.flyTo(f)})),this.disposeVar(new l.ObjResettingWithEvent(this.rotationModeChanged,()=>new LD(t,this)))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get customPrimitive(){return this._customPrimitive}};y(hp,"defaults",{position:[0,0,0],viewDistanceRange:[1e3,1e4,3e4,6e4],useAxis:"XY"});let Go=hp;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",czmTextureId:"",position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),rotationWithCamera:!1,rotationMode:"WithProp",useAxis:"XY",size:l.reactArray([1,1]),scale:[1,1],maximumScale:Number.MAX_VALUE,minimumScale:Number.MIN_VALUE,pixelSize:50,color:l.reactArray([1,1,1,1]),originRatioAndOffset:l.reactArray([.5,1,0,0]),viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Go||(Go={})),l.extendClassProps(Go.prototype,Go.createDefaultProps);class LD extends l.Destroyable{constructor(e,t){super(),this._czmViewer=e,this._czmImageModel=t;const{customPrimitive:n,rotationMode:r}=this._czmImageModel;if(r==="WithProp")this.dispose(l.track([n,"rotation"],[this._czmImageModel,"rotation"]));else if(r==="WithCameraOnlyZ"){const o=()=>{const{rotation:s}=this._czmImageModel,a=this._czmViewer.getCameraInfo();a&&(n.rotation=[a.rotation[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),s[1],s[2]])};o(),this.dispose(this._czmViewer.cameraChanged.disposableOn(o)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(o))}else if(r==="WithCamera"){const o=()=>{const s=this._czmViewer.getCameraInfo();if(!s)return;const a=s.rotation;n.rotation=[a[0]+(this._czmImageModel.useAxis.includes("YZ")?90:0),a[1]+(this._czmImageModel.useAxis.includes("Z")?0:90),a[2]]};o(),this.dispose(this._czmViewer.cameraChanged.disposableOn(o)),this.dispose(this._czmImageModel.rotationChanged.disposableOn(o))}}}class Wa extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");y(this,"_id",this.disposeVar(l.react(l.createGuid())));n&&(this.id=n);const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}if(!$e(t.viewer))return;const s=this.disposeVar(Nr([this,"material"])),a=this.disposeVar(l.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,s.changed)),c=this.disposeVar(new l.ObjResettingWithEvent(a,()=>{if(s.value)return new OD(t,r,this,s.value)}));this.dispose(this.flyToEvent.disposableOn(h=>{t.actived&&(a.flush(),c.obj&&c.obj.flyTo(h))}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get id(){return this._id.value}set id(t){this._id.value=t}get idChanged(){return this._id.changed}}(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,arcType:"GEODESIC",material:l.reactJson({type:"Color"}),stRotation:0,polygonHierarchy:l.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:1,perPositionHeight:!1,closeTop:!0,closeBottom:!0})})(Wa||(Wa={})),l.extendClassProps(Wa.prototype,Wa.createDefaultProps);class OD extends l.Destroyable{constructor(t,n,r,o){super();y(this,"_boundingSphere");this._czmViewer=t,this._viewer=n,this._sceneObject=r,this._material=o;const s=this._sceneObject,a=this._material,c=this._viewer;if(!s.polygonHierarchy)return;const h=new d.BoundingSphere,p=Wi(s.polygonHierarchy.positions);p.length<3?(h.radius=-1,this._boundingSphere=void 0):(d.BoundingSphere.fromPoints(p,h),this._boundingSphere=h);const f=new d.MaterialAppearance({material:a}),g=[],m=new d.GeometryInstance({geometry:new d.PolygonGeometry({vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Bo(s.polygonHierarchy),stRotation:s.stRotation&&d.Math.toRadians(s.stRotation),arcType:s.arcType&&d.ArcType[s.arcType],height:s.height,extrudedHeight:s.extrudedHeight,perPositionHeight:s.perPositionHeight,closeTop:s.closeTop,closeBottom:s.closeBottom,ellipsoid:s.ellipsoid&&Wt(s.ellipsoid),granularity:s.granularity!==void 0?d.Math.toRadians(s.granularity):void 0}),id:this});g.push(m);const v=new d.GroundPrimitive({geometryInstances:g,appearance:f,asynchronous:!1,allowPicking:s.allowPicking,compressVertices:!1});d.GroundPrimitive.prototype&&(v.ESSceneObjectID=r.id),c.scene.primitives.add(v),this.dispose(()=>c.scene.primitives.remove(v));{const _=()=>{v.show=s.show};_(),this.dispose(s.showChanged.disposableOn(_))}this.disposeVar(new ne.ObjectsToExcludeWrapper(this._czmViewer,v))}flyTo(t){const n=this._boundingSphere;if(n&&n.radius>0){const r=xt(n.center);r&&dt(this._viewer,r,n.radius*4,void 0,t)}}}class BD extends l.Destroyable{constructor(t,n){super();y(this,"_groundPolygonPrimitive");this._groundPolygonPrimitive=this.disposeVar(new Wa(n,t.id));const r=this._groundPolygonPrimitive;{const o=()=>{const a=t.show,c=t.fill;r.show=a&&c&&t.visibleAlpha>0,r.polygonHierarchy=r.show?{positions:t.positions||[]}:{positions:[]},r.material={type:"Color",color:t.color||[1,1,1,.5]}};o();const s=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.fillChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.depthChanged,t.visibleAlphaChanged));this.dispose(s.disposableOn(o))}this.dispose(l.track([r,"allowPicking"],[t,"allowPicking"]))}get groundPolygonPrimitive(){return this._groundPolygonPrimitive}}class zD extends l.Destroyable{constructor(t,n,r){super();y(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new ee(n,t.id));const o=this._geoPolyline;o.arcType="GEODESIC",o.loop=!0;{const s=()=>{const c=t.show,h=t.outline;if(o.show=c&&h&&t.visibleAlpha>0,o.show&&t.positions&&t.positions.length>1){const p=t.positions[0][2];o.positions=t.positions.map(f=>[f[0],f[1],p])}else o.positions=void 0;o.color=t.outlineColor,o.width=t.outlineWidth};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"])),this.dispose(l.track([o,"ground"],[t,"strokeGround"]))}get geoPolyline(){return this._geoPolyline}}class VD extends l.Destroyable{constructor(t,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=t.ground;this._innerPolygon=this.disposeVar(new BD(t,n)),this._bottomPolyline=this.disposeVar(new zD(t,n,r)),this.dispose(t.flyToEvent.disposableOn(o=>{if(t.viewDistanceRange){const s=t.positionsCenter.center,a=(t.viewDistanceRange[1]+t.viewDistanceRange[2])/2;dt(n.viewer,s,a,void 0,o)}else{const s=t.positionsCenter.center;if(!t.positions)return;const a=[s[0],s[1],t.positions[0][2]],c=t.positionsCenter.radius*4;dt(n.viewer,a,c,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}class Rs extends l.Destroyable{constructor(t,n){super();y(this,"_positions",this.disposeVar(l.reactPositions(void 0)));y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");this.d(this.polygonHierarchyChanged.don(()=>{this.polygonHierarchy?this.positions=this.polygonHierarchy.positions:this.positions=void 0})),this.d(this.positionsChanged.don(()=>{this.positions?this.polygonHierarchy.positions=[...this.positions]:this.polygonHierarchy={positions:[]}}));const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(Nr([this,"material"])),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=m=>{if(!this.polygonHierarchy)return;const v=new d.MaterialAppearance({material:m}),_=[],w=new d.GeometryInstance({geometry:new d.PolygonGeometry({vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Bo(this.polygonHierarchy),stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),arcType:this.arcType&&d.ArcType[this.arcType],height:this.height,extrudedHeight:this.extrudedHeight,perPositionHeight:this.perPositionHeight,closeTop:this.closeTop,closeBottom:this.closeBottom,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid),granularity:this.granularity!==void 0?d.Math.toRadians(this.granularity):void 0}),id:this});_.push(w);const C=new d.Primitive({geometryInstances:_,appearance:v,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return d.Primitive.prototype&&(C.ESSceneObjectID=n),C},c=new d.BoundingSphere,h=()=>{if(s(),!this.polygonHierarchy)return;const m=Wi(this.polygonHierarchy.positions);if(m.length<3||!o.value){c.radius=-1;return}d.BoundingSphere.fromPoints(m,c),this._primitive=a(o.value),this._primitive&&r.scene.primitives.add(this._primitive)},p=()=>{const m=this.show??!0;this._primitive&&(this._primitive.show=m)};h(),p();const f=this.disposeVar(l.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.materialChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,o.changed));this.dispose(f.disposableOn(()=>{h(),p()}));const g=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(g.disposableOn(()=>{p()})),this.dispose(this.flyToEvent.disposableOn(m=>{if(t.actived&&(f.flush(),g.flush(),c.radius>0)){const v=xt(c.center),_=this.height??0,w=this.extrudedHeight??0,C=Math.max(_,w),x=c.radius<C?C:c.radius;v&&dt(r,v,x*4,void 0,m)}}))}get positions(){return this._positions.value}get positionsChanged(){return this._positions.changed}set positions(t){this._positions.value=t}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}y(Rs,"defaults",{positions:[]}),(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,material:l.reactJson({type:"Color"}),stRotation:void 0,polygonHierarchy:l.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0})})(Rs||(Rs={})),l.extendClassProps(Rs.prototype,Rs.createDefaultProps);class tx extends l.Destroyable{constructor(t,n,r,o){super();y(this,"_czmInnerPolygonPrimitive");this._czmInnerPolygonPrimitive=this.disposeVar(new Rs(n,t.id));const s=this._czmInnerPolygonPrimitive;{const a=()=>{const h=t.show,p=t.fill;if(s.show=h&&p&&t.visibleAlpha>0,t.positions&&t.positions.length>0&&!o?s.height=t.positions[0][2]:s.height=void 0,s.polygonHierarchy=s.show?{positions:t.positions||[]}:{positions:[]},s.material={type:"Color",color:t.color||[1,1,1,.5]},r){if(t.depth===void 0)throw new Error("sceneObject.depth === undefined");s.extrudedHeight=(s.height??0)+t.depth}};a();const c=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.fillChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.depthChanged,t.visibleAlphaChanged));this.dispose(c.disposableOn(a))}this.dispose(l.track([s,"allowPicking"],[t,"allowPicking"]))}get czmInnerPolygonPrimitive(){return this._czmInnerPolygonPrimitive}}class ex extends l.Destroyable{constructor(t,n,r){super();y(this,"_geoPolyline");this._geoPolyline=this.disposeVar(new ee(n,t.id));const o=this._geoPolyline;o.arcType="GEODESIC",o.loop=!0,this.dispose(l.bind([o,"depthTest"],[t,"depthTest"])),this.dispose(l.bind([o,"ground"],[t,"strokeGround"]));{const s=()=>{const c=t.show,h=t.outline;if(o.show=c&&h&&t.visibleAlpha>0,o.show&&t.positions&&t.positions.length>1){const p=t.positions[0][2];o.positions=t.positions.map(f=>[f[0],f[1],p])}else o.positions=void 0;o.color=t.outlineColor,o.width=t.outlineWidth};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,t.outlineChanged,t.outlineColorChanged,t.outlineWidthChanged,t.colorChanged,t.positionsChanged,t.visibleAlphaChanged));this.dispose(a.disposableOn(s))}this.dispose(l.track([o,"allowPicking"],[t,"allowPicking"]))}get geoPolyline(){return this._geoPolyline}}class UD extends l.Destroyable{constructor(e,t){super();const n=this.disposeVar(new rr(t,e.id));n.arcType="GEODESIC",this.dispose(l.track([n,"allowPicking"],[e,"allowPicking"])),this.dispose(l.bind([n,"depthTest"],[e,"depthTest"]));{const r=()=>{if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=e.show,a=e.outline;n.show=s&&a&&e.visibleAlpha>0,n.color=e.outlineColor,n.width=e.outlineWidth;let c;if(n.show&&e.positions&&e.positions.length>1){const p=e.positions[0][2];c=e.positions.map(f=>[f[0],f[1],p])}let h;if(e.positions&&e.positions.length>0?h=e.positions[0][2]:h=void 0,n.show&&c){const p=h,f=(h??0)+e.depth;n.positions=c.map(g=>[[g[0],g[1],p],[g[0],g[1],f]])}else n.positions=void 0};r();const o=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(o.disposableOn(r))}}}class GD extends l.Destroyable{constructor(e,t){super();const n=this.disposeVar(new ee(t,e.id));n.arcType="GEODESIC",n.loop=!0,this.dispose(l.track([n,"allowPicking"],[e,"allowPicking"])),this.dispose(l.bind([n,"depthTest"],[e,"depthTest"]));{const r=()=>{if(e.depth===void 0)throw new Error("sceneObject.depth === undefined");const s=e.show,a=e.outline;n.show=s&&a&&e.visibleAlpha>0,n.color=e.outlineColor,n.width=e.outlineWidth;let c;if(n.show&&e.positions&&e.positions.length>1){const p=e.positions[0][2];c=e.positions.map(f=>[f[0],f[1],p])}let h;if(e.positions&&e.positions.length>0?h=e.positions[0][2]:h=void 0,n.show&&c){const p=(h??0)+e.depth;n.positions=c.map(f=>[f[0],f[1],p])}else n.positions=void 0};r();const o=this.disposeVar(l.createNextAnimateFrameEvent(e.showChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.visibleAlphaChanged));this.dispose(o.disposableOn(r))}}}class WD extends l.Destroyable{constructor(t,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=t.ground;this._innerPolygon=this.disposeVar(new tx(t,n,!0,r)),this._bottomPolyline=this.disposeVar(new ex(t,n,r)),this.disposeVar(new UD(t,n)),this.disposeVar(new GD(t,n)),this.dispose(t.flyToEvent.disposableOn(o=>{if(t.viewDistanceRange){const s=t.positionsCenter.center,a=(t.viewDistanceRange[1]+t.viewDistanceRange[2])/2;dt(n.viewer,s,a,void 0,o)}else{const s=t.positionsCenter.center;if(!t.positions)return;const a=[s[0],s[1],t.positions[0][2]],c=t.positionsCenter.radius*4;dt(n.viewer,a,c,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}}let HD=class extends l.Destroyable{constructor(t,n){super();y(this,"_innerPolygon");y(this,"_bottomPolyline");const r=t.ground;this._innerPolygon=this.disposeVar(new tx(t,n,!1,r)),this._bottomPolyline=this.disposeVar(new ex(t,n,r)),this.dispose(t.flyToEvent.disposableOn(o=>{if(t.viewDistanceRange){const s=t.positionsCenter.center,a=(t.viewDistanceRange[1]+t.viewDistanceRange[2])/2;dt(n.viewer,s,a,void 0,o)}else{const s=t.positionsCenter.center;if(!t.positions)return;const a=[s[0],s[1],t.positions[0][2]],c=t.positionsCenter.radius*4;dt(n.viewer,a,c,void 0,o)}}))}get innerPolygon(){return this._innerPolygon}get bottomPolyline(){return this._bottomPolyline}};class Fs extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_polygonOrGroundPolygonResetting");y(this,"_czmViewVisibleDistanceRangeControl");y(this,"_id",this.disposeVar(l.react(l.createGuid())));y(this,"_positionsCenter");this._positionsCenter=this.ad(new tv(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new Ma(t,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(l.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"]));const r=this.disposeVar(l.createNextAnimateFrameEvent(this.groundChanged,this.depthChanged,this.strokeGroundChanged));this._polygonOrGroundPolygonResetting=this.disposeVar(new l.ObjResettingWithEvent(r,()=>this.ground?new VD(this,t):this.depth!==void 0&&this.depth>0?new WD(this,t):new HD(this,t)))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get polygonOrGroundPolygonResetting(){return this._polygonOrGroundPolygonResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(t){this._id.value=t}get idChanged(){return this._id.changed}get positionsCenter(){return this._positionsCenter}}y(Fs,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,strokeGround:!1,outline:!0,outlineColor:l.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:l.reactArray([1,1,1,.5]),positions:l.reactPositions(void 0),depth:0,zIndex:0,viewDistanceRange:l.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(Fs||(Fs={})),l.extendClassProps(Fs.prototype,Fs.createDefaultProps);class Ju extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(Nr([this,"material"])),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(g,m)=>{const v=new d.MaterialAppearance({material:m}),_=[],w=new d.GeometryInstance({geometry:new d.RectangleGeometry({rectangle:g,height:this.height,rotation:this.rotation&&d.Math.toRadians(this.rotation),extrudedHeight:this.extrudedHeight,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});_.push(w);const C=new d.Primitive({geometryInstances:_,appearance:v,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return d.Primitive.prototype&&(C.ESSceneObjectID=n),C},c=()=>{if(s(),!this.positions)return;const g=oe(this.positions);!g||!o.value||(this._primitive=a(g,o.value),this._primitive&&r.scene.primitives.add(this._primitive))},h=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};c(),h();const p=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.extrudedHeightChanged,this.heightChanged,this.stRotationChanged,this.rotationChanged,o.changed,this.allowPickingChanged));this.dispose(p.disposableOn(()=>{c(),h()}));const f=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(!t.actived||!this.positions)return;const m=oe(this.positions),v=d.BoundingSphere.fromRectangle3D(m,void 0,this.height);if(v.radius>0){const _=xt(v.center);_&&dt(r,_,v.radius*4,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),positions:l.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,stRotation:void 0})})(Ju||(Ju={})),l.extendClassProps(Ju.prototype,Ju.createDefaultProps);const Mm=class Mm extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=this.disposeVar(Nr([this,"material"],Mm.defaults.material)),s=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(s);const a=(g,m)=>{const v=new d.MaterialAppearance({material:m}),_=[],w=new d.GeometryInstance({geometry:new d.RectangleGeometry({rectangle:g,rotation:this.rotation&&d.Math.toRadians(this.rotation),stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat}),id:this});_.push(w);const C=new d.GroundPrimitive({geometryInstances:_,appearance:v,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return d.GroundPrimitive.prototype&&(C.ESSceneObjectID=n),C},c=()=>{if(s(),!this.positions)return;const g=oe(this.positions);!g||!o.value||(this._primitive=a(g,o.value),this._primitive&&r.scene.primitives.add(this._primitive))},h=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};c(),h();const p=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.materialChanged,this.stRotationChanged,this.rotationChanged,o.changed,this.allowPickingChanged));this.dispose(p.disposableOn(()=>{c(),h()}));const f=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(!t.actived||!this.positions)return;const m=oe(this.positions),v=d.BoundingSphere.fromRectangle3D(m,void 0,0);if(v.radius>0){const _=xt(v.center);_&&dt(r,_,v.radius*4,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}};y(Mm,"defaults",{material:{type:"Color",color:[1,1,1,.5]}});let Ha=Mm;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),positions:l.reactArrayWithUndefined(void 0),rotation:void 0,stRotation:void 0})})(Ha||(Ha={})),l.extendClassProps(Ha.prototype,Ha.createDefaultProps);class ju extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.dispose(o);const s=new d.Color,a=g=>{const m=new d.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),v=[],_=new d.GeometryInstance({geometry:new d.RectangleOutlineGeometry({rectangle:g,height:this.height??0,extrudedHeight:this.extrudedHeight,rotation:this.rotation&&d.Math.toRadians(this.rotation)}),attributes:{color:this.color?d.ColorGeometryInstanceAttribute.fromColor(at(this.color,s)):d.ColorGeometryInstanceAttribute.fromColor(new d.Color(1,1,1,1))},id:this});v.push(_);const w=new d.Primitive({geometryInstances:v,appearance:m,asynchronous:!1,allowPicking:this.allowPicking??!1,compressVertices:!1});return d.Primitive.prototype&&(w.ESSceneObjectID=n),w},c=()=>{if(o(),!this.positions)return;const g=oe(this.positions);g&&(this._primitive=a(g),this._primitive&&r.scene.primitives.add(this._primitive))},h=()=>{const g=this.show??!0;this._primitive&&(this._primitive.show=g)};c(),h();const p=this.disposeVar(l.createNextAnimateFrameEvent(this.positionsChanged,this.colorChanged,this.translucentChanged,this.extrudedHeightChanged,this.heightChanged,this.rotationChanged,this.allowPickingChanged));this.dispose(p.disposableOn(()=>{c(),h()}));const f=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(f.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(g=>{if(!t.actived||!this.positions)return;const m=oe(this.positions),v=d.BoundingSphere.fromRectangle3D(m,void 0,this.height);if(v.radius>0){const _=xt(v.center);_&&dt(r,_,v.radius*4,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,translucent:void 0,color:l.reactArrayWithUndefined(void 0),height:void 0,extrudedHeight:void 0,rotation:void 0,positions:l.reactArrayWithUndefined(void 0)})})(ju||(ju={})),l.extendClassProps(ju.prototype,ju.createDefaultProps);const pp=class pp extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));if(!t.viewer)return;const o=this.ad(new Ju(t,n)),s=this.ad(new Ha(t,n)),a=this.ad(new ju(t,n));this.dispose(l.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"]));{const c=()=>{const p=this.show??!0,f=this.ground??!1,g=this.outline??!1;a.show=p&&!f&&g,o.show=p&&!f,a.show?a.positions=this.rectangle:a.positions=void 0,o.show?o.positions=this.rectangle:o.positions=void 0,a.rotation=o.rotation=this.rotation,o.material=this.material??pp.defaults.material,o.stRotation=this.stRotation,a.extrudedHeight=o.extrudedHeight=this.extrudedHeight,a.height=o.height=this.height,a.color=this.outlineColor,a.translucent=this.outlineTranslucent,s.show=p&&f,s.show?s.positions=this.rectangle:s.positions=void 0,s.rotation=this.rotation,s.material=this.material??pp.defaults.material,s.stRotation=this.stRotation};c();const h=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.heightChanged,this.extrudedHeightChanged,this.materialChanged,this.rectangleChanged,this.outlineColorChanged,this.stRotationChanged,this.rotationChanged,this.outlineTranslucentChanged,this.groundChanged));this.dispose(h.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(p=>{this.ground?s.flyTo(p):o.flyTo(p)}))}}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}};y(pp,"defaults",{material:{type:"Color",color:[1,1,1,.5]},rectangle:void 0,extrudedHeight:void 0});let oo=pp;(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outlineTranslucent:!0,outline:!1,outlineColor:l.reactArray([1,1,1,1]),height:0,extrudedHeight:void 0,material:l.reactJsonWithUndefined(void 0),rectangle:l.reactArrayWithUndefined(void 0),rotation:0,stRotation:0})})(oo||(oo={})),l.extendClassProps(oo.prototype,oo.createDefaultProps);const dp=class dp extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");this.czmViewer=t,this.id=n;const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this.clear()});const o=this.disposeVar(Nr([this,"material"])),s=()=>{this.clear(),!(!this.position||!o.value)&&(this._primitive=this.createPrimitive(o.value),this._primitive&&r.scene.primitives.add(this._primitive),this.updateShow())};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.ellipsoidChanged,this.granularityChanged,this.stRotationChanged,o.changed,this.instancesChanged,this.rotationChanged));this.dispose(a.disposableOn(()=>{s()})),this.dispose(this.showChanged.disposableOn(()=>{this.updateShow()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)dt(r,this.position,this.radius*4,void 0,1e3);else{const c=r.scene.camera.positionCartographic.height;dt(r,this.position,c,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}setGranularity(){let t=this.granularity??dp.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),t=t|0,t=Math.max(1,t),d.Math.toRadians(t)}createPrimitive(t){if(!this.position||!this.radius)return;const n=new d.MaterialAppearance({material:t}),r=[],o=this.setGranularity();if(this.instances&&this.instances.length>0)for(let a=0;a<this.instances.length;a++){const c=this.instances[a];r.push(this.createGeometry(c.position,c.rotation??this.rotation,c.radius??this.radius,c.id??this,c.position[2]??this.height,o))}else r.push(this.createGeometry(this.position,this.rotation,this.radius,this,this.height,o));const s=new d.Primitive({geometryInstances:r,appearance:n,asynchronous:r.length>1,allowPicking:this.allowPicking??dp.defaults.allowPicking,compressVertices:!1});return d.Primitive.prototype&&(s.ESSceneObjectID=this.id),s}createGeometry(t,n,r,o,s,a){const c=Gt(t),h=new d.GeometryInstance({geometry:new d.CircleGeometry({center:c,height:s,extrudedHeight:this.extrudedHeight,radius:r,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),vertexFormat:d.VertexFormat.ALL,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid),granularity:a}),id:o}),p=d.Transforms.eastNorthUpToFixedFrame(c),f=d.Matrix4.inverseTransformation(p,new d.Matrix4),g=d.Matrix4.multiplyByMatrix3(p,d.Matrix3.fromHeadingPitchRoll(d.HeadingPitchRoll.fromDegrees(n[0],n[1],n[2],new d.HeadingPitchRoll)),new d.Matrix4);return d.Matrix4.multiply(g,f,h.modelMatrix),h}updateShow(){this._primitive&&(this._primitive.show=!!this.show)}clear(){var t;this._primitive&&((t=this.czmViewer.viewer)==null||t.scene.primitives.remove(this._primitive),this._primitive=void 0)}};y(dp,"defaults",{show:!0,allowPicking:!1,translucent:!0,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Ns=dp;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJson({type:"Color"}),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,stRotation:void 0,ellipsoid:void 0,granularity:void 0,instances:l.reactArrayWithUndefined([])})})(Ns||(Ns={})),l.extendClassProps(Ns.prototype,Ns.createDefaultProps);const Ll=class Ll extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");this.czmViewer=t,this.id=n;const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this.clear()});const o=this.disposeVar(Nr([this,"material"],Ll.defaults.material)),s=()=>{if(this.clear(),!this.position||!this.radius||!o.value)return;const c=Gt(this.position);this._primitive=this.createPrimitive(c,o.value),this._primitive&&r.scene.groundPrimitives.add(this._primitive),this.updateShow()};s();const a=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.stRotationChanged,this.granularityChanged,this.ellipsoidChanged,this.materialChanged,this.instancesChanged,o.changed));this.dispose(a.disposableOn(()=>{s()})),this.dispose(this.showChanged.disposableOn(()=>{this.updateShow()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}if(this.radius)dt(r,this.position,this.radius*4,void 0,1e3);else{const c=r.scene.camera.positionCartographic.height;dt(r,this.position,c,void 0,1e3)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}clear(){var t;this._primitive&&((t=this.czmViewer.viewer)==null||t.scene.groundPrimitives.remove(this._primitive)),this._primitive=void 0}updateShow(){this._primitive&&(this._primitive.show=this.show??Ll.defaults.show)}createPrimitive(t,n){if(!t||!this.radius)return;const r=new d.MaterialAppearance({material:n}),o=[],s=this.setGranularity();if(this.instances&&this.instances.length>0)for(let c=0;c<this.instances.length;c++){const h=this.instances[c],p=new d.GeometryInstance({geometry:new d.CircleGeometry({center:Gt(h.position),radius:h.radius??this.radius,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),granularity:s,vertexFormat:d.VertexFormat.ALL,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid)}),id:h.id??this});o.push(p)}else{const c=new d.GeometryInstance({geometry:new d.CircleGeometry({center:t,radius:this.radius,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),granularity:s,vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid)}),id:this});o.push(c)}const a=new d.GroundPrimitive({geometryInstances:o,appearance:r,asynchronous:o.length>1,allowPicking:this.allowPicking??Ll.defaults.allowPicking,compressVertices:!1});return d.GroundPrimitive.prototype&&(a.ESSceneObjectID=this.id),a}setGranularity(){let t=this.granularity??Ll.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),t=t|0,t=Math.max(1,t),d.Math.toRadians(t)}};y(Ll,"defaults",{show:!0,allowPicking:!1,material:{type:"Color",color:[1,1,1,.5]},radius:0,stRotation:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1});let Ls=Ll;(i=>{i.createDefaultProps=()=>({show:void 0,allowPicking:void 0,material:l.reactJsonWithUndefined(void 0),granularity:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),radius:void 0,stRotation:void 0,ellipsoid:void 0,instances:l.reactArrayWithUndefined([])})})(Ls||(Ls={})),l.extendClassProps(Ls.prototype,Ls.createDefaultProps);const fp=class fp extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));y(this,"_primitive");const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}this.dispose(()=>{this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0});const o=new d.Color,s=f=>{if(!f||!this.radius)return;const g=new d.PerInstanceColorAppearance({flat:!0,translucent:this.translucent??!0}),m=[],v=d.ColorGeometryInstanceAttribute.fromColor(d.Color.WHITE),_=()=>{let A=this.granularity??fp.defaults.granularity;return this.granularity===0&&console.error("granularity不能设置为0"),A=A|0,A=Math.max(1,A),d.Math.toRadians(A)},w=new d.GeometryInstance({geometry:new d.CircleOutlineGeometry({center:f,radius:this.radius,height:this.height,extrudedHeight:this.extrudedHeight,ellipsoid:this.ellipsoid&&Wt(this.ellipsoid),granularity:_(),numberOfVerticalLines:this.numberOfVerticalLines}),attributes:{color:this.outlineColor?d.ColorGeometryInstanceAttribute.fromColor(at(this.outlineColor,o)):v},id:this}),C=ve({initialRotation:"yForwardzUp",rotation:[0,0,0],position:this.position}),x=ve({initialRotation:"yForwardzUp",rotation:this.rotation?[this.rotation[0],this.rotation[2],-this.rotation[1]]:[0,0,0],position:this.position});if(!x||!C){console.warn("modelMatrix is undefined!");return}const P=d.Matrix4.inverseTransformation(C,new d.Matrix4);d.Matrix4.multiply(x,P,w.modelMatrix),m.push(w);const b=new d.Primitive({geometryInstances:m,appearance:g,asynchronous:m.length>1,allowPicking:this.allowPicking??fp.defaults.allowPicking,compressVertices:!1});return d.Primitive.prototype&&(b.ESSceneObjectID=n),b},a=()=>{if(this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0,!this.position)return;const f=Gt(this.position);f&&(this._primitive=s(f),this._primitive&&r.scene.primitives.add(this._primitive))},c=()=>{const f=this.show??!0;this._primitive&&(this._primitive.show=f)};a(),c();const h=this.disposeVar(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.positionChanged,this.radiusChanged,this.extrudedHeightChanged,this.heightChanged,this.outlineColorChanged,this.translucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.rotationChanged));this.dispose(h.disposableOn(()=>{a(),c()}));const p=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged));this.dispose(p.disposableOn(()=>{c()})),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("GeoPoint当前没有位置信息,无法飞入!");return}const f=r.scene.camera.positionCartographic.height;dt(r,this.position,f,void 0,1e3)}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}};y(fp,"defaults",{show:!0,translucent:!0,allowPicking:!1,outlineColor:[1,1,1,1],position:[0,0,0],height:0,extrudedHeight:0,radius:0,ellipsoid:[6378137,6378137,6356752314245179e-9],granularity:1,numberOfVerticalLines:0});let Os=fp;(i=>{i.createDefaultProps=()=>({show:!0,translucent:void 0,allowPicking:void 0,outlineColor:l.reactArrayWithUndefined(void 0),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),height:void 0,extrudedHeight:void 0,radius:void 0,ellipsoid:void 0,granularity:void 0,numberOfVerticalLines:void 0})})(Os||(Os={})),l.extendClassProps(Os.prototype,Os.createDefaultProps);class qa extends l.Destroyable{constructor(t,n){super();y(this,"_flyToEvent",this.disposeVar(new l.Event));if(!t.viewer)return;const o=this.ad(new Ns(t,n)),s=this.ad(new Ls(t,n)),a=this.ad(new Os(t,n));this.dispose(l.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(l.track([o,"instances"],[this,"instances"])),this.dispose(l.track([s,"instances"],[this,"instances"]));{const c=()=>{const p=this.show??!0,f=this.ground??!1,g=this.outline??!1;a.show=p&&!f&&g,o.show=p&&!f,a.show?a.position=this.position:a.position=void 0,o.show?o.position=this.position:o.position=void 0,o.rotation=a.rotation=this.rotation,a.radius=o.radius=this.radius,a.extrudedHeight=o.extrudedHeight=this.extrudedHeight,this.position&&(a.height=o.height=this.position[2]),this.granularity===0&&(console.error("granularity不能设置为0"),this.granularity=1),o.granularity=a.granularity=this.granularity,o.ellipsoid=a.ellipsoid=this.ellipsoid,o.material=this.material,o.stRotation=this.stRotation,a.outlineColor=this.outlineColor,a.translucent=this.outlineTranslucent,a.numberOfVerticalLines=this.numberOfVerticalLines,s.show=p&&f,s.show?s.position=this.position:s.position=void 0,s.radius=this.radius,this.granularity===0?(console.error("granularity不能设置为0"),s.granularity=1):s.granularity=this.granularity,s.rotation=this.rotation,s.ellipsoid=this.ellipsoid,s.material=this.material,s.stRotation=this.stRotation};c();const h=this.disposeVar(l.createNextAnimateFrameEvent(this.showChanged,this.radiusChanged,this.outlineChanged,this.extrudedHeightChanged,this.materialChanged,this.positionChanged,this.outlineColorChanged,this.stRotationChanged,this.outlineTranslucentChanged,this.ellipsoidChanged,this.granularityChanged,this.numberOfVerticalLinesChanged,this.groundChanged,this.rotationChanged));this.dispose(h.disposableOn(c)),this.dispose(this.flyToEvent.disposableOn(p=>{this.ground?s.flyTo(p):o.flyTo(p)}))}}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}y(qa,"defaults",{extrudedHeight:void 0}),(i=>{i.createDefaultProps=()=>({show:!0,allowPicking:!1,ground:!1,outline:!0,outlineTranslucent:!0,extrudedHeight:void 0,outlineColor:l.reactArray([1,1,1,1]),material:l.reactJson({type:"Color",color:[1,1,1,.5]}),position:l.reactArrayWithUndefined(void 0),rotation:l.reactArray([0,0,0]),radius:0,stRotation:0,ellipsoid:l.reactArray([6378137,6378137,6356752314245179e-9]),granularity:1,numberOfVerticalLines:0,instances:l.reactArrayWithUndefined([])})})(qa||(qa={})),l.extendClassProps(qa.prototype,qa.createDefaultProps);class th extends l.Destroyable{constructor(t,n){super();y(this,"_primitive");y(this,"_flyToEvent",this.dv(new l.Event));const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}if(!$e(t.viewer))return;const s=d.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),a=()=>{this._primitive&&(r.scene.primitives.remove(this._primitive),this._primitive=void 0)};this.d(a);const c=()=>{const P={baseWaterColor:at(this.waterColor),normalMap:s,frequency:this.frequency,animationSpeed:this.waveVelocity,amplitude:this.amplitude,specularIntensity:this.specularIntensity};return new d.Material({fabric:{type:"Water",uniforms:P}})},h=()=>{if(!this.points)return;const P={positions:this.points},b=new d.PolygonGeometry({polygonHierarchy:Bo(P),vertexFormat:d.MaterialAppearance.MaterialSupport.ALL.vertexFormat,height:this.height});return new d.GeometryInstance({geometry:b,id:this})},p=()=>{if(!this.points)return;const P=new d.EllipsoidSurfaceAppearance({material:c(),aboveGround:!0}),b=h();let A;return this.ground??!1?A=new d.GroundPrimitive({geometryInstances:b,appearance:P,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}):A=new d.Primitive({geometryInstances:b,appearance:P,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1}),d.Primitive.prototype&&d.GroundPrimitive.prototype&&(A.ESSceneObjectID=n),A},f=new d.BoundingSphere,g=()=>{a(),m(f),this._primitive=p(),this._primitive&&r.scene.primitives.add(this._primitive)},m=P=>{if(!this.points)return;const b=Wi(this.points);if(b.length<3){P.radius=-1;return}d.BoundingSphere.fromPoints(b,P)},v=()=>{const P=this.show??!0;this._primitive&&(this._primitive.show=P)},_=()=>{g(),v()};_();let w=l.debounce(_,500);const C=this.dv(l.createNextAnimateFrameEvent(this.waterColorChanged,this.frequencyChanged,this.amplitudeChanged,this.specularIntensityChanged,this.waveVelocityChanged,this.groundChanged,this.allowPickingChanged));this.d(C.don(_));const x=this.dv(l.createNextAnimateFrameEvent(this.pointsChanged,this.heightChanged));this.d(x.don(()=>{if(!this.points){a();return}this._primitive&&!this.ground?(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=h(),m(f),w&&w[0]()):_()})),this.d(this.showChanged.don(v)),this.d(this.flyToEvent.don(P=>{if(f.radius>0){const b=xt(f.center);b&&dt(r,b,f.radius*4,void 0,P)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:!0,points:l.reactPositions(void 0),height:void 0,allowPicking:!0,ground:!1,waterColor:[.1497,.165,.0031,1],frequency:1e3,waveVelocity:.5,amplitude:.1,specularIntensity:.8,baseWaterImage:l.reactJsonWithUndefined(void 0),flowSpeed:0})})(th||(th={})),l.extendClassProps(th.prototype,th.createDefaultProps);class $a extends l.Destroyable{constructor(t,n){super();y(this,"_primitive");y(this,"_flyToEvent",this.dv(new l.Event));y(this,"_updateBoundingSphereEvent",this.ad(new l.Event));const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}const o=new d.BoundingSphere,s=()=>{this._primitive&&r.scene.primitives.remove(this._primitive),this._primitive=void 0};this.d(s);const a=P=>l.ESSceneObject.context.getStrFromEnv(P),c=()=>{this._primitive=new d[this.ground?"GroundPrimitive":"Primitive"]({compressVertices:!1,asynchronous:!1,allowPicking:this.allowPicking,geometryInstances:g()}),d.Primitive.prototype&&(this._primitive.ESSceneObjectID=n),r.scene.primitives.add(this._primitive)},h=()=>{var T;const P=a(this.normalMap??d.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg")),b={baseWaterColor:at(this.waterColor??[.25,.6,1,.7]),normalMap:P,frequency:this.frequency,animationSpeed:this.animationSpeed,amplitude:this.amplitude,specularIntensity:this.specularIntensity};if(this.blendColor&&(b.blendColor=at(this.blendColor)),this.specularMap&&(b.specularMap=a(this.specularMap)),this.points&&this.points.length>=1){const{maxPos:R,minPos:F}=l.getMinMaxCorner(this.points),B=l.getDistancesFromPositions([F,[R[0],R[1],F[2]]],"GEODESIC")[0],V=l.getDistancesFromPositions([F,[F[0],R[1],R[2]]],"GEODESIC")[0];this.baseWaterImage&&(this.baseWaterImage.url&&(b.baseWaterImage=a(this.baseWaterImage.url)),this.baseWaterImage.uDis&&(b.repeatX=B/this.baseWaterImage.uDis),this.baseWaterImage.vDis&&(b.repeatY=V/this.baseWaterImage.vDis)),b.flowSpeed=this.flowSpeed/(((T=this.baseWaterImage)==null?void 0:T.uDis)??B)}if(this._primitive&&this._primitive.appearance){this._primitive.appearance.material.uniforms=Object.assign({},this._primitive.appearance.material.uniforms,b);return}const A=new d.EllipsoidSurfaceAppearance({material:TC(b),aboveGround:!0});this._primitive&&(this._primitive.appearance=A)},p=this.ad(l.createNextAnimateFrameEvent(this.baseWaterImageChanged,this.waterColorChanged,this.blendColorChanged,this.specularMapChanged,this.flowSpeedChanged,this.normalMapChanged,this.frequencyChanged,this.animationSpeedChanged,this.amplitudeChanged,this.specularIntensityChanged));this.ad(p.don(h));const f=P=>{if(!this.points)return;const b=Wi(this.points);if(b.length<3){P.radius=-1;return}d.BoundingSphere.fromPoints(b,P)},g=()=>{if(!this.points||this.points.length<3)return;const{minPos:P}=l.getMinMaxCorner(this.points),[b]=pi({originPosition:P},this.points),{minPos:A,maxPos:T}=l.getMinMaxCorner(b),R=T[0]-A[0],F=T[1]-A[1],B={positions:this.points},V=new d.PolygonGeometry({polygonHierarchy:Bo(B),vertexFormat:d.VertexFormat.DEFAULT,stRotation:this.stRotation&&d.Math.toRadians(this.stRotation),perPositionHeight:!0,attributes:{st:new d.GeometryAttribute({componentDatatype:d.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(b.map(O=>[d.Math.clamp(O[0]/R,0,1),d.Math.clamp(O[1]/F,0,1)]).flat())})}});return new d.GeometryInstance({id:this,geometry:V})},m=()=>{this._primitive&&(this._primitive.show=this.show??!0)},v=this.ad(l.createNextAnimateFrameEvent(this.showChanged));this.ad(v.don(m));const _=this.ad(()=>{s(),c(),m(),h(),f(o)});_();const w=this.ad(l.createNextAnimateFrameEvent(this.allowPickingChanged,this.groundChanged));this.ad(w.don(_)),this.ad(new l.ObjResettingWithEvent(this.updateBoundingSphereEvent,P=>{const b=new l.Destroyable;return P?b.ad(r.scene.preUpdate.addEventListener(()=>{const A=r.camera;r.camera.frustum.computeCullingVolume(A.position,A.direction,A.up).computeVisibility(o)===d.Intersect.OUTSIDE&&_()})):(_(),b.ad(this.pointsChanged.don(_))),b}));const C=()=>{if(!this.points||this.points.length<3){_();return}this._primitive instanceof d.Primitive?(this._primitive._state=3,this._primitive._appearance=void 0):this._primitive._primitive=void 0,this._primitive.geometryInstances=g(),this._primitive._recomputeBoundingSpheres=!0},x=this.dv(l.createNextAnimateFrameEvent(this.pointsChanged,this.stRotationChanged));this.d(x.don(C)),this.d(this.flyToEvent.don(P=>{if(o.radius>0){const b=xt(o.center);b&&dt(r,b,o.radius*4,void 0,P)}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get updateBoundingSphereEvent(){return this._updateBoundingSphereEvent}updateBoundingSphere(t){this._updateBoundingSphereEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:!0,points:l.reactPositions(void 0),allowPicking:!0,waterColor:[.1497,.165,.0031,1],blendColor:l.reactArrayWithUndefined(void 0),specularMap:void 0,normalMap:d.buildModuleUrl("Assets/Textures/waterNormalsSmall.jpg"),frequency:1e3,animationSpeed:.005,amplitude:10,specularIntensity:.3,baseWaterImage:l.reactJsonWithUndefined(void 0),flowSpeed:0,stRotation:void 0,ground:void 0})})($a||($a={})),l.extendClassProps($a.prototype,$a.createDefaultProps);class Xa extends l.Destroyable{constructor(t,n){super();y(this,"pointPrimitives");y(this,"_flyToEvent",this.dv(new l.Event));const r=t.viewer;if(!r){console.warn("viewer is undefined!");return}if(!$e(t.viewer))return;let{pointPrimitives:s}=this;const a=()=>{s&&(s.removeAll(),r.scene.primitives.remove(s),s=void 0)};this.d(a);const c=()=>{const v=new d.PointPrimitiveCollection({show:this.show??!0,debugShowBoundingVolume:this.debugShowBoundingVolume??!1,blendOption:(this.blendOption&&M.czmPropMaps.blendOptionType[this.blendOption])??d.BlendOption.OPAQUE_AND_TRANSLUCENT});return this.pointPrimitiveOptions&&(this.pointPrimitiveOptions.forEach(w=>{v.add({show:w.show??!0,color:w.color&&at(w.color),disableDepthTestDistance:w.disableDepthTestDistance,distanceDisplayCondition:w.distanceDisplayCondition&&Uu(w.distanceDisplayCondition),outlineColor:w.outlineColor&&at(w.outlineColor),outlineWidth:w.outlineWidth,pixelSize:w.pixelSize,position:w.position&&Gt(w.position),scaleByDistance:w.scaleByDistance&&Cs(w.scaleByDistance),translucencyByDistance:w.translucencyByDistance&&Cs(w.translucencyByDistance)})}),d.PointPrimitiveCollection.prototype&&(v.ESSceneObjectID=n)),v},h=()=>{a(),s=c(),r.scene.primitives.add(s)};h();const p=this.dv(l.createNextAnimateFrameEvent(this.showChanged,this.debugShowBoundingVolumeChanged,this.blendOptionChanged)),f=()=>{s&&(s.show=this.show??!0,s.debugShowBoundingVolume=this.debugShowBoundingVolume??!1,s.blendOption=(this.blendOption&&M.czmPropMaps.blendOptionType[this.blendOption])??d.BlendOption.OPAQUE_AND_TRANSLUCENT)};this.d(p.don(f));const g=this.dv(l.createNextAnimateFrameEvent(this.pointPrimitiveOptionsChanged));this.d(g.don(h));const m=new d.BoundingSphere;this.d(this.flyToEvent.don(v=>{if(!(!t.actived||!this.pointPrimitiveOptions))if(p.flush(),g.flush(),this.pointPrimitiveOptions.length===1){const _=this.pointPrimitiveOptions[0].position;if(!_)return;const w=r.scene.camera.positionCartographic.height;dt(r,_,w,void 0,v)}else{const _=this.pointPrimitiveOptions,w=[];_.forEach(x=>{x.position&&w.push(x.position)});const C=Wi(w);if(d.BoundingSphere.fromPoints(C,m),m.radius>0){const x=xt(m.center);x&&dt(r,x,m.radius*4,void 0,v)}}}))}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}}(i=>{i.createDefaultProps=()=>({show:void 0,debugShowBoundingVolume:void 0,blendOption:void 0,pointPrimitiveOptions:void 0,position:l.reactArrayWithUndefined(void 0),rotation:l.reactArrayWithUndefined(void 0),scale:l.reactArrayWithUndefined(void 0),localPosition:l.reactArrayWithUndefined(void 0),localRotation:l.reactArrayWithUndefined(void 0),localScale:l.reactArrayWithUndefined(void 0),localModelMatrix:l.reactArrayWithUndefined(void 0),modelMatrix:l.reactArrayWithUndefined(void 0)})})(Xa||(Xa={})),l.extendClassProps(Xa.prototype,Xa.createDefaultProps);class qD extends l.Destroyable{constructor(e,t){super();const n=t.viewer;if(!n)throw new Error("!viewer");const r=St.czmJulianDateToTimeStamp,o=St.getClockRange,s=St.getClockStep;{const a=()=>n.clockViewModel.startTime=d.JulianDate.fromDate(new Date(e.startTime??l.getDefaultValue(St.defaults.startTime)));a(),this.dispose(eo(n.clockViewModel,"startTime",c=>e.startTime=r(c))),this.dispose(e.startTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.stopTime=d.JulianDate.fromDate(new Date(e.stopTime??l.getDefaultValue(St.defaults.stopTime)));a(),this.dispose(eo(n.clockViewModel,"stopTime",c=>e.stopTime=r(c))),this.dispose(e.stopTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.currentTime=d.JulianDate.fromDate(new Date(e.currentTime??l.getDefaultValue(St.defaults.currentTime)));a(),this.dispose(eo(n.clockViewModel,"currentTime",c=>e.currentTime=r(c))),this.dispose(e.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.multiplier=e.multiplier??St.defaults.multiplier;a(),this.dispose(eo(n.clockViewModel,"multiplier",c=>{(e.multiplier??St.defaults.multiplier!==c)&&(e.multiplier=c)})),this.dispose(e.currentTimeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockStep=d.ClockStep[e.clockStep??St.defaults.clockStep];a(),this.dispose(eo(n.clockViewModel,"clockStep",c=>{const h=s(c);(e.clockStep??St.defaults.clockStep!==h)&&(e.clockStep=h)})),this.dispose(e.clockStepChanged.disposableOn(a))}{const a=()=>n.clockViewModel.clockRange=d.ClockRange[e.clockRange??St.defaults.clockRange];a(),this.dispose(eo(n.clockViewModel,"clockRange",c=>{const h=o(c);(e.clockRange??St.defaults.clockRange!==h)&&(e.clockRange=h)})),this.dispose(e.clockRangeChanged.disposableOn(a))}{const a=()=>n.clockViewModel.shouldAnimate=e.shouldAnimate??St.defaults.shouldAnimate;a(),this.dispose(eo(n.clockViewModel,"shouldAnimate",c=>{(e.shouldAnimate??St.defaults.shouldAnimate!==c)&&(e.shouldAnimate=c)})),this.dispose(e.shouldAnimateChanged.disposableOn(a))}}}const Ol=class Ol extends l.Destroyable{constructor(e){super(),this.disposeVar(new l.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled??Ol.defaults.enabled)return new qD(this,e)}))}};y(Ol,"czmJulianDateToTimeStamp",$D),y(Ol,"getClockRange",XD),y(Ol,"getClockStep",YD),y(Ol,"defaults",{enabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+24*60*60*1e3,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1});let St=Ol;(i=>{i.createDefaultProps=()=>({enabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0})})(St||(St={})),l.extendClassProps(St.prototype,St.createDefaultProps);function $D(i){return d.JulianDate.toDate(i).getTime()}function XD(i){if(i===d.ClockRange.CLAMPED)return"CLAMPED";if(i===d.ClockRange.LOOP_STOP)return"LOOP_STOP";if(i===d.ClockRange.UNBOUNDED)return"UNBOUNDED";throw new Error(`getClockRange error: ${i}`)}function YD(i){if(i===d.ClockStep.SYSTEM_CLOCK)return"SYSTEM_CLOCK";if(i===d.ClockStep.SYSTEM_CLOCK_MULTIPLIER)return"SYSTEM_CLOCK_MULTIPLIER";if(i===d.ClockStep.TICK_DEPENDENT)return"TICK_DEPENDENT";throw new Error(`clockStep未知类型: ${i}`)}function D(i){return i!=null}function X(i){this.name="DeveloperError",this.message=i;let e;try{throw new Error}catch(t){e=t.stack}this.stack=e}D(Object.create)&&(X.prototype=Object.create(Error.prototype),X.prototype.constructor=X),X.prototype.toString=function(){let i=`${this.name}: ${this.message}`;return D(this.stack)&&(i+=`
|
|
321
321
|
${this.stack.toString()}`),i},X.throwInstantiationError=function(){throw new X("This function defines an interface and should not be called directly.")};const S={};S.typeOf={};function kD(i){return`${i} is required, actual value was undefined`}function rc(i,e,t){return`Expected ${t} to be typeof ${e}, actual typeof was ${i}`}S.defined=function(i,e){if(!D(e))throw new X(kD(i))},S.typeOf.func=function(i,e){if(typeof e!="function")throw new X(rc(typeof e,"function",i))},S.typeOf.string=function(i,e){if(typeof e!="string")throw new X(rc(typeof e,"string",i))},S.typeOf.number=function(i,e){if(typeof e!="number")throw new X(rc(typeof e,"number",i))},S.typeOf.number.lessThan=function(i,e,t){if(S.typeOf.number(i,e),e>=t)throw new X(`Expected ${i} to be less than ${t}, actual value was ${e}`)},S.typeOf.number.lessThanOrEquals=function(i,e,t){if(S.typeOf.number(i,e),e>t)throw new X(`Expected ${i} to be less than or equal to ${t}, actual value was ${e}`)},S.typeOf.number.greaterThan=function(i,e,t){if(S.typeOf.number(i,e),e<=t)throw new X(`Expected ${i} to be greater than ${t}, actual value was ${e}`)},S.typeOf.number.greaterThanOrEquals=function(i,e,t){if(S.typeOf.number(i,e),e<t)throw new X(`Expected ${i} to be greater than or equal to ${t}, actual value was ${e}`)},S.typeOf.object=function(i,e){if(typeof e!="object")throw new X(rc(typeof e,"object",i))},S.typeOf.bool=function(i,e){if(typeof e!="boolean")throw new X(rc(typeof e,"boolean",i))},S.typeOf.bigint=function(i,e){if(typeof e!="bigint")throw new X(rc(typeof e,"bigint",i))},S.typeOf.number.equals=function(i,e,t,n){if(S.typeOf.number(i,t),S.typeOf.number(e,n),t!==n)throw new X(`${i} must be equal to ${e}, the actual values are ${t} and ${n}`)};var Ya=typeof globalThis<"u"||typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:{};function oc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function ix(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}),t}var Wo=function(i){i==null&&(i=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,i.constructor==Array?this.init_by_array(i,i.length):this.init_seed(i)};Wo.prototype.init_seed=function(i){for(this.mt[0]=i>>>0,this.mti=1;this.mti<this.N;this.mti++){var i=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((i&4294901760)>>>16)*1812433253<<16)+(i&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},Wo.prototype.init_by_array=function(i,e){var t,n,r;for(this.init_seed(19650218),t=1,n=0,r=this.N>e?this.N:e;r;r--){var o=this.mt[t-1]^this.mt[t-1]>>>30;this.mt[t]=(this.mt[t]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+i[n]+n,this.mt[t]>>>=0,t++,n++,t>=this.N&&(this.mt[0]=this.mt[this.N-1],t=1),n>=e&&(n=0)}for(r=this.N-1;r;r--){var o=this.mt[t-1]^this.mt[t-1]>>>30;this.mt[t]=(this.mt[t]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-t,this.mt[t]>>>=0,t++,t>=this.N&&(this.mt[0]=this.mt[this.N-1],t=1)}this.mt[0]=2147483648},Wo.prototype.random_int=function(){var i,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var t;for(this.mti==this.N+1&&this.init_seed(5489),t=0;t<this.N-this.M;t++)i=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+this.M]^i>>>1^e[i&1];for(;t<this.N-1;t++)i=this.mt[t]&this.UPPER_MASK|this.mt[t+1]&this.LOWER_MASK,this.mt[t]=this.mt[t+(this.M-this.N)]^i>>>1^e[i&1];i=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^i>>>1^e[i&1],this.mti=0}return i=this.mt[this.mti++],i^=i>>>11,i^=i<<7&2636928640,i^=i<<15&4022730752,i^=i>>>18,i>>>0},Wo.prototype.random_int31=function(){return this.random_int()>>>1},Wo.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},Wo.prototype.random=function(){return this.random_int()*(1/4294967296)},Wo.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},Wo.prototype.random_long=function(){var i=this.random_int()>>>5,e=this.random_int()>>>6;return(i*67108864+e)*(1/9007199254740992)};var ZD=Wo;const nx=oc(ZD),z={};z.EPSILON1=.1,z.EPSILON2=.01,z.EPSILON3=.001,z.EPSILON4=1e-4,z.EPSILON5=1e-5,z.EPSILON6=1e-6,z.EPSILON7=1e-7,z.EPSILON8=1e-8,z.EPSILON9=1e-9,z.EPSILON10=1e-10,z.EPSILON11=1e-11,z.EPSILON12=1e-12,z.EPSILON13=1e-13,z.EPSILON14=1e-14,z.EPSILON15=1e-15,z.EPSILON16=1e-16,z.EPSILON17=1e-17,z.EPSILON18=1e-18,z.EPSILON19=1e-19,z.EPSILON20=1e-20,z.EPSILON21=1e-21,z.GRAVITATIONALPARAMETER=3986004418e5,z.SOLAR_RADIUS=6955e5,z.LUNAR_RADIUS=1737400,z.SIXTY_FOUR_KILOBYTES=64*1024,z.FOUR_GIGABYTES=4*1024*1024*1024,z.sign=Math.sign??function(e){return e=+e,e===0||e!==e?e:e>0?1:-1},z.signNotZero=function(i){return i<0?-1:1},z.toSNorm=function(i,e){return e=e??255,Math.round((z.clamp(i,-1,1)*.5+.5)*e)},z.fromSNorm=function(i,e){return e=e??255,z.clamp(i,0,e)/e*2-1},z.normalize=function(i,e,t){return t=Math.max(t-e,0),t===0?0:z.clamp((i-e)/t,0,1)},z.sinh=Math.sinh??function(e){return(Math.exp(e)-Math.exp(-e))/2},z.cosh=Math.cosh??function(e){return(Math.exp(e)+Math.exp(-e))/2},z.lerp=function(i,e,t){return(1-t)*i+t*e},z.PI=Math.PI,z.ONE_OVER_PI=1/Math.PI,z.PI_OVER_TWO=Math.PI/2,z.PI_OVER_THREE=Math.PI/3,z.PI_OVER_FOUR=Math.PI/4,z.PI_OVER_SIX=Math.PI/6,z.THREE_PI_OVER_TWO=3*Math.PI/2,z.TWO_PI=2*Math.PI,z.ONE_OVER_TWO_PI=1/(2*Math.PI),z.RADIANS_PER_DEGREE=Math.PI/180,z.DEGREES_PER_RADIAN=180/Math.PI,z.RADIANS_PER_ARCSECOND=z.RADIANS_PER_DEGREE/3600,z.toRadians=function(i){if(!D(i))throw new X("degrees is required.");return i*z.RADIANS_PER_DEGREE},z.toDegrees=function(i){if(!D(i))throw new X("radians is required.");return i*z.DEGREES_PER_RADIAN},z.convertLongitudeRange=function(i){if(!D(i))throw new X("angle is required.");const e=z.TWO_PI,t=i-Math.floor(i/e)*e;return t<-Math.PI?t+e:t>=Math.PI?t-e:t},z.clampToLatitudeRange=function(i){if(!D(i))throw new X("angle is required.");return z.clamp(i,-1*z.PI_OVER_TWO,z.PI_OVER_TWO)},z.negativePiToPi=function(i){if(!D(i))throw new X("angle is required.");return i>=-z.PI&&i<=z.PI?i:z.zeroToTwoPi(i+z.PI)-z.PI},z.zeroToTwoPi=function(i){if(!D(i))throw new X("angle is required.");if(i>=0&&i<=z.TWO_PI)return i;const e=z.mod(i,z.TWO_PI);return Math.abs(e)<z.EPSILON14&&Math.abs(i)>z.EPSILON14?z.TWO_PI:e},z.mod=function(i,e){if(!D(i))throw new X("m is required.");if(!D(e))throw new X("n is required.");if(e===0)throw new X("divisor cannot be 0.");return z.sign(i)===z.sign(e)&&Math.abs(i)<Math.abs(e)?i:(i%e+e)%e},z.equalsEpsilon=function(i,e,t,n){if(!D(i))throw new X("left is required.");if(!D(e))throw new X("right is required.");t=t??0,n=n??t;const r=Math.abs(i-e);return r<=n||r<=t*Math.max(Math.abs(i),Math.abs(e))},z.lessThan=function(i,e,t){if(!D(i))throw new X("first is required.");if(!D(e))throw new X("second is required.");if(!D(t))throw new X("absoluteEpsilon is required.");return i-e<-t},z.lessThanOrEquals=function(i,e,t){if(!D(i))throw new X("first is required.");if(!D(e))throw new X("second is required.");if(!D(t))throw new X("absoluteEpsilon is required.");return i-e<t},z.greaterThan=function(i,e,t){if(!D(i))throw new X("first is required.");if(!D(e))throw new X("second is required.");if(!D(t))throw new X("absoluteEpsilon is required.");return i-e>t},z.greaterThanOrEquals=function(i,e,t){if(!D(i))throw new X("first is required.");if(!D(e))throw new X("second is required.");if(!D(t))throw new X("absoluteEpsilon is required.");return i-e>-t};const Ff=[1];z.factorial=function(i){if(typeof i!="number"||i<0)throw new X("A number greater than or equal to 0 is required.");const e=Ff.length;if(i>=e){let t=Ff[e-1];for(let n=e;n<=i;n++){const r=t*n;Ff.push(r),t=r}}return Ff[i]},z.incrementWrap=function(i,e,t){if(t=t??0,!D(i))throw new X("n is required.");if(e<=t)throw new X("maximumValue must be greater than minimumValue.");return++i,i>e&&(i=t),i},z.isPowerOfTwo=function(i){if(typeof i!="number"||i<0||i>4294967295)throw new X("A number between 0 and (2^32)-1 is required.");return i!==0&&(i&i-1)===0},z.nextPowerOfTwo=function(i){if(typeof i!="number"||i<0||i>2147483648)throw new X("A number between 0 and 2^31 is required.");return--i,i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i|=i>>16,++i,i},z.previousPowerOfTwo=function(i){if(typeof i!="number"||i<0||i>4294967295)throw new X("A number between 0 and (2^32)-1 is required.");return i|=i>>1,i|=i>>2,i|=i>>4,i|=i>>8,i|=i>>16,i|=i>>32,i=(i>>>0)-(i>>>1),i},z.clamp=function(i,e,t){return S.typeOf.number("value",i),S.typeOf.number("min",e),S.typeOf.number("max",t),i<e?e:i>t?t:i};let rx=new nx;z.setRandomNumberSeed=function(i){if(!D(i))throw new X("seed is required.");rx=new nx(i)},z.nextRandomNumber=function(){return rx.random()},z.randomBetween=function(i,e){return z.nextRandomNumber()*(e-i)+i},z.acosClamped=function(i){if(!D(i))throw new X("value is required.");return Math.acos(z.clamp(i,-1,1))},z.asinClamped=function(i){if(!D(i))throw new X("value is required.");return Math.asin(z.clamp(i,-1,1))},z.chordLength=function(i,e){if(!D(i))throw new X("angle is required.");if(!D(e))throw new X("radius is required.");return 2*e*Math.sin(i*.5)},z.logBase=function(i,e){if(!D(i))throw new X("number is required.");if(!D(e))throw new X("base is required.");return Math.log(i)/Math.log(e)},z.cbrt=Math.cbrt??function(e){const t=Math.pow(Math.abs(e),.3333333333333333);return e<0?-t:t},z.log2=Math.log2??function(e){return Math.log(e)*Math.LOG2E},z.fog=function(i,e){const t=i*e;return 1-Math.exp(-(t*t))},z.fastApproximateAtan=function(i){return S.typeOf.number("x",i),i*(-.1784*Math.abs(i)-.0663*i*i+1.0301)},z.fastApproximateAtan2=function(i,e){S.typeOf.number("x",i),S.typeOf.number("y",e);let t,n=Math.abs(i);t=Math.abs(e);const r=Math.max(n,t);t=Math.min(n,t);const o=t/r;if(isNaN(o))throw new X("either x or y must be nonzero");return n=z.fastApproximateAtan(o),n=Math.abs(e)>Math.abs(i)?z.PI_OVER_TWO-n:n,n=i<0?z.PI-n:n,n=e<0?-n:n,n};let G=class vt{constructor(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}static fromSpherical(e,t){S.typeOf.object("spherical",e),D(t)||(t=new vt);const n=e.clock,r=e.cone,o=e.magnitude??1,s=o*Math.sin(r);return t.x=s*Math.cos(n),t.y=s*Math.sin(n),t.z=o*Math.cos(r),t}static fromElements(e,t,n,r){return D(r)?(r.x=e,r.y=t,r.z=n,r):new vt(e,t,n)}static clone(e,t){if(D(e))return D(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new vt(e.x,e.y,e.z)}static pack(e,t,n){return S.typeOf.object("value",e),S.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t}static unpack(e,t,n){return S.defined("array",e),t=t??0,D(n)||(n=new vt),n.x=e[t++],n.y=e[t++],n.z=e[t],n}static packArray(e,t){S.defined("array",e);const n=e.length,r=n*3;if(!D(t))t=new Array(r);else{if(!Array.isArray(t)&&t.length!==r)throw new X("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==r&&(t.length=r)}for(let o=0;o<n;++o)vt.pack(e[o],t,o*3);return t}static unpackArray(e,t){if(S.defined("array",e),S.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new X("array length must be a multiple of 3.");const n=e.length;D(t)?t.length=n/3:t=new Array(n/3);for(let r=0;r<n;r+=3){const o=r/3;t[o]=vt.unpack(e,r,t[o])}return t}static maximumComponent(e){return S.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)}static minimumComponent(e){return S.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)}static minimumByComponent(e,t,n){return S.typeOf.object("first",e),S.typeOf.object("second",t),S.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n}static maximumByComponent(e,t,n){return S.typeOf.object("first",e),S.typeOf.object("second",t),S.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n}static clamp(e,t,n,r){S.typeOf.object("value",e),S.typeOf.object("min",t),S.typeOf.object("max",n),S.typeOf.object("result",r);const o=z.clamp(e.x,t.x,n.x),s=z.clamp(e.y,t.y,n.y),a=z.clamp(e.z,t.z,n.z);return r.x=o,r.y=s,r.z=a,r}static magnitudeSquared(e){return S.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z}static magnitude(e){return Math.sqrt(vt.magnitudeSquared(e))}static distance(e,t){return S.typeOf.object("left",e),S.typeOf.object("right",t),vt.subtract(e,t,Nf),vt.magnitude(Nf)}static distanceSquared(e,t){return S.typeOf.object("left",e),S.typeOf.object("right",t),vt.subtract(e,t,Nf),vt.magnitudeSquared(Nf)}static normalize(e,t){S.typeOf.object("cartesian",e),S.typeOf.object("result",t);const n=vt.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new X("normalized result is not a number");return t}static dot(e,t){return S.typeOf.object("left",e),S.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z}static multiplyComponents(e,t,n){return S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n}static divideComponents(e,t,n){return S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n}static add(e,t,n){return S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n}static subtract(e,t,n){return S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n}static multiplyByScalar(e,t,n){return S.typeOf.object("cartesian",e),S.typeOf.number("scalar",t),S.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n}static divideByScalar(e,t,n){return S.typeOf.object("cartesian",e),S.typeOf.number("scalar",t),S.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n}static negate(e,t){return S.typeOf.object("cartesian",e),S.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t}static abs(e,t){return S.typeOf.object("cartesian",e),S.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t}static lerp(e,t,n,r){return S.typeOf.object("start",e),S.typeOf.object("end",t),S.typeOf.number("t",n),S.typeOf.object("result",r),vt.multiplyByScalar(t,n,ox),r=vt.multiplyByScalar(e,1-n,r),vt.add(ox,r,r)}static angleBetween(e,t){S.typeOf.object("left",e),S.typeOf.object("right",t),vt.normalize(e,Lf),vt.normalize(t,_v);const n=vt.dot(Lf,_v),r=vt.magnitude(vt.cross(Lf,_v,Lf));return Math.atan2(r,n)}static mostOrthogonalAxis(e,t){S.typeOf.object("cartesian",e),S.typeOf.object("result",t);const n=vt.normalize(e,QD);return vt.abs(n,n),n.x<=n.y?n.x<=n.z?t=vt.clone(vt.UNIT_X,t):t=vt.clone(vt.UNIT_Z,t):n.y<=n.z?t=vt.clone(vt.UNIT_Y,t):t=vt.clone(vt.UNIT_Z,t),t}static projectVector(e,t,n){S.defined("a",e),S.defined("b",t),S.defined("result",n);const r=vt.dot(e,t)/vt.dot(t,t);return vt.multiplyByScalar(t,r,n)}static equals(e,t){return e===t||D(e)&&D(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}static equalsArray(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]}static equalsEpsilon(e,t,n,r){return e===t||D(e)&&D(t)&&z.equalsEpsilon(e.x,t.x,n,r)&&z.equalsEpsilon(e.y,t.y,n,r)&&z.equalsEpsilon(e.z,t.z,n,r)}static cross(e,t,n){S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n);const r=e.x,o=e.y,s=e.z,a=t.x,c=t.y,h=t.z,p=o*h-s*c,f=s*a-r*h,g=r*c-o*a;return n.x=p,n.y=f,n.z=g,n}static midpoint(e,t,n){return S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n}static fromDegrees(e,t,n,r,o){return S.typeOf.number("longitude",e),S.typeOf.number("latitude",t),e=z.toRadians(e),t=z.toRadians(t),vt.fromRadians(e,t,n,r,o)}static fromRadians(e,t,n,r,o){S.typeOf.number("longitude",e),S.typeOf.number("latitude",t),n=n??0;const s=D(r)?r.radiiSquared:vt._ellipsoidRadiiSquared,a=Math.cos(t);or.x=a*Math.cos(e),or.y=a*Math.sin(e),or.z=Math.sin(t),or=vt.normalize(or,or),vt.multiplyComponents(s,or,sc);const c=Math.sqrt(vt.dot(or,sc));return sc=vt.divideByScalar(sc,c,sc),or=vt.multiplyByScalar(or,n,or),D(o)||(o=new vt),vt.add(sc,or,o)}static fromDegreesArray(e,t,n){if(S.defined("coordinates",e),e.length<2||e.length%2!==0)throw new X("the number of coordinates must be a multiple of 2 and at least 2");const r=e.length;D(n)?n.length=r/2:n=new Array(r/2);for(let o=0;o<r;o+=2){const s=e[o],a=e[o+1],c=o/2;n[c]=vt.fromDegrees(s,a,0,t,n[c])}return n}static fromRadiansArray(e,t,n){if(S.defined("coordinates",e),e.length<2||e.length%2!==0)throw new X("the number of coordinates must be a multiple of 2 and at least 2");const r=e.length;D(n)?n.length=r/2:n=new Array(r/2);for(let o=0;o<r;o+=2){const s=e[o],a=e[o+1],c=o/2;n[c]=vt.fromRadians(s,a,0,t,n[c])}return n}static fromDegreesArrayHeights(e,t,n){if(S.defined("coordinates",e),e.length<3||e.length%3!==0)throw new X("the number of coordinates must be a multiple of 3 and at least 3");const r=e.length;D(n)?n.length=r/3:n=new Array(r/3);for(let o=0;o<r;o+=3){const s=e[o],a=e[o+1],c=e[o+2],h=o/3;n[h]=vt.fromDegrees(s,a,c,t,n[h])}return n}static fromRadiansArrayHeights(e,t,n){if(S.defined("coordinates",e),e.length<3||e.length%3!==0)throw new X("the number of coordinates must be a multiple of 3 and at least 3");const r=e.length;D(n)?n.length=r/3:n=new Array(r/3);for(let o=0;o<r;o+=3){const s=e[o],a=e[o+1],c=e[o+2],h=o/3;n[h]=vt.fromRadians(s,a,c,t,n[h])}return n}clone(e){return vt.clone(this,e)}equals(e){return vt.equals(this,e)}equalsEpsilon(e,t,n){return vt.equalsEpsilon(this,e,t,n)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};G.fromCartesian4=G.clone,G.packedLength=3,G.fromArray=G.unpack;const Nf=new G,ox=new G,Lf=new G,_v=new G,QD=new G;let or=new G,sc=new G;G._ellipsoidRadiiSquared=new G(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9),G.ZERO=Object.freeze(new G(0,0,0)),G.ONE=Object.freeze(new G(1,1,1)),G.UNIT_X=Object.freeze(new G(1,0,0)),G.UNIT_Y=Object.freeze(new G(0,1,0)),G.UNIT_Z=Object.freeze(new G(0,0,1));class lt{constructor(e,t,n,r){this.x=e??0,this.y=t??0,this.z=n??0,this.w=r??0}static fromElements(e,t,n,r,o){return D(o)?(o.x=e,o.y=t,o.z=n,o.w=r,o):new lt(e,t,n,r)}static fromColor(e,t){return S.typeOf.object("color",e),D(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new lt(e.red,e.green,e.blue,e.alpha)}static clone(e,t){if(D(e))return D(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new lt(e.x,e.y,e.z,e.w)}static pack(e,t,n){return S.typeOf.object("value",e),S.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t}static unpack(e,t,n){return S.defined("array",e),t=t??0,D(n)||(n=new lt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n}static packArray(e,t){S.defined("array",e);const n=e.length,r=n*4;if(!D(t))t=new Array(r);else{if(!Array.isArray(t)&&t.length!==r)throw new X("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==r&&(t.length=r)}for(let o=0;o<n;++o)lt.pack(e[o],t,o*4);return t}static unpackArray(e,t){if(S.defined("array",e),S.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new X("array length must be a multiple of 4.");const n=e.length;D(t)?t.length=n/4:t=new Array(n/4);for(let r=0;r<n;r+=4){const o=r/4;t[o]=lt.unpack(e,r,t[o])}return t}static maximumComponent(e){return S.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)}static minimumComponent(e){return S.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)}static minimumByComponent(e,t,n){return S.typeOf.object("first",e),S.typeOf.object("second",t),S.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n}static maximumByComponent(e,t,n){return S.typeOf.object("first",e),S.typeOf.object("second",t),S.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n}static clamp(e,t,n,r){S.typeOf.object("value",e),S.typeOf.object("min",t),S.typeOf.object("max",n),S.typeOf.object("result",r);const o=z.clamp(e.x,t.x,n.x),s=z.clamp(e.y,t.y,n.y),a=z.clamp(e.z,t.z,n.z),c=z.clamp(e.w,t.w,n.w);return r.x=o,r.y=s,r.z=a,r.w=c,r}static magnitudeSquared(e){return S.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w}static magnitude(e){return Math.sqrt(lt.magnitudeSquared(e))}static distance(e,t){return S.typeOf.object("left",e),S.typeOf.object("right",t),lt.subtract(e,t,Of),lt.magnitude(Of)}static distanceSquared(e,t){return S.typeOf.object("left",e),S.typeOf.object("right",t),lt.subtract(e,t,Of),lt.magnitudeSquared(Of)}static normalize(e,t){S.typeOf.object("cartesian",e),S.typeOf.object("result",t);const n=lt.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new X("normalized result is not a number");return t}static dot(e,t){return S.typeOf.object("left",e),S.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w}static multiplyComponents(e,t,n){return S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n}static divideComponents(e,t,n){return S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n}static add(e,t,n){return S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n}static subtract(e,t,n){return S.typeOf.object("left",e),S.typeOf.object("right",t),S.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n}static multiplyByScalar(e,t,n){return S.typeOf.object("cartesian",e),S.typeOf.number("scalar",t),S.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n}static divideByScalar(e,t,n){return S.typeOf.object("cartesian",e),S.typeOf.number("scalar",t),S.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n}static negate(e,t){return S.typeOf.object("cartesian",e),S.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t}static abs(e,t){return S.typeOf.object("cartesian",e),S.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t}static lerp(e,t,n,r){return S.typeOf.object("start",e),S.typeOf.object("end",t),S.typeOf.number("t",n),S.typeOf.object("result",r),lt.multiplyByScalar(t,n,sx),r=lt.multiplyByScalar(e,1-n,r),lt.add(sx,r,r)}static mostOrthogonalAxis(e,t){S.typeOf.object("cartesian",e),S.typeOf.object("result",t);const n=lt.normalize(e,KD);return lt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=lt.clone(lt.UNIT_X,t):t=lt.clone(lt.UNIT_W,t):n.z<=n.w?t=lt.clone(lt.UNIT_Z,t):t=lt.clone(lt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=lt.clone(lt.UNIT_Y,t):t=lt.clone(lt.UNIT_W,t):n.z<=n.w?t=lt.clone(lt.UNIT_Z,t):t=lt.clone(lt.UNIT_W,t),t}static equals(e,t){return e===t||D(e)&&D(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w}static equalsArray(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]}static equalsEpsilon(e,t,n,r){return e===t||D(e)&&D(t)&&z.equalsEpsilon(e.x,t.x,n,r)&&z.equalsEpsilon(e.y,t.y,n,r)&&z.equalsEpsilon(e.z,t.z,n,r)&&z.equalsEpsilon(e.w,t.w,n,r)}clone(e){return lt.clone(this,e)}equals(e){return lt.equals(this,e)}equalsEpsilon(e,t,n){return lt.equalsEpsilon(this,e,t,n)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(e,t){return S.typeOf.number("value",e),D(t)||(t=new lt),wv[0]=e,ax?(t.x=qi[0],t.y=qi[1],t.z=qi[2],t.w=qi[3]):(t.x=qi[3],t.y=qi[2],t.z=qi[1],t.w=qi[0]),t}static unpackFloat(e){return S.typeOf.object("packedFloat",e),ax?(qi[0]=e.x,qi[1]=e.y,qi[2]=e.z,qi[3]=e.w):(qi[0]=e.w,qi[1]=e.z,qi[2]=e.y,qi[3]=e.x),wv[0]}}lt.packedLength=4,lt.fromArray=lt.unpack;const Of=new lt,sx=new lt,KD=new lt;lt.ZERO=Object.freeze(new lt(0,0,0,0)),lt.ONE=Object.freeze(new lt(1,1,1,1)),lt.UNIT_X=Object.freeze(new lt(1,0,0,0)),lt.UNIT_Y=Object.freeze(new lt(0,1,0,0)),lt.UNIT_Z=Object.freeze(new lt(0,0,1,0)),lt.UNIT_W=Object.freeze(new lt(0,0,0,1));const wv=new Float32Array(1),qi=new Uint8Array(wv.buffer),JD=new Uint32Array([287454020]),ax=new Uint8Array(JD.buffer)[0]===68,Ho={};Ho.EMPTY_OBJECT=Object.freeze({}),Ho.EMPTY_ARRAY=Object.freeze([]);function k(i,e,t,n,r,o,s,a,c){this[0]=i??0,this[1]=n??0,this[2]=s??0,this[3]=e??0,this[4]=r??0,this[5]=a??0,this[6]=t??0,this[7]=o??0,this[8]=c??0}k.packedLength=9,k.pack=function(i,e,t){return S.typeOf.object("value",i),S.defined("array",e),t=t??0,e[t++]=i[0],e[t++]=i[1],e[t++]=i[2],e[t++]=i[3],e[t++]=i[4],e[t++]=i[5],e[t++]=i[6],e[t++]=i[7],e[t++]=i[8],e},k.unpack=function(i,e,t){return S.defined("array",i),e=e??0,D(t)||(t=new k),t[0]=i[e++],t[1]=i[e++],t[2]=i[e++],t[3]=i[e++],t[4]=i[e++],t[5]=i[e++],t[6]=i[e++],t[7]=i[e++],t[8]=i[e++],t},k.packArray=function(i,e){S.defined("array",i);const t=i.length,n=t*9;if(!D(e))e=new Array(n);else{if(!Array.isArray(e)&&e.length!==n)throw new X("If result is a typed array, it must have exactly array.length * 9 elements");e.length!==n&&(e.length=n)}for(let r=0;r<t;++r)k.pack(i[r],e,r*9);return e},k.unpackArray=function(i,e){if(S.defined("array",i),S.typeOf.number.greaterThanOrEquals("array.length",i.length,9),i.length%9!==0)throw new X("array length must be a multiple of 9.");const t=i.length;D(e)?e.length=t/9:e=new Array(t/9);for(let n=0;n<t;n+=9){const r=n/9;e[r]=k.unpack(i,n,e[r])}return e},k.clone=function(i,e){if(D(i))return D(e)?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e):new k(i[0],i[3],i[6],i[1],i[4],i[7],i[2],i[5],i[8])},k.fromArray=k.unpack,k.fromColumnMajorArray=function(i,e){return S.defined("values",i),k.clone(i,e)},k.fromRowMajorArray=function(i,e){return S.defined("values",i),D(e)?(e[0]=i[0],e[1]=i[3],e[2]=i[6],e[3]=i[1],e[4]=i[4],e[5]=i[7],e[6]=i[2],e[7]=i[5],e[8]=i[8],e):new k(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8])},k.fromQuaternion=function(i,e){S.typeOf.object("quaternion",i);const t=i.x*i.x,n=i.x*i.y,r=i.x*i.z,o=i.x*i.w,s=i.y*i.y,a=i.y*i.z,c=i.y*i.w,h=i.z*i.z,p=i.z*i.w,f=i.w*i.w,g=t-s-h+f,m=2*(n-p),v=2*(r+c),_=2*(n+p),w=-t+s-h+f,C=2*(a-o),x=2*(r-c),P=2*(a+o),b=-t-s+h+f;return D(e)?(e[0]=g,e[1]=_,e[2]=x,e[3]=m,e[4]=w,e[5]=P,e[6]=v,e[7]=C,e[8]=b,e):new k(g,m,v,_,w,C,x,P,b)},k.fromHeadingPitchRoll=function(i,e){S.typeOf.object("headingPitchRoll",i);const t=Math.cos(-i.pitch),n=Math.cos(-i.heading),r=Math.cos(i.roll),o=Math.sin(-i.pitch),s=Math.sin(-i.heading),a=Math.sin(i.roll),c=t*n,h=-r*s+a*o*n,p=a*s+r*o*n,f=t*s,g=r*n+a*o*s,m=-a*n+r*o*s,v=-o,_=a*t,w=r*t;return D(e)?(e[0]=c,e[1]=f,e[2]=v,e[3]=h,e[4]=g,e[5]=_,e[6]=p,e[7]=m,e[8]=w,e):new k(c,h,p,f,g,m,v,_,w)},k.fromScale=function(i,e){return S.typeOf.object("scale",i),D(e)?(e[0]=i.x,e[1]=0,e[2]=0,e[3]=0,e[4]=i.y,e[5]=0,e[6]=0,e[7]=0,e[8]=i.z,e):new k(i.x,0,0,0,i.y,0,0,0,i.z)},k.fromUniformScale=function(i,e){return S.typeOf.number("scale",i),D(e)?(e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=i,e):new k(i,0,0,0,i,0,0,0,i)},k.fromCrossProduct=function(i,e){return S.typeOf.object("vector",i),D(e)?(e[0]=0,e[1]=i.z,e[2]=-i.y,e[3]=-i.z,e[4]=0,e[5]=i.x,e[6]=i.y,e[7]=-i.x,e[8]=0,e):new k(0,-i.z,i.y,i.z,0,-i.x,-i.y,i.x,0)},k.fromRotationX=function(i,e){S.typeOf.number("angle",i);const t=Math.cos(i),n=Math.sin(i);return D(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=n,e[6]=0,e[7]=-n,e[8]=t,e):new k(1,0,0,0,t,-n,0,n,t)},k.fromRotationY=function(i,e){S.typeOf.number("angle",i);const t=Math.cos(i),n=Math.sin(i);return D(e)?(e[0]=t,e[1]=0,e[2]=-n,e[3]=0,e[4]=1,e[5]=0,e[6]=n,e[7]=0,e[8]=t,e):new k(t,0,n,0,1,0,-n,0,t)},k.fromRotationZ=function(i,e){S.typeOf.number("angle",i);const t=Math.cos(i),n=Math.sin(i);return D(e)?(e[0]=t,e[1]=n,e[2]=0,e[3]=-n,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new k(t,-n,0,n,t,0,0,0,1)},k.toArray=function(i,e){return S.typeOf.object("matrix",i),D(e)?(e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e):[i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8]]},k.getElementIndex=function(i,e){return S.typeOf.number.greaterThanOrEquals("row",e,0),S.typeOf.number.lessThanOrEquals("row",e,2),S.typeOf.number.greaterThanOrEquals("column",i,0),S.typeOf.number.lessThanOrEquals("column",i,2),i*3+e},k.getColumn=function(i,e,t){S.typeOf.object("matrix",i),S.typeOf.number.greaterThanOrEquals("index",e,0),S.typeOf.number.lessThanOrEquals("index",e,2),S.typeOf.object("result",t);const n=e*3,r=i[n],o=i[n+1],s=i[n+2];return t.x=r,t.y=o,t.z=s,t},k.setColumn=function(i,e,t,n){S.typeOf.object("matrix",i),S.typeOf.number.greaterThanOrEquals("index",e,0),S.typeOf.number.lessThanOrEquals("index",e,2),S.typeOf.object("cartesian",t),S.typeOf.object("result",n),n=k.clone(i,n);const r=e*3;return n[r]=t.x,n[r+1]=t.y,n[r+2]=t.z,n},k.getRow=function(i,e,t){S.typeOf.object("matrix",i),S.typeOf.number.greaterThanOrEquals("index",e,0),S.typeOf.number.lessThanOrEquals("index",e,2),S.typeOf.object("result",t);const n=i[e],r=i[e+3],o=i[e+6];return t.x=n,t.y=r,t.z=o,t},k.setRow=function(i,e,t,n){return S.typeOf.object("matrix",i),S.typeOf.number.greaterThanOrEquals("index",e,0),S.typeOf.number.lessThanOrEquals("index",e,2),S.typeOf.object("cartesian",t),S.typeOf.object("result",n),n=k.clone(i,n),n[e]=t.x,n[e+3]=t.y,n[e+6]=t.z,n};const jD=new G;k.setScale=function(i,e,t){S.typeOf.object("matrix",i),S.typeOf.object("scale",e),S.typeOf.object("result",t);const n=k.getScale(i,jD),r=e.x/n.x,o=e.y/n.y,s=e.z/n.z;return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=i[3]*o,t[4]=i[4]*o,t[5]=i[5]*o,t[6]=i[6]*s,t[7]=i[7]*s,t[8]=i[8]*s,t};const tM=new G;k.setUniformScale=function(i,e,t){S.typeOf.object("matrix",i),S.typeOf.number("scale",e),S.typeOf.object("result",t);const n=k.getScale(i,tM),r=e/n.x,o=e/n.y,s=e/n.z;return t[0]=i[0]*r,t[1]=i[1]*r,t[2]=i[2]*r,t[3]=i[3]*o,t[4]=i[4]*o,t[5]=i[5]*o,t[6]=i[6]*s,t[7]=i[7]*s,t[8]=i[8]*s,t};const Cv=new G;k.getScale=function(i,e){return S.typeOf.object("matrix",i),S.typeOf.object("result",e),e.x=G.magnitude(G.fromElements(i[0],i[1],i[2],Cv)),e.y=G.magnitude(G.fromElements(i[3],i[4],i[5],Cv)),e.z=G.magnitude(G.fromElements(i[6],i[7],i[8],Cv)),e};const lx=new G;k.getMaximumScale=function(i){return k.getScale(i,lx),G.maximumComponent(lx)};const eM=new G;k.setRotation=function(i,e,t){S.typeOf.object("matrix",i),S.typeOf.object("result",t);const n=k.getScale(i,eM);return t[0]=e[0]*n.x,t[1]=e[1]*n.x,t[2]=e[2]*n.x,t[3]=e[3]*n.y,t[4]=e[4]*n.y,t[5]=e[5]*n.y,t[6]=e[6]*n.z,t[7]=e[7]*n.z,t[8]=e[8]*n.z,t};const iM=new G;k.getRotation=function(i,e){S.typeOf.object("matrix",i),S.typeOf.object("result",e);const t=k.getScale(i,iM);return e[0]=i[0]/t.x,e[1]=i[1]/t.x,e[2]=i[2]/t.x,e[3]=i[3]/t.y,e[4]=i[4]/t.y,e[5]=i[5]/t.y,e[6]=i[6]/t.z,e[7]=i[7]/t.z,e[8]=i[8]/t.z,e},k.multiply=function(i,e,t){S.typeOf.object("left",i),S.typeOf.object("right",e),S.typeOf.object("result",t);const n=i[0]*e[0]+i[3]*e[1]+i[6]*e[2],r=i[1]*e[0]+i[4]*e[1]+i[7]*e[2],o=i[2]*e[0]+i[5]*e[1]+i[8]*e[2],s=i[0]*e[3]+i[3]*e[4]+i[6]*e[5],a=i[1]*e[3]+i[4]*e[4]+i[7]*e[5],c=i[2]*e[3]+i[5]*e[4]+i[8]*e[5],h=i[0]*e[6]+i[3]*e[7]+i[6]*e[8],p=i[1]*e[6]+i[4]*e[7]+i[7]*e[8],f=i[2]*e[6]+i[5]*e[7]+i[8]*e[8];return t[0]=n,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=c,t[6]=h,t[7]=p,t[8]=f,t},k.add=function(i,e,t){return S.typeOf.object("left",i),S.typeOf.object("right",e),S.typeOf.object("result",t),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t[3]=i[3]+e[3],t[4]=i[4]+e[4],t[5]=i[5]+e[5],t[6]=i[6]+e[6],t[7]=i[7]+e[7],t[8]=i[8]+e[8],t},k.subtract=function(i,e,t){return S.typeOf.object("left",i),S.typeOf.object("right",e),S.typeOf.object("result",t),t[0]=i[0]-e[0],t[1]=i[1]-e[1],t[2]=i[2]-e[2],t[3]=i[3]-e[3],t[4]=i[4]-e[4],t[5]=i[5]-e[5],t[6]=i[6]-e[6],t[7]=i[7]-e[7],t[8]=i[8]-e[8],t},k.multiplyByVector=function(i,e,t){S.typeOf.object("matrix",i),S.typeOf.object("cartesian",e),S.typeOf.object("result",t);const n=e.x,r=e.y,o=e.z,s=i[0]*n+i[3]*r+i[6]*o,a=i[1]*n+i[4]*r+i[7]*o,c=i[2]*n+i[5]*r+i[8]*o;return t.x=s,t.y=a,t.z=c,t},k.multiplyByScalar=function(i,e,t){return S.typeOf.object("matrix",i),S.typeOf.number("scalar",e),S.typeOf.object("result",t),t[0]=i[0]*e,t[1]=i[1]*e,t[2]=i[2]*e,t[3]=i[3]*e,t[4]=i[4]*e,t[5]=i[5]*e,t[6]=i[6]*e,t[7]=i[7]*e,t[8]=i[8]*e,t},k.multiplyByScale=function(i,e,t){return S.typeOf.object("matrix",i),S.typeOf.object("scale",e),S.typeOf.object("result",t),t[0]=i[0]*e.x,t[1]=i[1]*e.x,t[2]=i[2]*e.x,t[3]=i[3]*e.y,t[4]=i[4]*e.y,t[5]=i[5]*e.y,t[6]=i[6]*e.z,t[7]=i[7]*e.z,t[8]=i[8]*e.z,t},k.multiplyByUniformScale=function(i,e,t){return S.typeOf.object("matrix",i),S.typeOf.number("scale",e),S.typeOf.object("result",t),t[0]=i[0]*e,t[1]=i[1]*e,t[2]=i[2]*e,t[3]=i[3]*e,t[4]=i[4]*e,t[5]=i[5]*e,t[6]=i[6]*e,t[7]=i[7]*e,t[8]=i[8]*e,t},k.negate=function(i,e){return S.typeOf.object("matrix",i),S.typeOf.object("result",e),e[0]=-i[0],e[1]=-i[1],e[2]=-i[2],e[3]=-i[3],e[4]=-i[4],e[5]=-i[5],e[6]=-i[6],e[7]=-i[7],e[8]=-i[8],e},k.transpose=function(i,e){S.typeOf.object("matrix",i),S.typeOf.object("result",e);const t=i[0],n=i[3],r=i[6],o=i[1],s=i[4],a=i[7],c=i[2],h=i[5],p=i[8];return e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=s,e[5]=a,e[6]=c,e[7]=h,e[8]=p,e};function nM(i){let e=0;for(let t=0;t<9;++t){const n=i[t];e+=n*n}return Math.sqrt(e)}const xv=[1,0,0],Pv=[2,2,1];function rM(i){let e=0;for(let t=0;t<3;++t){const n=i[k.getElementIndex(Pv[t],xv[t])];e+=2*n*n}return Math.sqrt(e)}function oM(i,e){const t=z.EPSILON15;let n=0,r=1;for(let h=0;h<3;++h){const p=Math.abs(i[k.getElementIndex(Pv[h],xv[h])]);p>n&&(r=h,n=p)}let o=1,s=0;const a=xv[r],c=Pv[r];if(Math.abs(i[k.getElementIndex(c,a)])>t){const h=i[k.getElementIndex(c,c)],p=i[k.getElementIndex(a,a)],f=i[k.getElementIndex(c,a)],g=(h-p)/2/f;let m;g<0?m=-1/(-g+Math.sqrt(1+g*g)):m=1/(g+Math.sqrt(1+g*g)),o=1/Math.sqrt(1+m*m),s=m*o}return e=k.clone(k.IDENTITY,e),e[k.getElementIndex(a,a)]=e[k.getElementIndex(c,c)]=o,e[k.getElementIndex(c,a)]=s,e[k.getElementIndex(a,c)]=-s,e}const Bf=new k,cx=new k;k.computeEigenDecomposition=function(i,e){S.typeOf.object("matrix",i);const t=z.EPSILON20,n=10;let r=0,o=0;D(e)||(e={});const s=e.unitary=k.clone(k.IDENTITY,e.unitary),a=e.diagonal=k.clone(i,e.diagonal),c=t*nM(a);for(;o<n&&rM(a)>c;)oM(a,Bf),k.transpose(Bf,cx),k.multiply(a,Bf,a),k.multiply(cx,a,a),k.multiply(s,Bf,s),++r>2&&(++o,r=0);return e},k.abs=function(i,e){return S.typeOf.object("matrix",i),S.typeOf.object("result",e),e[0]=Math.abs(i[0]),e[1]=Math.abs(i[1]),e[2]=Math.abs(i[2]),e[3]=Math.abs(i[3]),e[4]=Math.abs(i[4]),e[5]=Math.abs(i[5]),e[6]=Math.abs(i[6]),e[7]=Math.abs(i[7]),e[8]=Math.abs(i[8]),e},k.determinant=function(i){S.typeOf.object("matrix",i);const e=i[0],t=i[3],n=i[6],r=i[1],o=i[4],s=i[7],a=i[2],c=i[5],h=i[8];return e*(o*h-c*s)+r*(c*n-t*h)+a*(t*s-o*n)},k.inverse=function(i,e){S.typeOf.object("matrix",i),S.typeOf.object("result",e);const t=i[0],n=i[1],r=i[2],o=i[3],s=i[4],a=i[5],c=i[6],h=i[7],p=i[8],f=k.determinant(i);if(Math.abs(f)<=z.EPSILON15)throw new X("matrix is not invertible");e[0]=s*p-h*a,e[1]=h*r-n*p,e[2]=n*a-s*r,e[3]=c*a-o*p,e[4]=t*p-c*r,e[5]=o*r-t*a,e[6]=o*h-c*s,e[7]=c*n-t*h,e[8]=t*s-o*n;const g=1/f;return k.multiplyByScalar(e,g,e)};const sM=new k;k.inverseTranspose=function(i,e){return S.typeOf.object("matrix",i),S.typeOf.object("result",e),k.inverse(k.transpose(i,sM),e)},k.equals=function(i,e){return i===e||D(i)&&D(e)&&i[0]===e[0]&&i[1]===e[1]&&i[2]===e[2]&&i[3]===e[3]&&i[4]===e[4]&&i[5]===e[5]&&i[6]===e[6]&&i[7]===e[7]&&i[8]===e[8]},k.equalsEpsilon=function(i,e,t){return t=t??0,i===e||D(i)&&D(e)&&Math.abs(i[0]-e[0])<=t&&Math.abs(i[1]-e[1])<=t&&Math.abs(i[2]-e[2])<=t&&Math.abs(i[3]-e[3])<=t&&Math.abs(i[4]-e[4])<=t&&Math.abs(i[5]-e[5])<=t&&Math.abs(i[6]-e[6])<=t&&Math.abs(i[7]-e[7])<=t&&Math.abs(i[8]-e[8])<=t},k.IDENTITY=Object.freeze(new k(1,0,0,0,1,0,0,0,1)),k.ZERO=Object.freeze(new k(0,0,0,0,0,0,0,0,0)),k.COLUMN0ROW0=0,k.COLUMN0ROW1=1,k.COLUMN0ROW2=2,k.COLUMN1ROW0=3,k.COLUMN1ROW1=4,k.COLUMN1ROW2=5,k.COLUMN2ROW0=6,k.COLUMN2ROW1=7,k.COLUMN2ROW2=8,Object.defineProperties(k.prototype,{length:{get:function(){return k.packedLength}}}),k.prototype.clone=function(i){return k.clone(this,i)},k.prototype.equals=function(i){return k.equals(this,i)},k.equalsArray=function(i,e,t){return i[0]===e[t]&&i[1]===e[t+1]&&i[2]===e[t+2]&&i[3]===e[t+3]&&i[4]===e[t+4]&&i[5]===e[t+5]&&i[6]===e[t+6]&&i[7]===e[t+7]&&i[8]===e[t+8]},k.prototype.equalsEpsilon=function(i,e){return k.equalsEpsilon(this,i,e)},k.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
322
322
|
(${this[1]}, ${this[4]}, ${this[7]})
|
|
323
323
|
(${this[2]}, ${this[5]}, ${this[8]})`};function Di(i){this.name="RuntimeError",this.message=i;let e;try{throw new Error}catch(t){e=t.stack}this.stack=e}D(Object.create)&&(Di.prototype=Object.create(Error.prototype),Di.prototype.constructor=Di),Di.prototype.toString=function(){let i=`${this.name}: ${this.message}`;return D(this.stack)&&(i+=`
|
|
@@ -3706,10 +3706,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
3706
3706
|
`;function A7(){const i="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",t=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
3707
3707
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
3708
3708
|
gitee地址:${i}
|
|
3709
|
-
`;console.log(t);const n=globalThis.prompt(t,i);n&&globalThis.open(n,"_blank")}const Ti=class Ti extends l.ESViewer{constructor(t){super(t);y(this,"_disabledInputStack",this.disposeVar(l.react(0)));y(this,"_viewer",this.dv(l.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(l.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(l.react(0)));y(this,"_editingSystem",Cm);y(this,"_moveObjectsProcess",this.ad(KS()));if(t.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new JV(this)),this.ad(new jV(this)),this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new n6(this)})),this._viewerLegend=this.dv(new C7(this)),this._viewerInstance=this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Zw(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=at([1,1,1,1]))}));const n=t;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new l.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new F8(this.subContainer,this,r=>this._viewer.value=r,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&$e(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(t,n,r){if(!this.extensions)return;const{pickingManager:o}=this.extensions;return await o.pick(t,void 0,n)}async pickPosition(t){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(t)}async quickPickPosition(t){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(t)}async getTerrainHeight(t){var s;const{viewer:n}=this;if(!n)return;const r=d.Cartographic.fromDegrees(t[0],t[1],t[2],Ti.getHeightsScartchCarto),o=n.scene.globe.terrainProvider;return o instanceof d.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(s=(await d.sampleTerrainMostDetailed(o,[r]))[0])==null?void 0:s.height}getCameraInfo(){if(!this.viewer)return;const{camera:t}=this.viewer;return{position:Ln(t),rotation:Xl(t)}}calcFlyToParam(t){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!t)return;const r=d.Cartesian3.fromDegrees(...t),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,n.positionWC,new d.Cartesian3),c=d.Cartesian3.magnitude(a);let h=-Math.asin(a.z/c);h=d.Math.toDegrees(h);let p=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(p+=a.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=Xl(n),g=f[0]-p,m=f[1]-h;return{distance:c,heading:p,pitch:h,flyDuration:1,hDelta:g,pDelta:m}}flyIn(t,n,r,o="default"){var c;const s={position:t,rotation:n,duration:(r??1)*1e3},a=(c=this.viewer)==null?void 0:c.camera;return a&&Qu(a,s,o)}flyTo(t,n,r="default"){var m;const{distance:o,heading:s,pitch:a,flyDuration:c,hDelta:h,pDelta:p}=t,f={position:n,viewDistance:o,rotation:[s,a,0],duration:c*1e3,hdelta:h,pdelta:p},g=(m=this.viewer)==null?void 0:m.camera;return g&&Qu(g,f,r)}flyToBoundingSphere(t,n,r=1){var f;const o=[[t[0],t[1],0],[t[0],t[3],0],[t[2],t[3],0],[t[2],t[1],0]],s=l.getGeoBoundingSphereFromPositions(o);if(!s)return;const{center:a,radius:c}=s,h={position:a,viewDistance:n??c,rotation:[0,-90,0],duration:r*1e3},p=(f=this.viewer)==null?void 0:f.camera;return p&&Qu(p,h)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:t}=this.viewer;return{position:Ln(t),rotation:Xl(t)}}transformFlyParam(t,n){if("position"in n){const r=d.Cartesian3.fromDegrees(...t),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,Gt(n.position),new d.Cartesian3),c=d.Cartesian3.magnitude(a);let h=-Math.asin(a.z/c);h=d.Math.toDegrees(h);let p=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(p+=a.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=n.rotation[0]-p,g=n.rotation[1]-h;return{distance:c,heading:p,pitch:h,flyDuration:n.flyDuration??1,hDelta:f,pDelta:g}}else{const r=Gt(t);let o={heading:d.Math.toRadians(n.heading),pitch:d.Math.toRadians(n.pitch),roll:0};const s=new d.HeadingPitchRoll;if(n.distance){s.heading=o.heading,s.pitch=o.pitch,s.roll=0,s.heading-=d.Math.PI_OVER_TWO;const c=d.Transforms.headingPitchRollToFixedFrame(r,s,void 0,void 0),h=d.Matrix4.multiplyByPointAsVector(c,d.Cartesian3.UNIT_X,new d.Cartesian3);d.Cartesian3.multiplyByScalar(h,n.distance,h),d.Cartesian3.subtract(r,h,r)}n.hDelta&&(o.heading+=d.Math.toRadians(n.hDelta)),n.pDelta&&(o.pitch+=d.Math.toRadians(n.pDelta));const a=xt(r);return a?{position:a,rotation:[d.Math.toDegrees(o.heading),d.Math.toDegrees(o.pitch),d.Math.toDegrees(o.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(t,n=4.2,r=1.6){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToWalk(t,n,r),this._navigationMode.value="Walk"}changeToMap(){var t,n;(n=(t=this._viewerInstance)==null?void 0:t.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(t,n,r){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToRotateGlobe(t,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(t,n,r,o,s,a){var c,h;(h=(c=this._viewerInstance)==null?void 0:c.obj)==null||h.navigationManager.changeToLine(t,n,r,o,s,a),this._navigationMode.value="Line"}changeToUserDefined(t){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(t,n,r,o,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToRotatePoint(t,n,r,o,s),this._navigationMode.value="RotatePoint"}changeToFollow(t,n,r,o,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToFollow(t,n,r,o,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(t){return Promise.resolve(void 0)}async getVersion(){const t=globalThis.g_XE3CopyRights??{};return t.cesium={version:d.VERSION},t}async getHeightByLonLat(t,n,r){if(!this.viewer)return null;const o=d.Cartographic.fromDegrees(t,n,void 0,Ti.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(o)??null}async getHeightsByLonLats(t,n){const r=t.map(s=>this.getHeightByLonLat(...s));return await Promise.all(r)}async capture(t,n){if(this.viewer)return await BC(this.viewer.scene,t,n)}async lonLatAltToScreenPosition(t){if(!this.viewer||!this.isPointVisible(t))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Gt(t));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(t){this._notSupportEditingCount.value=t}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(t,n,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const o=t.components.main??t;o&&n!=null&&(o.editingID=`${r.callSource}_${l.createGuid()}`,this._editingSystem.create(this,o,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(t){const n=[],r=l.createGuid();for(let o=0;o<t.length;o++){const s=t[o],a=s.components.main??s;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(t){return this.sceneObjectsMap.get(t)}setCurrentDefaultAccessToken(){this.ionAccessToken=Ti.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Ti.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Ti.latestDefaultAccessToken}positionsToLocalPositions(t,n){return pi(t,n)}localPositionsToPositions(t,n){return As(t,n)}isPointVisible(t){if(!this.viewer)return!1;const n=t instanceof d.Cartesian3?t:Gt(t),r=new d.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.isPointVisible(n))return!1;const o=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!o||o.x<0||o.y<0)}getESProperties(){const t={...super.getESProperties()},n=Ti.defaults;return{...t,more:[...t.more,new l.DivideProperty("通用"),new l.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",S7,b7,!0),new l.MethodProperty("获取Cesium官方TOKEN",()=>Ti.getCesiumIonToken(),[],"获取官方token"),new l.MethodProperty("重置为当前使用的Cesium版本的TOKEN",()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new l.MethodProperty("重置为当前Cesium官方的最新token",()=>this.setLatestDefaultAccessToken(),[],"重置为当前Cesium官方的最新token"),new l.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new l.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new l.DivideProperty("Viewer"),new l.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new l.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new l.BooleanProperty([this,"shadows"]),new l.DivideProperty("比例尺"),new l.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new l.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new l.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new l.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new l.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new l.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new l.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new l.DivideProperty("场景"),new l.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new l.DivideProperty("Globe"),new l.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new l.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new l.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new l.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new l.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new l.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new l.BooleanProperty([this,"sceneGlobeShowSkirts"]),new l.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new l.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new l.JsonProperty([this,"sceneGlobeClippingPlanes"]),new l.StringProperty([this,"sceneGlobeClippingPlanesId"]),new l.JsonArrayProperty([this,"sceneGlobeClippingPolygons"]),new l.JsonArrayProperty([this,"sceneGlobeClippingPolygonsId"]),new l.DivideProperty("underground"),new l.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new l.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new l.DivideProperty("Translucency"),new l.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new l.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new l.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new l.DivideProperty("Sun"),new l.BooleanProperty([this,"sun"],"sun",n.sun,!0),new l.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new l.DivideProperty("Moon"),new l.BooleanProperty([this,"moon"],"moon",n.moon,!0),new l.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new l.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new l.DivideProperty("SkyBox"),new l.BooleanProperty([this,"sceneSkyBoxShow"]),new l.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new l.DivideProperty("Background"),new l.BooleanProperty([this,"xbsjUseBackground"]),new l.StringProperty([this,"xbsjBackgroundImageUri"]),new l.ColorProperty([this,"xbsjBackgroundColor"]),new l.DivideProperty("SkyAtmosphere"),new l.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new l.DivideProperty("Fog"),new l.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new l.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new l.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new l.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new l.DivideProperty("Sscc"),new l.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new l.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new l.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new l.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new l.DivideProperty("后处理"),new l.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new l.DivideProperty("环境遮蔽"),new l.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new l.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new l.DivideProperty("Bloom"),new l.BooleanProperty([this,"scenePpsBloomEnabled"]),new l.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new l.NumberProperty([this,"scenePpsBloomContrast"]),new l.NumberProperty([this,"scenePpsBloomBrightness"]),new l.NumberProperty([this,"scenePpsBloomDelta"]),new l.NumberProperty([this,"scenePpsBloomSigma"]),new l.NumberProperty([this,"scenePpsBloomStepSize"]),new l.DivideProperty("调试"),new l.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new l.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new l.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new l.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new l.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new l.DivideProperty("Inspector"),new l.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new l.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new l.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(Ti,"type",Ti.register("ESCesiumViewer",Ti)),y(Ti,"getCesiumIonToken",A7),y(Ti,"currentDefaultAccessToken",d.Ion.defaultAccessToken),y(Ti,"latestDefaultAccessToken"),y(Ti,"ObjectsToExcludeWrapper",i6),y(Ti,"defaults",{...l.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(t=>180*t/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:d.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:d.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}),y(Ti,"getHeightsScartchCarto",new d.Cartographic);let ne=Ti;(i=>{i.createDefaultProps=()=>({...l.ESViewer.createDefaultProps(),...E7()})})(ne||(ne={})),l.extendClassProps(ne.prototype,ne.createDefaultProps),M.copyright=void 0;try{const i="earthsdk3-cesium",e="3.8.2",t="2026-04-07T10:31:15.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="9512dc5fa41db879512c0c6f8a36c463d4b0f58c",a=((Date.now()-1775557875e3)/36e5).toFixed(1),c=`%c🌏 ${i}%c ${e}.${o.slice(0,8)}.${t} (距今${a}个小时)
|
|
3709
|
+
`;console.log(t);const n=globalThis.prompt(t,i);n&&globalThis.open(n,"_blank")}const Ti=class Ti extends l.ESViewer{constructor(t){super(t);y(this,"_disabledInputStack",this.disposeVar(l.react(0)));y(this,"_viewer",this.dv(l.react(void 0)));y(this,"_viewerInstance");y(this,"_viewerLegend");y(this,"pickCustomAttachedInfo");y(this,"_fps",this.dv(l.react(0)));y(this,"_notSupportEditingCount",this.disposeVar(l.react(0)));y(this,"_editingSystem",Cm);y(this,"_moveObjectsProcess",this.ad(KS()));if(t.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new JV(this)),this.ad(new jV(this)),this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new n6(this)})),this._viewerLegend=this.dv(new C7(this)),this._viewerInstance=this.dv(new l.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Zw(this,this.viewer)})),this.d(this.viewerChanged.don(r=>{this.viewer&&(this.viewer.scene.globe.baseColor=at([1,1,1,1]))}));const n=t;this.d(this._viewer.changed.don(r=>{this.viewerChanged.emit(r)})),this.dv(new l.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new F8(this.subContainer,this,r=>this._viewer.value=r,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&$e(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(t,n,r){if(!this.extensions)return;const{pickingManager:o}=this.extensions;return await o.pick(t,void 0,n)}async pickPosition(t){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(t)}async quickPickPosition(t){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(t)}async getTerrainHeight(t){var s;const{viewer:n}=this;if(!n)return;const r=d.Cartographic.fromDegrees(t[0],t[1],t[2],Ti.getHeightsScartchCarto),o=n.scene.globe.terrainProvider;return o instanceof d.EllipsoidTerrainProvider?n.scene.globe.getHeight(r):(s=(await d.sampleTerrainMostDetailed(o,[r]))[0])==null?void 0:s.height}getCameraInfo(){if(!this.viewer)return;const{camera:t}=this.viewer;return{position:Ln(t),rotation:Xl(t)}}calcFlyToParam(t){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!t)return;const r=d.Cartesian3.fromDegrees(...t),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,n.positionWC,new d.Cartesian3),c=d.Cartesian3.magnitude(a);let h=-Math.asin(a.z/c);h=d.Math.toDegrees(h);let p=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(p+=a.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=Xl(n),g=f[0]-p,m=f[1]-h;return{distance:c,heading:p,pitch:h,flyDuration:1,hDelta:g,pDelta:m}}flyIn(t,n,r,o="default"){var c;const s={position:t,rotation:n,duration:(r??1)*1e3},a=(c=this.viewer)==null?void 0:c.camera;return a&&Qu(a,s,o)}flyTo(t,n,r="default"){var m;const{distance:o,heading:s,pitch:a,flyDuration:c,hDelta:h,pDelta:p}=t,f={position:n,viewDistance:o,rotation:[s,a,0],duration:c*1e3,hdelta:h,pdelta:p},g=(m=this.viewer)==null?void 0:m.camera;return g&&Qu(g,f,r)}flyToBoundingSphere(t,n,r=1){var f;const o=[[t[0],t[1],0],[t[0],t[3],0],[t[2],t[3],0],[t[2],t[1],0]],s=l.getGeoBoundingSphereFromPositions(o);if(!s)return;const{center:a,radius:c}=s,h={position:a,viewDistance:n??c,rotation:[0,-90,0],duration:r*1e3},p=(f=this.viewer)==null?void 0:f.camera;return p&&Qu(p,h)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:t}=this.viewer;return{position:Ln(t),rotation:Xl(t)}}transformFlyParam(t,n){if("position"in n){const r=d.Cartesian3.fromDegrees(...t),o=d.Transforms.eastNorthUpToFixedFrame(r),s=d.Matrix4.inverse(o,new d.Matrix4),a=d.Matrix4.multiplyByPoint(s,Gt(n.position),new d.Cartesian3),c=d.Cartesian3.magnitude(a);let h=-Math.asin(a.z/c);h=d.Math.toDegrees(h);let p=d.Math.PI_OVER_TWO-Math.atan(a.y/a.x);a.x>0&&(p+=a.y<0?-d.Math.PI:d.Math.PI),p=d.Math.toDegrees(p);const f=n.rotation[0]-p,g=n.rotation[1]-h;return{distance:c,heading:p,pitch:h,flyDuration:n.flyDuration??1,hDelta:f,pDelta:g}}else{const r=Gt(t);let o={heading:d.Math.toRadians(n.heading),pitch:d.Math.toRadians(n.pitch),roll:0};const s=new d.HeadingPitchRoll;if(n.distance){s.heading=o.heading,s.pitch=o.pitch,s.roll=0,s.heading-=d.Math.PI_OVER_TWO;const c=d.Transforms.headingPitchRollToFixedFrame(r,s,void 0,void 0),h=d.Matrix4.multiplyByPointAsVector(c,d.Cartesian3.UNIT_X,new d.Cartesian3);d.Cartesian3.multiplyByScalar(h,n.distance,h),d.Cartesian3.subtract(r,h,r)}n.hDelta&&(o.heading+=d.Math.toRadians(n.hDelta)),n.pDelta&&(o.pitch+=d.Math.toRadians(n.pDelta));const a=xt(r);return a?{position:a,rotation:[d.Math.toDegrees(o.heading),d.Math.toDegrees(o.pitch),d.Math.toDegrees(o.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(t,n=4.2,r=1.6){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToWalk(t,n,r),this._navigationMode.value="Walk"}changeToMap(){var t,n;(n=(t=this._viewerInstance)==null?void 0:t.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(t,n,r){var o,s;(s=(o=this._viewerInstance)==null?void 0:o.obj)==null||s.navigationManager.changeToRotateGlobe(t,n,r),this._navigationMode.value="RotateGlobe"}changeToLine(t,n,r,o,s,a){var c,h;(h=(c=this._viewerInstance)==null?void 0:c.obj)==null||h.navigationManager.changeToLine(t,n,r,o,s,a),this._navigationMode.value="Line"}changeToUserDefined(t){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(t,n,r,o,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToRotatePoint(t,n,r,o,s),this._navigationMode.value="RotatePoint"}changeToFollow(t,n,r,o,s){var a,c;(c=(a=this._viewerInstance)==null?void 0:a.obj)==null||c.navigationManager.changeToFollow(t,n,r,o,s),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(t){return Promise.resolve(void 0)}async getVersion(){const t=globalThis.g_XE3CopyRights??{};return t.cesium={version:d.VERSION},t}async getHeightByLonLat(t,n,r){if(!this.viewer)return null;const o=d.Cartographic.fromDegrees(t,n,void 0,Ti.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(o)??null}async getHeightsByLonLats(t,n){const r=t.map(s=>this.getHeightByLonLat(...s));return await Promise.all(r)}async capture(t,n){if(this.viewer)return await BC(this.viewer.scene,t,n)}async lonLatAltToScreenPosition(t){if(!this.viewer||!this.isPointVisible(t))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Gt(t));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(t){this._notSupportEditingCount.value=t}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(t,n,r){r=Object.assign({useKeyToSwitch:!0,callSource:"outer"},r);const o=t.components.main??t;o&&n!=null&&(o.editingID=`${r.callSource}_${l.createGuid()}`,this._editingSystem.create(this,o,n,r.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(t){const n=[],r=l.createGuid();for(let o=0;o<t.length;o++){const s=t[o],a=s.components.main??s;a.editingID=r,a&&n.push(a)}this._moveObjectsProcess.restart(void 0,this,n,r)}getCzmObject(t){return this.sceneObjectsMap.get(t)}setCurrentDefaultAccessToken(){this.ionAccessToken=Ti.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Ti.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Ti.latestDefaultAccessToken}positionsToLocalPositions(t,n){return pi(t,n)}localPositionsToPositions(t,n){return As(t,n)}isPointVisible(t){if(!this.viewer)return!1;const n=t instanceof d.Cartesian3?t:Gt(t),r=new d.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(r.cameraPosition=this.viewer.scene.camera.positionWC,!r.isPointVisible(n))return!1;const o=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!o||o.x<0||o.y<0)}getESProperties(){const t={...super.getESProperties()},n=Ti.defaults;return{...t,more:[...t.more,new l.DivideProperty("通用"),new l.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",S7,b7,!0),new l.MethodProperty("获取Cesium官方TOKEN",()=>Ti.getCesiumIonToken(),[],"获取官方token"),new l.MethodProperty("重置为当前使用的Cesium版本的TOKEN",()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new l.MethodProperty("重置为当前Cesium官方的最新token",()=>this.setLatestDefaultAccessToken(),[],"重置为当前Cesium官方的最新token"),new l.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new l.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new l.DivideProperty("Viewer"),new l.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new l.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new l.BooleanProperty([this,"shadows"]),new l.DivideProperty("比例尺"),new l.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new l.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new l.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new l.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new l.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new l.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new l.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new l.DivideProperty("场景"),new l.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new l.DivideProperty("Globe"),new l.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new l.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new l.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new l.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new l.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new l.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new l.BooleanProperty([this,"sceneGlobeShowSkirts"]),new l.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new l.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new l.JsonProperty([this,"sceneGlobeClippingPlanes"]),new l.StringProperty([this,"sceneGlobeClippingPlanesId"]),new l.JsonArrayProperty([this,"sceneGlobeClippingPolygons"]),new l.JsonArrayProperty([this,"sceneGlobeClippingPolygonsId"]),new l.DivideProperty("underground"),new l.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new l.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new l.DivideProperty("Translucency"),new l.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new l.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new l.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new l.DivideProperty("Sun"),new l.BooleanProperty([this,"sun"],"sun",n.sun,!0),new l.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new l.DivideProperty("Moon"),new l.BooleanProperty([this,"moon"],"moon",n.moon,!0),new l.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new l.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new l.DivideProperty("SkyBox"),new l.BooleanProperty([this,"sceneSkyBoxShow"]),new l.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new l.DivideProperty("Background"),new l.BooleanProperty([this,"xbsjUseBackground"]),new l.StringProperty([this,"xbsjBackgroundImageUri"]),new l.ColorProperty([this,"xbsjBackgroundColor"]),new l.DivideProperty("SkyAtmosphere"),new l.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new l.DivideProperty("Fog"),new l.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new l.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new l.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new l.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new l.DivideProperty("Sscc"),new l.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new l.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new l.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new l.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new l.DivideProperty("后处理"),new l.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new l.DivideProperty("环境遮蔽"),new l.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new l.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new l.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new l.DivideProperty("Bloom"),new l.BooleanProperty([this,"scenePpsBloomEnabled"]),new l.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new l.NumberProperty([this,"scenePpsBloomContrast"]),new l.NumberProperty([this,"scenePpsBloomBrightness"]),new l.NumberProperty([this,"scenePpsBloomDelta"]),new l.NumberProperty([this,"scenePpsBloomSigma"]),new l.NumberProperty([this,"scenePpsBloomStepSize"]),new l.DivideProperty("调试"),new l.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new l.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new l.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new l.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new l.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new l.DivideProperty("Inspector"),new l.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new l.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new l.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};y(Ti,"type",Ti.register("ESCesiumViewer",Ti)),y(Ti,"getCesiumIonToken",A7),y(Ti,"currentDefaultAccessToken",d.Ion.defaultAccessToken),y(Ti,"latestDefaultAccessToken"),y(Ti,"ObjectsToExcludeWrapper",i6),y(Ti,"defaults",{...l.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(t=>180*t/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:d.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:d.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:d.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}),y(Ti,"getHeightsScartchCarto",new d.Cartographic);let ne=Ti;(i=>{i.createDefaultProps=()=>({...l.ESViewer.createDefaultProps(),...E7()})})(ne||(ne={})),l.extendClassProps(ne.prototype,ne.createDefaultProps),M.copyright=void 0;try{const i="earthsdk3-cesium",e="3.8.3",t="2026-04-08T02:51:44.000Z",n="北京西部世界科技有限公司",r="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",o="d0b97d4259cdb0d69fb9f2148dd2d3da3bc752e3",a=((Date.now()-1775616704e3)/36e5).toFixed(1),c=`%c🌏 ${i}%c ${e}.${o.slice(0,8)}.${t} (距今${a}个小时)
|
|
3710
3710
|
%c${r?r+`
|
|
3711
3711
|
`:""}当前网站正在使用${i},此软件版权归${n}所有
|
|
3712
|
-
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
3712
|
+
`;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","d0b97d4259cdb0d69fb9f2148dd2d3da3bc752e3")},get info(){return c},get date(){return"2026-04-08T02:51:44.000Z"},get author(){return"suplyang"},get version(){return"3.8.3"},get name(){return"earthsdk3-cesium"},get commitId(){return"d0b97d4259cdb0d69fb9f2148dd2d3da3bc752e3"},print(){console.info(this.info,`
|
|
3713
3713
|
font-size: 18px;
|
|
3714
3714
|
font-weight: 1000;
|
|
3715
3715
|
line-height: 1;
|