earthsdk3-cesium 3.6.0 → 3.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-cesium.iife.js +17 -17
- package/dist/earthsdk3-cesium.js +6 -6
- package/dist/earthsdk3-cesium.umd.cjs +11 -11
- package/dist/types/CzmObjects/base/InnerClass/Widget/Widget3D.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmES3DTileset/Czm3DTiles/ClippingPolygonsIdBind.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmES3DTileset/Czm3DTiles/NativeTilesetReadyResetting.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmES3DTileset/Czm3DTiles/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESBoxClipping/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESClippingPlane/CzmClippingPlanes.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESClippingPlane/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESExcavate/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESImageLabel/index.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESPolygonFlattenedPlane/CzmPolygonFlattenedPlane.d.ts.map +1 -1
- package/dist/types/CzmObjects/general/CzmESTextLabel/index.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/Clipping/ClippingPlanedIdResetting.d.ts.map +1 -1
- package/dist/types/ESCesiumViewer/Clipping/ClippingPolygonsIdResetting.d.ts.map +1 -1
- package/dist/types/EditingSystem/wrapper/RotationEditingWrapper.d.ts.map +1 -1
- package/dist/types/EditingSystem/wrapper/TranslationEditingWrapper.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -264,7 +264,7 @@ ${Nm}
|
|
|
264
264
|
${this.text??"请输入内容"}
|
|
265
265
|
</div>
|
|
266
266
|
</div>
|
|
267
|
-
</div>`;d?o.innerHTML=p:o.innerHTML=f},l=u=>{const d=this.showIcon??!0;if(d){const p=u.querySelectorAll("#xbsj-geoDivSwitchPoi-defaultpoi-icon")[0];p&&(p.onclick=()=>{(this.editing??!1)||(this.showIcon=!d)})}else{const p=u.querySelectorAll("#xbsj-geoDivSwitchPoi-defaultpoi-infos")[0];p&&(p.onclick=()=>{(this.editing??!1)||(this.showIcon=!d)})}};this.dispose(o.innerHtmlMounted.disposableOn(u=>{u&&l(u)})),r();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.textChanged,this.showIconChanged,this.sizeChanged));this.dispose(c.disposableOn(r)),this.dispose(s.changed.disposableOn(r))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}m(fo,"defaults",{text:"请输入内容"}),(t=>{t.createDefaultProps=()=>({...a.ESSceneObject.createDefaultProps(),show:!0,position:a.reactArrayWithUndefined(void 0),text:void 0,editing:!1,showIcon:!0,size:[50,50],originRatioAndOffset:a.reactArray([.5,1,0,0]),uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",zOrder:0})})(fo||(fo={})),a.extendClassProps(fo.prototype,fo.createDefaultProps);function Mc(t){return`rgba(${t[0]*255|0}, ${t[1]*255|0}, ${t[2]*255|0}, ${t[3]})`}class XP extends a.Destroyable{constructor(i,e,n){super();const o=()=>e.radius=i.radius??6;o(),this.dispose(i.radiusChanged.disposableOn(o));const s=()=>e.text=i.text;s(),this.dispose(i.textChanged.disposableOn(s));const r=()=>e.font=i.font;r(),this.dispose(i.fontChanged.disposableOn(r));const l=()=>e.fontStyle=i.fontColor&&Mc(i.fontColor);l(),this.dispose(i.fontColorChanged.disposableOn(l));const c=()=>e.fillStyle=i.color&&Mc(i.color);c(),this.dispose(i.colorChanged.disposableOn(c));const u=()=>e.outlineStyle=i.outlineColor&&Mc(i.outlineColor);u(),this.dispose(i.outlineColorChanged.disposableOn(u));const d=()=>e.selectedStyle=i.selectedColor&&Mc(i.selectedColor);d(),this.dispose(i.selectedColorChanged.disposableOn(d)),this.dispose(e.clickEvent.disposableOn((p,f,g,v,y)=>{i.clickEvent.emit(y)})),this.dispose(e.dbclickEvent.disposableOn((p,f,g,v,y)=>{i.dbclickEvent.emit(y)})),this.dispose(a.bind([e,"selected"],[i,"selected"])),this.dispose(a.bind([e,"hovered"],[i,"hovered"]))}}function cs(t,i,e,n,o){t.beginPath(),t.moveTo(i+n,e),t.arc(i,e,n,0,2*Math.PI),t.fillStyle=o,t.fill()}function YP(t,i,e,n,o,s){t.font=o;const r=t.measureText(n),l=r.actualBoundingBoxLeft+r.actualBoundingBoxRight,c=Number.isFinite(r.fontBoundingBoxAscent)?r.fontBoundingBoxAscent:r.actualBoundingBoxAscent,u=Number.isFinite(r.fontBoundingBoxDescent)?r.fontBoundingBoxDescent:r.actualBoundingBoxDescent;let d=c+u;t.fillStyle=s,t.fillText(n,i-l*.5,e+d*.5-u)}const Om=6;class ZP extends a.CanvasPoi{constructor(e){super(e);m(this,"_scale",a.react(1));m(this,"_text",a.react(void 0));m(this,"_font",a.react(void 0));m(this,"_fontStyle",a.react(void 0));m(this,"_radius",a.react(void 0));m(this,"_outlineStyle",a.react(void 0));m(this,"_selectedStyle",a.react(void 0));m(this,"_fillStyle",a.react(void 0));const n=this.disposeVar(new a.Transition(100)),o=this.disposeVar(new a.Transition(100)),s=()=>{this._clickEvent&&!this._clickEvent.empty&&(this._scale.value=(1+.1*o.current)*(1+.2*n.current))};this.dispose(o.currentChanged.disposableOn(s)),this.dispose(n.currentChanged.disposableOn(s)),this.dispose(this.activedChanged.disposableOn(r=>{o.target=r?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(r=>{n.target=r?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(r=>{this.needRedraw()})),this.dispose(this._scale.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._text.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._font.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._fontStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._radius.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._fillStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._outlineStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._selectedStyle.changed.disposableOn(()=>this.needRedraw()))}get scale(){return this._scale.value}set scale(e){this._scale.value=e}get scaleChanged(){return this._scale.changed}get text(){return this._text.value}set text(e){this._text.value=e}get textChanged(){return this._text.changed}get font(){return this._font.value}set font(e){this._font.value=e}get fontChanged(){return this._font.changed}get fontStyle(){return this._fontStyle.value}set fontStyle(e){this._fontStyle.value=e}get fontStyleChanged(){return this._fontStyle.changed}get radius(){return this._radius.value}set radius(e){this._radius.value=e}get radiusChanged(){return this._radius.changed}get outlineStyle(){return this._outlineStyle.value}set outlineStyle(e){this._outlineStyle.value=e}get outlineStyleChanged(){return this._outlineStyle.changed}get selectedStyle(){return this._selectedStyle.value}set selectedStyle(e){this._selectedStyle.value=e}get selectedStyleChanged(){return this._selectedStyle.changed}get fillStyle(){return this._fillStyle.value}set fillStyle(e){this._fillStyle.value=e}get fillStyleChanged(){return this._fillStyle.changed}draw(e){if(!this._show)return;const[n,o]=this._winPos,s=e.globalAlpha;e.globalAlpha=this.opacity;const r=(this._radius.value??Om)*this._scale.value;if(this.selected&&cs(e,n,o,r+3,this._selectedStyle.value??"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&cs(e,n,o,r+1,this._fillStyle.value??"#FFF"),this._outlineStyle.value&&(this.hovered?cs(e,n,o,r+1,this._outlineStyle.value):cs(e,n,o,r+1,this._outlineStyle.value)),cs(e,n,o,r,this._fillStyle.value??"#FFF"),this._text.value){const l=this._font.value??"bold 10px Arial",c=this._fontStyle.value??"#000";YP(e,n,o,this._text.value,l,c)}e.globalAlpha=s}drawForPick(e,n){if(!this._show)return;const[o,s]=this._winPos,r=(this._radius.value??Om)*this._scale.value,l=n("default");cs(e,o,s,r,l)}}class Sn extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_clickEvent",this.disposeVar(new a.Event));m(this,"_dbclickEvent",this.disposeVar(new a.Event));m(this,"_geoCanvasPoi");this._geoCanvasPoi=this.disposeVar(new qi(e,n));const{geoCanvasPoi:o}=this;o.canvasPoiClassAndCreateFunc=[ZP,(s,r)=>new XP(this,s,r)],this.dispose(a.track([o,"show"],[this,"show"])),this.dispose(a.track([o,"enabled"],[this,"enabled"])),this.dispose(a.bind([o,"position"],[this,"position"])),this.dispose(a.bind([o,"positionEditing"],[this,"positionEditing"])),this.dispose(a.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(a.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"])),this.dispose(this.flyToEvent.disposableOn(s=>{o.flyTo(s)})),this.dispose(this._clickEvent.disposableOn(s=>{this.pickOnClick&&this.pickedEvent.emit(new a.ESJPickedResult({type:"viewerPicking",pointerEvent:s}))}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}get geoCanvasPoi(){return this._geoCanvasPoi}}m(Sn,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:a.reactArrayWithUndefined(void 0),positionEditing:!1,radius:6,text:"",font:"bold 10px Arial",fontColor:a.reactArray([1,1,1,1]),color:a.reactArray([1,1,1,1]),outlineColor:a.reactArray([0,0,0,1]),selectedColor:a.reactArray([0,0,0,1]),hovered:!1,selected:!1,viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,pickOnClick:!1})})(Sn||(Sn={})),a.extendClassProps(Sn.prototype,Sn.createDefaultProps);class hs extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o)return;const s=this.disposeVar(pi([this,"material"])),r=(v,y)=>{const w=new h.PolylineMaterialAppearance({material:y,renderState:{depthTest:{enabled:this.depthTest??!1}}});w.renderState.depthMask=!1;const P=[];if(v.length<2)return;this.arcType==="NONE"&&console.warn("贴地折线不能使用NONE模式,如果客户设定为此模式,则强制使用GEODESIC模式来处理!");const C=this.arcType!=="RHUMB"?"GEODESIC":"RHUMB";P.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:v,width:this.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[C]}),id:this}));const S=new h.GroundPolylinePrimitive({geometryInstances:P,appearance:w,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return h.GroundPolylinePrimitive.prototype&&(S.ESSceneObjectID=n),S};let l;const c=new h.BoundingSphere,u=()=>{l&&(o.scene.primitives.remove(l),l=void 0)};this.dispose(u);const d=()=>{if(u(),!(this.show??!0)||!this.positions)return;const v=pt(this.positions);if(v.length<2||!s.value){c.radius=-1;return}h.BoundingSphere.fromPoints(v,c),l=r(v,s.value),l&&o.scene.primitives.add(l)},p=()=>{l&&(l.show=this.show??!0)};d(),p();const f=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,s.changed,this.arcTypeChanged,this.allowPickingChanged,this.depthTestChanged));this.dispose(f.disposableOn(()=>{d(),p()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(g.disposableOn(()=>{p()})),this.dispose(this.flyToEvent.disposableOn(v=>{if(e.actived&&(f.flush(),g.flush(),c.radius>0)){const y=se(c.center);y&&ne(o,y,c.radius*4,void 0,v)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,material:a.reactJson({type:"Color"}),depthTest:void 0})})(hs||(hs={})),a.extendClassProps(hs.prototype,hs.createDefaultProps);class us extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o)return;const s=this.disposeVar(pi([this,"material"])),r=(v,y)=>{const w=new h.PolylineMaterialAppearance({material:y,renderState:{depthTest:{enabled:this.depthTest??!1}}});w.renderState.depthMask=!1;const P=[];if(v.length<2)return;P.push(new h.GeometryInstance({geometry:new h.PolylineGeometry({positions:v,width:this.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:this.arcType&&h.ArcType[this.arcType]}),id:this}));const C=new h.Primitive({geometryInstances:P,appearance:w,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(C.ESSceneObjectID=n),C};let l;const c=new h.BoundingSphere,u=()=>{l&&(o.scene.primitives.remove(l),l=void 0)};this.dispose(u);const d=()=>{if(u(),!this.positions)return;const v=pt(this.positions);if(v.length<2||!s.value){c.radius=-1;return}h.BoundingSphere.fromPoints(v,c),l=r(v,s.value),l&&o.scene.primitives.add(l)},p=()=>{l&&(l.show=this.show??!0)};d(),p();const f=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,s.changed,this.arcTypeChanged,this.allowPickingChanged,this.depthTestChanged));this.dispose(f.disposableOn(()=>{d(),p()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(g.disposableOn(()=>{p()})),this.dispose(this.flyToEvent.disposableOn(v=>{if(e.actived&&(g.flush(),f.flush(),c.radius>0)){const y=se(c.center);y&&ne(o,y,c.radius*4,void 0,v)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,material:a.reactJson({type:"Color"}),depthTest:void 0})})(us||(us={})),a.extendClassProps(us.prototype,us.createDefaultProps);class xe extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_polylineOrGroundPolylineResetting");m(this,"_czmViewVisibleDistanceRangeControl");m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_positionsCenter");n&&(this.id=n),this._positionsCenter=this.ad(new Cu(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new no(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(a.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"])),this._polylineOrGroundPolylineResetting=this.disposeVar(new a.ObjResettingWithEvent(this.groundChanged,()=>this.ground?new kP(e,this):new QP(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylineOrGroundPolylineResetting(){return this._polylineOrGroundPolylineResetting}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}}m(xe,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),loop:!1,width:2,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,customArrow:!1,customArrowParams:a.reactJson({repeat:60,speed:.1,color:[1,1,1,1],arrowColor:[1,1,1,1],image:"",lineLength:10}),arcType:"GEODESIC",depthTest:!1,zIndex:0,viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(xe||(xe={})),a.extendClassProps(xe.prototype,xe.createDefaultProps);class QP extends a.Destroyable{constructor(i,e){super();const n=this.disposeVar(new us(i,e.id));this.dispose(a.track([n,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([n,"depthTest"],[e,"depthTest"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(...Wm(e),e.czmViewVisibleDistanceRangeControl.visibleAlphaChanged));{const s=()=>{const{visibleAlpha:r}=e.czmViewVisibleDistanceRangeControl;n.show=e.show&&r>0,n.arcType=e.arcType,n.width=e.width,n.positions=Vm(e),n.material=Bm(e)};s(),this.dispose(o.disposableOn(s))}this.dispose(e.flyToEvent.disposableOn(s=>{o.flush(),e.viewDistanceRange||n.flyTo(s)}))}}class kP extends a.Destroyable{constructor(i,e){super();const n=this.disposeVar(new hs(i,e.id));this.dispose(a.track([n,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([n,"depthTest"],[e,"depthTest"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(...Wm(e),e.czmViewVisibleDistanceRangeControl.visibleAlphaChanged));{const s=()=>{const{visibleAlpha:r}=e.czmViewVisibleDistanceRangeControl;n.show=e.show&&r>0,n.arcType=e.arcType,n.width=e.width,n.positions=Vm(e),n.material=Bm(e)};s(),this.dispose(o.disposableOn(s))}this.dispose(e.flyToEvent.disposableOn(s=>{o.flush(),e.viewDistanceRange||n.flyTo(s)}))}}function Bm(t){const i=t.color,e=t.gapColor;let n;return t.hasDash?n={type:"PolylineDash",color:i,gapColor:e,dashLength:t.dashLength,dashPattern:t.dashPattern}:t.customArrow?n={type:"XbsjPolylineArrow",...t.customArrowParams}:t.hasArrow?n={type:"PolylineArrow",color:i}:n={type:"Color",color:i},n}function Vm(t){return t.loop&&t.positions&&t.positions.length>=3?[...t.positions,t.positions[0]]:t.positions}function Wm(t){return[t.showChanged,t.positionsChanged,t.loopChanged,t.widthChanged,t.colorChanged,t.hasDashChanged,t.gapColorChanged,t.dashLengthChanged,t.dashPatternChanged,t.hasArrowChanged,t.customArrowChanged,t.arcTypeChanged,t.depthTestChanged,t.customArrowParamsChanged]}function KP(t){if(t.type==="BoxEmitter"){const i=t.dimensions;return i?new h.BoxEmitter(hi(i)):void 0}else if(t.type==="CircleEmitter"){const i=t.radius;return new h.CircleEmitter(i)}else if(t.type==="ConeEmitter"){const i=t.angle;return new h.ConeEmitter(i)}else if(t.type==="SphereEmitter"){const i=t.radius;return new h.SphereEmitter(i)}}const Vi=class Vi extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_player");m(this,"_updateCallbackFunc",this.disposeVar(a.react(void 0)));m(this,"_disposeUpdateCallbackFunc",(()=>{this.dispose(this.updateCallbackFuncChanged.don(e=>{e?this.updateCallback=e.toString():this.updateCallback=void 0}))})());m(this,"_disposeUpdateCallback",(()=>{this.dispose(this.updateCallbackChanged.don(e=>{e?this.updateCallbackFunc=Function('"use strict";return ('+e+")")():this.updateCallbackFunc=void 0}))})());m(this,"_primitive");this._player=this.disposeVar(new a.Player);const o=e.viewer;if(o){{const s=Vi.defaults;this.dispose(a.bind([this._player,"loop"],[this,"playingLoop"],r=>r??s.playingLoop,r=>r??s.playingLoop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],r=>r??s.currentTime,r=>r??s.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],r=>r??s.duration,r=>r??s.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],r=>r??s.playing,r=>r??s.playing)),this.dispose(a.bind([this._player,"speed"],[this,"playingSpeed"],r=>r??s.playingSpeed,r=>r??s.playingSpeed))}{const s=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.dispose(s);const r=()=>{const P=this.position??[0,0,0];return h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(P[0],P[1],P[2]))},l=()=>{const P=this.rotation??[0,0,0],C=this.translation??[0,0,0],S=h.HeadingPitchRoll.fromDegrees(P[0],P[1],P[2],new h.HeadingPitchRoll);let A=new h.TranslationRotationScale;return A.translation=h.Cartesian3.fromElements(C[0],C[1],C[2],new h.Cartesian3),A.rotation=h.Quaternion.fromHeadingPitchRoll(S,new h.Quaternion),h.Matrix4.fromTranslationRotationScale(A,new h.Matrix4)},c=()=>{if(!this.bursts)return;let P=[];return this.bursts.forEach(C=>{const S=new h.ParticleBurst({time:C[0],minimum:C[1],maximum:C[2]});P.push(S)}),P},u=()=>{const P=r(),C=l(),S=c(),A=KP(this.emitter??Vi.defaults.emitter),E=new h.ParticleSystem({emitter:A,bursts:S,modelMatrix:P,emitterModelMatrix:C,updateCallback:this.updateCallbackFunc?(R,N)=>{this.updateCallbackFunc&&this.updateCallbackFunc(R,N)}:void 0,image:a.ESSceneObject.context.getStrFromEnv(this.image&&this.image.length!=0?this.image:Vi.defaults.image),imageSize:Pe(this.imageSize??Vi.defaults.imageSize),minimumImageSize:this.minimumImageSize&&Pe(this.minimumImageSize),maximumImageSize:this.maximumImageSize&&Pe(this.maximumImageSize),show:this.show,emissionRate:this.emissionRate,loop:this.loop,scale:this.scale,startScale:this.startScale,endScale:this.endScale??Vi.defaults.endScale,color:this.color&&te(this.color),startColor:this.startColor&&te(this.startColor),endColor:this.endColor&&te(this.endColor),sizeInMeters:this.sizeInMeters,speed:this.speed,minimumSpeed:this.minimumSpeed,maximumSpeed:this.maximumSpeed,lifetime:this.lifetime,particleLife:this.particleLife??Vi.defaults.particleLife,minimumParticleLife:this.minimumParticleLife,maximumParticleLife:this.maximumParticleLife,mass:this.mass,minimumMass:this.minimumMass,maximumMass:this.maximumMass});return h.ParticleSystem.prototype&&(E.ESSceneObjectID=n),E},d=()=>{s(),this._primitive=u(),this._primitive&&o.scene.primitives.add(this._primitive)},p=()=>{if(!this._primitive)return;const P=this.show??!0;this._primitive.show=P,this.image&&(this._primitive.image=a.ESSceneObject.context.getStrFromEnv(this.image&&this.image.length!=0?this.image:Vi.defaults.image))};d(),p();const f=this.disposeVar(a.createNextAnimateFrameEvent(this.emitterChanged,this.burstsChanged,this.emissionRateChanged,this.loopChanged,this.scaleChanged,this.startScaleChanged,this.endScaleChanged,this.colorChanged,this.startColorChanged,this.endColorChanged,this.imageSizeChanged,this.minimumImageSizeChanged,this.maximumImageSizeChanged,this.sizeInMetersChanged,this.speedChanged,this.minimumSpeedChanged,this.maximumSpeedChanged,this.lifetimeChanged,this.particleLifeChanged,this.minimumParticleLifeChanged,this.maximumParticleLifeChanged,this.massChanged,this.minimumMassChanged,this.maximumMassChanged,this.updateCallbackFuncChanged));this.dispose(f.disposableOn(()=>{d(),p()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.imageChanged));this.dispose(g.disposableOn(()=>{p()}));const v=()=>{if(!this._primitive)return;const P=r(),C=l();this._primitive.modelMatrix=P,this._primitive.emitterModelMatrix=C},y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.translationChanged));this.dispose(y.disposableOn(v));const w=()=>{this._primitive&&(this._primitive.timeStamp=this.currentTime)};w(),this.dispose(this.currentTimeChanged.disposableOn(w)),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("当前没有位置信息,无法飞入!");return}const P=this.position[2]+100;ne(o,this.position,P,void 0,1e3)}))}}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get updateCallbackFunc(){return this._updateCallbackFunc.value}set updateCallbackFunc(e){this._updateCallbackFunc.value=e}get updateCallbackFuncChanged(){return this._updateCallbackFunc.changed}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get primitive(){return this._primitive}};m(Vi,"defaults",{playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0,ratio:0,particleLife:.5,endScale:4,imageSize:[20,20],image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",emitter:{type:"CircleEmitter",radius:.5}});let bi=Vi;(t=>{t.createDefaultProps=()=>({emitter:a.reactJsonWithUndefined(void 0),bursts:a.reactArrayCollectionWithUndefined(void 0),position:a.reactArrayWithUndefined(void 0),translation:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),image:void 0,imageSize:void 0,minimumImageSize:void 0,maximumImageSize:void 0,show:void 0,updateCallback:void 0,emissionRate:void 0,loop:void 0,scale:void 0,startScale:void 0,endScale:void 0,color:a.reactArrayWithUndefined(void 0),startColor:a.reactArrayWithUndefined(void 0),endColor:a.reactArrayWithUndefined(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:void 0,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:void 0,currentTime:void 0,duration:void 0,playingSpeed:void 0,playing:void 0})})(bi||(bi={})),a.extendClassProps(bi.prototype,bi.createDefaultProps);class JP extends a.Destroyable{constructor(e,n){super();m(this,"_model");m(this,"_geoPoint");m(this,"_geoAxis");this._model=this.disposeVar(new ct(n,e.id)),this._geoPoint=this.disposeVar(new ti(n,e.id)),this._geoAxis=this.disposeVar(new xe(n,e.id)),this._geoAxis.hasArrow=!0,this._geoAxis.width=10;{this._model.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._model.localRotation=[90,0,0],this._model.allowPicking=!1,this._model.pixelSize=30;{const o=()=>{e.position&&(this._model.position=Hg(e.position,e.rotation??[0,0,0],e.viewDistance??0),this._model.rotation=e.rotation??[0,0,0])};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.viewDistanceChanged));this.dispose(s.disposableOn(o))}{const o=()=>{const r=n.getCameraInfo();if(!r)return;const l=r.position,c=this._model.position;if(!c)return;const u=h.Cartesian3.fromDegrees(c[0],c[1],c[2]),d=h.Cartesian3.fromDegrees(l[0],l[1],l[2]),p=h.Cartesian3.distanceSquared(u,d);this._model.show=p>1};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(n.cameraChanged,this._model.positionChanged));this.dispose(s.disposableOn(o))}}{this._geoAxis.width=6,this._geoAxis.color=[1,1,0,.7];{const o=()=>{e.position&&this.model.position&&(this._geoAxis.positions=[this.model.position,e.position])};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this._model.positionChanged));this.dispose(s.disposableOn(o))}}}get model(){return this._model}get geoPoint(){return this._geoPoint}get geoAxis(){return this._geoAxis}}const un=class un extends a.Destroyable{constructor(e,n){super();m(this,"_captureEvent",this.disposeVar(new a.Event));m(this,"_id",this.disposeVar(a.react(a.createGuid())));this._czmViewer=e,n&&(this.id=n);const o=e.viewer;if(!o)return;this.disposeVar(new a.ObjResettingWithEvent(this.showChanged,()=>{if(this.show&&this.position)return new JP(this,e)})),this.default&&this.flyTo(void 0,!1);const s=this.disposeVar(a.createProcessingFromAsyncFunc(async l=>{const{position:c,rotation:u,viewDistance:d,duration:p=1e3}=this;if(c){const f=ne(o,c,d,u,p,()=>{this.enabled=!1});f&&await l.promise(f),this.enabled=!1}}));this.dispose(this.enabledChanged.disposableOn(()=>{s.isRunning&&s.cancel(),this.enabled&&s.restart()}));const r=this.disposeVar(a.createProcessingFromAsyncFunc(async(l,c,u)=>{const d=e.capture(c,u);if(!d)return;const p=await l.promise(d);p&&(this.thumbnail=p)}));this.dispose(this.captureEvent.disposableOn((l,c)=>{r.restart(void 0,l??un.defaults.thumbnailWidth,c??un.defaults.thumbnailHeight)}))}get captureEvent(){return this._captureEvent}capture(e,n){this._captureEvent.emit(e,n)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}resetWithCurrentCamera(e){const{_czmViewer:n}=this;if(!n.actived)return;const{viewer:o}=this._czmViewer;if(!o)return;const s=this;e&un.ResetFlag.Position&&(s.position=Ht(o.camera)),e&un.ResetFlag.Rotation&&(s.rotation=jo(o.camera)),e&un.ResetFlag.ViewDistance&&(s.viewDistance=0)}flyTo(e,n,o="default"){if((n??!0)&&!this._czmViewer.actived)return;const{_czmViewer:{viewer:s}}=this,{position:r,rotation:l,viewDistance:c,duration:u}=this;!s||!r||ne(s,r,c,l,e??u,void 0,o)}};m(un,"ResetFlag",{Position:1,Rotation:2,ViewDistance:4}),m(un,"defaults",{thumbnailWidth:64,thumbnailHeight:64,enabled:!0,show:!1,position:[116.39,39.9,100],duration:1e3,default:!1,thumbnail:""});let Ft=un;(t=>{t.createDefaultProps=()=>({enabled:!0,position:a.reactArrayWithUndefined(void 0),positionEditing:!1,show:!1,rotation:a.reactArray([0,0,0]),viewDistance:0,duration:void 0,default:!1,thumbnail:""})})(Ft||(Ft={})),a.extendClassProps(Ft.prototype,Ft.createDefaultProps);function Gm(t,i){let e=[0,0];if(!t||!i)return e;const n=t.cloneNode(!0);n.style.position="absolute",n.style.top="0",n.style.zIndex="-1",document.body.appendChild(n);const o=n.querySelector(`.${i}-anchor`)??n.querySelector(`.${i}-iconBox`);if(o&&o.parentElement){const s=(o.parentElement.offsetTop+o.parentElement.offsetHeight-(["Flag01"].includes(i)?10:["P3D02","P3D04"].includes(i)?15:0))/n.offsetHeight;e=[(o.offsetLeft+o.width/2)/n.offsetWidth,s<1?s:1]}return document.body.removeChild(n),e}class xn extends a.Destroyable{constructor(e,n,o,s,r=!0){super();m(this,"widgetInfo");m(this,"_czmGeoCustomDivPoi");m(this,"sceneObject");m(this,"domSize");m(this,"_defaultAnchor",this.disposeVar(a.react([0,0])));m(this,"flyTo",(e,n)=>{if(this.czmGeoCustomDivPoi.position){ne(this._czmViewer.viewer,this.czmGeoCustomDivPoi.position,1e3,ei,e);return}this.czmGeoCustomDivPoi.flyTo(e&&e*1e3)});m(this,"createInstanceClass",()=>{let e=this;return class extends a.Destroyable{constructor(o,s,r){if(super(),this._subContainer=o,!r||!(r instanceof Me))return;const l=e.widgetInfo;this._subContainer.appendChild(l),this.dispose(()=>{this._subContainer.removeChild(l)});{const c=()=>{l.style.pointerEvents=e.sceneObject.editing?"none":"all"};c(),this.d(e.sceneObject.editingChanged.don(c))}}}});this._sceneObject=e,this._czmViewer=n,this._widgetInfo=o,this._drawWidget=s,this._czmGeoCustomDivPoi=this.disposeVar(new Ue(n,e.id));let l=this.sceneObject=this._sceneObject;this._czmViewer,this.widgetInfo=this._widgetInfo,l instanceof a.ESPoi2D&&(this.defaultAnchor=Gm(this.widgetInfo,l.mode));const{czmGeoCustomDivPoi:c}=this;this.d(a.track([c,"zOrder"],[l,"zOrder"])),this.dispose(a.track([c,"show"],[l,"show"])),this.dispose(a.bind([c,"position"],[l,"position"])),l instanceof a.ESWidget&&this.dispose(a.track([c,"opacity"],[l,"opacity"]));{const u=this.dv(a.createNextAnimateFrameEvent(l.allowPickingChanged,l.editingChanged)),d=()=>{l.allowPicking&&!l.editing?c.allowPicking=!0:c.allowPicking=!1};d(),this.d(u.don(d))}if(this.d(c.pickedEvent.don(u=>{var f;const d=(f=po(u,"pickResult"))==null?void 0:f.pointerEvent;if(!d)return;const p={type:d.buttons!=0&&d.button==0?"leftClick":d.button==2?"rightClick":void 0,add:{mousePos:[d.offsetX,d.offsetY]}};p.type==null&&(p.type=d.type),l.widgetEvent.emit(p)})),(()=>{try{s?c.instanceClass=this.createInstanceClass():c.instanceClass=void 0}catch(d){console.log(d)}})(),r){const u=()=>{const p=l.anchor,f=l.offset;p?c.originRatioAndOffset=[...p,-f[0],-f[1]]:c.originRatioAndOffset=[0,0,0,0]};u();const d=this.ad(a.createNextAnimateFrameEvent(l.anchorChanged,l.offsetChanged));this.dispose(d.disposableOn(u))}{const u=async()=>{let p,f;if((!this.domSize||this.domSize.width==0||this.domSize.height==0)&&(this.domSize=this.widgetInfo.getBoundingClientRect(),this.domSize.width==0||this.domSize.height==0)){const g=setTimeout(()=>{u(),clearTimeout(g)},200);return}l.sizeByContent?(p=this.domSize.width,f=this.domSize.height):(p=l.size[0],f=l.size[1]),this.widgetInfo.style.transform=`scale(${p/this.domSize.width*l.scale[1]},${f/this.domSize.height*l.scale[2]})`,this.widgetInfo.style.transformOrigin=`${l.anchor[0]*100}% ${l.anchor[1]*100}%`};u();const d=this.disposeVar(a.createNextAnimateFrameEvent(l.sizeChanged,l.sizeByContentChanged,l.scaleChanged));this.dispose(d.disposableOn(u))}}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}get defaultAnchor(){return this._defaultAnchor.value}set defaultAnchor(e){this._defaultAnchor.value=e}get defaultAnchorChanged(){return this._defaultAnchor.changed}}class Dc extends a.Destroyable{constructor(e,n,o,s,r=!0){super();m(this,"widgetInfo");m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"_czmCustomPrimitive");m(this,"_czmTexture");m(this,"sceneObject");m(this,"domSize");m(this,"_defaultAnchor",this.disposeVar(a.react([0,0])));m(this,"czmViewer");m(this,"flyTo",(e,n)=>{Rt(this.czmViewer,this.sceneObject,n,e,this.czmCustomPrimitive,!0)});this._sceneObject=e,this._czmViewer=n,this._widgetInfo=o,this._drawWidget=s,this._czmCustomPrimitive=this.disposeVar(new Fe(n,e.id)),this._czmTexture=this.ad(new Ne(n));let l=this.sceneObject=this._sceneObject,c=this.czmViewer=this._czmViewer;this.widgetInfo=this._widgetInfo,l instanceof a.ESPoi2D&&(this.defaultAnchor=Gm(this.widgetInfo,l.mode));const{czmTexture:u}=this,{czmCustomPrimitive:d}=this;d.localRotation=[-90,0,0],this.dispose(a.bind([d,"position"],[l,"position"]));{const p=this.dv(a.createNextAnimateFrameEvent(l.allowPickingChanged,l.editingChanged)),f=()=>{l.allowPicking&&!l.editing?d.allowPicking=!0:d.allowPicking=!1};f(),this.d(p.don(f))}this.ad(n.clickEvent.don(p=>{const f=p==null?void 0:p.pointerEvent;f&&(this._isPointEvent=!0,this._eventInfo={type:f.button==0?"leftClick":f.button==2?"rightClick":"leftClick",add:{mousePos:[f.offsetX,f.offsetY]}})})),this.d(l.pickedEvent.don(p=>{var f,g,v;p.screenPosition&&this._isPointEvent&&p.attachedInfo!="innerHoverEvent"&&((f=this._eventInfo.add)!=null&&f.mousePos)&&Math.abs(p.screenPosition[0]-((g=this._eventInfo.add)==null?void 0:g.mousePos[0]))<1&&Math.abs(p.screenPosition[1]-((v=this._eventInfo.add)==null?void 0:v.mousePos[1]))<1&&(l.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,l,()=>{const p=c.getEngineObject(l);this.ad(p.lastHoverResultChanged.don((f,g)=>{(f==null?void 0:f.sceneObject)==(g==null?void 0:g.sceneObject)||(f==null?void 0:f.sceneObject)!=l&&(g==null?void 0:g.sceneObject)!=l||(f!=null&&f.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:f==null?void 0:f.screenPosition}},f.sceneObject.widgetEvent.emit(this._eventInfo)),g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:f==null?void 0:f.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo)))}))});{const p=()=>{d.scale=[l.scale[1],l.scale[0],l.scale[2]]};p(),this.d(l.scaleChanged.don(p))}d.indexTypedArray=new Uint16Array([0,1,2,0,2,3,6,5,4,7,6,4]);{const p=()=>{this._drawWidget&&(d.show=l.show)};p(),this.d(l.showChanged.don(p))}if(this.disposeVar(new a.ObjResettingWithEvent(l.rotationTypeChanged,()=>{if(l.rotationType==0)return new tb(this);if(l.rotationType==1)return new jP(this);if(l.rotationType==2)return new eb(this)})),(()=>{try{if(this._drawWidget){const f=this.widgetInfo.cloneNode(!0);f.style.position="fixed",f.style.zIndex="-1",f.style.top="0px",document.body.contains(f)||(document.body.appendChild(f),this.domSize=f.getBoundingClientRect()),tu(f,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:f.offsetWidth,height:f.offsetHeight,scale:2}).then(g=>{document.body.contains(f)&&document.body.removeChild(f),this.czmTexture.copyFromCanvas(g),this.czmCustomPrimitive.uniformMap={u_image:{type:"texture",id:`${this.czmTexture.id}`},u_color:[1,1,1,1]}}).catch(()=>{document.body.contains(f)&&document.body.removeChild(f)})}else this.czmCustomPrimitive.uniformMap=void 0,this.czmCustomPrimitive.show=!1}catch(f){console.log(f)}})(),r){const p=()=>{const g=l.anchor,v=l.offset;let y=100,w=100;l.sizeByContent&&this.domSize?(y=this.domSize.width/100,w=this.domSize.height/100):(y=l.size[0]/100,w=l.size[1]/100),g?this.czmCustomPrimitive.localPosition=[g[0]*y-v[0]/100,0,g[1]*w-v[1]/100]:this.czmCustomPrimitive.localPosition=[0,0,0]};p();const f=this.ad(a.createNextAnimateFrameEvent(l.anchorChanged,l.offsetChanged));this.dispose(f.disposableOn(p))}{const p=()=>{let g,v;l.sizeByContent&&this.domSize?(g=this.domSize.width/100,v=this.domSize.height/100):(g=l.size[0]/100,v=l.size[1]/100),this.czmCustomPrimitive.attributes={position:{typedArray:new Float32Array([0,0,0,0,g,0,0,g,-v,0,0,-v,0,0,0,0,g,0,0,g,-v,0,0,-v]),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([1,1,0,1,0,0,1,0,0,1,1,1,1,0,0,0]),componentsPerAttribute:2}},this.czmCustomPrimitive.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[0,0,-v],max:[0,g,0]}},this.czmCustomPrimitive.localPosition=[l.anchor[0]*g,0,l.anchor[1]*v]};p();const f=this.disposeVar(a.createNextAnimateFrameEvent(l.sizeChanged,l.sizeByContentChanged));this.dispose(f.disposableOn(p))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}get defaultAnchor(){return this._defaultAnchor.value}set defaultAnchor(e){this._defaultAnchor.value=e}get defaultAnchorChanged(){return this._defaultAnchor.changed}}class jP extends a.Destroyable{constructor(i){super(),this._widget3D=i;const{sceneObject:e,czmCustomPrimitive:n,czmViewer:o}=this._widget3D;{const s=()=>{const r=o.getCameraInfo();if(!r)return;const l=r.rotation;n.rotation=[l[0]+180,0-l[1],l[2]]};s(),this.dispose(o.cameraChanged.disposableOn(s))}}}class eb extends a.Destroyable{constructor(i){super(),this._widget3D=i;const{sceneObject:e,czmCustomPrimitive:n,czmViewer:o}=this._widget3D,{rotation:s}=e;{const r=()=>{const c=o.getCameraInfo();c&&(n.rotation=[c.rotation[0]+180,s[1],s[2]])};r();const l=this.ad(a.createNextAnimateFrameEvent(e.rotationChanged,o.cameraChanged));this.dispose(l.disposableOn(r))}}}class tb extends a.Destroyable{constructor(i){super(),this._widget3D=i;const{sceneObject:e,czmCustomPrimitive:n}=this._widget3D;this.dispose(je([n,"rotation"],[e,"rotation"]))}}const wa=class wa extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_customPrimitive");const o=this._customPrimitive=this.disposeVar(new Fe(e,n));o.indexTypedArray=new Uint16Array([0,1,2,0,2,3,6,5,4,7,6,4]),o.pass="TRANSLUCENT";const s=`
|
|
267
|
+
</div>`;d?o.innerHTML=p:o.innerHTML=f},l=u=>{const d=this.showIcon??!0;if(d){const p=u.querySelectorAll("#xbsj-geoDivSwitchPoi-defaultpoi-icon")[0];p&&(p.onclick=()=>{(this.editing??!1)||(this.showIcon=!d)})}else{const p=u.querySelectorAll("#xbsj-geoDivSwitchPoi-defaultpoi-infos")[0];p&&(p.onclick=()=>{(this.editing??!1)||(this.showIcon=!d)})}};this.dispose(o.innerHtmlMounted.disposableOn(u=>{u&&l(u)})),r();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.textChanged,this.showIconChanged,this.sizeChanged));this.dispose(c.disposableOn(r)),this.dispose(s.changed.disposableOn(r))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}m(fo,"defaults",{text:"请输入内容"}),(t=>{t.createDefaultProps=()=>({...a.ESSceneObject.createDefaultProps(),show:!0,position:a.reactArrayWithUndefined(void 0),text:void 0,editing:!1,showIcon:!0,size:[50,50],originRatioAndOffset:a.reactArray([.5,1,0,0]),uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",zOrder:0})})(fo||(fo={})),a.extendClassProps(fo.prototype,fo.createDefaultProps);function Mc(t){return`rgba(${t[0]*255|0}, ${t[1]*255|0}, ${t[2]*255|0}, ${t[3]})`}class XP extends a.Destroyable{constructor(i,e,n){super();const o=()=>e.radius=i.radius??6;o(),this.dispose(i.radiusChanged.disposableOn(o));const s=()=>e.text=i.text;s(),this.dispose(i.textChanged.disposableOn(s));const r=()=>e.font=i.font;r(),this.dispose(i.fontChanged.disposableOn(r));const l=()=>e.fontStyle=i.fontColor&&Mc(i.fontColor);l(),this.dispose(i.fontColorChanged.disposableOn(l));const c=()=>e.fillStyle=i.color&&Mc(i.color);c(),this.dispose(i.colorChanged.disposableOn(c));const u=()=>e.outlineStyle=i.outlineColor&&Mc(i.outlineColor);u(),this.dispose(i.outlineColorChanged.disposableOn(u));const d=()=>e.selectedStyle=i.selectedColor&&Mc(i.selectedColor);d(),this.dispose(i.selectedColorChanged.disposableOn(d)),this.dispose(e.clickEvent.disposableOn((p,f,g,v,y)=>{i.clickEvent.emit(y)})),this.dispose(e.dbclickEvent.disposableOn((p,f,g,v,y)=>{i.dbclickEvent.emit(y)})),this.dispose(a.bind([e,"selected"],[i,"selected"])),this.dispose(a.bind([e,"hovered"],[i,"hovered"]))}}function cs(t,i,e,n,o){t.beginPath(),t.moveTo(i+n,e),t.arc(i,e,n,0,2*Math.PI),t.fillStyle=o,t.fill()}function YP(t,i,e,n,o,s){t.font=o;const r=t.measureText(n),l=r.actualBoundingBoxLeft+r.actualBoundingBoxRight,c=Number.isFinite(r.fontBoundingBoxAscent)?r.fontBoundingBoxAscent:r.actualBoundingBoxAscent,u=Number.isFinite(r.fontBoundingBoxDescent)?r.fontBoundingBoxDescent:r.actualBoundingBoxDescent;let d=c+u;t.fillStyle=s,t.fillText(n,i-l*.5,e+d*.5-u)}const Om=6;class ZP extends a.CanvasPoi{constructor(e){super(e);m(this,"_scale",a.react(1));m(this,"_text",a.react(void 0));m(this,"_font",a.react(void 0));m(this,"_fontStyle",a.react(void 0));m(this,"_radius",a.react(void 0));m(this,"_outlineStyle",a.react(void 0));m(this,"_selectedStyle",a.react(void 0));m(this,"_fillStyle",a.react(void 0));const n=this.disposeVar(new a.Transition(100)),o=this.disposeVar(new a.Transition(100)),s=()=>{this._clickEvent&&!this._clickEvent.empty&&(this._scale.value=(1+.1*o.current)*(1+.2*n.current))};this.dispose(o.currentChanged.disposableOn(s)),this.dispose(n.currentChanged.disposableOn(s)),this.dispose(this.activedChanged.disposableOn(r=>{o.target=r?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(r=>{n.target=r?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(r=>{this.needRedraw()})),this.dispose(this._scale.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._text.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._font.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._fontStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._radius.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._fillStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._outlineStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._selectedStyle.changed.disposableOn(()=>this.needRedraw()))}get scale(){return this._scale.value}set scale(e){this._scale.value=e}get scaleChanged(){return this._scale.changed}get text(){return this._text.value}set text(e){this._text.value=e}get textChanged(){return this._text.changed}get font(){return this._font.value}set font(e){this._font.value=e}get fontChanged(){return this._font.changed}get fontStyle(){return this._fontStyle.value}set fontStyle(e){this._fontStyle.value=e}get fontStyleChanged(){return this._fontStyle.changed}get radius(){return this._radius.value}set radius(e){this._radius.value=e}get radiusChanged(){return this._radius.changed}get outlineStyle(){return this._outlineStyle.value}set outlineStyle(e){this._outlineStyle.value=e}get outlineStyleChanged(){return this._outlineStyle.changed}get selectedStyle(){return this._selectedStyle.value}set selectedStyle(e){this._selectedStyle.value=e}get selectedStyleChanged(){return this._selectedStyle.changed}get fillStyle(){return this._fillStyle.value}set fillStyle(e){this._fillStyle.value=e}get fillStyleChanged(){return this._fillStyle.changed}draw(e){if(!this._show)return;const[n,o]=this._winPos,s=e.globalAlpha;e.globalAlpha=this.opacity;const r=(this._radius.value??Om)*this._scale.value;if(this.selected&&cs(e,n,o,r+3,this._selectedStyle.value??"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&cs(e,n,o,r+1,this._fillStyle.value??"#FFF"),this._outlineStyle.value&&(this.hovered?cs(e,n,o,r+1,this._outlineStyle.value):cs(e,n,o,r+1,this._outlineStyle.value)),cs(e,n,o,r,this._fillStyle.value??"#FFF"),this._text.value){const l=this._font.value??"bold 10px Arial",c=this._fontStyle.value??"#000";YP(e,n,o,this._text.value,l,c)}e.globalAlpha=s}drawForPick(e,n){if(!this._show)return;const[o,s]=this._winPos,r=(this._radius.value??Om)*this._scale.value,l=n("default");cs(e,o,s,r,l)}}class Sn extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_clickEvent",this.disposeVar(new a.Event));m(this,"_dbclickEvent",this.disposeVar(new a.Event));m(this,"_geoCanvasPoi");this._geoCanvasPoi=this.disposeVar(new qi(e,n));const{geoCanvasPoi:o}=this;o.canvasPoiClassAndCreateFunc=[ZP,(s,r)=>new XP(this,s,r)],this.dispose(a.track([o,"show"],[this,"show"])),this.dispose(a.track([o,"enabled"],[this,"enabled"])),this.dispose(a.bind([o,"position"],[this,"position"])),this.dispose(a.bind([o,"positionEditing"],[this,"positionEditing"])),this.dispose(a.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(a.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"])),this.dispose(this.flyToEvent.disposableOn(s=>{o.flyTo(s)})),this.dispose(this._clickEvent.disposableOn(s=>{this.pickOnClick&&this.pickedEvent.emit(new a.ESJPickedResult({type:"viewerPicking",pointerEvent:s}))}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}get geoCanvasPoi(){return this._geoCanvasPoi}}m(Sn,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:a.reactArrayWithUndefined(void 0),positionEditing:!1,radius:6,text:"",font:"bold 10px Arial",fontColor:a.reactArray([1,1,1,1]),color:a.reactArray([1,1,1,1]),outlineColor:a.reactArray([0,0,0,1]),selectedColor:a.reactArray([0,0,0,1]),hovered:!1,selected:!1,viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,pickOnClick:!1})})(Sn||(Sn={})),a.extendClassProps(Sn.prototype,Sn.createDefaultProps);class hs extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o)return;const s=this.disposeVar(pi([this,"material"])),r=(v,y)=>{const w=new h.PolylineMaterialAppearance({material:y,renderState:{depthTest:{enabled:this.depthTest??!1}}});w.renderState.depthMask=!1;const P=[];if(v.length<2)return;this.arcType==="NONE"&&console.warn("贴地折线不能使用NONE模式,如果客户设定为此模式,则强制使用GEODESIC模式来处理!");const C=this.arcType!=="RHUMB"?"GEODESIC":"RHUMB";P.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:v,width:this.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[C]}),id:this}));const S=new h.GroundPolylinePrimitive({geometryInstances:P,appearance:w,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return h.GroundPolylinePrimitive.prototype&&(S.ESSceneObjectID=n),S};let l;const c=new h.BoundingSphere,u=()=>{l&&(o.scene.primitives.remove(l),l=void 0)};this.dispose(u);const d=()=>{if(u(),!(this.show??!0)||!this.positions)return;const v=pt(this.positions);if(v.length<2||!s.value){c.radius=-1;return}h.BoundingSphere.fromPoints(v,c),l=r(v,s.value),l&&o.scene.primitives.add(l)},p=()=>{l&&(l.show=this.show??!0)};d(),p();const f=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,s.changed,this.arcTypeChanged,this.allowPickingChanged,this.depthTestChanged));this.dispose(f.disposableOn(()=>{d(),p()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(g.disposableOn(()=>{p()})),this.dispose(this.flyToEvent.disposableOn(v=>{if(e.actived&&(f.flush(),g.flush(),c.radius>0)){const y=se(c.center);y&&ne(o,y,c.radius*4,void 0,v)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,material:a.reactJson({type:"Color"}),depthTest:void 0})})(hs||(hs={})),a.extendClassProps(hs.prototype,hs.createDefaultProps);class us extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o)return;const s=this.disposeVar(pi([this,"material"])),r=(v,y)=>{const w=new h.PolylineMaterialAppearance({material:y,renderState:{depthTest:{enabled:this.depthTest??!1}}});w.renderState.depthMask=!1;const P=[];if(v.length<2)return;P.push(new h.GeometryInstance({geometry:new h.PolylineGeometry({positions:v,width:this.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:this.arcType&&h.ArcType[this.arcType]}),id:this}));const C=new h.Primitive({geometryInstances:P,appearance:w,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return h.Primitive.prototype&&(C.ESSceneObjectID=n),C};let l;const c=new h.BoundingSphere,u=()=>{l&&(o.scene.primitives.remove(l),l=void 0)};this.dispose(u);const d=()=>{if(u(),!this.positions)return;const v=pt(this.positions);if(v.length<2||!s.value){c.radius=-1;return}h.BoundingSphere.fromPoints(v,c),l=r(v,s.value),l&&o.scene.primitives.add(l)},p=()=>{l&&(l.show=this.show??!0)};d(),p();const f=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,s.changed,this.arcTypeChanged,this.allowPickingChanged,this.depthTestChanged));this.dispose(f.disposableOn(()=>{d(),p()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(g.disposableOn(()=>{p()})),this.dispose(this.flyToEvent.disposableOn(v=>{if(e.actived&&(g.flush(),f.flush(),c.radius>0)){const y=se(c.center);y&&ne(o,y,c.radius*4,void 0,v)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,material:a.reactJson({type:"Color"}),depthTest:void 0})})(us||(us={})),a.extendClassProps(us.prototype,us.createDefaultProps);class xe extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_polylineOrGroundPolylineResetting");m(this,"_czmViewVisibleDistanceRangeControl");m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_positionsCenter");n&&(this.id=n),this._positionsCenter=this.ad(new Cu(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new no(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(a.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"])),this._polylineOrGroundPolylineResetting=this.disposeVar(new a.ObjResettingWithEvent(this.groundChanged,()=>this.ground?new kP(e,this):new QP(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylineOrGroundPolylineResetting(){return this._polylineOrGroundPolylineResetting}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}}m(xe,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),loop:!1,width:2,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,customArrow:!1,customArrowParams:a.reactJson({repeat:60,speed:.1,color:[1,1,1,1],arrowColor:[1,1,1,1],image:"",lineLength:10}),arcType:"GEODESIC",depthTest:!1,zIndex:0,viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(xe||(xe={})),a.extendClassProps(xe.prototype,xe.createDefaultProps);class QP extends a.Destroyable{constructor(i,e){super();const n=this.disposeVar(new us(i,e.id));this.dispose(a.track([n,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([n,"depthTest"],[e,"depthTest"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(...Wm(e),e.czmViewVisibleDistanceRangeControl.visibleAlphaChanged));{const s=()=>{const{visibleAlpha:r}=e.czmViewVisibleDistanceRangeControl;n.show=e.show&&r>0,n.arcType=e.arcType,n.width=e.width,n.positions=Vm(e),n.material=Bm(e)};s(),this.dispose(o.disposableOn(s))}this.dispose(e.flyToEvent.disposableOn(s=>{o.flush(),e.viewDistanceRange||n.flyTo(s)}))}}class kP extends a.Destroyable{constructor(i,e){super();const n=this.disposeVar(new hs(i,e.id));this.dispose(a.track([n,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([n,"depthTest"],[e,"depthTest"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(...Wm(e),e.czmViewVisibleDistanceRangeControl.visibleAlphaChanged));{const s=()=>{const{visibleAlpha:r}=e.czmViewVisibleDistanceRangeControl;n.show=e.show&&r>0,n.arcType=e.arcType,n.width=e.width,n.positions=Vm(e),n.material=Bm(e)};s(),this.dispose(o.disposableOn(s))}this.dispose(e.flyToEvent.disposableOn(s=>{o.flush(),e.viewDistanceRange||n.flyTo(s)}))}}function Bm(t){const i=t.color,e=t.gapColor;let n;return t.hasDash?n={type:"PolylineDash",color:i,gapColor:e,dashLength:t.dashLength,dashPattern:t.dashPattern}:t.customArrow?n={type:"XbsjPolylineArrow",...t.customArrowParams}:t.hasArrow?n={type:"PolylineArrow",color:i}:n={type:"Color",color:i},n}function Vm(t){return t.loop&&t.positions&&t.positions.length>=3?[...t.positions,t.positions[0]]:t.positions}function Wm(t){return[t.showChanged,t.positionsChanged,t.loopChanged,t.widthChanged,t.colorChanged,t.hasDashChanged,t.gapColorChanged,t.dashLengthChanged,t.dashPatternChanged,t.hasArrowChanged,t.customArrowChanged,t.arcTypeChanged,t.depthTestChanged,t.customArrowParamsChanged]}function KP(t){if(t.type==="BoxEmitter"){const i=t.dimensions;return i?new h.BoxEmitter(hi(i)):void 0}else if(t.type==="CircleEmitter"){const i=t.radius;return new h.CircleEmitter(i)}else if(t.type==="ConeEmitter"){const i=t.angle;return new h.ConeEmitter(i)}else if(t.type==="SphereEmitter"){const i=t.radius;return new h.SphereEmitter(i)}}const Vi=class Vi extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_player");m(this,"_updateCallbackFunc",this.disposeVar(a.react(void 0)));m(this,"_disposeUpdateCallbackFunc",(()=>{this.dispose(this.updateCallbackFuncChanged.don(e=>{e?this.updateCallback=e.toString():this.updateCallback=void 0}))})());m(this,"_disposeUpdateCallback",(()=>{this.dispose(this.updateCallbackChanged.don(e=>{e?this.updateCallbackFunc=Function('"use strict";return ('+e+")")():this.updateCallbackFunc=void 0}))})());m(this,"_primitive");this._player=this.disposeVar(new a.Player);const o=e.viewer;if(o){{const s=Vi.defaults;this.dispose(a.bind([this._player,"loop"],[this,"playingLoop"],r=>r??s.playingLoop,r=>r??s.playingLoop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],r=>r??s.currentTime,r=>r??s.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],r=>r??s.duration,r=>r??s.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],r=>r??s.playing,r=>r??s.playing)),this.dispose(a.bind([this._player,"speed"],[this,"playingSpeed"],r=>r??s.playingSpeed,r=>r??s.playingSpeed))}{const s=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.dispose(s);const r=()=>{const P=this.position??[0,0,0];return h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(P[0],P[1],P[2]))},l=()=>{const P=this.rotation??[0,0,0],C=this.translation??[0,0,0],S=h.HeadingPitchRoll.fromDegrees(P[0],P[1],P[2],new h.HeadingPitchRoll);let A=new h.TranslationRotationScale;return A.translation=h.Cartesian3.fromElements(C[0],C[1],C[2],new h.Cartesian3),A.rotation=h.Quaternion.fromHeadingPitchRoll(S,new h.Quaternion),h.Matrix4.fromTranslationRotationScale(A,new h.Matrix4)},c=()=>{if(!this.bursts)return;let P=[];return this.bursts.forEach(C=>{const S=new h.ParticleBurst({time:C[0],minimum:C[1],maximum:C[2]});P.push(S)}),P},u=()=>{const P=r(),C=l(),S=c(),A=KP(this.emitter??Vi.defaults.emitter),E=new h.ParticleSystem({emitter:A,bursts:S,modelMatrix:P,emitterModelMatrix:C,updateCallback:this.updateCallbackFunc?(R,N)=>{this.updateCallbackFunc&&this.updateCallbackFunc(R,N)}:void 0,image:a.ESSceneObject.context.getStrFromEnv(this.image&&this.image.length!=0?this.image:Vi.defaults.image),imageSize:Pe(this.imageSize??Vi.defaults.imageSize),minimumImageSize:this.minimumImageSize&&Pe(this.minimumImageSize),maximumImageSize:this.maximumImageSize&&Pe(this.maximumImageSize),show:this.show,emissionRate:this.emissionRate,loop:this.loop,scale:this.scale,startScale:this.startScale,endScale:this.endScale??Vi.defaults.endScale,color:this.color&&te(this.color),startColor:this.startColor&&te(this.startColor),endColor:this.endColor&&te(this.endColor),sizeInMeters:this.sizeInMeters,speed:this.speed,minimumSpeed:this.minimumSpeed,maximumSpeed:this.maximumSpeed,lifetime:this.lifetime,particleLife:this.particleLife??Vi.defaults.particleLife,minimumParticleLife:this.minimumParticleLife,maximumParticleLife:this.maximumParticleLife,mass:this.mass,minimumMass:this.minimumMass,maximumMass:this.maximumMass});return h.ParticleSystem.prototype&&(E.ESSceneObjectID=n),E},d=()=>{s(),this._primitive=u(),this._primitive&&o.scene.primitives.add(this._primitive)},p=()=>{if(!this._primitive)return;const P=this.show??!0;this._primitive.show=P,this.image&&(this._primitive.image=a.ESSceneObject.context.getStrFromEnv(this.image&&this.image.length!=0?this.image:Vi.defaults.image))};d(),p();const f=this.disposeVar(a.createNextAnimateFrameEvent(this.emitterChanged,this.burstsChanged,this.emissionRateChanged,this.loopChanged,this.scaleChanged,this.startScaleChanged,this.endScaleChanged,this.colorChanged,this.startColorChanged,this.endColorChanged,this.imageSizeChanged,this.minimumImageSizeChanged,this.maximumImageSizeChanged,this.sizeInMetersChanged,this.speedChanged,this.minimumSpeedChanged,this.maximumSpeedChanged,this.lifetimeChanged,this.particleLifeChanged,this.minimumParticleLifeChanged,this.maximumParticleLifeChanged,this.massChanged,this.minimumMassChanged,this.maximumMassChanged,this.updateCallbackFuncChanged));this.dispose(f.disposableOn(()=>{d(),p()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.imageChanged));this.dispose(g.disposableOn(()=>{p()}));const v=()=>{if(!this._primitive)return;const P=r(),C=l();this._primitive.modelMatrix=P,this._primitive.emitterModelMatrix=C},y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.translationChanged));this.dispose(y.disposableOn(v));const w=()=>{this._primitive&&(this._primitive.timeStamp=this.currentTime)};w(),this.dispose(this.currentTimeChanged.disposableOn(w)),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("当前没有位置信息,无法飞入!");return}const P=this.position[2]+100;ne(o,this.position,P,void 0,1e3)}))}}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get updateCallbackFunc(){return this._updateCallbackFunc.value}set updateCallbackFunc(e){this._updateCallbackFunc.value=e}get updateCallbackFuncChanged(){return this._updateCallbackFunc.changed}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get primitive(){return this._primitive}};m(Vi,"defaults",{playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0,ratio:0,particleLife:.5,endScale:4,imageSize:[20,20],image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",emitter:{type:"CircleEmitter",radius:.5}});let bi=Vi;(t=>{t.createDefaultProps=()=>({emitter:a.reactJsonWithUndefined(void 0),bursts:a.reactArrayCollectionWithUndefined(void 0),position:a.reactArrayWithUndefined(void 0),translation:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),image:void 0,imageSize:void 0,minimumImageSize:void 0,maximumImageSize:void 0,show:void 0,updateCallback:void 0,emissionRate:void 0,loop:void 0,scale:void 0,startScale:void 0,endScale:void 0,color:a.reactArrayWithUndefined(void 0),startColor:a.reactArrayWithUndefined(void 0),endColor:a.reactArrayWithUndefined(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:void 0,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:void 0,currentTime:void 0,duration:void 0,playingSpeed:void 0,playing:void 0})})(bi||(bi={})),a.extendClassProps(bi.prototype,bi.createDefaultProps);class JP extends a.Destroyable{constructor(e,n){super();m(this,"_model");m(this,"_geoPoint");m(this,"_geoAxis");this._model=this.disposeVar(new ct(n,e.id)),this._geoPoint=this.disposeVar(new ti(n,e.id)),this._geoAxis=this.disposeVar(new xe(n,e.id)),this._geoAxis.hasArrow=!0,this._geoAxis.width=10;{this._model.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._model.localRotation=[90,0,0],this._model.allowPicking=!1,this._model.pixelSize=30;{const o=()=>{e.position&&(this._model.position=Hg(e.position,e.rotation??[0,0,0],e.viewDistance??0),this._model.rotation=e.rotation??[0,0,0])};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.viewDistanceChanged));this.dispose(s.disposableOn(o))}{const o=()=>{const r=n.getCameraInfo();if(!r)return;const l=r.position,c=this._model.position;if(!c)return;const u=h.Cartesian3.fromDegrees(c[0],c[1],c[2]),d=h.Cartesian3.fromDegrees(l[0],l[1],l[2]),p=h.Cartesian3.distanceSquared(u,d);this._model.show=p>1};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(n.cameraChanged,this._model.positionChanged));this.dispose(s.disposableOn(o))}}{this._geoAxis.width=6,this._geoAxis.color=[1,1,0,.7];{const o=()=>{e.position&&this.model.position&&(this._geoAxis.positions=[this.model.position,e.position])};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this._model.positionChanged));this.dispose(s.disposableOn(o))}}}get model(){return this._model}get geoPoint(){return this._geoPoint}get geoAxis(){return this._geoAxis}}const un=class un extends a.Destroyable{constructor(e,n){super();m(this,"_captureEvent",this.disposeVar(new a.Event));m(this,"_id",this.disposeVar(a.react(a.createGuid())));this._czmViewer=e,n&&(this.id=n);const o=e.viewer;if(!o)return;this.disposeVar(new a.ObjResettingWithEvent(this.showChanged,()=>{if(this.show&&this.position)return new JP(this,e)})),this.default&&this.flyTo(void 0,!1);const s=this.disposeVar(a.createProcessingFromAsyncFunc(async l=>{const{position:c,rotation:u,viewDistance:d,duration:p=1e3}=this;if(c){const f=ne(o,c,d,u,p,()=>{this.enabled=!1});f&&await l.promise(f),this.enabled=!1}}));this.dispose(this.enabledChanged.disposableOn(()=>{s.isRunning&&s.cancel(),this.enabled&&s.restart()}));const r=this.disposeVar(a.createProcessingFromAsyncFunc(async(l,c,u)=>{const d=e.capture(c,u);if(!d)return;const p=await l.promise(d);p&&(this.thumbnail=p)}));this.dispose(this.captureEvent.disposableOn((l,c)=>{r.restart(void 0,l??un.defaults.thumbnailWidth,c??un.defaults.thumbnailHeight)}))}get captureEvent(){return this._captureEvent}capture(e,n){this._captureEvent.emit(e,n)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}resetWithCurrentCamera(e){const{_czmViewer:n}=this;if(!n.actived)return;const{viewer:o}=this._czmViewer;if(!o)return;const s=this;e&un.ResetFlag.Position&&(s.position=Ht(o.camera)),e&un.ResetFlag.Rotation&&(s.rotation=jo(o.camera)),e&un.ResetFlag.ViewDistance&&(s.viewDistance=0)}flyTo(e,n,o="default"){if((n??!0)&&!this._czmViewer.actived)return;const{_czmViewer:{viewer:s}}=this,{position:r,rotation:l,viewDistance:c,duration:u}=this;!s||!r||ne(s,r,c,l,e??u,void 0,o)}};m(un,"ResetFlag",{Position:1,Rotation:2,ViewDistance:4}),m(un,"defaults",{thumbnailWidth:64,thumbnailHeight:64,enabled:!0,show:!1,position:[116.39,39.9,100],duration:1e3,default:!1,thumbnail:""});let Ft=un;(t=>{t.createDefaultProps=()=>({enabled:!0,position:a.reactArrayWithUndefined(void 0),positionEditing:!1,show:!1,rotation:a.reactArray([0,0,0]),viewDistance:0,duration:void 0,default:!1,thumbnail:""})})(Ft||(Ft={})),a.extendClassProps(Ft.prototype,Ft.createDefaultProps);function Gm(t,i){let e=[0,0];if(!t||!i)return e;const n=t.cloneNode(!0);n.style.position="absolute",n.style.top="0",n.style.zIndex="-1",document.body.appendChild(n);const o=n.querySelector(`.${i}-anchor`)??n.querySelector(`.${i}-iconBox`);if(o&&o.parentElement){const s=(o.parentElement.offsetTop+o.parentElement.offsetHeight-(["Flag01"].includes(i)?10:["P3D02","P3D04"].includes(i)?15:0))/n.offsetHeight;e=[(o.offsetLeft+o.width/2)/n.offsetWidth,s<1?s:1]}return document.body.removeChild(n),e}class xn extends a.Destroyable{constructor(e,n,o,s,r=!0){super();m(this,"widgetInfo");m(this,"_czmGeoCustomDivPoi");m(this,"sceneObject");m(this,"domSize");m(this,"_defaultAnchor",this.disposeVar(a.react([0,0])));m(this,"flyTo",(e,n)=>{if(this.czmGeoCustomDivPoi.position){ne(this._czmViewer.viewer,this.czmGeoCustomDivPoi.position,1e3,ei,e);return}this.czmGeoCustomDivPoi.flyTo(e&&e*1e3)});m(this,"createInstanceClass",()=>{let e=this;return class extends a.Destroyable{constructor(o,s,r){if(super(),this._subContainer=o,!r||!(r instanceof Me))return;const l=e.widgetInfo;this._subContainer.appendChild(l),this.dispose(()=>{this._subContainer.removeChild(l)});{const c=()=>{l.style.pointerEvents=e.sceneObject.editing?"none":"all"};c(),this.d(e.sceneObject.editingChanged.don(c))}}}});this._sceneObject=e,this._czmViewer=n,this._widgetInfo=o,this._drawWidget=s,this._czmGeoCustomDivPoi=this.disposeVar(new Ue(n,e.id));let l=this.sceneObject=this._sceneObject;this._czmViewer,this.widgetInfo=this._widgetInfo,l instanceof a.ESPoi2D&&(this.defaultAnchor=Gm(this.widgetInfo,l.mode));const{czmGeoCustomDivPoi:c}=this;this.d(a.track([c,"zOrder"],[l,"zOrder"])),this.dispose(a.track([c,"show"],[l,"show"])),this.dispose(a.bind([c,"position"],[l,"position"])),l instanceof a.ESWidget&&this.dispose(a.track([c,"opacity"],[l,"opacity"]));{const u=this.dv(a.createNextAnimateFrameEvent(l.allowPickingChanged,l.editingChanged)),d=()=>{l.allowPicking&&!l.editing?c.allowPicking=!0:c.allowPicking=!1};d(),this.d(u.don(d))}if(this.d(c.pickedEvent.don(u=>{var f;const d=(f=po(u,"pickResult"))==null?void 0:f.pointerEvent;if(!d)return;const p={type:d.buttons!=0&&d.button==0?"leftClick":d.button==2?"rightClick":void 0,add:{mousePos:[d.offsetX,d.offsetY]}};p.type==null&&(p.type=d.type),l.widgetEvent.emit(p)})),(()=>{try{s?c.instanceClass=this.createInstanceClass():c.instanceClass=void 0}catch(d){console.log(d)}})(),r){const u=()=>{const p=l.anchor,f=l.offset;p?c.originRatioAndOffset=[...p,-f[0],-f[1]]:c.originRatioAndOffset=[0,0,0,0]};u();const d=this.ad(a.createNextAnimateFrameEvent(l.anchorChanged,l.offsetChanged));this.dispose(d.disposableOn(u))}{const u=async()=>{let p,f;if((!this.domSize||this.domSize.width==0||this.domSize.height==0)&&(this.domSize=this.widgetInfo.getBoundingClientRect(),this.domSize.width==0||this.domSize.height==0)){const g=setTimeout(()=>{u(),clearTimeout(g)},200);return}l.sizeByContent?(p=this.domSize.width,f=this.domSize.height):(p=l.size[0],f=l.size[1]),this.widgetInfo.style.transform=`scale(${p/this.domSize.width*l.scale[1]},${f/this.domSize.height*l.scale[2]})`,this.widgetInfo.style.transformOrigin=`${l.anchor[0]*100}% ${l.anchor[1]*100}%`};u();const d=this.disposeVar(a.createNextAnimateFrameEvent(l.sizeChanged,l.sizeByContentChanged,l.scaleChanged));this.dispose(d.disposableOn(u))}}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}get defaultAnchor(){return this._defaultAnchor.value}set defaultAnchor(e){this._defaultAnchor.value=e}get defaultAnchorChanged(){return this._defaultAnchor.changed}}class Dc extends a.Destroyable{constructor(e,n,o,s,r=!0){super();m(this,"widgetInfo");m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"_czmCustomPrimitive");m(this,"_czmTexture");m(this,"sceneObject");m(this,"domSize");m(this,"_defaultAnchor",this.disposeVar(a.react([0,0])));m(this,"czmViewer");m(this,"flyTo",(e,n)=>{Rt(this.czmViewer,this.sceneObject,n,e,this.czmCustomPrimitive,!0)});this._sceneObject=e,this._czmViewer=n,this._widgetInfo=o,this._drawWidget=s,this._czmCustomPrimitive=this.disposeVar(new Fe(n,e.id)),this._czmTexture=this.ad(new Ne(n));let l=this.sceneObject=this._sceneObject,c=this.czmViewer=this._czmViewer;this.widgetInfo=this._widgetInfo,l instanceof a.ESPoi2D&&(this.defaultAnchor=Gm(this.widgetInfo,l.mode));const{czmTexture:u}=this,{czmCustomPrimitive:d}=this;d.localRotation=[-90,0,0],this.dispose(a.bind([d,"position"],[l,"position"]));{const p=this.dv(a.createNextAnimateFrameEvent(l.allowPickingChanged,l.editingChanged)),f=()=>{l.allowPicking&&!l.editing?d.allowPicking=!0:d.allowPicking=!1};f(),this.d(p.don(f))}this.ad(n.clickEvent.don(p=>{const f=p==null?void 0:p.pointerEvent;f&&(this._isPointEvent=!0,this._eventInfo={type:f.button==0?"leftClick":f.button==2?"rightClick":"leftClick",add:{mousePos:[f.offsetX,f.offsetY]}})})),this.d(l.pickedEvent.don(p=>{var f,g,v;p.screenPosition&&this._isPointEvent&&p.attachedInfo!="innerHoverEvent"&&((f=this._eventInfo.add)!=null&&f.mousePos)&&Math.abs(p.screenPosition[0]-((g=this._eventInfo.add)==null?void 0:g.mousePos[0]))<1&&Math.abs(p.screenPosition[1]-((v=this._eventInfo.add)==null?void 0:v.mousePos[1]))<1&&(l.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.engineObjectCreatedUpdate(this,l,()=>{const p=c.getEngineObject(l);this.ad(p.lastHoverResultChanged.don((f,g)=>{(f==null?void 0:f.sceneObject)==(g==null?void 0:g.sceneObject)||(f==null?void 0:f.sceneObject)!=l&&(g==null?void 0:g.sceneObject)!=l||(f!=null&&f.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:f==null?void 0:f.screenPosition}},f.sceneObject.widgetEvent.emit(this._eventInfo)),g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:f==null?void 0:f.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo)))}))});{const p=()=>{d.scale=[l.scale[1],l.scale[0],l.scale[2]]};p(),this.d(l.scaleChanged.don(p))}d.indexTypedArray=new Uint16Array([0,1,2,0,2,3,6,5,4,7,6,4]);{const p=()=>{this._drawWidget&&(d.show=l.show)};p(),this.d(l.showChanged.don(p))}if(this.disposeVar(new a.ObjResettingWithEvent(l.rotationTypeChanged,()=>{if(l.rotationType==0)return new tb(this);if(l.rotationType==1)return new jP(this);if(l.rotationType==2)return new eb(this)})),(()=>{try{if(this._drawWidget){const f=this.widgetInfo.cloneNode(!0);f.style.position="fixed",f.style.zIndex="-1",f.style.top="0px",document.body.contains(f)||(document.body.appendChild(f),this.domSize=f.getBoundingClientRect()),tu(f,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:f.offsetWidth,height:f.offsetHeight,scale:2}).then(g=>{document.body.contains(f)&&document.body.removeChild(f),this.czmTexture.copyFromCanvas(g),this.czmCustomPrimitive.uniformMap={u_image:{type:"texture",id:`${this.czmTexture.id}`},u_color:[1,1,1,1]}}).catch(()=>{document.body.contains(f)&&document.body.removeChild(f)})}else this.czmCustomPrimitive.uniformMap=void 0,this.czmCustomPrimitive.show=!1}catch(f){console.log(f)}})(),r){const p=()=>{const g=l.anchor,v=l.offset;let y=100,w=100;l.sizeByContent&&this.domSize?(y=this.domSize.width/100,w=this.domSize.height/100):(y=l.size[0]/100,w=l.size[1]/100),g?this.czmCustomPrimitive.localPosition=[g[0]*y-v[0]/100,0,g[1]*w-v[1]/100]:this.czmCustomPrimitive.localPosition=[0,0,0]};p();const f=this.ad(a.createNextAnimateFrameEvent(l.anchorChanged,l.offsetChanged));this.dispose(f.disposableOn(p))}{const p=()=>{let g,v;l.sizeByContent&&this.domSize?(g=this.domSize.width/100,v=this.domSize.height/100):(g=l.size[0]/100,v=l.size[1]/100),this.czmCustomPrimitive.attributes={position:{typedArray:new Float32Array([0,0,0,0,g,0,0,g,-v,0,0,-v,0,0,0,0,g,0,0,g,-v,0,0,-v]),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([1,1,0,1,0,0,1,0,0,1,1,1,1,0,0,0]),componentsPerAttribute:2}},this.czmCustomPrimitive.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[0,0,-v],max:[0,g,0]}},this.czmCustomPrimitive.localPosition=[l.anchor[0]*g,0,l.anchor[1]*v]};p();const f=this.disposeVar(a.createNextAnimateFrameEvent(l.sizeChanged,l.sizeByContentChanged));this.dispose(f.disposableOn(p))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}get defaultAnchor(){return this._defaultAnchor.value}set defaultAnchor(e){this._defaultAnchor.value=e}get defaultAnchorChanged(){return this._defaultAnchor.changed}}class jP extends a.Destroyable{constructor(i){super(),this._widget3D=i;const{sceneObject:e,czmCustomPrimitive:n,czmViewer:o}=this._widget3D;{const s=()=>{const r=o.getCameraInfo();if(!r)return;const l=r.rotation;n.rotation=[l[0]+180,0-l[1],l[2]]};s(),this.dispose(o.cameraChanged.disposableOn(s))}}}class eb extends a.Destroyable{constructor(i){super(),this._widget3D=i;const{sceneObject:e,czmCustomPrimitive:n,czmViewer:o}=this._widget3D,{rotation:s}=e;{const r=()=>{const c=o.getCameraInfo();c&&(n.rotation=[c.rotation[0]+180,s[1],s[2]])};r();const l=this.ad(a.createNextAnimateFrameEvent(e.rotationChanged,o.cameraChanged));this.dispose(l.disposableOn(r))}}}class tb extends a.Destroyable{constructor(i){super(),this._widget3D=i;const{sceneObject:e,czmCustomPrimitive:n}=this._widget3D;this.dispose(je([n,"rotation"],[e,"rotation"]))}}const wa=class wa extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_customPrimitive");const o=this._customPrimitive=this.disposeVar(new Fe(e,n));o.indexTypedArray=new Uint16Array([0,1,2,0,2,3,6,5,4,7,6,4]),o.pass="TRANSLUCENT";const s=`
|
|
268
268
|
// vtxf 使用double类型的position进行计算
|
|
269
269
|
// in vec3 position3DHigh;
|
|
270
270
|
// in vec3 position3DLow;
|
|
@@ -363,7 +363,7 @@ ${this.stack.toString()}`),t};function X(t,i,e,n,o,s,r,l,c,u,d,p,f,g,v,y){this[0
|
|
|
363
363
|
`);for(let n=0;n<e.length;++n){const o=e[n],s=o.indexOf(": ");if(s>0){const r=o.substring(0,s),l=o.substring(s+2);i[r]=l}}return i}function Or(t,i,e){this.statusCode=t,this.response=i,this.responseHeaders=e,typeof this.responseHeaders=="string"&&(this.responseHeaders=yS(this.responseHeaders))}Or.prototype.toString=function(){let t="Request has failed.";return T(this.statusCode)&&(t+=` Status Code: ${this.statusCode}`),t};function ys(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(ys.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}}),ys.prototype.addEventListener=function(t,i){b.typeOf.func("listener",t);const e=this,n=e._invokingListeners?e._toAdd:e._listeners;return ju(this,n,t,i)&&e._listenerCount++,function(){e.removeEventListener(t,i)}};function ju(t,i,e,n){i.has(e)||i.set(e,new Set);const o=i.get(e);return o.has(n)?!1:(o.add(n),!0)}ys.prototype.removeEventListener=function(t,i){b.typeOf.func("listener",t);const e=ed(this,this._listeners,t,i),n=ed(this,this._toAdd,t,i),o=e||n;return o&&this._listenerCount--,o};function ed(t,i,e,n){const o=i.get(e);if(!o||!o.has(n))return!1;if(t._invokingListeners){if(!ju(t,t._toRemove,e,n))return!1}else o.delete(n),o.size===0&&i.delete(e);return!0}ys.prototype.raiseEvent=function(){this._invokingListeners=!0;for(const[t,i]of this._listeners.entries())if(T(t))for(const e of i)t.apply(e,arguments);this._invokingListeners=!1;for(const[t,i]of this._toAdd.entries())for(const e of i)ju(this,this._listeners,t,e);this._toAdd.clear();for(const[t,i]of this._toRemove.entries())for(const e of i)ed(this,this._listeners,t,e);this._toRemove.clear()};function _o(t){b.typeOf.object("options",t),b.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(_o.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){b.typeOf.number.greaterThanOrEquals("maximumLength",t,0);const i=this._length;if(t<i){const e=this._array;for(let n=t;n<i;++n)e[n]=void 0;this._length=t,e.length=t}this._maximumLength=t}},comparator:{get:function(){return this._comparator}}});function td(t,i,e){const n=t[i];t[i]=t[e],t[e]=n}_o.prototype.reserve=function(t){t=t??this._length,this._array.length=t},_o.prototype.heapify=function(t){t=t??0;const i=this._length,e=this._comparator,n=this._array;let o=-1,s=!0;for(;s;){const r=2*(t+1),l=r-1;l<i&&e(n[l],n[t])<0?o=l:o=t,r<i&&e(n[r],n[o])<0&&(o=r),o!==t?(td(n,o,t),t=o):s=!1}},_o.prototype.resort=function(){const t=this._length;for(let i=Math.ceil(t/2);i>=0;--i)this.heapify(i)},_o.prototype.insert=function(t){b.defined("element",t);const i=this._array,e=this._comparator,n=this._maximumLength;let o=this._length++;for(o<i.length?i[o]=t:i.push(t);o!==0;){const r=Math.floor((o-1)/2);if(e(i[o],i[r])<0)td(i,o,r),o=r;else break}let s;return T(n)&&this._length>n&&(s=i[n],this._length=n),s},_o.prototype.pop=function(t){if(t=t??0,this._length===0)return;b.typeOf.number.lessThan("index",t,this._length);const i=this._array,e=i[t];return td(i,t,--this._length),this.heapify(t),i[this._length]=void 0,e};function wS(t,i){return t.priority-i.priority}const _e={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let ws=20;const gt=new _o({comparator:wS});gt.maximumLength=ws,gt.reserve(ws);const Ai=[];let ki={};const CS=typeof document<"u"?new Qi(document.location.href):new Qi,$c=new ys;function Ie(){}Ie.maximumRequests=50,Ie.maximumRequestsPerServer=18,Ie.requestsByServer={},Ie.throttleRequests=!0,Ie.debugShowStatistics=!1,Ie.requestCompletedEvent=$c,Object.defineProperties(Ie,{statistics:{get:function(){return _e}},priorityHeapLength:{get:function(){return ws},set:function(t){if(t<ws)for(;gt.length>t;){const i=gt.pop();Po(i)}ws=t,gt.maximumLength=t,gt.reserve(t)}}});function mv(t){T(t.priorityFunction)&&(t.priority=t.priorityFunction())}Ie.serverHasOpenSlots=function(t,i){i=i??1;const e=Ie.requestsByServer[t]??Ie.maximumRequestsPerServer;return ki[t]+i<=e},Ie.heapHasOpenSlots=function(t){return gt.length+t<=ws};function vv(t){return t.state===He.UNISSUED&&(t.state=He.ISSUED,t.deferred=Lr()),t.deferred.promise}function _S(t){return function(i){if(t.state===He.CANCELLED)return;const e=t.deferred;--_e.numberOfActiveRequests,--ki[t.serverKey],$c.raiseEvent(),t.state=He.RECEIVED,t.deferred=void 0,e.resolve(i)}}function PS(t){return function(i){t.state!==He.CANCELLED&&(++_e.numberOfFailedRequests,--_e.numberOfActiveRequests,--ki[t.serverKey],$c.raiseEvent(i),t.state=He.FAILED,t.deferred.reject(i))}}function yv(t){const i=vv(t);return t.state=He.ACTIVE,Ai.push(t),++_e.numberOfActiveRequests,++_e.numberOfActiveRequestsEver,++ki[t.serverKey],t.requestFunction().then(_S(t)).catch(PS(t)),i}function Po(t){const i=t.state===He.ACTIVE;if(t.state=He.CANCELLED,++_e.numberOfCancelledRequests,T(t.deferred)){const e=t.deferred;t.deferred=void 0,e.reject()}i&&(--_e.numberOfActiveRequests,--ki[t.serverKey],++_e.numberOfCancelledActiveRequests),T(t.cancelFunction)&&t.cancelFunction()}Ie.update=function(){let t,i,e=0;const n=Ai.length;for(t=0;t<n;++t){if(i=Ai[t],i.cancelled&&Po(i),i.state!==He.ACTIVE){++e;continue}e>0&&(Ai[t-e]=i)}Ai.length-=e;const o=gt.internalArray,s=gt.length;for(t=0;t<s;++t)mv(o[t]);gt.resort();const r=Math.max(Ie.maximumRequests-Ai.length,0);let l=0;for(;l<r&>.length>0;){if(i=gt.pop(),i.cancelled){Po(i);continue}if(i.throttleByServer&&!Ie.serverHasOpenSlots(i.serverKey)){Po(i);continue}yv(i),++l}bS()},Ie.getServerKey=function(t){b.typeOf.string("url",t);let i=new Qi(t);i.scheme()===""&&(i=i.absoluteTo(CS),i.normalize());let e=i.authority();/:/.test(e)||(e=`${e}:${i.scheme()==="https"?"443":"80"}`);const n=ki[e];return T(n)||(ki[e]=0),e},Ie.request=function(t){if(b.typeOf.object("request",t),b.typeOf.string("request.url",t.url),b.typeOf.func("request.requestFunction",t.requestFunction),gv(t.url)||fv(t.url))return $c.raiseEvent(),t.state=He.RECEIVED,t.requestFunction();if(++_e.numberOfAttemptedRequests,T(t.serverKey)||(t.serverKey=Ie.getServerKey(t.url)),Ie.throttleRequests&&t.throttleByServer&&!Ie.serverHasOpenSlots(t.serverKey))return;if(!Ie.throttleRequests||!t.throttle)return yv(t);if(Ai.length>=Ie.maximumRequests)return;mv(t);const i=gt.insert(t);if(T(i)){if(i===t)return;Po(i)}return vv(t)};function bS(){Ie.debugShowStatistics&&(_e.numberOfActiveRequests===0&&_e.lastNumberOfActiveRequests>0&&(_e.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${_e.numberOfAttemptedRequests}`),_e.numberOfAttemptedRequests=0),_e.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${_e.numberOfCancelledRequests}`),_e.numberOfCancelledRequests=0),_e.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${_e.numberOfCancelledActiveRequests}`),_e.numberOfCancelledActiveRequests=0),_e.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${_e.numberOfFailedRequests}`),_e.numberOfFailedRequests=0)),_e.lastNumberOfActiveRequests=_e.numberOfActiveRequests)}Ie.clearForSpecs=function(){for(;gt.length>0;){const i=gt.pop();Po(i)}const t=Ai.length;for(let i=0;i<t;++i)Po(Ai[i]);Ai.length=0,ki={},_e.numberOfAttemptedRequests=0,_e.numberOfActiveRequests=0,_e.numberOfCancelledRequests=0,_e.numberOfCancelledActiveRequests=0,_e.numberOfFailedRequests=0,_e.numberOfActiveRequestsEver=0,_e.lastNumberOfActiveRequests=0},Ie.numberOfActiveRequestsByServer=function(t){return ki[t]},Ie.requestHeap=gt;const Cs={};let _s={};Cs.add=function(t,i){if(!T(t))throw new W("host is required.");if(!T(i)||i<=0)throw new W("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;T(_s[e])||(_s[e]=!0)},Cs.remove=function(t,i){if(!T(t))throw new W("host is required.");if(!T(i)||i<=0)throw new W("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;T(_s[e])&&delete _s[e]};function SS(t){const i=new Qi(t);i.normalize();let e=i.authority();if(e.length!==0){if(i.authority(e),e.indexOf("@")!==-1&&(e=e.split("@")[1]),e.indexOf(":")===-1){let n=i.scheme();if(n.length===0&&(n=globalThis.location.protocol,n=n.substring(0,n.length-1)),n==="http")e+=":80";else if(n==="https")e+=":443";else return}return e}}Cs.contains=function(t){if(!T(t))throw new W("url is required.");const i=SS(t);return!!(T(i)&&T(_s[i]))},Cs.clear=function(){_s={}};const wv=function(){try{const t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob",t.responseType==="blob"}catch{return!1}}();function J(t){t=t??Zi.EMPTY_OBJECT,typeof t=="string"&&(t={url:t}),b.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=Ei(t.templateValues,{}),this._queryParameters=Ei(t.queryParameters,{}),this.headers=Ei(t.headers,{}),this.request=t.request??new Hc,this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=t.retryAttempts??0,this._retryCount=0,t.parseUrl??!0?this.parseUrl(t.url,!0,!0):this._url=t.url,this._credits=t.credits}function Ei(t,i){return T(t)?vs(t):i}J.createIfNeeded=function(t){return t instanceof J?t.getDerivedResource({request:t.request}):typeof t!="string"?t:new J({url:t})};let Ps;J.supportsImageBitmapOptions=function(){return T(Ps)?Ps:typeof createImageBitmap!="function"?(Ps=Promise.resolve(!1),Ps):(Ps=J.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(i){const e={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(i,e),createImageBitmap(i)])}).then(function(i){const e=pv(i[0]),n=pv(i[1]);return e[1]!==n[1]}).catch(function(){return!1}),Ps)},Object.defineProperties(J,{isBlobSupported:{get:function(){return wv}}}),Object.defineProperties(J.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){this.parseUrl(t,!1,!1)}},extension:{get:function(){return uS(this._url)}},isDataUri:{get:function(){return gv(this._url)}},isBlobUri:{get:function(){return fv(this._url)}},isCrossOriginUrl:{get:function(){return Ju(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),J.prototype.toString=function(){return this.getUrlComponent(!0,!0)},J.prototype.parseUrl=function(t,i,e,n){let o=new Qi(t);const s=xS(o.query());this._queryParameters=i?qc(s,this.queryParameters,e):s,o.search(""),o.fragment(""),T(n)&&o.scheme()===""&&(o=o.absoluteTo(Nr(n))),this._url=o.toString()};function xS(t){return t.length===0?{}:t.indexOf("=")===-1?{[t]:void 0}:mS(t)}function qc(t,i,e){if(!e)return Rn(t,i);const n=vs(t,!0);for(const o in i)if(i.hasOwnProperty(o)){let s=n[o];const r=i[o];T(s)?(Array.isArray(s)||(s=n[o]=[s]),n[o]=s.concat(r)):n[o]=Array.isArray(r)?r.slice():r}return n}J.prototype.getUrlComponent=function(t,i){if(this.isDataUri)return this._url;let e=this._url;t&&(e=`${e}${AS(this.queryParameters)}`),e=e.replace(/%7B/g,"{").replace(/%7D/g,"}");const n=this._templateValues;return Object.keys(n).length>0&&(e=e.replace(/{(.*?)}/g,function(o,s){const r=n[s];return T(r)?encodeURIComponent(r):o})),i&&T(this.proxy)&&(e=this.proxy.getURL(e)),e};function AS(t){const i=Object.keys(t);return i.length===0?"":i.length===1&&!T(t[i[0]])?`?${i[0]}`:`?${gS(t)}`}J.prototype.setQueryParameters=function(t,i){i?this._queryParameters=qc(this._queryParameters,t,!1):this._queryParameters=qc(t,this._queryParameters,!1)},J.prototype.appendQueryParameters=function(t){this._queryParameters=qc(t,this._queryParameters,!0)},J.prototype.setTemplateValues=function(t,i){i?this._templateValues=Rn(this._templateValues,t):this._templateValues=Rn(t,this._templateValues)},J.prototype.getDerivedResource=function(t){const i=this.clone();if(i._retryCount=0,T(t.url)){const e=t.preserveQueryParameters??!1;i.parseUrl(t.url,!0,e,this._url)}return T(t.queryParameters)&&(i._queryParameters=Rn(t.queryParameters,i.queryParameters)),T(t.templateValues)&&(i._templateValues=Rn(t.templateValues,i.templateValues)),T(t.headers)&&(i.headers=Rn(t.headers,i.headers)),T(t.proxy)&&(i.proxy=t.proxy),T(t.request)&&(i.request=t.request),T(t.retryCallback)&&(i.retryCallback=t.retryCallback),T(t.retryAttempts)&&(i.retryAttempts=t.retryAttempts),i},J.prototype.retryOnError=function(t){const i=this.retryCallback;if(typeof i!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const e=this;return Promise.resolve(i(this,t)).then(function(n){return++e._retryCount,n})},J.prototype.clone=function(t){return T(t)?(t._url=this._url,t._queryParameters=vs(this._queryParameters),t._templateValues=vs(this._templateValues),t.headers=vs(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t):new J({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:T(this.credits)?this.credits.slice():void 0})},J.prototype.getBaseUri=function(t){return hS(this.getUrlComponent(t),t)},J.prototype.appendForwardSlash=function(){this._url=cS(this._url)},J.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},J.fetchArrayBuffer=function(t){return new J(t).fetchArrayBuffer()},J.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},J.fetchBlob=function(t){return new J(t).fetchBlob()},J.prototype.fetchImage=function(t){t=t??Zi.EMPTY_OBJECT;const i=t.preferImageBitmap??!1,e=t.preferBlob??!1,n=t.flipY??!1,o=t.skipColorSpaceConversion??!1;if(nd(this.request),!wv||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!e)return id({resource:this,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i});const s=this.fetchBlob();if(!T(s))return;let r,l,c,u;return J.supportsImageBitmapOptions().then(function(d){return r=d,l=r&&i,s}).then(function(d){if(!T(d))return;if(u=d,l)return J.createImageBitmapFromBlob(d,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=globalThis.URL.createObjectURL(d);return c=new J({url:p}),id({resource:c,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(d){if(T(d))return d.blob=u,l||globalThis.URL.revokeObjectURL(c.url),d}).catch(function(d){return T(c)&&globalThis.URL.revokeObjectURL(c.url),d.blob=u,Promise.reject(d)})};function id(t){const i=t.resource,e=t.flipY,n=t.skipColorSpaceConversion,o=t.preferImageBitmap,s=i.request;s.url=i.url,s.requestFunction=function(){let l=!1;!i.isDataUri&&!i.isBlobUri&&(l=i.isCrossOriginUrl);const c=Lr();return J._Implementations.createImage(s,l,c,e,n,o),c.promise};const r=Ie.request(s);if(T(r))return r.catch(function(l){return s.state!==He.FAILED?Promise.reject(l):i.retryOnError(l).then(function(c){return c?(s.state=He.UNISSUED,s.deferred=void 0,id({resource:i,flipY:e,skipColorSpaceConversion:n,preferImageBitmap:o})):Promise.reject(l)})})}J.fetchImage=function(t){return new J(t).fetchImage({flipY:t.flipY,skipColorSpaceConversion:t.skipColorSpaceConversion,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})},J.prototype.fetchText=function(){return this.fetch({responseType:"text"})},J.fetchText=function(t){return new J(t).fetchText()},J.prototype.fetchJson=function(){const t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(T(t))return t.then(function(i){if(T(i))return JSON.parse(i)})},J.fetchJson=function(t){return new J(t).fetchJson()},J.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},J.fetchXML=function(t){return new J(t).fetchXML()},J.prototype.fetchJsonp=function(t){t=t??"callback",nd(this.request);let i;do i=`loadJsonp${F.nextRandomNumber().toString().substring(2,8)}`;while(T(globalThis[i]));return Cv(this,t,i)};function Cv(t,i,e){const n={};n[i]=e,t.setQueryParameters(n);const o=t.request,s=t.url;o.url=s,o.requestFunction=function(){const l=Lr();return globalThis[e]=function(c){l.resolve(c);try{delete globalThis[e]}catch{globalThis[e]=void 0}},J._Implementations.loadAndExecuteScript(s,e,l),l.promise};const r=Ie.request(o);if(T(r))return r.catch(function(l){return o.state!==He.FAILED?Promise.reject(l):t.retryOnError(l).then(function(c){return c?(o.state=He.UNISSUED,o.deferred=void 0,Cv(t,i,e)):Promise.reject(l)})})}J.fetchJsonp=function(t){return new J(t).fetchJsonp(t.callbackParameterName)},J.prototype._makeRequest=function(t){const i=this;nd(i.request);const e=i.request,n=i.url;e.url=n,e.requestFunction=function(){const s=t.responseType,r=Rn(t.headers,i.headers),l=t.overrideMimeType,c=t.method,u=t.data,d=Lr(),p=J._Implementations.loadWithXhr(n,s,c,u,r,d,l);return T(p)&&T(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise};const o=Ie.request(e);if(T(o))return o.then(function(s){return e.cancelFunction=void 0,s}).catch(function(s){return e.cancelFunction=void 0,e.state!==He.FAILED?Promise.reject(s):i.retryOnError(s).then(function(r){return r?(e.state=He.UNISSUED,e.deferred=void 0,i.fetch(t)):Promise.reject(s)})})};function nd(t){if(t.state===He.ISSUED||t.state===He.ACTIVE)throw new ht("The Resource is already being fetched.");t.state=He.UNISSUED,t.deferred=void 0}const ES=/^data:(.*?)(;base64)?,(.*)$/;function Xc(t,i){const e=decodeURIComponent(i);return t?atob(e):e}function _v(t,i){const e=Xc(t,i),n=new ArrayBuffer(e.length),o=new Uint8Array(n);for(let s=0;s<e.length;s++)o[s]=e.charCodeAt(s);return n}function TS(t,i){i=i??"";const e=t[1],n=!!t[2],o=t[3];let s,r;switch(i){case"":case"text":return Xc(n,o);case"arraybuffer":return _v(n,o);case"blob":return s=_v(n,o),new Blob([s],{type:e});case"document":return r=new DOMParser,r.parseFromString(Xc(n,o),e);case"json":return JSON.parse(Xc(n,o));default:throw new W(`Unhandled responseType: ${i}`)}}J.prototype.fetch=function(t){return t=Ei(t,{}),t.method="GET",this._makeRequest(t)},J.fetch=function(t){return new J(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.delete=function(t){return t=Ei(t,{}),t.method="DELETE",this._makeRequest(t)},J.delete=function(t){return new J(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})},J.prototype.head=function(t){return t=Ei(t,{}),t.method="HEAD",this._makeRequest(t)},J.head=function(t){return new J(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.options=function(t){return t=Ei(t,{}),t.method="OPTIONS",this._makeRequest(t)},J.options=function(t){return new J(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.post=function(t,i){return b.defined("data",t),i=Ei(i,{}),i.method="POST",i.data=t,this._makeRequest(i)},J.post=function(t){return new J(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.put=function(t,i){return b.defined("data",t),i=Ei(i,{}),i.method="PUT",i.data=t,this._makeRequest(i)},J.put=function(t){return new J(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.patch=function(t,i){return b.defined("data",t),i=Ei(i,{}),i.method="PATCH",i.data=t,this._makeRequest(i)},J.patch=function(t){return new J(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J._Implementations={},J._Implementations.loadImageElement=function(t,i,e){const n=new Image;n.onload=function(){n.naturalWidth===0&&n.naturalHeight===0&&n.width===0&&n.height===0&&(n.width=300,n.height=150),e.resolve(n)},n.onerror=function(o){e.reject(o)},i&&(Cs.contains(t)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=t},J._Implementations.createImage=function(t,i,e,n,o,s){const r=t.url;J.supportsImageBitmapOptions().then(function(l){if(!(l&&s)){J._Implementations.loadImageElement(r,i,e);return}const c="blob",u="GET",d=Lr(),p=J._Implementations.loadWithXhr(r,c,u,void 0,void 0,d,void 0,void 0,void 0);return T(p)&&T(p.abort)&&(t.cancelFunction=function(){p.abort()}),d.promise.then(function(f){if(!T(f)){e.reject(new ht(`Successfully retrieved ${r} but it contained no content.`));return}return J.createImageBitmapFromBlob(f,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(f){e.resolve(f)})}).catch(function(l){e.reject(l)})},J.createImageBitmapFromBlob=function(t,i){return b.defined("options",i),b.typeOf.bool("options.flipY",i.flipY),b.typeOf.bool("options.premultiplyAlpha",i.premultiplyAlpha),b.typeOf.bool("options.skipColorSpaceConversion",i.skipColorSpaceConversion),createImageBitmap(t,{imageOrientation:i.flipY?"flipY":"none",premultiplyAlpha:i.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:i.skipColorSpaceConversion?"none":"default"})};function IS(t,i,e,n,o,s,r){fetch(t,{method:e,headers:o}).then(async l=>{if(!l.ok){const c={};l.headers.forEach((u,d)=>{c[d]=u}),s.reject(new Or(l.status,l,c));return}switch(i){case"text":s.resolve(l.text());break;case"json":s.resolve(l.json());break;default:s.resolve(new Uint8Array(await l.arrayBuffer()).buffer);break}}).catch(()=>{s.reject(new Or)})}const MS=typeof XMLHttpRequest>"u";J._Implementations.loadWithXhr=function(t,i,e,n,o,s,r){const l=ES.exec(t);if(l!==null){s.resolve(TS(l,i));return}if(MS){IS(t,i,e,n,o,s);return}const c=new XMLHttpRequest;if(Cs.contains(t)&&(c.withCredentials=!0),c.open(e,t,!0),T(r)&&T(c.overrideMimeType)&&c.overrideMimeType(r),T(o))for(const d in o)o.hasOwnProperty(d)&&c.setRequestHeader(d,o[d]);T(i)&&(c.responseType=i);let u=!1;return typeof t=="string"&&(u=t.indexOf("file://")===0||typeof globalThis<"u"&&globalThis.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){s.reject(new Or(c.status,c.response,c.getAllResponseHeaders()));return}const d=c.response,p=c.responseType;if(e==="HEAD"||e==="OPTIONS"){const g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),v={};g.forEach(function(y){const w=y.split(": "),P=w.shift();v[P]=w.join(": ")}),s.resolve(v);return}if(c.status===204)s.resolve(void 0);else if(T(d)&&(!T(i)||p===i))s.resolve(d);else if(i==="json"&&typeof d=="string")try{s.resolve(JSON.parse(d))}catch(f){s.reject(f)}else(p===""||p==="document")&&T(c.responseXML)&&c.responseXML.hasChildNodes()?s.resolve(c.responseXML):(p===""||p==="text")&&T(c.responseText)?s.resolve(c.responseText):s.reject(new ht("Invalid XMLHttpRequest response type."))},c.onerror=function(d){s.reject(new Or)},c.send(n),c},J._Implementations.loadAndExecuteScript=function(t,i,e){return fS(t).catch(function(n){e.reject(n)})},J._DefaultImplementations={},J._DefaultImplementations.createImage=J._Implementations.createImage,J._DefaultImplementations.loadWithXhr=J._Implementations.loadWithXhr,J._DefaultImplementations.loadAndExecuteScript=J._Implementations.loadAndExecuteScript,J.DEFAULT=Object.freeze(new J({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function Br(t){t=t??Zi.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=t.addNewLeapSeconds??!0,T(t.data)?Pv(this,t.data):Pv(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Br.fromUrl=async function(t,i){b.defined("url",t),i=i??Zi.EMPTY_OBJECT;const e=J.createIfNeeded(t);let n;try{n=await e.fetchJson()}catch{throw new ht(`An error occurred while retrieving the EOP data from the URL ${e.url}.`)}return new Br({addNewLeapSeconds:i.addNewLeapSeconds,data:n})},Br.NONE=Object.freeze({compute:function(t,i){return T(i)?(i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0):i=new $u(0,0,0,0,0),i}}),Br.prototype.compute=function(t,i){if(!T(this._samples))return;if(T(i)||(i=new $u(0,0,0,0,0)),this._samples.length===0)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;const e=this._dates,n=this._lastIndex;let o=0,s=0;if(T(n)){const l=e[n],c=e[n+1],u=k.lessThanOrEquals(l,t),d=!T(c),p=d||k.greaterThanOrEquals(c,t);if(u&&p)return o=n,!d&&c.equals(t)&&++o,s=o+1,Sv(this,e,this._samples,t,o,s,i),i}let r=Fr(e,t,k.compare,this._dateColumn);return r>=0?(r<e.length-1&&e[r+1].equals(t)&&++r,o=r,s=r):(s=~r,o=s-1,o<0&&(o=0)),this._lastIndex=o,Sv(this,e,this._samples,t,o,s,i),i};function DS(t,i){return k.compare(t.julianDate,i)}function Pv(t,i){if(!T(i.columnNames))throw new ht("Error in loaded EOP data: The columnNames property is required.");if(!T(i.samples))throw new ht("Error in loaded EOP data: The samples property is required.");const e=i.columnNames.indexOf("modifiedJulianDateUtc"),n=i.columnNames.indexOf("xPoleWanderRadians"),o=i.columnNames.indexOf("yPoleWanderRadians"),s=i.columnNames.indexOf("ut1MinusUtcSeconds"),r=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),l=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=i.columnNames.indexOf("taiMinusUtcSeconds");if(e<0||n<0||o<0||s<0||r<0||l<0||c<0)throw new ht("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const u=t._samples=i.samples,d=t._dates=[];t._dateColumn=e,t._xPoleWanderRadiansColumn=n,t._yPoleWanderRadiansColumn=o,t._ut1MinusUtcSecondsColumn=s,t._xCelestialPoleOffsetRadiansColumn=r,t._yCelestialPoleOffsetRadiansColumn=l,t._taiMinusUtcSecondsColumn=c,t._columnCount=i.columnNames.length,t._lastIndex=void 0;let p;const f=t._addNewLeapSeconds;for(let g=0,v=u.length;g<v;g+=t._columnCount){const y=u[g+e],w=u[g+c],P=y+Be.MODIFIED_JULIAN_DATE_DIFFERENCE,C=new k(P,w,fe.TAI);if(d.push(C),f){if(w!==p&&T(p)){const S=k.leapSeconds,A=Fr(S,C,DS);if(A<0){const E=new Ae(C,w);S.splice(~A,0,E)}}p=w}}}function bv(t,i,e,n,o){const s=e*n;o.xPoleWander=i[s+t._xPoleWanderRadiansColumn],o.yPoleWander=i[s+t._yPoleWanderRadiansColumn],o.xPoleOffset=i[s+t._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=i[s+t._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=i[s+t._ut1MinusUtcSecondsColumn]}function Vr(t,i,e){return i+t*(e-i)}function Sv(t,i,e,n,o,s,r){const l=t._columnCount;if(s>i.length-1)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;const c=i[o],u=i[s];if(c.equals(u)||n.equals(c))return bv(t,e,o,l,r),r;if(n.equals(u))return bv(t,e,s,l,r),r;const d=k.secondsDifference(n,c)/k.secondsDifference(u,c),p=o*l,f=s*l;let g=e[p+t._ut1MinusUtcSecondsColumn],v=e[f+t._ut1MinusUtcSecondsColumn];const y=v-g;if(y>.5||y<-.5){const w=e[p+t._taiMinusUtcSecondsColumn],P=e[f+t._taiMinusUtcSecondsColumn];w!==P&&(u.equals(n)?g=v:v-=P-w)}return r.xPoleWander=Vr(d,e[p+t._xPoleWanderRadiansColumn],e[f+t._xPoleWanderRadiansColumn]),r.yPoleWander=Vr(d,e[p+t._yPoleWanderRadiansColumn],e[f+t._yPoleWanderRadiansColumn]),r.xPoleOffset=Vr(d,e[p+t._xCelestialPoleOffsetRadiansColumn],e[f+t._xCelestialPoleOffsetRadiansColumn]),r.yPoleOffset=Vr(d,e[p+t._yCelestialPoleOffsetRadiansColumn],e[f+t._yCelestialPoleOffsetRadiansColumn]),r.ut1MinusUtc=Vr(d,g,v),r}function tt(t,i,e){this.heading=t??0,this.pitch=i??0,this.roll=e??0}tt.fromQuaternion=function(t,i){if(!T(t))throw new W("quaternion is required");T(i)||(i=new tt);const e=2*(t.w*t.y-t.z*t.x),n=1-2*(t.x*t.x+t.y*t.y),o=2*(t.w*t.x+t.y*t.z),s=1-2*(t.y*t.y+t.z*t.z),r=2*(t.w*t.z+t.x*t.y);return i.heading=-Math.atan2(r,s),i.roll=Math.atan2(o,n),i.pitch=-F.asinClamped(e),i},tt.fromDegrees=function(t,i,e,n){if(!T(t))throw new W("heading is required");if(!T(i))throw new W("pitch is required");if(!T(e))throw new W("roll is required");return T(n)||(n=new tt),n.heading=t*F.RADIANS_PER_DEGREE,n.pitch=i*F.RADIANS_PER_DEGREE,n.roll=e*F.RADIANS_PER_DEGREE,n},tt.clone=function(t,i){if(T(t))return T(i)?(i.heading=t.heading,i.pitch=t.pitch,i.roll=t.roll,i):new tt(t.heading,t.pitch,t.roll)},tt.equals=function(t,i){return t===i||T(t)&&T(i)&&t.heading===i.heading&&t.pitch===i.pitch&&t.roll===i.roll},tt.equalsEpsilon=function(t,i,e,n){return t===i||T(t)&&T(i)&&F.equalsEpsilon(t.heading,i.heading,e,n)&&F.equalsEpsilon(t.pitch,i.pitch,e,n)&&F.equalsEpsilon(t.roll,i.roll,e,n)},tt.prototype.clone=function(t){return tt.clone(this,t)},tt.prototype.equals=function(t){return tt.equals(this,t)},tt.prototype.equalsEpsilon=function(t,i,e){return tt.equalsEpsilon(this,t,i,e)},tt.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const xv=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function RS(){const t=document.getElementsByTagName("script");for(let i=0,e=t.length;i<e;++i){const n=t[i].getAttribute("src"),o=xv.exec(n);if(o!==null)return o[1]}}let Yc;function Av(t){return typeof document>"u"?t:(T(Yc)||(Yc=document.createElement("a")),Yc.href=t,Yc.href)}let bo;function Ev(){if(T(bo))return bo;let t;if(typeof CESIUM_BASE_URL<"u"?t=CESIUM_BASE_URL:T(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Gi&&Gi.tagName.toUpperCase()==="SCRIPT"&&Gi.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href)?t=Nr(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Gi&&Gi.tagName.toUpperCase()==="SCRIPT"&&Gi.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href):typeof define=="object"&&T(define.amd)&&!define.amd.toUrlUndefined&&T(require.toUrl)?t=Nr("..",ni("Core/buildModuleUrl.js")):t=RS(),!T(t))throw new W("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return bo=new J({url:Av(t)}),bo.appendForwardSlash(),bo}function FS(t){return Av(require.toUrl(`../${t}`))}function Tv(t){return Ev().getDerivedResource({url:t}).url}let Zc;function ni(t){return T(Zc)||(typeof define=="object"&&T(define.amd)&&!define.amd.toUrlUndefined&&T(require.toUrl)?Zc=FS:Zc=Tv),Zc(t)}ni._cesiumScriptRegex=xv,ni._buildModuleUrlFromBaseUrl=Tv,ni._clearBaseResource=function(){bo=void 0},ni.setBaseUrl=function(t){bo=J.DEFAULT.getDerivedResource({url:t})},ni.getCesiumBaseUrl=Ev;function Iv(t,i,e){this.x=t,this.y=i,this.s=e}function od(t){t=t??Zi.EMPTY_OBJECT,this._xysFileUrlTemplate=J.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=t.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=t.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new k(this._sampleZeroJulianEphemerisDate,0,fe.TAI),this._stepSizeDays=t.stepSizeDays??1,this._samplesPerXysFile=t.samplesPerXysFile??1e3,this._totalSamples=t.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const i=this._interpolationOrder,e=this._denominators=new Array(i+1),n=this._xTable=new Array(i+1),o=Math.pow(this._stepSizeDays,i);for(let s=0;s<=i;++s){e[s]=o,n[s]=s*this._stepSizeDays;for(let r=0;r<=i;++r)r!==s&&(e[s]*=s-r);e[s]=1/e[s]}this._work=new Array(i+1),this._coef=new Array(i+1)}const zS=new k(0,0,fe.TAI);function sd(t,i,e){const n=zS;return n.dayNumber=i,n.secondsOfDay=e,k.daysDifference(n,t._sampleZeroDateTT)}od.prototype.preload=function(t,i,e,n){const o=sd(this,t,i),s=sd(this,e,n);let r=o/this._stepSizeDays-this._interpolationOrder/2|0;r<0&&(r=0);let l=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);const c=r/this._samplesPerXysFile|0,u=l/this._samplesPerXysFile|0,d=[];for(let p=c;p<=u;++p)d.push(rd(this,p));return Promise.all(d)},od.prototype.computeXysRadians=function(t,i,e){const n=sd(this,t,i);if(n<0)return;const o=n/this._stepSizeDays|0;if(o>=this._totalSamples)return;const s=this._interpolationOrder;let r=o-(s/2|0);r<0&&(r=0);let l=r+s;l>=this._totalSamples&&(l=this._totalSamples-1,r=l-s,r<0&&(r=0));let c=!1;const u=this._samples;if(T(u[r*3])||(rd(this,r/this._samplesPerXysFile|0),c=!0),T(u[l*3])||(rd(this,l/this._samplesPerXysFile|0),c=!0),c)return;T(e)?(e.x=0,e.y=0,e.s=0):e=new Iv(0,0,0);const d=n-r*this._stepSizeDays,p=this._work,f=this._denominators,g=this._coef,v=this._xTable;let y,w;for(y=0;y<=s;++y)p[y]=d-v[y];for(y=0;y<=s;++y){for(g[y]=1,w=0;w<=s;++w)w!==y&&(g[y]*=p[w]);g[y]*=f[y];let P=(r+y)*3;e.x+=g[y]*u[P++],e.y+=g[y]*u[P++],e.s+=g[y]*u[P]}return e};function rd(t,i){if(t._chunkDownloadsInProgress[i])return t._chunkDownloadsInProgress[i];let e;const n=t._xysFileUrlTemplate;T(n)?e=n.getDerivedResource({templateValues:{0:i}}):e=new J({url:ni(`Assets/IAU2006_XYS/IAU2006_XYS_${i}.json`)});const o=e.fetchJson().then(function(s){t._chunkDownloadsInProgress[i]=!1;const r=t._samples,l=s.samples,c=i*t._samplesPerXysFile*3;for(let u=0,d=l.length;u<d;++u)r[c+u]=l[u]});return t._chunkDownloadsInProgress[i]=o,o}let Fn;const We={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},zt={};Object.defineProperties(zt,{element:{get:function(){if(zt.supportsFullscreen())return document[We.fullscreenElement]}},changeEventName:{get:function(){if(zt.supportsFullscreen())return We.fullscreenchange}},errorEventName:{get:function(){if(zt.supportsFullscreen())return We.fullscreenerror}},enabled:{get:function(){if(zt.supportsFullscreen())return document[We.fullscreenEnabled]}},fullscreen:{get:function(){if(zt.supportsFullscreen())return zt.element!==null}}}),zt.supportsFullscreen=function(){if(T(Fn))return Fn;Fn=!1;const t=document.body;if(typeof t.requestFullscreen=="function")return We.requestFullscreen="requestFullscreen",We.exitFullscreen="exitFullscreen",We.fullscreenEnabled="fullscreenEnabled",We.fullscreenElement="fullscreenElement",We.fullscreenchange="fullscreenchange",We.fullscreenerror="fullscreenerror",Fn=!0,Fn;const i=["webkit","moz","o","ms","khtml"];let e;for(let n=0,o=i.length;n<o;++n){const s=i[n];e=`${s}RequestFullscreen`,typeof t[e]=="function"?(We.requestFullscreen=e,Fn=!0):(e=`${s}RequestFullScreen`,typeof t[e]=="function"&&(We.requestFullscreen=e,Fn=!0)),e=`${s}ExitFullscreen`,typeof document[e]=="function"?We.exitFullscreen=e:(e=`${s}CancelFullScreen`,typeof document[e]=="function"&&(We.exitFullscreen=e)),e=`${s}FullscreenEnabled`,document[e]!==void 0?We.fullscreenEnabled=e:(e=`${s}FullScreenEnabled`,document[e]!==void 0&&(We.fullscreenEnabled=e)),e=`${s}FullscreenElement`,document[e]!==void 0?We.fullscreenElement=e:(e=`${s}FullScreenElement`,document[e]!==void 0&&(We.fullscreenElement=e)),e=`${s}fullscreenchange`,document[`on${e}`]!==void 0&&(s==="ms"&&(e="MSFullscreenChange"),We.fullscreenchange=e),e=`${s}fullscreenerror`,document[`on${e}`]!==void 0&&(s==="ms"&&(e="MSFullscreenError"),We.fullscreenerror=e)}return Fn},zt.requestFullscreen=function(t,i){zt.supportsFullscreen()&&t[We.requestFullscreen]({vrDisplay:i})},zt.exitFullscreen=function(){zt.supportsFullscreen()&&document[We.exitFullscreen]()},zt._names=We;let mt;typeof navigator<"u"?mt=navigator:mt={};function So(t){const i=t.split(".");for(let e=0,n=i.length;e<n;++e)i[e]=parseInt(i[e],10);return i}let Qc,Mv;function ad(){if(!T(Qc)&&(Qc=!1,!jc())){const t=/ Chrome\/([\.0-9]+)/.exec(mt.userAgent);t!==null&&(Qc=!0,Mv=So(t[1]))}return Qc}function LS(){return ad()&&Mv}let kc,Dv;function Rv(){if(!T(kc)&&(kc=!1,!ad()&&!jc()&&/ Safari\/[\.0-9]+/.test(mt.userAgent))){const t=/ Version\/([\.0-9]+)/.exec(mt.userAgent);t!==null&&(kc=!0,Dv=So(t[1]))}return kc}function NS(){return Rv()&&Dv}let Kc,ld;function Fv(){if(!T(Kc)){Kc=!1;const t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(mt.userAgent);t!==null&&(Kc=!0,ld=So(t[1]),ld.isNightly=!!t[2])}return Kc}function OS(){return Fv()&&ld}let Wr,cd;function zv(){if(!T(Wr)){Wr=!1;let t;mt.appName==="Microsoft Internet Explorer"?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(mt.userAgent),t!==null&&(Wr=!0,cd=So(t[1]))):mt.appName==="Netscape"&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(mt.userAgent),t!==null&&(Wr=!0,cd=So(t[1])))}return Wr}function BS(){return zv()&&cd}let Jc,Lv;function jc(){if(!T(Jc)){Jc=!1;const t=/ Edg\/([\.0-9]+)/.exec(mt.userAgent);t!==null&&(Jc=!0,Lv=So(t[1]))}return Jc}function VS(){return jc()&&Lv}let eh,hd;function th(){if(!T(eh)){eh=!1;const t=/Firefox\/([\.0-9]+)/.exec(mt.userAgent);t!==null&&(eh=!0,hd=So(t[1]))}return eh}let ud;function WS(){return T(ud)||(ud=/Windows/i.test(mt.appVersion)),ud}let dd;function GS(){return T(dd)||(dd=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),dd}function US(){return th()&&hd}let pd;function HS(){return T(pd)||(pd=!th()&&typeof PointerEvent<"u"&&(!T(mt.pointerEnabled)||mt.pointerEnabled)),pd}let Nv,ih;function Ov(){if(!T(ih)){const t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");const i=t.style.imageRendering;ih=T(i)&&i!=="",ih&&(Nv=i)}return ih}function $S(){return Ov()?Nv:void 0}function vt(){if(!vt.initialized)throw new W("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return vt._result}vt._promise=void 0,vt._result=void 0,vt.initialize=function(){return T(vt._promise)||(vt._promise=new Promise(t=>{const i=new Image;i.onload=function(){vt._result=i.width>0&&i.height>0,t(vt._result)},i.onerror=function(){vt._result=!1,t(vt._result)},i.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),vt._promise},Object.defineProperties(vt,{initialized:{get:function(){return T(vt._result)}}});const bs=[];typeof ArrayBuffer<"u"&&(bs.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&bs.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&bs.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&bs.push(BigInt64Array),typeof BigUint64Array<"u"&&bs.push(BigUint64Array));const ut={isChrome:ad,chromeVersion:LS,isSafari:Rv,safariVersion:NS,isWebkit:Fv,webkitVersion:OS,isInternetExplorer:zv,internetExplorerVersion:BS,isEdge:jc,edgeVersion:VS,isFirefox:th,firefoxVersion:US,isWindows:WS,isIPadOrIOS:GS,hardwareConcurrency:mt.hardwareConcurrency??3,supportsPointerEvents:HS,supportsImageRenderingPixelated:Ov,supportsWebP:vt,imageRenderingValue:$S,typedArrayTypes:bs};ut.supportsBasis=function(t){return ut.supportsWebAssembly()&&t.context.supportsBasis},ut.supportsFullscreen=function(){return zt.supportsFullscreen()},ut.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"},ut.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"},ut.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"},ut.supportsBigInt=function(){return typeof BigInt<"u"},ut.supportsWebWorkers=function(){return typeof Worker<"u"},ut.supportsWebAssembly=function(){return typeof WebAssembly<"u"},ut.supportsWebgl2=function(t){return b.defined("scene",t),t.context.webgl2},ut.supportsEsmWebWorkers=function(){return!th()||parseInt(hd)>=114};function Z(t,i,e,n){this.x=t??0,this.y=i??0,this.z=e??0,this.w=n??0}let Gr=new D;Z.fromAxisAngle=function(t,i,e){b.typeOf.object("axis",t),b.typeOf.number("angle",i);const n=i/2,o=Math.sin(n);Gr=D.normalize(t,Gr);const s=Gr.x*o,r=Gr.y*o,l=Gr.z*o,c=Math.cos(n);return T(e)?(e.x=s,e.y=r,e.z=l,e.w=c,e):new Z(s,r,l,c)};const qS=[1,2,0],XS=new Array(3);Z.fromRotationMatrix=function(t,i){b.typeOf.object("matrix",t);let e,n,o,s,r;const l=t[H.COLUMN0ROW0],c=t[H.COLUMN1ROW1],u=t[H.COLUMN2ROW2],d=l+c+u;if(d>0)e=Math.sqrt(d+1),r=.5*e,e=.5/e,n=(t[H.COLUMN1ROW2]-t[H.COLUMN2ROW1])*e,o=(t[H.COLUMN2ROW0]-t[H.COLUMN0ROW2])*e,s=(t[H.COLUMN0ROW1]-t[H.COLUMN1ROW0])*e;else{const p=qS;let f=0;c>l&&(f=1),u>l&&u>c&&(f=2);const g=p[f],v=p[g];e=Math.sqrt(t[H.getElementIndex(f,f)]-t[H.getElementIndex(g,g)]-t[H.getElementIndex(v,v)]+1);const y=XS;y[f]=.5*e,e=.5/e,r=(t[H.getElementIndex(v,g)]-t[H.getElementIndex(g,v)])*e,y[g]=(t[H.getElementIndex(g,f)]+t[H.getElementIndex(f,g)])*e,y[v]=(t[H.getElementIndex(v,f)]+t[H.getElementIndex(f,v)])*e,n=-y[0],o=-y[1],s=-y[2]}return T(i)?(i.x=n,i.y=o,i.z=s,i.w=r,i):new Z(n,o,s,r)};const Bv=new Z;let Vv=new Z,fd=new Z,Wv=new Z;Z.fromHeadingPitchRoll=function(t,i){return b.typeOf.object("headingPitchRoll",t),Wv=Z.fromAxisAngle(D.UNIT_X,t.roll,Bv),fd=Z.fromAxisAngle(D.UNIT_Y,-t.pitch,i),i=Z.multiply(fd,Wv,fd),Vv=Z.fromAxisAngle(D.UNIT_Z,-t.heading,Bv),Z.multiply(Vv,i,i)};const nh=new D,gd=new D,mi=new Z,Gv=new Z,oh=new Z;Z.packedLength=4,Z.pack=function(t,i,e){return b.typeOf.object("value",t),b.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e++]=t.z,i[e]=t.w,i},Z.unpack=function(t,i,e){return b.defined("array",t),i=i??0,T(e)||(e=new Z),e.x=t[i],e.y=t[i+1],e.z=t[i+2],e.w=t[i+3],e},Z.packedInterpolationLength=3,Z.convertPackedArrayForInterpolation=function(t,i,e,n){Z.unpack(t,e*4,oh),Z.conjugate(oh,oh);for(let o=0,s=e-i+1;o<s;o++){const r=o*3;Z.unpack(t,(i+o)*4,mi),Z.multiply(mi,oh,mi),mi.w<0&&Z.negate(mi,mi),Z.computeAxis(mi,nh);const l=Z.computeAngle(mi);T(n)||(n=[]),n[r]=nh.x*l,n[r+1]=nh.y*l,n[r+2]=nh.z*l}},Z.unpackInterpolationResult=function(t,i,e,n,o){T(o)||(o=new Z),D.fromArray(t,0,gd);const s=D.magnitude(gd);return Z.unpack(i,n*4,Gv),s===0?Z.clone(Z.IDENTITY,mi):Z.fromAxisAngle(gd,s,mi),Z.multiply(mi,Gv,o)},Z.clone=function(t,i){if(T(t))return T(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i.w=t.w,i):new Z(t.x,t.y,t.z,t.w)},Z.conjugate=function(t,i){return b.typeOf.object("quaternion",t),b.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=t.w,i},Z.magnitudeSquared=function(t){return b.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},Z.magnitude=function(t){return Math.sqrt(Z.magnitudeSquared(t))},Z.normalize=function(t,i){b.typeOf.object("result",i);const e=1/Z.magnitude(t),n=t.x*e,o=t.y*e,s=t.z*e,r=t.w*e;return i.x=n,i.y=o,i.z=s,i.w=r,i},Z.inverse=function(t,i){b.typeOf.object("result",i);const e=Z.magnitudeSquared(t);return i=Z.conjugate(t,i),Z.multiplyByScalar(i,1/e,i)},Z.add=function(t,i,e){return b.typeOf.object("left",t),b.typeOf.object("right",i),b.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e.w=t.w+i.w,e},Z.subtract=function(t,i,e){return b.typeOf.object("left",t),b.typeOf.object("right",i),b.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e.w=t.w-i.w,e},Z.negate=function(t,i){return b.typeOf.object("quaternion",t),b.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=-t.w,i},Z.dot=function(t,i){return b.typeOf.object("left",t),b.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w},Z.multiply=function(t,i,e){b.typeOf.object("left",t),b.typeOf.object("right",i),b.typeOf.object("result",e);const n=t.x,o=t.y,s=t.z,r=t.w,l=i.x,c=i.y,u=i.z,d=i.w,p=r*l+n*d+o*u-s*c,f=r*c-n*u+o*d+s*l,g=r*u+n*c-o*l+s*d,v=r*d-n*l-o*c-s*u;return e.x=p,e.y=f,e.z=g,e.w=v,e},Z.multiplyByScalar=function(t,i,e){return b.typeOf.object("quaternion",t),b.typeOf.number("scalar",i),b.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},Z.divideByScalar=function(t,i,e){return b.typeOf.object("quaternion",t),b.typeOf.number("scalar",i),b.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e.w=t.w/i,e},Z.computeAxis=function(t,i){b.typeOf.object("quaternion",t),b.typeOf.object("result",i);const e=t.w;if(Math.abs(e-1)<F.EPSILON6||Math.abs(e+1)<F.EPSILON6)return i.x=1,i.y=i.z=0,i;const n=1/Math.sqrt(1-e*e);return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i},Z.computeAngle=function(t){return b.typeOf.object("quaternion",t),Math.abs(t.w-1)<F.EPSILON6?0:2*Math.acos(t.w)};let md=new Z;Z.lerp=function(t,i,e,n){return b.typeOf.object("start",t),b.typeOf.object("end",i),b.typeOf.number("t",e),b.typeOf.object("result",n),md=Z.multiplyByScalar(i,e,md),n=Z.multiplyByScalar(t,1-e,n),Z.add(md,n,n)};let Uv=new Z,vd=new Z,yd=new Z;Z.slerp=function(t,i,e,n){b.typeOf.object("start",t),b.typeOf.object("end",i),b.typeOf.number("t",e),b.typeOf.object("result",n);let o=Z.dot(t,i),s=i;if(o<0&&(o=-o,s=Uv=Z.negate(i,Uv)),1-o<F.EPSILON6)return Z.lerp(t,s,e,n);const r=Math.acos(o);return vd=Z.multiplyByScalar(t,Math.sin((1-e)*r),vd),yd=Z.multiplyByScalar(s,Math.sin(e*r),yd),n=Z.add(vd,yd,n),Z.multiplyByScalar(n,1/Math.sin(r),n)},Z.log=function(t,i){b.typeOf.object("quaternion",t),b.typeOf.object("result",i);const e=F.acosClamped(t.w);let n=0;return e!==0&&(n=e/Math.sin(e)),D.multiplyByScalar(t,n,i)},Z.exp=function(t,i){b.typeOf.object("cartesian",t),b.typeOf.object("result",i);const e=D.magnitude(t);let n=0;return e!==0&&(n=Math.sin(e)/e),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(e),i};const YS=new D,ZS=new D,Ur=new Z,Ss=new Z;Z.computeInnerQuadrangle=function(t,i,e,n){b.typeOf.object("q0",t),b.typeOf.object("q1",i),b.typeOf.object("q2",e),b.typeOf.object("result",n);const o=Z.conjugate(i,Ur);Z.multiply(o,e,Ss);const s=Z.log(Ss,YS);Z.multiply(o,t,Ss);const r=Z.log(Ss,ZS);return D.add(s,r,s),D.multiplyByScalar(s,.25,s),D.negate(s,s),Z.exp(s,Ur),Z.multiply(i,Ur,n)},Z.squad=function(t,i,e,n,o,s){b.typeOf.object("q0",t),b.typeOf.object("q1",i),b.typeOf.object("s0",e),b.typeOf.object("s1",n),b.typeOf.number("t",o),b.typeOf.object("result",s);const r=Z.slerp(t,i,o,Ur),l=Z.slerp(e,n,o,Ss);return Z.slerp(r,l,2*o*(1-o),s)};const QS=new Z,Hv=1.9011074535173003,sh=ut.supportsTypedArrays()?new Float32Array(8):[],rh=ut.supportsTypedArrays()?new Float32Array(8):[],Ki=ut.supportsTypedArrays()?new Float32Array(8):[],Ji=ut.supportsTypedArrays()?new Float32Array(8):[];for(let t=0;t<7;++t){const i=t+1,e=2*i+1;sh[t]=1/(i*e),rh[t]=i/e}sh[7]=Hv/(8*17),rh[7]=Hv*8/17,Z.fastSlerp=function(t,i,e,n){b.typeOf.object("start",t),b.typeOf.object("end",i),b.typeOf.number("t",e),b.typeOf.object("result",n);let o=Z.dot(t,i),s;o>=0?s=1:(s=-1,o=-o);const r=o-1,l=1-e,c=e*e,u=l*l;for(let g=7;g>=0;--g)Ki[g]=(sh[g]*c-rh[g])*r,Ji[g]=(sh[g]*u-rh[g])*r;const d=s*e*(1+Ki[0]*(1+Ki[1]*(1+Ki[2]*(1+Ki[3]*(1+Ki[4]*(1+Ki[5]*(1+Ki[6]*(1+Ki[7])))))))),p=l*(1+Ji[0]*(1+Ji[1]*(1+Ji[2]*(1+Ji[3]*(1+Ji[4]*(1+Ji[5]*(1+Ji[6]*(1+Ji[7])))))))),f=Z.multiplyByScalar(t,p,QS);return Z.multiplyByScalar(i,d,n),Z.add(f,n,n)},Z.fastSquad=function(t,i,e,n,o,s){b.typeOf.object("q0",t),b.typeOf.object("q1",i),b.typeOf.object("s0",e),b.typeOf.object("s1",n),b.typeOf.number("t",o),b.typeOf.object("result",s);const r=Z.fastSlerp(t,i,o,Ur),l=Z.fastSlerp(e,n,o,Ss);return Z.fastSlerp(r,l,2*o*(1-o),s)},Z.equals=function(t,i){return t===i||T(t)&&T(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z&&t.w===i.w},Z.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t.x-i.x)<=e&&Math.abs(t.y-i.y)<=e&&Math.abs(t.z-i.z)<=e&&Math.abs(t.w-i.w)<=e},Z.ZERO=Object.freeze(new Z(0,0,0,0)),Z.IDENTITY=Object.freeze(new Z(0,0,0,1)),Z.prototype.clone=function(t){return Z.clone(this,t)},Z.prototype.equals=function(t){return Z.equals(this,t)},Z.prototype.equalsEpsilon=function(t,i){return Z.equalsEpsilon(this,t,i)},Z.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const he={},wd={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},xs={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Cd={},Lt={east:new D,north:new D,up:new D,west:new D,south:new D,down:new D};let zn=new D,Ln=new D,Nn=new D;he.localFrameToFixedFrameGenerator=function(t,i){if(!wd.hasOwnProperty(t)||!wd[t].hasOwnProperty(i))throw new W("firstAxis and secondAxis must be east, north, up, west, south or down.");const e=wd[t][i];let n;const o=t+i;return T(Cd[o])?n=Cd[o]:(n=function(s,r,l){if(!T(s))throw new W("origin is required.");if(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))throw new W("origin has a NaN component");if(T(l)||(l=new X),D.equalsEpsilon(s,D.ZERO,F.EPSILON14))D.unpack(xs[t],0,zn),D.unpack(xs[i],0,Ln),D.unpack(xs[e],0,Nn);else if(F.equalsEpsilon(s.x,0,F.EPSILON14)&&F.equalsEpsilon(s.y,0,F.EPSILON14)){const c=F.sign(s.z);D.unpack(xs[t],0,zn),t!=="east"&&t!=="west"&&D.multiplyByScalar(zn,c,zn),D.unpack(xs[i],0,Ln),i!=="east"&&i!=="west"&&D.multiplyByScalar(Ln,c,Ln),D.unpack(xs[e],0,Nn),e!=="east"&&e!=="west"&&D.multiplyByScalar(Nn,c,Nn)}else{r=r??re.default,r.geodeticSurfaceNormal(s,Lt.up);const c=Lt.up,u=Lt.east;u.x=-s.y,u.y=s.x,u.z=0,D.normalize(u,Lt.east),D.cross(c,u,Lt.north),D.multiplyByScalar(Lt.up,-1,Lt.down),D.multiplyByScalar(Lt.east,-1,Lt.west),D.multiplyByScalar(Lt.north,-1,Lt.south),zn=Lt[t],Ln=Lt[i],Nn=Lt[e]}return l[0]=zn.x,l[1]=zn.y,l[2]=zn.z,l[3]=0,l[4]=Ln.x,l[5]=Ln.y,l[6]=Ln.z,l[7]=0,l[8]=Nn.x,l[9]=Nn.y,l[10]=Nn.z,l[11]=0,l[12]=s.x,l[13]=s.y,l[14]=s.z,l[15]=1,l},Cd[o]=n),n},he.eastNorthUpToFixedFrame=he.localFrameToFixedFrameGenerator("east","north"),he.northEastDownToFixedFrame=he.localFrameToFixedFrameGenerator("north","east"),he.northUpEastToFixedFrame=he.localFrameToFixedFrameGenerator("north","up"),he.northWestUpToFixedFrame=he.localFrameToFixedFrameGenerator("north","west");const kS=new Z,KS=new D(1,1,1),JS=new X;he.headingPitchRollToFixedFrame=function(t,i,e,n,o){b.typeOf.object("HeadingPitchRoll",i),n=n??he.eastNorthUpToFixedFrame;const s=Z.fromHeadingPitchRoll(i,kS),r=X.fromTranslationQuaternionRotationScale(D.ZERO,s,KS,JS);return o=n(t,e,o),X.multiply(o,r,o)};const jS=new X,ex=new H;he.headingPitchRollQuaternion=function(t,i,e,n,o){b.typeOf.object("HeadingPitchRoll",i);const s=he.headingPitchRollToFixedFrame(t,i,e,n,jS),r=X.getMatrix3(s,ex);return Z.fromRotationMatrix(r,o)};const tx=new D(1,1,1),ix=new D,$v=new X,nx=new X,ox=new H,sx=new Z;he.fixedFrameToHeadingPitchRoll=function(t,i,e,n){b.defined("transform",t),i=i??re.default,e=e??he.eastNorthUpToFixedFrame,T(n)||(n=new tt);const o=X.getTranslation(t,ix);if(D.equals(o,D.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;let s=X.inverseTransformation(e(o,i,$v),$v),r=X.setScale(t,tx,nx);r=X.setTranslation(r,D.ZERO,r),s=X.multiply(s,r,s);let l=Z.fromRotationMatrix(X.getMatrix3(s,ox),sx);return l=Z.normalize(l,l),tt.fromQuaternion(l,n)};const rx=6*3600+41*60+50.54841,ax=8640184812866e-6,lx=.093104,cx=-62e-7,hx=11772758384668e-32,ux=72921158553e-15,dx=F.TWO_PI/86400;let ah=new k;he.computeIcrfToCentralBodyFixedMatrix=function(t,i){let e=he.computeIcrfToFixedMatrix(t,i);return T(e)||(e=he.computeTemeToPseudoFixedMatrix(t,i)),e},he.computeTemeToPseudoFixedMatrix=function(t,i){if(!T(t))throw new W("date is required.");ah=k.addSeconds(t,-k.computeTaiMinusUtc(t),ah);const e=ah.dayNumber,n=ah.secondsOfDay;let o;const s=e-2451545;n>=43200?o=(s+.5)/Be.DAYS_PER_JULIAN_CENTURY:o=(s-.5)/Be.DAYS_PER_JULIAN_CENTURY;const l=(rx+o*(ax+o*(lx+o*cx)))*dx%F.TWO_PI,c=ux+hx*(e-24515455e-1),u=(n+Be.SECONDS_PER_DAY*.5)%Be.SECONDS_PER_DAY,d=l+c*u,p=Math.cos(d),f=Math.sin(d);return T(i)?(i[0]=p,i[1]=-f,i[2]=0,i[3]=f,i[4]=p,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new H(p,f,0,-f,p,0,0,0,1)},he.iau2006XysData=new od,he.earthOrientationParameters=Br.NONE;const _d=32.184,px=2451545;he.preloadIcrfFixed=function(t){const i=t.start.dayNumber,e=t.start.secondsOfDay+_d,n=t.stop.dayNumber,o=t.stop.secondsOfDay+_d;return he.iau2006XysData.preload(i,e,n,o)},he.computeIcrfToFixedMatrix=function(t,i){if(!T(t))throw new W("date is required.");T(i)||(i=new H);const e=he.computeFixedToIcrfMatrix(t,i);if(T(e))return H.transpose(e,i)};const fx=32.184,gx=2451545,lh=new tt,mx=new H,vx=new k;he.computeMoonFixedToIcrfMatrix=function(t,i){if(!T(t))throw new W("date is required.");const e=k.addSeconds(t,fx,vx),n=k.totalDays(e)-gx,o=F.toRadians(12.112)-F.toRadians(.052992)*n,s=F.toRadians(24.224)-F.toRadians(.105984)*n,r=F.toRadians(227.645)+F.toRadians(13.012)*n,l=F.toRadians(261.105)+F.toRadians(13.340716)*n,c=F.toRadians(358)+F.toRadians(.9856)*n;return lh.pitch=F.toRadians(180)-F.toRadians(3.878)*Math.sin(o)-F.toRadians(.12)*Math.sin(s)+F.toRadians(.07)*Math.sin(r)-F.toRadians(.017)*Math.sin(l),lh.roll=F.toRadians(66.53-90)+F.toRadians(1.543)*Math.cos(o)+F.toRadians(.24)*Math.cos(s)-F.toRadians(.028)*Math.cos(r)+F.toRadians(.007)*Math.cos(l),lh.heading=F.toRadians(244.375-90)+F.toRadians(13.17635831)*n+F.toRadians(3.558)*Math.sin(o)+F.toRadians(.121)*Math.sin(s)-F.toRadians(.064)*Math.sin(r)+F.toRadians(.016)*Math.sin(l)+F.toRadians(.025)*Math.sin(c),H.fromHeadingPitchRoll(lh,mx)},he.computeIcrfToMoonFixedMatrix=function(t,i){if(!T(t))throw new W("date is required.");T(i)||(i=new H);const e=he.computeMoonFixedToIcrfMatrix(t,i);if(T(e))return H.transpose(e,i)};const yx=new Iv(0,0,0),wx=new $u(0,0,0,0,0),Pd=new H,bd=new H;he.computeFixedToIcrfMatrix=function(t,i){if(!T(t))throw new W("date is required.");T(i)||(i=new H);const e=he.earthOrientationParameters.compute(t,wx);if(!T(e))return;const n=t.dayNumber,o=t.secondsOfDay+_d,s=he.iau2006XysData.computeXysRadians(n,o,yx);if(!T(s))return;const r=s.x+e.xPoleOffset,l=s.y+e.yPoleOffset,c=1/(1+Math.sqrt(1-r*r-l*l)),u=Pd;u[0]=1-c*r*r,u[3]=-c*r*l,u[6]=r,u[1]=-c*r*l,u[4]=1-c*l*l,u[7]=l,u[2]=-r,u[5]=-l,u[8]=1-c*(r*r+l*l);const d=H.fromRotationZ(-s.s,bd),p=H.multiply(u,d,Pd),f=t.dayNumber,g=t.secondsOfDay-k.computeTaiMinusUtc(t)+e.ut1MinusUtc,v=f-2451545,y=g/Be.SECONDS_PER_DAY;let w=.779057273264+y+.00273781191135448*(v+y);w=w%1*F.TWO_PI;const P=H.fromRotationZ(w,bd),C=H.multiply(p,P,Pd),S=Math.cos(e.xPoleWander),A=Math.cos(e.yPoleWander),E=Math.sin(e.xPoleWander),R=Math.sin(e.yPoleWander);let N=n-px+o/Be.SECONDS_PER_DAY;N/=36525;const B=-47e-6*N*F.RADIANS_PER_DEGREE/3600,V=Math.cos(B),G=Math.sin(B),z=bd;return z[0]=S*V,z[1]=S*G,z[2]=E,z[3]=-A*G+R*E*V,z[4]=A*V+R*E*G,z[5]=-R*S,z[6]=-R*G-A*E*V,z[7]=R*V-A*E*G,z[8]=A*S,H.multiply(C,z,i)};const Cx=new K;he.pointToWindowCoordinates=function(t,i,e,n){return n=he.pointToGLWindowCoordinates(t,i,e,n),n.y=2*i[5]-n.y,n},he.pointToGLWindowCoordinates=function(t,i,e,n){if(!T(t))throw new W("modelViewProjectionMatrix is required.");if(!T(i))throw new W("viewportTransformation is required.");if(!T(e))throw new W("point is required.");T(n)||(n=new j);const o=Cx;return X.multiplyByVector(t,K.fromElements(e.x,e.y,e.z,1,o),o),K.multiplyByScalar(o,1/o.w,o),X.multiplyByVector(i,o,o),j.fromCartesian4(o,n)};const _x=new D,Px=new D,bx=new D;he.rotationMatrixFromPositionVelocity=function(t,i,e,n){if(!T(t))throw new W("position is required.");if(!T(i))throw new W("velocity is required.");const o=(e??re.default).geodeticSurfaceNormal(t,_x);let s=D.cross(i,o,Px);D.equalsEpsilon(s,D.ZERO,F.EPSILON6)&&(s=D.clone(D.UNIT_X,s));const r=D.cross(s,i,bx);return D.normalize(r,r),D.cross(i,r,s),D.negate(s,s),D.normalize(s,s),T(n)||(n=new H),n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=s.x,n[4]=s.y,n[5]=s.z,n[6]=r.x,n[7]=r.y,n[8]=r.z,n};const qv=new X(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),Xv=new de,Sd=new D,Sx=new D,xx=new H,xd=new X,Yv=new X;he.basisTo2D=function(t,i,e){if(!T(t))throw new W("projection is required.");if(!T(i))throw new W("matrix is required.");if(!T(e))throw new W("result is required.");const n=X.getTranslation(i,Sx),o=t.ellipsoid;let s;if(D.equals(n,D.ZERO))s=D.clone(D.ZERO,Sd);else{const d=o.cartesianToCartographic(n,Xv);s=t.project(d,Sd),D.fromElements(s.z,s.x,s.y,s)}const r=he.eastNorthUpToFixedFrame(n,o,xd),l=X.inverseTransformation(r,Yv),c=X.getMatrix3(i,xx),u=X.multiplyByMatrix3(l,c,e);return X.multiply(qv,u,e),X.setTranslation(e,s,e),e},he.ellipsoidTo2DModelMatrix=function(t,i,e){if(!T(t))throw new W("projection is required.");if(!T(i))throw new W("center is required.");if(!T(e))throw new W("result is required.");const n=t.ellipsoid,o=he.eastNorthUpToFixedFrame(i,n,xd),s=X.inverseTransformation(o,Yv),r=n.cartesianToCartographic(i,Xv),l=t.project(r,Sd);D.fromElements(l.z,l.x,l.y,l);const c=X.fromTranslation(l,xd);return X.multiply(qv,s,e),X.multiply(c,e,e),e};function ie(t,i,e,n){this.west=t??0,this.south=i??0,this.east=e??0,this.north=n??0}Object.defineProperties(ie.prototype,{width:{get:function(){return ie.computeWidth(this)}},height:{get:function(){return ie.computeHeight(this)}}}),ie.packedLength=4,ie.pack=function(t,i,e){return b.typeOf.object("value",t),b.defined("array",i),e=e??0,i[e++]=t.west,i[e++]=t.south,i[e++]=t.east,i[e]=t.north,i},ie.unpack=function(t,i,e){return b.defined("array",t),i=i??0,T(e)||(e=new ie),e.west=t[i++],e.south=t[i++],e.east=t[i++],e.north=t[i],e},ie.computeWidth=function(t){b.typeOf.object("rectangle",t);let i=t.east;const e=t.west;return i<e&&(i+=F.TWO_PI),i-e},ie.computeHeight=function(t){return b.typeOf.object("rectangle",t),t.north-t.south},ie.fromDegrees=function(t,i,e,n,o){return t=F.toRadians(t??0),i=F.toRadians(i??0),e=F.toRadians(e??0),n=F.toRadians(n??0),T(o)?(o.west=t,o.south=i,o.east=e,o.north=n,o):new ie(t,i,e,n)},ie.fromRadians=function(t,i,e,n,o){return T(o)?(o.west=t??0,o.south=i??0,o.east=e??0,o.north=n??0,o):new ie(t,i,e,n)},ie.fromCartographicArray=function(t,i){b.defined("cartographics",t);let e=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let c=0,u=t.length;c<u;c++){const d=t[c];e=Math.min(e,d.longitude),n=Math.max(n,d.longitude),r=Math.min(r,d.latitude),l=Math.max(l,d.latitude);const p=d.longitude>=0?d.longitude:d.longitude+F.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return n-e>s-o&&(e=o,n=s,n>F.PI&&(n=n-F.TWO_PI),e>F.PI&&(e=e-F.TWO_PI)),T(i)?(i.west=e,i.south=r,i.east=n,i.north=l,i):new ie(e,r,n,l)},ie.fromCartesianArray=function(t,i,e){b.defined("cartesians",t),i=i??re.default;let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,d=t.length;u<d;u++){const p=i.cartesianToCartographic(t[u]);n=Math.min(n,p.longitude),o=Math.max(o,p.longitude),l=Math.min(l,p.latitude),c=Math.max(c,p.latitude);const f=p.longitude>=0?p.longitude:p.longitude+F.TWO_PI;s=Math.min(s,f),r=Math.max(r,f)}return o-n>r-s&&(n=s,o=r,o>F.PI&&(o=o-F.TWO_PI),n>F.PI&&(n=n-F.TWO_PI)),T(e)?(e.west=n,e.south=l,e.east=o,e.north=c,e):new ie(n,l,o,c)};const Ax=new D,Ex=new D,Tx=new D,Ix=new D,Mx=new D,Ad=new Array(5);for(let t=0;t<Ad.length;++t)Ad[t]=new D;ie.fromBoundingSphere=function(t,i,e){b.typeOf.object("boundingSphere",t);const n=t.center,o=t.radius;if(T(i)||(i=re.default),T(e)||(e=new ie),D.equals(n,D.ZERO))return ie.clone(ie.MAX_VALUE,e),e;const s=he.eastNorthUpToFixedFrame(n,i,Ax),r=X.multiplyByPointAsVector(s,D.UNIT_X,Ex);D.normalize(r,r);const l=X.multiplyByPointAsVector(s,D.UNIT_Y,Tx);D.normalize(l,l),D.multiplyByScalar(l,o,l),D.multiplyByScalar(r,o,r);const c=D.negate(l,Mx),u=D.negate(r,Ix),d=Ad;let p=d[0];return D.add(n,l,p),p=d[1],D.add(n,u,p),p=d[2],D.add(n,c,p),p=d[3],D.add(n,r,p),d[4]=n,ie.fromCartesianArray(d,i,e)},ie.clone=function(t,i){if(T(t))return T(i)?(i.west=t.west,i.south=t.south,i.east=t.east,i.north=t.north,i):new ie(t.west,t.south,t.east,t.north)},ie.equalsEpsilon=function(t,i,e){return e=e??0,t===i||T(t)&&T(i)&&Math.abs(t.west-i.west)<=e&&Math.abs(t.south-i.south)<=e&&Math.abs(t.east-i.east)<=e&&Math.abs(t.north-i.north)<=e},ie.prototype.clone=function(t){return ie.clone(this,t)},ie.prototype.equals=function(t){return ie.equals(this,t)},ie.equals=function(t,i){return t===i||T(t)&&T(i)&&t.west===i.west&&t.south===i.south&&t.east===i.east&&t.north===i.north},ie.prototype.equalsEpsilon=function(t,i){return ie.equalsEpsilon(this,t,i)},ie._validate=function(t){b.typeOf.object("rectangle",t);const i=t.north;b.typeOf.number.greaterThanOrEquals("north",i,-F.PI_OVER_TWO),b.typeOf.number.lessThanOrEquals("north",i,F.PI_OVER_TWO);const e=t.south;b.typeOf.number.greaterThanOrEquals("south",e,-F.PI_OVER_TWO),b.typeOf.number.lessThanOrEquals("south",e,F.PI_OVER_TWO);const n=t.west;b.typeOf.number.greaterThanOrEquals("west",n,-Math.PI),b.typeOf.number.lessThanOrEquals("west",n,Math.PI);const o=t.east;b.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),b.typeOf.number.lessThanOrEquals("east",o,Math.PI)},ie.southwest=function(t,i){return b.typeOf.object("rectangle",t),T(i)?(i.longitude=t.west,i.latitude=t.south,i.height=0,i):new de(t.west,t.south)},ie.northwest=function(t,i){return b.typeOf.object("rectangle",t),T(i)?(i.longitude=t.west,i.latitude=t.north,i.height=0,i):new de(t.west,t.north)},ie.northeast=function(t,i){return b.typeOf.object("rectangle",t),T(i)?(i.longitude=t.east,i.latitude=t.north,i.height=0,i):new de(t.east,t.north)},ie.southeast=function(t,i){return b.typeOf.object("rectangle",t),T(i)?(i.longitude=t.east,i.latitude=t.south,i.height=0,i):new de(t.east,t.south)},ie.center=function(t,i){b.typeOf.object("rectangle",t);let e=t.east;const n=t.west;e<n&&(e+=F.TWO_PI);const o=F.negativePiToPi((n+e)*.5),s=(t.south+t.north)*.5;return T(i)?(i.longitude=o,i.latitude=s,i.height=0,i):new de(o,s)},ie.intersection=function(t,i,e){b.typeOf.object("rectangle",t),b.typeOf.object("otherRectangle",i);let n=t.east,o=t.west,s=i.east,r=i.west;n<o&&s>0?n+=F.TWO_PI:s<r&&n>0&&(s+=F.TWO_PI),n<o&&r<0?r+=F.TWO_PI:s<r&&o<0&&(o+=F.TWO_PI);const l=F.negativePiToPi(Math.max(o,r)),c=F.negativePiToPi(Math.min(n,s));if((t.west<t.east||i.west<i.east)&&c<=l)return;const u=Math.max(t.south,i.south),d=Math.min(t.north,i.north);if(!(u>=d))return T(e)?(e.west=l,e.south=u,e.east=c,e.north=d,e):new ie(l,u,c,d)},ie.simpleIntersection=function(t,i,e){b.typeOf.object("rectangle",t),b.typeOf.object("otherRectangle",i);const n=Math.max(t.west,i.west),o=Math.max(t.south,i.south),s=Math.min(t.east,i.east),r=Math.min(t.north,i.north);if(!(o>=r||n>=s))return T(e)?(e.west=n,e.south=o,e.east=s,e.north=r,e):new ie(n,o,s,r)},ie.union=function(t,i,e){b.typeOf.object("rectangle",t),b.typeOf.object("otherRectangle",i),T(e)||(e=new ie);let n=t.east,o=t.west,s=i.east,r=i.west;n<o&&s>0?n+=F.TWO_PI:s<r&&n>0&&(s+=F.TWO_PI),n<o&&r<0?r+=F.TWO_PI:s<r&&o<0&&(o+=F.TWO_PI);const l=F.negativePiToPi(Math.min(o,r)),c=F.negativePiToPi(Math.max(n,s));return e.west=l,e.south=Math.min(t.south,i.south),e.east=c,e.north=Math.max(t.north,i.north),e},ie.expand=function(t,i,e){return b.typeOf.object("rectangle",t),b.typeOf.object("cartographic",i),T(e)||(e=new ie),e.west=Math.min(t.west,i.longitude),e.south=Math.min(t.south,i.latitude),e.east=Math.max(t.east,i.longitude),e.north=Math.max(t.north,i.latitude),e},ie.contains=function(t,i){b.typeOf.object("rectangle",t),b.typeOf.object("cartographic",i);let e=i.longitude;const n=i.latitude,o=t.west;let s=t.east;return s<o&&(s+=F.TWO_PI,e<0&&(e+=F.TWO_PI)),(e>o||F.equalsEpsilon(e,o,F.EPSILON14))&&(e<s||F.equalsEpsilon(e,s,F.EPSILON14))&&n>=t.south&&n<=t.north};const Dx=new de;ie.subsample=function(t,i,e,n){b.typeOf.object("rectangle",t),i=i??re.default,e=e??0,T(n)||(n=[]);let o=0;const s=t.north,r=t.south,l=t.east,c=t.west,u=Dx;u.height=e,u.longitude=c,u.latitude=s,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=l,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.latitude=r,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=c,n[o]=i.cartographicToCartesian(u,n[o]),o++,s<0?u.latitude=s:r>0?u.latitude=r:u.latitude=0;for(let d=1;d<8;++d)u.longitude=-Math.PI+d*F.PI_OVER_TWO,ie.contains(t,u)&&(n[o]=i.cartographicToCartesian(u,n[o]),o++);return u.latitude===0&&(u.longitude=c,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=l,n[o]=i.cartographicToCartesian(u,n[o]),o++),n.length=o,n},ie.subsection=function(t,i,e,n,o,s){if(b.typeOf.object("rectangle",t),b.typeOf.number.greaterThanOrEquals("westLerp",i,0),b.typeOf.number.lessThanOrEquals("westLerp",i,1),b.typeOf.number.greaterThanOrEquals("southLerp",e,0),b.typeOf.number.lessThanOrEquals("southLerp",e,1),b.typeOf.number.greaterThanOrEquals("eastLerp",n,0),b.typeOf.number.lessThanOrEquals("eastLerp",n,1),b.typeOf.number.greaterThanOrEquals("northLerp",o,0),b.typeOf.number.lessThanOrEquals("northLerp",o,1),b.typeOf.number.lessThanOrEquals("westLerp",i,n),b.typeOf.number.lessThanOrEquals("southLerp",e,o),T(s)||(s=new ie),t.west<=t.east){const l=t.east-t.west;s.west=t.west+i*l,s.east=t.west+n*l}else{const l=F.TWO_PI+t.east-t.west;s.west=F.negativePiToPi(t.west+i*l),s.east=F.negativePiToPi(t.west+n*l)}const r=t.north-t.south;return s.south=t.south+e*r,s.north=t.south+o*r,i===1&&(s.west=t.east),n===1&&(s.east=t.east),e===1&&(s.south=t.north),o===1&&(s.north=t.north),s},ie.MAX_VALUE=Object.freeze(new ie(-Math.PI,-F.PI_OVER_TWO,Math.PI,F.PI_OVER_TWO));function Nt(t){this._ellipsoid=t??re.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Nt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Nt.mercatorAngleToGeodeticLatitude=function(t){return F.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},Nt.geodeticLatitudeToMercatorAngle=function(t){t>Nt.MaximumLatitude?t=Nt.MaximumLatitude:t<-Nt.MaximumLatitude&&(t=-Nt.MaximumLatitude);const i=Math.sin(t);return .5*Math.log((1+i)/(1-i))},Nt.MaximumLatitude=Nt.mercatorAngleToGeodeticLatitude(Math.PI),Nt.prototype.project=function(t,i){const e=this._semimajorAxis,n=t.longitude*e,o=Nt.geodeticLatitudeToMercatorAngle(t.latitude)*e,s=t.height;return T(i)?(i.x=n,i.y=o,i.z=s,i):new D(n,o,s)},Nt.prototype.unproject=function(t,i){if(!T(t))throw new W("cartesian is required");const e=this._oneOverSemimajorAxis,n=t.x*e,o=Nt.mercatorAngleToGeodeticLatitude(t.y*e),s=t.z;return T(i)?(i.longitude=n,i.latitude=o,i.height=s,i):new de(n,o,s)};function Rx(){return!0}function Fx(t,i){i=i??"This object was destroyed, i.e., destroy() was called.";function e(){throw new W(i)}for(const n in t)typeof t[n]=="function"&&(t[n]=e);t.isDestroyed=Rx}function Zv(){if(!T(it._canTransferArrayBuffer)){const t=Id("transferTypedArrayTest");t.postMessage=t.webkitPostMessage??t.postMessage;const i=99,e=new Int8Array([i]);try{t.postMessage({array:e},[e.buffer])}catch{return it._canTransferArrayBuffer=!1,it._canTransferArrayBuffer}it._canTransferArrayBuffer=new Promise(n=>{t.onmessage=function(o){const s=o.data.array,r=T(s)&&s[0]===i;n(r),t.terminate(),it._canTransferArrayBuffer=r}})}return it._canTransferArrayBuffer}const Ed=new ys;function Td(t){let i;try{i=new Blob([t],{type:"application/javascript"})}catch{const o=globalThis.BlobBuilder||globalThis.WebKitBlobBuilder||globalThis.MozBlobBuilder||globalThis.MSBlobBuilder,s=new o;s.append(t),i=s.getBlob("application/javascript")}return(globalThis.URL||globalThis.webkitURL).createObjectURL(i)}function Id(t){const i=new Qi(t),e=i.scheme().length!==0&&i.fragment().length===0,n=t.replace(/\.js$/,""),o={};let s,r;if(Ju(t))r=t;else if(!e){const l=ni(`${it._workerModulePrefix}/${n}.js`);Ju(l)&&(r=l)}if(r){const l=`import "${r}";`;return s=Td(l),o.type="module",new Worker(s,o)}if(!e&&typeof CESIUM_WORKERS<"u"){const l=`
|
|
364
364
|
importScripts("${Td(CESIUM_WORKERS)}");
|
|
365
365
|
CesiumWorkers["${n}"]();
|
|
366
|
-
`;return s=Td(l),new Worker(s,o)}if(s=t,e||(s=ni(`${it._workerModulePrefix+n}.js`)),!ut.supportsEsmWebWorkers())throw new ht("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(s,o)}async function zx(t,i){const e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!ut.supportsWebAssembly()){if(!T(i.fallbackModulePath))throw new ht(`This browser does not support Web Assembly, and no backup module was provided for ${t._workerPath}`);return e.modulePath=ni(i.fallbackModulePath),e}e.wasmBinaryFile=ni(i.wasmBinaryFile);const n=await J.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=n,e}function it(t,i){this._workerPath=t,this._maximumActiveTasks=i??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const Lx=(t,i,e,n)=>{const o=({data:s})=>{if(s.id===i){if(T(s.error)){let r=s.error;r.name==="RuntimeError"?(r=new ht(s.error.message),r.stack=s.error.stack):r.name==="DeveloperError"?(r=new W(s.error.message),r.stack=s.error.stack):r.name==="Error"&&(r=new Error(s.error.message),r.stack=s.error.stack),Ed.raiseEvent(r),n(r)}else Ed.raiseEvent(),e(s.result);t.removeEventListener("message",o)}};return o},Nx=[];async function Ox(t,i,e){const n=await Promise.resolve(Zv());T(e)?n||(e.length=0):e=Nx;const o=t._nextID++,s=new Promise((r,l)=>{t._worker.addEventListener("message",Lx(t._worker,o,r,l))});return t._worker.postMessage({id:o,baseUrl:ni.getCesiumBaseUrl().url,parameters:i,canTransferArrayBuffer:n},e),s}async function Bx(t,i,e){++t._activeTasks;try{const n=await Ox(t,i,e);return--t._activeTasks,n}catch(n){throw--t._activeTasks,n}}it.prototype.scheduleTask=function(t,i){if(T(this._worker)||(this._worker=Id(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Bx(this,t,i)},it.prototype.initWebAssemblyModule=async function(t){if(T(this._webAssemblyPromise))return this._webAssemblyPromise;const i=async()=>{const e=this._worker=Id(this._workerPath),n=await zx(this,t),o=await Promise.resolve(Zv());let s;const r=n.wasmBinary;T(r)&&o&&(s=[r]);const l=new Promise((c,u)=>{e.onmessage=function({data:d}){T(d)?c(d.result):u(new ht("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:n}},s),l};return this._webAssemblyPromise=i(),this._webAssemblyPromise},it.prototype.isDestroyed=function(){return!1},it.prototype.destroy=function(){return T(this._worker)&&this._worker.terminate(),Fx(this)},it.taskCompletedEvent=Ed,it._defaultWorkerModulePrefix="Workers/",it._workerModulePrefix=it._defaultWorkerModulePrefix,it._canTransferArrayBuffer=void 0;function As(t,i,e,n,o){this._format=t,this._datatype=i,this._width=e,this._height=n,this._buffer=o}Object.defineProperties(As.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}}),As.clone=function(t){if(T(t))return new As(t._format,t._datatype,t._width,t._height,t._buffer)},As.prototype.clone=function(){return As.clone(this)};function ji(){}ji._transcodeTaskProcessor=new it("transcodeKTX2",Number.POSITIVE_INFINITY),ji._readyPromise=void 0;function Vx(){const t=ji._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(i){if(i)return ji._transcodeTaskProcessor;throw new ht("KTX2 transcoder could not be initialized.")});ji._readyPromise=t}ji.transcode=function(t,i){return b.defined("supportedTargetFormats",i),T(ji._readyPromise)||Vx(),ji._readyPromise.then(function(e){let n=t;t instanceof ArrayBuffer&&(n=new Uint8Array(t));const o={supportedTargetFormats:i,ktx2Buffer:n};return e.scheduleTask(o,[n.buffer])}).then(function(e){const n=e.length,o=Object.keys(e[0]);for(let s=0;s<n;s++){const r=e[s];for(let l=0;l<o.length;l++){const c=r[o[l]];r[o[l]]=new As(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let s=0;s<n;++s)e[s]=e[s][o[0]];n===1&&(e=e[0])}return e}).catch(function(e){throw e})};let Qv;kv.setKTX2SupportedFormats=function(t,i,e,n,o,s){Qv={s3tc:t,pvrtc:i,astc:e,etc:n,etc1:o,bc7:s}};function kv(t){b.defined("resourceOrUrlOrBuffer",t);let i;return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?i=Promise.resolve(t):i=J.createIfNeeded(t).fetchArrayBuffer(),i.then(function(e){return ji.transcode(e,Qv)})}function Es(){W.throwInstantiationError()}Object.defineProperties(Es.prototype,{rectangle:{get:W.throwInstantiationError},tileWidth:{get:W.throwInstantiationError},tileHeight:{get:W.throwInstantiationError},maximumLevel:{get:W.throwInstantiationError},minimumLevel:{get:W.throwInstantiationError},tilingScheme:{get:W.throwInstantiationError},tileDiscardPolicy:{get:W.throwInstantiationError},errorEvent:{get:W.throwInstantiationError},credit:{get:W.throwInstantiationError},proxy:{get:W.throwInstantiationError},hasAlphaChannel:{get:W.throwInstantiationError}}),Es.prototype.getTileCredits=function(t,i,e){W.throwInstantiationError()},Es.prototype.requestImage=function(t,i,e,n){W.throwInstantiationError()},Es.prototype.pickFeatures=function(t,i,e,n,o){W.throwInstantiationError()};const Wx=/\.ktx2$/i;Es.loadImage=function(t,i){b.defined("url",i);const e=J.createIfNeeded(i);return Wx.test(e.url)?kv(e):T(t)&&T(t.tileDiscardPolicy)?e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):e.fetchImage({preferImageBitmap:!0,flipY:!0})};var ch=3.141592653589793*3e3/180,nt=3.141592653589793,hh=6378245,uh=.006693421622965943,Kv=function(n,o){var n=+n,o=+o,s=n-.0065,r=o-.006,l=Math.sqrt(s*s+r*r)-2e-5*Math.sin(r*ch),c=Math.atan2(r,s)-3e-6*Math.cos(s*ch),u=l*Math.cos(c),d=l*Math.sin(c);return[u,d]},Jv=function(o,n){var n=+n,o=+o,s=Math.sqrt(o*o+n*n)+2e-5*Math.sin(n*ch),r=Math.atan2(n,o)+3e-6*Math.cos(o*ch),l=s*Math.cos(r)+.0065,c=s*Math.sin(r)+.006;return[l,c]},Md=function(o,n){var n=+n,o=+o;if(ty(o,n))return[o,n];var s=jv(o-105,n-35),r=ey(o-105,n-35),l=n/180*nt,c=Math.sin(l);c=1-uh*c*c;var u=Math.sqrt(c);s=s*180/(hh*(1-uh)/(c*u)*nt),r=r*180/(hh/u*Math.cos(l)*nt);var d=n+s,p=o+r;return[p,d]},Dd=function(o,n){var n=+n,o=+o;if(ty(o,n))return[o,n];var s=jv(o-105,n-35),r=ey(o-105,n-35),l=n/180*nt,c=Math.sin(l);c=1-uh*c*c;var u=Math.sqrt(c);s=s*180/(hh*(1-uh)/(c*u)*nt),r=r*180/(hh/u*Math.cos(l)*nt);var d=n+s,p=o+r;return[o*2-p,n*2-d]},jv=function(o,n){var n=+n,o=+o,s=-100+2*o+3*n+.2*n*n+.1*o*n+.2*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*nt)+20*Math.sin(2*o*nt))*2/3,s+=(20*Math.sin(n*nt)+40*Math.sin(n/3*nt))*2/3,s+=(160*Math.sin(n/12*nt)+320*Math.sin(n*nt/30))*2/3,s},ey=function(o,n){var n=+n,o=+o,s=300+o+2*n+.1*o*o+.1*o*n+.1*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*nt)+20*Math.sin(2*o*nt))*2/3,s+=(20*Math.sin(o*nt)+40*Math.sin(o/3*nt))*2/3,s+=(150*Math.sin(o/12*nt)+300*Math.sin(o/30*nt))*2/3,s},ty=function(o,n){var n=+n,o=+o;return!(o>73.66&&o<135.05&&n>3.86&&n<53.55)};function Rd(t,i){this.x=t||0,this.y=i||0,this.x=this.x,this.y=this.y}Rd.prototype.equals=function(t){return t&&t.x==this.x&&t.y==this.y};function vi(t,i){isNaN(t)&&(t=decode64(t),t=isNaN(t)?0:t),typeof t=="string"&&(t=parseFloat(t)),isNaN(i)&&(i=decode64(i),i=isNaN(i)?0:i),typeof t=="lat"&&(i=parseFloat(i)),this.lng=t,this.lat=i}vi.isInRange=function(t){return t&&t.lng<=180&&t.lng>=-180&&t.lat<=74&&t.lat>=-74},vi.prototype.equals=function(t){return t&&this.lat==t.lat&&this.lng==t.lng};function ze(){}ze.EARTHRADIUS=637099681e-2,ze.MCBAND=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],ze.LLBAND=[75,60,45,30,15,0],ze.MC2LL=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],ze.LL2MC=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],ze.getDistanceByMC=function(t,i){if(!t||!i)return 0;var e,n,o,s;return t=this.convertMC2LL(t),!t||(e=this.toRadians(t.lng),n=this.toRadians(t.lat),i=this.convertMC2LL(i),!i)?0:(o=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,o,n,s))},ze.getDistanceByLL=function(t,i){if(!t||!i)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),i.lng=this.getLoop(i.lng,-180,180),i.lat=this.getRange(i.lat,-74,74);var e,n,o,s;return e=this.toRadians(t.lng),o=this.toRadians(t.lat),n=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,n,o,s)},ze.convertMC2LL=function(s){var i,e;i=new vi(Math.abs(s.lng),Math.abs(s.lat));for(var n=0;n<this.MCBAND.length;n++)if(i.lat>=this.MCBAND[n]){e=this.MC2LL[n];break}var o=this.convertor(s,e),s=new vi(o.lng.toFixed(6),o.lat.toFixed(6));return s},ze.convertLL2MC=function(s){var i,e;s.lng=this.getLoop(s.lng,-180,180),s.lat=this.getRange(s.lat,-74,74),i=new vi(s.lng,s.lat);for(var n=0;n<this.LLBAND.length;n++)if(i.lat>=this.LLBAND[n]){e=this.LL2MC[n];break}if(!e){for(var n=this.LLBAND.length-1;n>=0;n--)if(i.lat<=-this.LLBAND[n]){e=this.LL2MC[n];break}}var o=this.convertor(s,e),s=new vi(o.lng.toFixed(2),o.lat.toFixed(2));return s},ze.convertor=function(t,i){if(!(!t||!i)){var e=i[0]+i[1]*Math.abs(t.lng),n=Math.abs(t.lat)/i[9],o=i[2]+i[3]*n+i[4]*n*n+i[5]*n*n*n+i[6]*n*n*n*n+i[7]*n*n*n*n*n+i[8]*n*n*n*n*n*n;return e*=t.lng<0?-1:1,o*=t.lat<0?-1:1,new vi(e,o)}},ze.getDistance=function(t,i,e,n){return this.EARTHRADIUS*Math.acos(Math.sin(e)*Math.sin(n)+Math.cos(e)*Math.cos(n)*Math.cos(i-t))},ze.toRadians=function(t){return Math.PI*t/180},ze.toDegrees=function(t){return 180*t/Math.PI},ze.getRange=function(t,i,e){return i!=null&&(t=Math.max(t,i)),e!=null&&(t=Math.min(t,e)),t},ze.getLoop=function(t,i,e){for(;t>e;)t-=e-i;for(;t<i;)t+=e-i;return t},ze.prototype.lngLatToMercator=function(t){return ze.convertLL2MC(t)},ze.prototype.lngLatToPoint=function(t){var i=ze.convertLL2MC(t);return new Rd(i.lng,i.lat)},ze.prototype.mercatorToLngLat=function(t){return ze.convertMC2LL(t)},ze.prototype.PointToLngLat=function(t){var i=new vi(t.x,t.y);return ze.convertMC2LL(i)},ze.prototype.PointToPixel=function(t,i,e,n,o){if(t){t=this.lngLatToMercator(t,o);var s=this.getZoomUnits(i),r=Math.round((t.lng-e.lng)/s+n[Twidth]/2),l=Math.round((e.lat-t.lat)/s+n[Theight]/2);return new Rd(r,l)}},ze.prototype.PixelToPoint=function(t,i,e,n,o){if(t){var s=this.getZoomUnits(i),r=e.lng+s*(t.x-n[Twidth]/2),l=e.lat-s*(t.y-n[Theight]/2),c=new vi(r,l);return this.mercatorToLngLat(c,o)}},ze.prototype.getZoomUnits=function(t){return Math.pow(2,18-t)};function On(t){t=t||{},this._ellipsoid=t.ellipsoid??re.WGS84;var i=!0;T(t.wgs84)&&(i=t.wgs84),this._projection=new Nt(this._ellipsoid);var e=new ze;this._projection.project=function(r){var l={};return i?(l=Md(F.toDegrees(r.longitude),F.toDegrees(r.latitude)),l=Jv(l[0],l[1])):l=Jv(F.toDegrees(r.longitude),F.toDegrees(r.latitude)),l[0]=Math.min(l[0],180),l[0]=Math.max(l[0],-180),l[1]=Math.min(l[1],74.000022),l[1]=Math.max(l[1],-71.988531),l=e.lngLatToPoint(new vi(l[0],l[1])),new j(l.x,l.y)},this._projection.unproject=function(r){var l=e.mercatorToLngLat(new vi(r.x,r.y));return l[0]=(l[0]+180)%360-180,i?(l=Kv(l.lng,l.lat),l=Dd(l[0],l[1])):l=Kv(l.lng,l.lat),new de(F.toRadians(l[0]),F.toRadians(l[1]))},this._rectangleSouthwestInMeters=new j(-2003772637e-2,-1170804166e-2),this._rectangleNortheastInMeters=new j(2003772637e-2,1247410417e-2);var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ie(n.longitude,n.latitude,o.longitude,o.latitude),this.levelWidth=[];for(var s=0;s<19;s++)this.levelWidth[s]=Math.pow(2,18-s)*256}Object.defineProperties(On.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),On.prototype.getNumberOfXTilesAtLevel=function(t){return(1<<t)*.7},On.prototype.getNumberOfYTilesAtLevel=function(t){return 1<<t},On.prototype.rectangleToNativeRectangle=function(t,i){var e=this._projection,n=e.project(ie.southwest(t)),o=e.project(ie.northeast(t));return T(i)?(i.west=n.x,i.south=n.y,i.east=o.x,i.north=o.y,i):new ie(n.x,n.y,o.x,o.y)},On.prototype.tileXYToNativeRectangle=function(t,i,e,n){var o=this.levelWidth[e],s=t*o,r=(t+1)*o;i=-i;var l=(i+1)*o,c=i*o;return T(n)?(n.west=s,n.south=c,n.east=r,n.north=l,n):new ie(s,c,r,l)},On.prototype.tileXYToRectangle=function(t,i,e,n){var o=this.tileXYToNativeRectangle(t,i,e,n),s=this._projection,r=s.unproject(new j(o.west,o.south)),l=s.unproject(new j(o.east,o.north));return o.west=r.longitude,o.south=r.latitude,o.east=l.longitude,o.north=l.latitude,o},On.prototype.positionToTileXY=function(t,i,e){var n=this._rectangle;if(ie.contains(n,t)){var o=this._projection,s=o.project(t);if(T(s)){var r=this.levelWidth[i],l=Math.floor(s.x/r),c=-Math.floor(s.y/r);return T(e)?(e.x=l,e.y=c,e):new j(l,c)}}};function dh(t){this._url=t.url||"http://online2.map.bdimg.com/onlinelabel/?qt=tile&styles=pl&x={x}&y={y}&z={z}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new On(t),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function Gx(t,i,e,n){var o=t._url;return o=o.replace("{x}",i).replace("{y}",-e).replace("{z}",n),o}Object.defineProperties(dh.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 3}},tilingScheme:{get:function(){if(!this._ready)throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),dh.prototype.getTileCredits=function(t,i,e){},dh.prototype.requestImage=function(t,i,e){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=Gx(this,t,i,e);return Es.loadImage(this,n)};class Ux extends h.UrlTemplateImageryProvider{constructor(e){super(e);m(this,"_indexTime",0);e.url="https://tileser.giiiis.com/timetile/",e.minimumLevel=1,e.maximumLevel=18,e.tilingScheme=new h.GeographicTilingScheme,this.indexTime=e.indexTime||0}get indexTime(){return this._indexTime}set indexTime(e){this._indexTime=e}async requestImage(e,n,o,s){try{let r=this.buildImageUrl(this.indexTime,e,n,o);return h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://tileser.giiiis.com/timetile/${e}/${s}/${n}/${o}.jpg`}}class Hx extends h.UrlTemplateImageryProvider{constructor(e){super(e);m(this,"_indexTimeID",0);e.url="https://wayback.maptiles.arcgis.com/",e.minimumLevel=1,e.maximumLevel=18,this.indexTimeID=e.indexTimeID||0}get indexTimeID(){return this._indexTimeID}set indexTimeID(e){this._indexTimeID=e}async requestImage(e,n,o,s){try{let r;return this.indexTimeID!==0?r=this.buildImageUrl(this.indexTimeID,e,n,o):r=`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${o}/${n}/${e}`,h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${e}/${s}/${o}/${n}`}}const $x="https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",qx=document.createElement("canvas");class Fd{constructor(i){m(this,"viewer");m(this,"esSceneObjectId");m(this,"vectorTileManager");m(this,"mapboxRenderer");m(this,"ready");m(this,"readyPromise");m(this,"rectangle");m(this,"tileSize");m(this,"tileWidth");m(this,"tileHeight");m(this,"maximumLevel");m(this,"minimumLevel");m(this,"tileDiscardPolicy");m(this,"credit");m(this,"proxy");m(this,"layerStyle");m(this,"hasAlphaChannel");m(this,"sourceFilter");m(this,"tilingScheme");m(this,"_destroyed",!1);m(this,"_error");m(this,"_style");m(this,"_accessToken");m(this,"_enablePickFeatures");var e;this.viewer=i.viewer,this.viewer&&(this.vectorTileManager=(e=Ke(this.viewer))==null?void 0:e.vectorTIlesManager),this.esSceneObjectId=i.esSceneObjectId,this.ready=!1,this.tilingScheme=i.tilingScheme??new we.WebMercatorTilingScheme,this.rectangle=i.rectangle??this.tilingScheme.rectangle,this.rectangle=we.Rectangle.intersection(this.rectangle,this.tilingScheme.rectangle),this.tileSize=this.tileWidth=this.tileHeight=i.tileSize||256,this.maximumLevel=i.maximumLevel??18,this.minimumLevel=i.minimumLevel??0,this.tileDiscardPolicy=void 0,this._error=new we.Event,this.credit=new we.Credit(i.credit||"",!1),this.proxy=new we.DefaultProxy(""),this.hasAlphaChannel=i.hasAlphaChannel??!0,this.sourceFilter=i.sourceFilter,this._accessToken=i.accessToken,this._enablePickFeatures=i.enablePickFeatures??!0,this.layerStyle=i.layerStyle??[],we.defined(i.style)&&(this.readyPromise=this._build(i.style,i).then(()=>!0))}get style(){return this._style}get isDestroyed(){return this._destroyed}get errorEvent(){return this._error}async _build(i,e={}){const n=await this._preLoad(i,e.scheme??"tms");n.layers=this.layerStyle.length!=0?this.layerStyle:n.layers,Reflect.has(n,"glyphs")||(n.glyphs=$x),this._style=n,this.mapboxRenderer=new C_.BasicRenderer({style:n,canvas:qx,token:e.accessToken,transformRequest:e.transformRequest}),e.showCanvas&&this.mapboxRenderer.showCanvasForDebug(),await this.mapboxRenderer._style.loadedPromise,this.readyPromise=Promise.resolve(!0),this.ready=!0}static async fromUrl(i,e={}){const n=new Fd(e);return await n._build(i,e),n}_preLoad(i,e){let n=i;if(typeof i=="string"&&(i.endsWith(".json")||i.startsWith("mapbox://")?i=new we.Resource({url:i}):(i={version:8,sources:{customSource:{type:"vector",scheme:e,tiles:[i]}},layers:this.layerStyle},n=i)),i instanceof we.Resource){const o="https://api.mapbox.com/";i.url.startsWith("mapbox://")&&(i.url=i.url.replace("mapbox://",o)),this._accessToken&&i.appendQueryParameters({access_token:this._accessToken}),n=i.fetchJson()}return Promise.resolve(n).catch(o=>{throw this._error.raiseEvent(o),o})}_createTile(){const i=document.createElement("canvas");return i.width=this.tileSize,i.height=this.tileSize,i.style.imageRendering="pixelated",i}_resetTileCache(){Object.values(this.mapboxRenderer._style.sourceCaches).forEach(i=>i._tileCache.reset())}_getTilesSpec(i,e){const{x:n,y:o,level:s}=i,r=this.tileSize,l=[],c=this.tilingScheme.getNumberOfXTilesAtLevel(s)-1,u=this.tilingScheme.getNumberOfYTilesAtLevel(s)-1;for(let d=-1;d<=1;d++){let p=n+d;p<0&&(p=c),p>c&&(p=0);for(let f=-1;f<=1;f++){let g=o+f;g<0||g>u||l.push({source:e,z:s,x:p,y:g,left:0+d*r,top:0+f*r,size:r})}}return l}requestImage(i,e,n,o=!0){if(n<this.minimumLevel||n>this.maximumLevel)return;this.mapboxRenderer.filterForZoom(n);const s=this.mapboxRenderer.getVisibleSources(n).reduce((r,l)=>r.concat(this._getTilesSpec({x:i,y:e,level:n},l)),[]);return new Promise((r,l)=>{const c=this._createTile(),u=c.getContext("2d");u&&(u.globalCompositeOperation="copy");const d=this.mapboxRenderer.renderTiles(u,{srcLeft:0,srcTop:0,width:this.tileSize,height:this.tileSize,destLeft:0,destTop:0},s,p=>{typeof p=="string"&&!p.endsWith("tiles not available")?l(void 0):o?(d.consumer.ctx=null,r(c),this.mapboxRenderer.releaseRender(d),this._resetTileCache()):r(d)})})}pickFeatures(i,e,n,o,s){var r;if(this._enablePickFeatures)return(r=this.requestImage(i,e,n,!1))==null?void 0:r.then(l=>{let c=this.mapboxRenderer.getVisibleSources(n);c=this.sourceFilter?this.sourceFilter(c):c;const u=[],d=we.Math.toDegrees(o),p=we.Math.toDegrees(s);return c.forEach(f=>{const g=new we.ImageryLayerFeatureInfo;g.data=this.mapboxRenderer.queryRenderedFeatures({source:f,renderedZoom:n,lng:d,lat:p,tileZ:n});const v=Object.keys(g.data)[0];g.name=v;const y=g.data[v];y&&(g.configureDescriptionFromProperties((y==null?void 0:y.length)===1?y[0]:y),u.push(g))}),l.consumer.ctx=void 0,this.mapboxRenderer.releaseRender(l),this._resetTileCache(),u.length?u:void 0})}destroy(){this.mapboxRenderer._cancelAllPendingRenders(),this._resetTileCache(),this._destroyed=!0}}function Xx(t,i){let e;return i===0?e=h.JulianDate.toIso8601(t.stop):e=h.JulianDate.toIso8601(t.start),{Time:e}}function iy(t){if(t.type==="fromIso8601")return h.TimeIntervalCollection.fromIso8601({iso8601:t.iso8601,isStartIncluded:t.isStartIncluded,isStopIncluded:t.isStopIncluded,leadingInterval:t.leadingInterval,trailingInterval:t.trailingInterval,dataCallback:Xx})}const{getStrFromEnv:ph}=a.ESSceneObject.context;function Yx(t){const i=Object.entries(t).map(([e,n])=>{try{const o=n&&Function(`"use strict";return (${n})`)();return[e,o]}catch(o){console.error(`getCustomTagsFromJson error: ${o}`,o);return}}).filter(e=>!!e);return Object.fromEntries(i)}async function Zx(t,i,e){var n,o;if(t.type==="WebMapTileServiceImageryProvider")return new h.WebMapTileServiceImageryProvider({url:jt(t.url),format:t.format??"image/jpeg",layer:t.layer,style:t.style,tileMatrixSetID:t.tileMatrixSetID,tileMatrixLabels:t.tileMatrixLabels,clock:t.times&&((n=i.viewer)==null?void 0:n.clock),times:t.times&&iy(t.times),dimensions:t.dimensions,tileWidth:t.tileWidth??256,tileHeight:t.tileHeight??256,tilingScheme:t.tilingScheme&&di(t.tilingScheme),rectangle:t.rectangle&&Ve(t.rectangle),minimumLevel:t.minimumLevel??0,maximumLevel:t.maximumLevel,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit,subdomains:t.subdomains});if(t.type==="TileMapServiceImageryProvider")return t.url?await h.TileMapServiceImageryProvider.fromUrl(jt(t.url),{fileExtension:t.fileExtension,credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ve(t.rectangle),tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,flipXY:t.flipXY}):void 0;if(t.type==="UrlTemplateImageryProvider"){const s=t.customTags&&Yx(t.customTags);return new h.UrlTemplateImageryProvider({url:jt(t.url),credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ve(t.rectangle),tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,subdomains:t.subdomains,hasAlphaChannel:t.hasAlphaChannel,pickFeaturesUrl:t.pickFeaturesUrl,enablePickFeatures:t.enablePickFeatures,urlSchemeZeroPadding:t.urlSchemeZeroPadding,customTags:s})}else{if(t.type==="GridImageryProvider")return new h.GridImageryProvider({tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,cells:t.cells,color:t.color&&te(t.color),glowColor:t.glowColor&&te(t.glowColor),backgroundColor:t.backgroundColor&&te(t.backgroundColor),canvasSize:t.canvasSize,glowWidth:t.glowWidth});if(t.type==="ArcGisMapServerImageryProvider")return t.url?await h.ArcGisMapServerImageryProvider.fromUrl(jt(t.url),{token:t.token,usePreCachedTilesIfAvailable:t.usePreCachedTilesIfAvailable,layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ve(t.rectangle),tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit,tileWidth:t.tileWidth,tileHeight:t.tileHeight,maximumLevel:t.maximumLevel}):void 0;if(t.type==="BingMapsImageryProvider")return t.url?await h.BingMapsImageryProvider.fromUrl(jt(t.url),{key:t.key,tileProtocol:t.tileProtocol,mapStyle:t.mapStyle&&h.BingMapsStyle[t.mapStyle],culture:t.culture,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid)}):void 0;if(t.type==="GoogleEarthEnterpriseImageryProvider"){if(!t.url)return;const s=await h.GoogleEarthEnterpriseMetadata.fromUrl(jt(t.url));return await h.GoogleEarthEnterpriseImageryProvider.fromMetadata(s,{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}else{if(t.type==="IonImageryProvider")return await h.IonImageryProvider.fromAssetId(t.assetId,{accessToken:t.accessToken,server:t.server});if(t.type==="MapboxImageryProvider")return new h.MapboxImageryProvider({url:t.url&&ph(t.url),mapId:t.mapId,accessToken:t.accessToken,format:t.format,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ve(t.rectangle),credit:t.credit});if(t.type==="MapboxStyleImageryProvider")return new h.MapboxStyleImageryProvider({url:t.url&&ph(t.url),username:t.username,styleId:t.styleId,accessToken:t.accessToken,tilesize:t.tilesize,scaleFactor:t.scaleFactor,rectangle:t.rectangle&&Ve(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel});if(t.type==="OpenStreetMapImageryProvider")return new h.OpenStreetMapImageryProvider({url:ph(t.url),rectangle:t.rectangle&&Ve(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,fileExtension:t.fileExtension});if(t.type==="SingleTileImageryProvider")return new h.SingleTileImageryProvider({url:jt(t.url),rectangle:t.rectangle&&Ve(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid)});if(t.type==="TileCoordinatesImageryProvider")return new h.TileCoordinatesImageryProvider({tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),color:t.color&&te(t.color),tileWidth:t.tileWidth,tileHeight:t.tileHeight});if(t.type==="WebMapServiceImageryProvider")return new h.WebMapServiceImageryProvider({url:jt(t.url),layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ve(t.rectangle),tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,tileWidth:t.tileWidth,tileHeight:t.tileHeight,crs:t.crs,srs:t.srs,credit:t.credit,subdomains:t.subdomains,clock:t.times&&((o=i.viewer)==null?void 0:o.clock),times:t.times&&iy(t.times),parameters:t.parameters,getFeatureInfoParameters:t.getFeatureInfoParameters});if(t.type==="BDImageryProvider")return new dh({url:t.url&&ph(t.url),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),wgs84:t.wgs84});if(t.type==="GeHistoryImagery")return new Ux({indexTime:t.indexTime});if(t.type==="ArcgisHistoryImagery")return new Hx({indexTimeID:t.indexTimeID});if(t.type==="MVTImageryProvider")return t.url?await Fd.fromUrl(t.url,{maximumLevel:t.maximumLevel,minimumLevel:t.minimumLevel,tileSize:t.tileSize,accessToken:t.accessToken,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ve(t.rectangle),layerStyle:t.style,scheme:t.scheme,viewer:i.viewer,esSceneObjectId:e}):void 0}}}function Qx(t,i){i.type}class ny extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(s){var r={};return r=Dd(h.Math.toDegrees(s.longitude),h.Math.toDegrees(s.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(r[0]),h.Math.toRadians(r[1])))},e.s_unproject=e.unproject,e.unproject=function(s){var r=e.s_unproject(s),l={};return l=Md(h.Math.toDegrees(r.longitude),h.Math.toDegrees(r.latitude)),new h.Cartographic(h.Math.toRadians(l[0]),h.Math.toRadians(l[1]))};var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new h.Rectangle(n.longitude,n.latitude,o.longitude,o.latitude)}}class oy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(n){var o={};return o=Md(h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(o[0]),h.Math.toRadians(o[1])))},e.s_unproject=e.unproject,e.unproject=function(n){var o=e.s_unproject(n),s={};return s=Dd(h.Math.toDegrees(o.longitude),h.Math.toDegrees(o.latitude)),new h.Cartographic(h.Math.toRadians(s[0]),h.Math.toRadians(s[1]))}}}function kx(t){if(t.type==="GeographicTilingScheme")return"new Cesium.GeographicTilingScheme()";if(t.type==="WebMercatorTilingScheme")return"new Cesium.WebMercatorTilingScheme()"}class Bn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_innerImageryProvider",this.disposeVar(a.react(void 0)));m(this,"_layer",this.disposeVar(a.react(void 0)));const o=e.viewer;if(!o)return;const s=Ke(o);if(!s)return;const{imageriesManager:r}=s;r.add(this),this.dispose(()=>{r.has(this)&&r.delete(this)});const l=()=>{this.layer&&(this.layer=void 0)};this.dispose(l);const c=()=>{this.layer&&(this.layer.alpha=this.alpha??1,this.layer.nightAlpha=this.nightAlpha??1,this.layer.dayAlpha=this.dayAlpha??1,this.layer.brightness=this.brightness??1,this.layer.contrast=this.contrast??1,this.layer.hue=this.hue??0,this.layer.saturation=this.saturation??1,this.layer.gamma=this.gamma??1,this.layer.splitDirection=this.splitDirection&&h.SplitDirection[this.splitDirection]||h.SplitDirection.NONE,this.layer.minificationFilter=this.minificationFilter&&h.TextureMinificationFilter[this.minificationFilter]||h.TextureMinificationFilter.LINEAR,this.layer.magnificationFilter=this.magnificationFilter&&h.TextureMagnificationFilter[this.magnificationFilter]||h.TextureMagnificationFilter.LINEAR,this.layer.show=this.show??!0,this.layer.maximumAnisotropy=this.maximumAnisotropy,this.layer.minimumTerrainLevel=this.minimumTerrainLevel,this.layer.maximumTerrainLevel=this.maximumTerrainLevel,this.layer.colorToAlpha=this.colorToAlpha&&toColor(this.colorToAlpha),this.layer.colorToAlphaThreshold=this.colorToAlphaThreshold??.004,this.imageryProvider&&Qx(this.layer.imageryProvider,this.imageryProvider))};let u=!1;const d=this.disposeVar(a.createProcessingFromAsyncFunc(async(y,w)=>{if(w){if(u=!0,l(),!this.innerImageryProvider)return;const P=await y.promise(Zx(this.innerImageryProvider,e,n));if(!P)return;this.layer=new h.ImageryLayer(P),h.ImageryLayer.prototype&&(this.layer.ESSceneObjectID=n),u=!1}c()}));d.restart(void 0,!0);const p=this.disposeVar(new a.Event),f=this.disposeVar(new a.Event);this.ad(this.layerChanged.don(()=>{if(!this.innerImageryProvider||!this.layer||!Reflect.has(this.innerImageryProvider,"rectangle")||this.innerImageryProvider.rectangle[0]!=this.imageryProvider.rectangle[0]||this.innerImageryProvider.rectangle[1]!=this.imageryProvider.rectangle[1]||this.innerImageryProvider.rectangle[2]!=this.imageryProvider.rectangle[2]||this.innerImageryProvider.rectangle[3]!=this.imageryProvider.rectangle[3])return;const y=this.layer.imageryProvider.tilingScheme.rectangle,w=this.innerImageryProvider.rectangle&&Ve(this.innerImageryProvider.rectangle);(w.west<y.west||w.south<y.south||w.east>y.east||w.north>y.north)&&(this.innerImageryProvider.rectangle=[h.Math.toDegrees(Math.max(y.west,parseFloat(w.west.toFixed(7)))),h.Math.toDegrees(Math.max(y.south,parseFloat(w.south.toFixed(7)))),h.Math.toDegrees(Math.min(y.east,parseFloat(w.east.toFixed(7)))),h.Math.toDegrees(Math.min(y.north,parseFloat(w.north.toFixed(7))))],p.emit())})),this.dispose(this.imageryProviderChanged.disposableOn(()=>{this.innerImageryProvider=structuredClone(this.imageryProvider),p.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{p.emit()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.rectangleChanged,p));this.dispose(g.disposableOn(()=>{d.restart(void 0,!0)}));const v=this.disposeVar(a.createNextAnimateFrameEvent(this.alphaChanged,this.nightAlphaChanged,this.dayAlphaChanged,this.brightnessChanged,this.contrastChanged,this.hueChanged,this.saturationChanged,this.gammaChanged,this.splitDirectionChanged,this.minificationFilterChanged,this.magnificationFilterChanged,this.showChanged,this.maximumAnisotropyChanged,this.minimumTerrainLevelChanged,this.maximumTerrainLevelChanged,this.cutoutRectangleChanged,this.colorToAlphaChanged,this.colorToAlphaThresholdChanged,f));this.dispose(v.disposableOn(()=>{u||d.restart(void 0,!1)})),this.dispose(this.flyToEvent.disposableOn(y=>{if(!e.actived)return;const{viewer:w}=e;w&&(this.rectangle&&!bu(this.rectangle)?w.camera.flyTo({destination:Ve(this.rectangle),duration:y}):w.camera.flyHome(y))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get innerImageryProvider(){return this._innerImageryProvider.value}set innerImageryProvider(e){this._innerImageryProvider.value=e}get innerImageryProviderChanged(){return this._innerImageryProvider.changed}get layer(){return this._layer.value}set layer(e){this._layer.value=e}get layerChanged(){return this._layer.changed}}m(Bn,"defaults",{show:!0,rectangle:[-180,-90,180,90],alpha:1,nightAlpha:1,dayAlpha:1,brightness:1,contrast:1,hue:0,saturation:1,gamma:1,splitDirection:"NONE",minificationFilter:"LINEAR",magnificationFilter:"LINEAR",maximumAnisotropy:0,minimumTerrainLevel:0,maximumTerrainLevel:0,cutoutRectangle:[1,1,1,1],colorToAlpha:[1,1,1,.5],colorToAlphaThreshold:.004,imageryProvider:{type:"TileMapServiceImageryProvider"},zIndex:0,hasAlphaChannel:!0,pickFeaturesUrl:""}),(t=>{t.createDefaultProps=()=>({show:void 0,rectangle:a.reactArrayWithUndefined(void 0),alpha:void 0,nightAlpha:void 0,dayAlpha:void 0,brightness:void 0,contrast:void 0,hue:void 0,saturation:void 0,gamma:void 0,splitDirection:void 0,minificationFilter:void 0,magnificationFilter:void 0,maximumAnisotropy:void 0,minimumTerrainLevel:void 0,maximumTerrainLevel:void 0,cutoutRectangle:a.reactArrayWithUndefined(void 0),colorToAlpha:a.reactArrayWithUndefined(void 0),colorToAlphaThreshold:void 0,imageryProvider:a.reactJsonWithUndefined(void 0),zIndex:0,hasAlphaChannel:void 0,pickFeaturesUrl:void 0,targetID:void 0})})(Bn||(Bn={})),a.extendClassProps(Bn.prototype,Bn.createDefaultProps);const zd=h.ApproximateTerrainHeights,Kx=h.ComponentDatatype,dt=h.defined,Jx=h.destroyObject,Ld=h.DeveloperError,jx=h.deprecationWarning,eA=h.GeometryInstance,tA=h.GeometryInstanceAttribute,iA=h.GroundPolylineGeometry,Hr=h.DrawCommand,sy=h.Pass,ry=h.RenderState,nA=h.ShaderProgram,$r=h.ShaderSource;let Nd=h._shadersPolylineShadowVolumeFS;const oA=h._shadersPolylineShadowVolumeMorphFS,sA=h._shadersPolylineShadowVolumeMorphVS;let Od=h._shadersPolylineShadowVolumeVS;const ay=h.BlendingState,Bd=h.ClassificationType,rA=h.CullFace,ly=h.PolylineColorAppearance,aA=h.PolylineMaterialAppearance,Vn=h.Primitive,Ts=h.SceneMode,cy=h.StencilConstants,hy=h.StencilFunction,Is=h.StencilOperation;Od=Od.replace("width = width * max(0.0, czm_metersPerPixel(positionEC));",""),Nd=Nd.replace("float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);","float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w;");function Ti(t){t=t??h.Frozen.EMPTY_OBJECT,this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let i=t.appearance;dt(i)||(i=new aA),this.appearance=i,this.show=t.show??!0,this.classificationType=t.classificationType??Bd.BOTH,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._debugShowShadowVolume=t.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:t.interleave??!1,releaseGeometryInstances:t.releaseGeometryInstances??!0,allowPicking:t.allowPicking??!0,asynchronous:t.asynchronous??!0,compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;const e=this;this._readyPromise=new Promise((n,o)=>{e._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const s=this._error;dt(s)?o(s):n(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=uy(!1),this._renderState3DTiles=uy(!0),this._renderStateMorph=ry.fromCache({cull:{enabled:!0,face:rA.FRONT},depthTest:{enabled:!0},blending:ay.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Ti.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return jx("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),Ti.initializeTerrainHeights=function(){return zd.initialize()};function lA(t,i,e){const n=i.context,o=t._primitive,s=o._attributeLocations;let r=o._batchTable.getVertexShaderCallback()(Od);r=Vn._appendShowToShader(o,r),r=Vn._appendDistanceDisplayConditionToShader(o,r),r=Vn._modifyShaderPosition(t,r,i.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(sA);l=Vn._appendShowToShader(o,l),l=Vn._appendDistanceDisplayConditionToShader(o,l),l=Vn._modifyShaderPosition(t,l,i.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Nd);const u=[`GLOBE_MINIMUM_ALTITUDE ${i.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let d="",p="";dt(e.material)?(p=dt(e.material)?e.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",u.push(d);const f=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],g=new $r({defines:u,sources:[r]}),v=new $r({defines:f,sources:[p,c]});t._sp=nA.replaceCache({context:n,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:s});let y=n.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!dt(y)){const P=new $r({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[r]});y=n.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:n,shaderProgram:t._sp2D,vertexShaderSource:P,fragmentShaderSource:v,attributeLocations:s})}t._sp2D=y;let w=n.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!dt(w)){const P=new $r({defines:u.concat([`MAX_TERRAIN_HEIGHT ${zd._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[l]});c=o._batchTable.getVertexShaderCallback()(oA);const C=new $r({defines:f,sources:[p,c]});w=n.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:n,shaderProgram:t._spMorph,vertexShaderSource:P,fragmentShaderSource:C,attributeLocations:s})}t._spMorph=w}function uy(t){return ry.fromCache({cull:{enabled:!0},blending:ay.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:hy.EQUAL,frontOperation:{fail:Is.KEEP,zFail:Is.KEEP,zPass:Is.KEEP},backFunction:hy.EQUAL,backOperation:{fail:Is.KEEP,zFail:Is.KEEP,zPass:Is.KEEP},reference:cy.CESIUM_3D_TILE_MASK,mask:cy.CESIUM_3D_TILE_MASK}})}function cA(t,i,e,n,o,s){const r=t._primitive,l=r._va.length;o.length=l,s.length=l;const u=i instanceof ly?{}:e._uniforms,d=r._batchTable.getUniformMapCallback()(u);for(let p=0;p<l;p++){const f=r._va[p];let g=o[p];dt(g)||(g=o[p]=new Hr({owner:t,primitiveType:r._primitiveType})),g.vertexArray=f,g.renderState=t._renderState,g.shaderProgram=t._sp,g.uniformMap=d,g.pass=sy.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const v=Hr.shallowClone(g,g.derivedCommands.tileset);v.renderState=t._renderState3DTiles,v.pass=sy.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=v;const y=Hr.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=t._sp2D,g.derivedCommands.color2D=y;const w=Hr.shallowClone(v,v.derivedCommands.color2D);w.shaderProgram=t._sp2D,v.derivedCommands.color2D=w;const P=Hr.shallowClone(g,g.derivedCommands.colorMorph);P.renderState=t._renderStateMorph,P.shaderProgram=t._spMorph,P.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=P}}function dy(t,i,e,n,o,s,r){e.mode===Ts.MORPHING?i=i.derivedCommands.colorMorph:e.mode!==Ts.SCENE3D&&(i=i.derivedCommands.color2D),i.modelMatrix=n,i.boundingVolume=s,i.cull=o,i.debugShowBoundingVolume=r,e.commandList.push(i)}function hA(t,i,e,n,o,s,r){const l=t._primitive;Vn._updateBoundingVolumes(l,i,o);let c;i.mode===Ts.SCENE3D?c=l._boundingSphereWC:i.mode===Ts.COLUMBUS_VIEW?c=l._boundingSphereCV:i.mode===Ts.SCENE2D&&dt(l._boundingSphere2D)?c=l._boundingSphere2D:dt(l._boundingSphereMorph)&&(c=l._boundingSphereMorph);const u=i.mode===Ts.MORPHING,d=t.classificationType,p=d!==Bd.CESIUM_3D_TILE,f=d!==Bd.TERRAIN&&!u;let g;const v=i.passes;if(v.render||v.pick&&l.allowPicking){const y=e.length;for(let w=0;w<y;++w){const P=c[w];p&&(g=e[w],dy(t,g,i,o,s,P,r)),f&&(g=e[w].derivedCommands.tileset,dy(t,g,i,o,s,P,r))}}}Ti.prototype.update=function(t){if(!dt(this._primitive)&&!dt(this.geometryInstances))return;if(!zd.initialized){if(!this.asynchronous)throw new Ld("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");Ti.initializeTerrainHeights();return}let i;const e=this,n=this._primitiveOptions;if(!dt(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],s=o.length,r=new Array(s);let l;for(i=0;i<s;++i)if(l=o[i].attributes,!dt(l)||!dt(l.color)){this._hasPerInstanceColors=!1;break}for(i=0;i<s;++i){const c=o[i];l={};const u=c.attributes;for(const d in u)u.hasOwnProperty(d)&&(l[d]=u[d]);dt(l.width)||(l.width=new tA({componentDatatype:Kx.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=t.scene3DOnly,iA.setProjectionAndEllipsoid(c.geometry,t.mapProjection),r[i]=new eA({geometry:c.geometry,attributes:l,id:c.id,pickPrimitive:e})}n.geometryInstances=r,n.appearance=this.appearance,n._createShaderProgramFunction=function(c,u,d){lA(e,u,d)},n._createCommandsFunction=function(c,u,d,p,f,g,v){cA(e,u,d,p,g,v)},n._updateAndQueueCommandsFunction=function(c,u,d,p,f,g,v,y){hA(e,u,d,p,f,g,v)},this._primitive=new Vn(n)}if(this.appearance instanceof ly&&!this._hasPerInstanceColors)throw new Ld("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(t),t.afterRender.push(()=>{!this._ready&&dt(this._primitive)&&this._primitive.ready&&this._completeLoad()})},Ti.prototype.getGeometryInstanceAttributes=function(t){if(!dt(this._primitive))throw new Ld("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},Ti.isSupported=function(t){return t.frameState.context.depthTexture},Ti.prototype.isDestroyed=function(){return!1},Ti.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,Jx(this)};class xo extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.globe,o=-414,s=8777;let r={};const l=()=>{var p,f,g,v,y;if(!e)return;let u;const d=this.shadingMode||"none";if((this.show??!0)&&!(d==="none"&&!this.enableContour)){let w;this.enableContour?(d==="elevation"?(u=uA(),w=u.materials.elevationRampMaterial.uniforms,w.minimumHeight=((p=this.elevationParam)==null?void 0:p.minHeight)??o,w.maximumHeight=((f=this.elevationParam)==null?void 0:f.maxHeight)??s,r=u.materials.contourMaterial.uniforms):d==="slope"?(u=dA(),w=u.materials.slopeRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):d==="aspect"?(u=pA(),w=u.materials.aspectRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):(u=h.Material.fromType("ElevationContour"),r=u.uniforms),r.width=this.contourWidth,r.spacing=this.contourSpacing,r.color=h.Color.fromCartesian4(h.Cartesian4.fromArray(this.contourColor))):d==="elevation"?(u=h.Material.fromType("ElevationRamp"),w=u.uniforms,w.minimumHeight=((g=this.elevationParam)==null?void 0:g.minHeight)??o,w.maximumHeight=((v=this.elevationParam)==null?void 0:v.maxHeight)??s):d==="slope"?(u=h.Material.fromType("SlopeRamp"),w=u.uniforms):d==="aspect"&&(u=h.Material.fromType("AspectRamp"),w=u.uniforms),d!=="none"&&(w.image=py(d),d==="elevation"&&((y=this.elevationParam)==null?void 0:y.color)!==void 0&&(w.image=Array.isArray(this.elevationParam.color)?py(d,this.elevationParam.color):this.elevationParam.color))}n.material=u};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.contourColorChanged,this.contourSpacingChanged,this.contourWidthChanged,this.enableContourChanged,this.shadingModeChanged,this.showChanged,this.elevationParamChanged));this.dispose(c.disposableOn(l)),this.dispose(()=>n.material=void 0)}}m(xo,"defaults",{show:!1,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],shadingMode:"none"}),(t=>{t.createDefaultProps=()=>({show:void 0,shadingMode:void 0,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],elevationParam:a.reactJsonWithUndefined(void 0)})})(xo||(xo={})),a.extendClassProps(xo.prototype,xo.createDefaultProps);function uA(){return new h.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1})}function dA(){return new h.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1})}function pA(){return new h.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1})}const fA=[0,.045,.1,.15,.37,.54,1],gA=[0,.29,.5,Math.sqrt(2)/2,.87,.91,1],mA=[0,.2,.4,.6,.8,.9,1];function py(t,i){const e=document.createElement("canvas");e.width=100,e.height=1;const n=e.getContext("2d");let o;if(t==="elevation")o=fA;else if(t==="slope")o=gA;else if(t==="aspect")o=mA;else throw new Error("values未赋值!");const s=n.createLinearGradient(0,0,100,0);return s.addColorStop(o[0],i!=null&&i[0]?_n(i==null?void 0:i[0]):"#000000"),s.addColorStop(o[1],i!=null&&i[1]?_n(i==null?void 0:i[1]):"#2747E0"),s.addColorStop(o[2],i!=null&&i[2]?_n(i==null?void 0:i[2]):"#D33B7D"),s.addColorStop(o[3],i!=null&&i[3]?_n(i==null?void 0:i[3]):"#D33038"),s.addColorStop(o[4],i!=null&&i[4]?_n(i==null?void 0:i[4]):"#FF9742"),s.addColorStop(o[5],i!=null&&i[5]?_n(i==null?void 0:i[5]):"#ffd700"),s.addColorStop(o[6],i!=null&&i[6]?_n(i==null?void 0:i[6]):"#ffffff"),n.fillStyle=s,n.fillRect(0,0,100,1),e}class Ms extends a.Destroyable{constructor(e){super();m(this,"_geoPath");m(this,"_geoPolyline");m(this,"_geoCanvasPointPoi");m(this,"_player");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));m(this,"_ratio",this.disposeVar(a.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new a.ESPathImpl),this._geoPolyline=this.disposeVar(new xe(e)),this._geoCanvasPointPoi=this.disposeVar(new Sn(e)),this._player=this.disposeVar(new a.Player),this._geoPolyline.show=!1,this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(a.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPath,"show"],[this,"show"])),this.dispose(a.track([this._geoPath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.track([this._geoPath,"width"],[this,"width"])),this.dispose(a.track([this._geoPath,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPath,"color"],[this,"color"])),this.dispose(a.track([this._geoPath,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPath,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPath,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPath,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPath,"allowPicking"],[this,"allowPicking"]));{const n=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};n(),this.dispose(this.showChanged.disposableOn(n)),this.dispose(this.currentPoiShowChanged.disposableOn(n))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const n=()=>{if(this.positions){const s=this.granularity*Math.PI/180,r=mu(this.positions,this.arcType??"GEODESIC",s);if(r){this._geoPath.timePosRots=r.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};n();const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(o.disposableOn(n))}{const n=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const o=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(o-this.currentDistance)>.01&&(this.currentDistance=o)};n(),this.dispose(this._player.currentTimeChanged.disposableOn(n))}{const n=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const o=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(o-(this._player.currentTime??0))>.01&&(this._player.currentTime=o)};n(),this.dispose(this.currentDistanceChanged.disposableOn(n))}this.dispose(a.bind([this._player,"loop"],[this,"loop"])),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._player,"duration"],[this,"duration"])),this.dispose(a.bind([this._player,"playing"],[this,"playing"])),this.dispose(a.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(n=>{this._geoPolyline.flyTo(n)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(s=>s[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Ms||(Ms={})),a.extendClassProps(Ms.prototype,Ms.createDefaultProps);class me extends Jt{constructor(e,n){super(e,n);m(this,"_smoothMoving");if(this._smoothMoving=this.disposeVar(new a.SmoothMoveController(this.czmViewer)),this.d(this._smoothMoving.currentPositionChanged.don(s=>{s&&(this.sceneObject.position=s)})),this.d(this._smoothMoving.currentRotationChanged.don(s=>{s&&this._smoothMoving.isRotating&&(this.sceneObject.rotation=s)})),this.d(this._smoothMoving.currentHeadingChanged.don(s=>{if(s!==void 0&&!this._smoothMoving.isRotating){const r=this.sceneObject.rotation;this.sceneObject.rotation=[s-90,r[1],r[2]]}})),!n.viewer){console.warn("viewer is undefined!");return}this.d(e.smoothMoveEvent.don((s,r)=>{this.smoothMove(s,r*1e3)})),this.d(e.smoothMoveWithRotationEvent.don((s,r,l)=>{this.smoothMoveWithRotation(s,r,l*1e3)})),this.d(e.smoothMoveOnGroundEvent.don((s,r,l)=>{this.smoothMoveOnGround(s,r,l*1e3)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((s,r,l,c)=>{this.smoothMoveWithRotationOnGround(s,r,l,c*1e3)})),this.d(e.calcFlyToParamEvent.don(()=>{if(!e.useCalcFlyToParamInESObjectWithLocation)return;if(!e.position){console.warn(`!sceneObject(${e.name}-${e.id}).position`);return}const s=n.calcFlyToParam(e.position);if(!s){console.warn("czmViewer.calcFlyToParam error.");return}e.flyToParam=s})),this.d(e.automaticLandingEvent.don(async s=>{const r=[e.position[0],e.position[1]],l=await n.getTerrainHeight(r);l?e.position=[...r,l]:console.warn("不存在相交"),e.collision=s})),this.d(a.createEventsCallFunc([e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged,n.cameraChanged],()=>this.visibleDistance(e,n)))}smoothMove(e,n){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,this.sceneObject.rotation,n)}smoothMoveWithRotation(e,n,o){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,n,o)}async smoothMoveOnGround(e,n,o){const s=await this.czmViewer.getTerrainHeight([e,n])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([e,n,s],this.sceneObject.rotation,o)}async smoothMoveWithRotationOnGround(e,n,o,s){const r=await this.czmViewer.getTerrainHeight([n,o])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([n,o,r],e,s)}visibleDistance(e,n){var s;if(!e.show||!((s=n.viewer)!=null&&s.camera))return;const o=me.getInnerCzmObjects(this);if(o.length!=0){const r=a.getDistancesFromPositions([e.position,Ht(n.viewer.camera)],"NONE")[0];let l=!1;e.minVisibleDistance<e.maxVisibleDistance?l=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(l=r>e.minVisibleDistance),o.forEach(c=>{if(c instanceof Ne)return;const u=e.show&&l;Reflect.has(c,"showHelper")&&(c.showHelper=u),Reflect.has(c,"enabled")&&(c.enabled=u),Reflect.has(c,"show")&&(c.show=u)})}}static getInnerCzmObjects(e){const n=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(!o.includes("czmViewer")&&o.includes("czm")||!Number.isNaN(+o)?Array.isArray(e[o])?n.push(...me.getInnerCzmObjects(e[o])):n.push(e[o]):e[o]&&e[o].obj&&n.push(...me.getInnerCzmObjects(e[o].obj)));return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&o.position){const{position:r,flyToParam:l}=o,{distance:c,heading:u,pitch:d,flyDuration:p,hDelta:f,pDelta:g}=l;return this.flyToWithPromise(n,r,c,[u,d,0],e??p,f,g),!0}return super.flyTo(e,n)}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(!o.flyInParam&&o.position&&o.rotation){const r=e??1,l=[...o.rotation];return l[0]+=90,this.flyToWithPromise(n,o.position,void 0,l,r),!0}return super.flyIn(e,n)}}class yt extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}class qr extends me{constructor(e,n){super(e,n);m(this,"_lastHoverResult",this.disposeVar(a.react(void 0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.ad(a.createProcessingFromAsyncFunc(async(r,l)=>{const c=await r.promise(n.pick(l.screenPosition,"innerHoverEvent"));this.lastHoverResult=Object.assign({},c,l)}));this.ad(n.pointerMoveEvent.don(async r=>{!s.isRunning&&s.restart(void 0,r)}))}get lastHoverResult(){return this._lastHoverResult.value}set lastHoverResult(e){this._lastHoverResult.value=e}get lastHoverResultChanged(){return this._lastHoverResult.changed}}class fh extends me{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}function vA(t,i,e){const n=t,o=i,s=(o[0]-n[0]+(o[1]-n[1]))/4,r=[[n[0],0,n[1]],[o[0],0,n[1]],[o[0],0,o[1]],[n[0],0,o[1]],[0,s,0]],l=h.Math.toDegrees,c=r.map(d=>{const p=h.Matrix4.multiplyByPoint(e,h.Cartesian3.fromElements(...d),new h.Cartesian3),f=h.Cartographic.fromCartesian(p);return[l(f.longitude),l(f.latitude),f.height]});return[[[c[0],c[1],c[2],c[3],c[0]]],c[4]]}class Ao extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_polylines");m(this,"_axis");n&&(this.id=n),this._polylines=this.disposeVar(new qt(e,n)),this._axis=this.disposeVar(new xe(e,n)),this._axis.hasArrow=!0,this._axis.width=10,this._polylines.arcType=this._axis.arcType="NONE",this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Me)||!e.actived)return;if(!this.position){console.warn("CzmPlane warning: 没有位置,无法飞入!");return}const s=this.minSize,r=this.maxSize,l=[r[0]-s[0],r[1]-s[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);ne(e.viewer,this.position,c*2,void 0,o)}));{const o=()=>{let r=[],l;if(this.position){const c=Re({position:this.position,rotation:this.rotation});if(c){const u=vA(this.minSize,this.maxSize,c);r=u[0],l=u[1]}}this.polylines.positions=r,!(!this.position||!l)&&(this.axis.positions=[this.position,l])};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(s.disposableOn(o))}this.dispose(a.track([this.polylines,"color"],[this,"color"])),this.dispose(a.track([this.polylines,"width"],[this,"width"])),this.dispose(a.track([this.polylines,"show"],[this,"show"])),this.dispose(a.track([this.axis,"color"],[this,"color"]));{const o=()=>{this.axis.show=this.show&&this.showArrow};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.showArrowChanged.disposableOn(o))}}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylines(){return this._polylines}get axis(){return this._axis}}m(Ao,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,showArrow:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),color:a.reactArray([1,1,1,1]),width:2,minSize:a.reactArray([-100,-100]),maxSize:a.reactArray([100,100])})})(Ao||(Ao={})),a.extendClassProps(Ao.prototype,Ao.createDefaultProps);class yA extends a.Destroyable{constructor(e,n,o){super();m(this,"_centerMatrix",this.disposeVar(a.react(void 0)));m(this,"_inverseCenterMatrix",this.disposeVar(a.react(void 0)));m(this,"_czmPlaneWrappers");m(this,"_czmPlaneWrappersChanged",this.disposeVar(a.createNextAnimateFrameEvent()));m(this,"_computedPlanesChanged",this.disposeVar(a.createNextAnimateFrameEvent()));this._czmClippingPlanes=n,this._planeIds=o,this._czmPlaneWrappers=this._planeIds.map(s=>this.disposeVar(new CA(e,this,s)));{const s=()=>{let r,l;const c=this._czmPlaneWrappers.filter(u=>u.position&&u.rotation);if(c.length!==0){const u=c.map(p=>p.position),d=a.getMinMaxCorner(u);r=Re({position:d.center}),r&&(l=h.Matrix4.inverseTransformation(r,new h.Matrix4))}this.centerMatrix=r,this.inverseCenterMatrix=l};s(),this.dispose(this.czmPlaneWrappersChanged.disposableOn(s))}{const s=()=>{if(!this.centerMatrix){this._czmClippingPlanes.computedClippingPlanes=void 0;return}const l=h.Matrix4.toArray(this.centerMatrix),c=this._czmPlaneWrappers.filter(u=>!!u.computedPlane).map(u=>u.computedPlane);this._czmClippingPlanes.computedClippingPlanes={planes:c,enabled:this._czmClippingPlanes.enabled,modelMatrix:l,unionClippingRegions:this._czmClippingPlanes.unionClippingRegions,edgeColor:this._czmClippingPlanes.edgeColor,edgeWidth:this._czmClippingPlanes.edgeWidth}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._czmClippingPlanes.enabledChanged,this.centerMatrixChanged,this.inverseCenterMatrixChanged,this.computedPlanesChanged,this._czmClippingPlanes.unionClippingRegionsChanged,this._czmClippingPlanes.edgeColorChanged,this._czmClippingPlanes.edgeWidthChanged));this.dispose(r.disposableOn(s))}}get centerMatrix(){return this._centerMatrix.value}set centerMatrix(e){this._centerMatrix.value=e}get centerMatrixChanged(){return this._centerMatrix.changed}get inverseCenterMatrix(){return this._inverseCenterMatrix.value}set inverseCenterMatrix(e){this._inverseCenterMatrix.value=e}get inverseCenterMatrixChanged(){return this._inverseCenterMatrix.changed}get czmPlaneWrappers(){return this._czmPlaneWrappers}get czmPlaneWrappersChanged(){return this._czmPlaneWrappersChanged}get computedPlanesChanged(){return this._computedPlanesChanged}get czmClippingPlanes(){return this._czmClippingPlanes}}class wA extends a.Destroyable{constructor(i,e){super(),this._czmPlaneWrapper=i,this._czmPlane=e,this._czmPlaneWrapper.position=this._czmPlane.position,this.dispose(()=>this._czmPlaneWrapper.position=void 0),this.dispose(a.track([this._czmPlaneWrapper,"position"],[this._czmPlane,"position"])),this._czmPlaneWrapper.rotation=this._czmPlane.rotation,this.dispose(()=>this._czmPlaneWrapper.rotation=[0,0,0]),this.dispose(a.track([this._czmPlaneWrapper,"rotation"],[this._czmPlane,"rotation"]))}}class CA extends a.Destroyable{constructor(e,n,o){super();m(this,"_sowi");m(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_rotation",this.disposeVar(a.reactArray([0,0,0])));m(this,"_computedPlane",this.disposeVar(a.reactJson(void 0)));this._planesResetting=n,this._planeId=o,this._sowi=this.disposeVar(new a.ESSceneObjectWithId),this._sowi.id=this._planeId,this.disposeVar(new a.ObjResettingWithEvent(this.sowi.sceneObjectChanged,()=>{const{sceneObject:s}=this.sowi;if(!s)return;let r;a.registerCreatedEventUpdate(this,s,()=>{const l=e.getEngineObject(s);if(s instanceof a.ESClippingPlane&&(r=l.czmPlane),!!r&&r instanceof Ao)return new wA(this,r)})})),this.dispose(this.positionChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next())),this.dispose(this.rotationChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next()));{const s=()=>{const{inverseCenterMatrix:l}=this._planesResetting;if(!l)return this.computedPlane=void 0;const{position:c,rotation:u}=this;if(!c)return this.computedPlane=void 0;const d=Re({position:c,rotation:u});if(!d)return this.computedPlane=void 0;const f=h.Matrix4.multiply(l,d,new h.Matrix4),g=new h.Cartesian3(f[4],f[5],f[6]),v=new h.Cartesian3(f[12],f[13],f[14]);h.Cartesian3.normalize(g,g);let y=-h.Cartesian3.dot(g,v);const w=[g.x,g.y,g.z];this._planesResetting.czmClippingPlanes.reverseNormal&&(a.Vector.negate(w,w),y=-y),this.computedPlane={normal:w,distance:y}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._planesResetting.inverseCenterMatrixChanged,this.positionChanged,this.rotationChanged,this._planesResetting.czmClippingPlanes.reverseNormalChanged));this.dispose(r.disposableOn(s))}this.dispose(this.computedPlaneChanged.disposableOn(()=>this._planesResetting.computedPlanesChanged.next()))}get sowi(){return this._sowi}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get rotation(){return this._rotation.value}set rotation(e){this._rotation.value=e}get rotationChanged(){return this._rotation.changed}get computedPlane(){return this._computedPlane.value}set computedPlane(e){this._computedPlane.value=e}get computedPlaneChanged(){return this._computedPlane.changed}}class Ds extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_computedClippingPlanes",this.disposeVar(a.react(void 0)));n&&(this.id=n),this.disposeVar(new a.ObjResettingWithEvent(this.planeIdsChanged,()=>new yA(e,this,this.planeIds)))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,planeIds:a.reactArray([]),reverseNormal:!1,unionClippingRegions:!0,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Ds||(Ds={})),a.extendClassProps(Ds.prototype,Ds.createDefaultProps);let _A=class extends a.Destroyable{constructor(i,e){super(),this._czmESClippingPlane=i,this._eS3DTileset=e;const o=[this._czmESClippingPlane.czmPlane.id,...this._eS3DTileset.clippingPlaneIds];this._eS3DTileset.clippingPlaneIds=o,this.dispose(()=>{const s=[...this._eS3DTileset.clippingPlaneIds],r=this._czmESClippingPlane.czmPlane.id;s.includes(r)&&(s.splice(s.indexOf(r),1),this._eS3DTileset.clippingPlaneIds=s)})}},PA=class extends a.Destroyable{constructor(i){if(super(),this._czmESClippingPlane=i,!this._czmESClippingPlane.viewer)return;this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId=this._czmESClippingPlane.czmPlane.id;const e=()=>{if(!this._czmESClippingPlane.viewer)return;const o=Re({position:this._czmESClippingPlane.sceneObject.position});if(!o)return;const s=em(this._czmESClippingPlane.sceneObject.rotation);this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes={planes:[{normal:s,distance:0}],enabled:!0,modelMatrix:h.Matrix4.toArray(o),unionClippingRegions:!1,edgeColor:this._czmESClippingPlane.sceneObject.edgeColor,edgeWidth:this._czmESClippingPlane.sceneObject.edgetWidth}};e();const n=this.dv(a.createNextAnimateFrameEvent(this._czmESClippingPlane.sceneObject.positionChanged,this._czmESClippingPlane.sceneObject.rotationChanged,this._czmESClippingPlane.sceneObject.edgeColorChanged,this._czmESClippingPlane.sceneObject.edgetWidthChanged));this.d(n.don(e)),this.dispose(()=>{this._czmESClippingPlane.viewer&&(this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId="",this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes=void 0)})}};const ba=class ba extends me{constructor(e,n){super(e,n);m(this,"_innerPositionReact",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_czmPlane");m(this,"_tilesSceneObjectWithId");this._czmPlane=this.disposeVar(new Ao(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),!n.viewer)return;const r=this._czmPlane;a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmPlane.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(!(!this.sceneObject.show||!this.czmPlane.show))return u===""?new PA(this):!c||!(c instanceof a.ES3DTileset)?void 0:new _A(this,c)}))}),this.dispose(a.track([r,"show"],[e,"show"])),this.dispose(a.bind([r,"position"],[e,"position"])),this.dispose(je([r,"rotation"],[e,"rotation"])),this.dispose(a.track([r,"showArrow"],[e,"showArrow"])),this.dispose(a.track([r,"color"],[e,"edgeColor"])),this.dispose(a.track([r,"width"],[e,"edgetWidth"]));{const l=()=>{r.minSize=[-e.width/2,-e.height/2],r.maxSize=[e.width/2,e.height/2]};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.widthChanged,e.heightChanged));this.dispose(c.disposableOn(l))}{const l=()=>{a.Vector.equals(e.position,[0,0,0])?this._innerPositionReact.value=void 0:this._innerPositionReact.value=e.position};l(),this.dispose(this.sceneObject.positionChanged.disposableOn(l))}{const l=()=>{this._innerPositionReact.value==null?e.position=[0,0,0]:e.position=this._innerPositionReact.value};this.dispose(this._innerPositionReact.changed.disposableOn(l))}}get czmPlane(){return this._czmPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.position?($t(s,o,n,o.position,Math.max(o.width,o.height),e,!0),!0):!1:!1}};m(ba,"type",ba.register("ESCesiumViewer",a.ESClippingPlane.type,ba));let Vd=ba;function bA(t){t.toBlob(i=>{if(!i){console.warn("canvas.toBlob error!");return}var e=new ClipboardItem({"image/png":i});navigator.clipboard.write([e]).then(function(){alert("图像已复制到剪切板")}).catch(function(n){console.error("复制到剪切板失败: ",n)})})}const Jh=class Jh extends a.Destroyable{constructor(i,e){super(),this._geoPolygonCanvas=i,this._geoPolygon=e;{const n=(r,l)=>{const{canvas:c,canvasCtx:u,canvasWidth:d}=this._geoPolygonCanvas,{toMercatorPos:p}=Jh,f=p(r),g=p(l),v=g[0]-f[0],y=g[1]-f[1],w=d>8192?8192:d;if(v<=0)return;const P=w*y/v|0;if(P<=0||P>8192)return;const{points:C}=this._geoPolygon;if(!C)throw new Error("!positions");const S=C.map(A=>{const E=p(A);return[(E[0]-f[0])*w/v,P-(E[1]-f[1])*P/y]});c.width=w,c.height=P,u.clearRect(0,0,w,P),u.beginPath();for(const A of S)u.lineTo(A[0],A[1]);u.closePath(),u.fillStyle="#FFFFFF",u.fill()},o=()=>{let r;const{canvas:l,canvasCtx:c,canvasWidth:u}=this._geoPolygonCanvas;c.clearRect(0,0,l.width,l.height);const{points:d}=this._geoPolygon;if(d&&d.length>=3){const p=a.getMinMaxCorner(d),{minPos:f,maxPos:g}=p;n(f,g),r={rect:[f[0],f[1],g[0],g[1]],height:d[0][2]}}this._geoPolygonCanvas.canvasGeoInfo=r,this.ad(a.nextAnimateFrame(()=>{this._geoPolygonCanvas.canvasChanged.emit()}))};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._geoPolygon.pointsChanged,this._geoPolygonCanvas.canvasWidthChanged));this.dispose(s.disposableOn(o))}}};m(Jh,"toMercatorPos",function(i){const[e,n,o]=i;return[e,n/Math.cos(n*Math.PI/180),o]});let Wd=Jh;const Sa=class Sa extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_geoPolygonWithId");m(this,"_canvas",document.createElement("canvas"));m(this,"_canvasCtx",this._canvas.getContext("2d"));m(this,"_canvasChanged",this.disposeVar(new a.Event));m(this,"_canvasGeoInfo",this.disposeVar(a.reactJsonWithUndefined(void 0)));this._geoPolygonWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._geoPolygonWithId,"id"],[this,"geoPolygonId"])),this.disposeVar(new a.ObjResettingWithEvent(this.geoPolygonWithId.sceneObjectChanged,()=>{const{sceneObject:o}=this.geoPolygonWithId;if(o&&o instanceof a.ESGeoPolygon)return new Sa.PolygonCanvasResetting(this,o)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygonWithId(){return this._geoPolygonWithId}get canvas(){return this._canvas}get canvasCtx(){return this._canvasCtx}get canvasChanged(){return this._canvasChanged}get canvasGeoInfo(){return this._canvasGeoInfo.value}set canvasGeoInfo(e){this._canvasGeoInfo.value=e}get canvasGeoInfoChanged(){return this._canvasGeoInfo.changed}};m(Sa,"saveCanvasToClipboard",bA),m(Sa,"PolygonCanvasResetting",Wd);let Eo=Sa;(t=>{t.createDefaultProps=()=>({enabled:!0,geoPolygonId:"",canvasWidth:512})})(Eo||(Eo={})),a.extendClassProps(Eo.prototype,Eo.createDefaultProps);function SA(t,i){return class extends a.Destroyable{constructor(o,s){super();m(this,"_customShader",this.disposeVar(new h.CustomShader({uniforms:{u_discardRatio:{value:new h.Cartesian2(0,1),type:h.UniformType.VEC2},u_topColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4},u_bottomColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4}},varyings:{v_xbsjPos:h.VaryingType.VEC3,v_m:h.VaryingType.FLOAT},vertexShaderText:` // IMPORTANT: the function signature must use these parameter names. This
|
|
366
|
+
`;return s=Td(l),new Worker(s,o)}if(s=t,e||(s=ni(`${it._workerModulePrefix+n}.js`)),!ut.supportsEsmWebWorkers())throw new ht("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(s,o)}async function zx(t,i){const e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!ut.supportsWebAssembly()){if(!T(i.fallbackModulePath))throw new ht(`This browser does not support Web Assembly, and no backup module was provided for ${t._workerPath}`);return e.modulePath=ni(i.fallbackModulePath),e}e.wasmBinaryFile=ni(i.wasmBinaryFile);const n=await J.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=n,e}function it(t,i){this._workerPath=t,this._maximumActiveTasks=i??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const Lx=(t,i,e,n)=>{const o=({data:s})=>{if(s.id===i){if(T(s.error)){let r=s.error;r.name==="RuntimeError"?(r=new ht(s.error.message),r.stack=s.error.stack):r.name==="DeveloperError"?(r=new W(s.error.message),r.stack=s.error.stack):r.name==="Error"&&(r=new Error(s.error.message),r.stack=s.error.stack),Ed.raiseEvent(r),n(r)}else Ed.raiseEvent(),e(s.result);t.removeEventListener("message",o)}};return o},Nx=[];async function Ox(t,i,e){const n=await Promise.resolve(Zv());T(e)?n||(e.length=0):e=Nx;const o=t._nextID++,s=new Promise((r,l)=>{t._worker.addEventListener("message",Lx(t._worker,o,r,l))});return t._worker.postMessage({id:o,baseUrl:ni.getCesiumBaseUrl().url,parameters:i,canTransferArrayBuffer:n},e),s}async function Bx(t,i,e){++t._activeTasks;try{const n=await Ox(t,i,e);return--t._activeTasks,n}catch(n){throw--t._activeTasks,n}}it.prototype.scheduleTask=function(t,i){if(T(this._worker)||(this._worker=Id(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Bx(this,t,i)},it.prototype.initWebAssemblyModule=async function(t){if(T(this._webAssemblyPromise))return this._webAssemblyPromise;const i=async()=>{const e=this._worker=Id(this._workerPath),n=await zx(this,t),o=await Promise.resolve(Zv());let s;const r=n.wasmBinary;T(r)&&o&&(s=[r]);const l=new Promise((c,u)=>{e.onmessage=function({data:d}){T(d)?c(d.result):u(new ht("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:n}},s),l};return this._webAssemblyPromise=i(),this._webAssemblyPromise},it.prototype.isDestroyed=function(){return!1},it.prototype.destroy=function(){return T(this._worker)&&this._worker.terminate(),Fx(this)},it.taskCompletedEvent=Ed,it._defaultWorkerModulePrefix="Workers/",it._workerModulePrefix=it._defaultWorkerModulePrefix,it._canTransferArrayBuffer=void 0;function As(t,i,e,n,o){this._format=t,this._datatype=i,this._width=e,this._height=n,this._buffer=o}Object.defineProperties(As.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}}),As.clone=function(t){if(T(t))return new As(t._format,t._datatype,t._width,t._height,t._buffer)},As.prototype.clone=function(){return As.clone(this)};function ji(){}ji._transcodeTaskProcessor=new it("transcodeKTX2",Number.POSITIVE_INFINITY),ji._readyPromise=void 0;function Vx(){const t=ji._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(i){if(i)return ji._transcodeTaskProcessor;throw new ht("KTX2 transcoder could not be initialized.")});ji._readyPromise=t}ji.transcode=function(t,i){return b.defined("supportedTargetFormats",i),T(ji._readyPromise)||Vx(),ji._readyPromise.then(function(e){let n=t;t instanceof ArrayBuffer&&(n=new Uint8Array(t));const o={supportedTargetFormats:i,ktx2Buffer:n};return e.scheduleTask(o,[n.buffer])}).then(function(e){const n=e.length,o=Object.keys(e[0]);for(let s=0;s<n;s++){const r=e[s];for(let l=0;l<o.length;l++){const c=r[o[l]];r[o[l]]=new As(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let s=0;s<n;++s)e[s]=e[s][o[0]];n===1&&(e=e[0])}return e}).catch(function(e){throw e})};let Qv;kv.setKTX2SupportedFormats=function(t,i,e,n,o,s){Qv={s3tc:t,pvrtc:i,astc:e,etc:n,etc1:o,bc7:s}};function kv(t){b.defined("resourceOrUrlOrBuffer",t);let i;return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?i=Promise.resolve(t):i=J.createIfNeeded(t).fetchArrayBuffer(),i.then(function(e){return ji.transcode(e,Qv)})}function Es(){W.throwInstantiationError()}Object.defineProperties(Es.prototype,{rectangle:{get:W.throwInstantiationError},tileWidth:{get:W.throwInstantiationError},tileHeight:{get:W.throwInstantiationError},maximumLevel:{get:W.throwInstantiationError},minimumLevel:{get:W.throwInstantiationError},tilingScheme:{get:W.throwInstantiationError},tileDiscardPolicy:{get:W.throwInstantiationError},errorEvent:{get:W.throwInstantiationError},credit:{get:W.throwInstantiationError},proxy:{get:W.throwInstantiationError},hasAlphaChannel:{get:W.throwInstantiationError}}),Es.prototype.getTileCredits=function(t,i,e){W.throwInstantiationError()},Es.prototype.requestImage=function(t,i,e,n){W.throwInstantiationError()},Es.prototype.pickFeatures=function(t,i,e,n,o){W.throwInstantiationError()};const Wx=/\.ktx2$/i;Es.loadImage=function(t,i){b.defined("url",i);const e=J.createIfNeeded(i);return Wx.test(e.url)?kv(e):T(t)&&T(t.tileDiscardPolicy)?e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):e.fetchImage({preferImageBitmap:!0,flipY:!0})};var ch=3.141592653589793*3e3/180,nt=3.141592653589793,hh=6378245,uh=.006693421622965943,Kv=function(n,o){var n=+n,o=+o,s=n-.0065,r=o-.006,l=Math.sqrt(s*s+r*r)-2e-5*Math.sin(r*ch),c=Math.atan2(r,s)-3e-6*Math.cos(s*ch),u=l*Math.cos(c),d=l*Math.sin(c);return[u,d]},Jv=function(o,n){var n=+n,o=+o,s=Math.sqrt(o*o+n*n)+2e-5*Math.sin(n*ch),r=Math.atan2(n,o)+3e-6*Math.cos(o*ch),l=s*Math.cos(r)+.0065,c=s*Math.sin(r)+.006;return[l,c]},Md=function(o,n){var n=+n,o=+o;if(ty(o,n))return[o,n];var s=jv(o-105,n-35),r=ey(o-105,n-35),l=n/180*nt,c=Math.sin(l);c=1-uh*c*c;var u=Math.sqrt(c);s=s*180/(hh*(1-uh)/(c*u)*nt),r=r*180/(hh/u*Math.cos(l)*nt);var d=n+s,p=o+r;return[p,d]},Dd=function(o,n){var n=+n,o=+o;if(ty(o,n))return[o,n];var s=jv(o-105,n-35),r=ey(o-105,n-35),l=n/180*nt,c=Math.sin(l);c=1-uh*c*c;var u=Math.sqrt(c);s=s*180/(hh*(1-uh)/(c*u)*nt),r=r*180/(hh/u*Math.cos(l)*nt);var d=n+s,p=o+r;return[o*2-p,n*2-d]},jv=function(o,n){var n=+n,o=+o,s=-100+2*o+3*n+.2*n*n+.1*o*n+.2*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*nt)+20*Math.sin(2*o*nt))*2/3,s+=(20*Math.sin(n*nt)+40*Math.sin(n/3*nt))*2/3,s+=(160*Math.sin(n/12*nt)+320*Math.sin(n*nt/30))*2/3,s},ey=function(o,n){var n=+n,o=+o,s=300+o+2*n+.1*o*o+.1*o*n+.1*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*nt)+20*Math.sin(2*o*nt))*2/3,s+=(20*Math.sin(o*nt)+40*Math.sin(o/3*nt))*2/3,s+=(150*Math.sin(o/12*nt)+300*Math.sin(o/30*nt))*2/3,s},ty=function(o,n){var n=+n,o=+o;return!(o>73.66&&o<135.05&&n>3.86&&n<53.55)};function Rd(t,i){this.x=t||0,this.y=i||0,this.x=this.x,this.y=this.y}Rd.prototype.equals=function(t){return t&&t.x==this.x&&t.y==this.y};function vi(t,i){isNaN(t)&&(t=decode64(t),t=isNaN(t)?0:t),typeof t=="string"&&(t=parseFloat(t)),isNaN(i)&&(i=decode64(i),i=isNaN(i)?0:i),typeof t=="lat"&&(i=parseFloat(i)),this.lng=t,this.lat=i}vi.isInRange=function(t){return t&&t.lng<=180&&t.lng>=-180&&t.lat<=74&&t.lat>=-74},vi.prototype.equals=function(t){return t&&this.lat==t.lat&&this.lng==t.lng};function ze(){}ze.EARTHRADIUS=637099681e-2,ze.MCBAND=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],ze.LLBAND=[75,60,45,30,15,0],ze.MC2LL=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],ze.LL2MC=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],ze.getDistanceByMC=function(t,i){if(!t||!i)return 0;var e,n,o,s;return t=this.convertMC2LL(t),!t||(e=this.toRadians(t.lng),n=this.toRadians(t.lat),i=this.convertMC2LL(i),!i)?0:(o=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,o,n,s))},ze.getDistanceByLL=function(t,i){if(!t||!i)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),i.lng=this.getLoop(i.lng,-180,180),i.lat=this.getRange(i.lat,-74,74);var e,n,o,s;return e=this.toRadians(t.lng),o=this.toRadians(t.lat),n=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,n,o,s)},ze.convertMC2LL=function(s){var i,e;i=new vi(Math.abs(s.lng),Math.abs(s.lat));for(var n=0;n<this.MCBAND.length;n++)if(i.lat>=this.MCBAND[n]){e=this.MC2LL[n];break}var o=this.convertor(s,e),s=new vi(o.lng.toFixed(6),o.lat.toFixed(6));return s},ze.convertLL2MC=function(s){var i,e;s.lng=this.getLoop(s.lng,-180,180),s.lat=this.getRange(s.lat,-74,74),i=new vi(s.lng,s.lat);for(var n=0;n<this.LLBAND.length;n++)if(i.lat>=this.LLBAND[n]){e=this.LL2MC[n];break}if(!e){for(var n=this.LLBAND.length-1;n>=0;n--)if(i.lat<=-this.LLBAND[n]){e=this.LL2MC[n];break}}var o=this.convertor(s,e),s=new vi(o.lng.toFixed(2),o.lat.toFixed(2));return s},ze.convertor=function(t,i){if(!(!t||!i)){var e=i[0]+i[1]*Math.abs(t.lng),n=Math.abs(t.lat)/i[9],o=i[2]+i[3]*n+i[4]*n*n+i[5]*n*n*n+i[6]*n*n*n*n+i[7]*n*n*n*n*n+i[8]*n*n*n*n*n*n;return e*=t.lng<0?-1:1,o*=t.lat<0?-1:1,new vi(e,o)}},ze.getDistance=function(t,i,e,n){return this.EARTHRADIUS*Math.acos(Math.sin(e)*Math.sin(n)+Math.cos(e)*Math.cos(n)*Math.cos(i-t))},ze.toRadians=function(t){return Math.PI*t/180},ze.toDegrees=function(t){return 180*t/Math.PI},ze.getRange=function(t,i,e){return i!=null&&(t=Math.max(t,i)),e!=null&&(t=Math.min(t,e)),t},ze.getLoop=function(t,i,e){for(;t>e;)t-=e-i;for(;t<i;)t+=e-i;return t},ze.prototype.lngLatToMercator=function(t){return ze.convertLL2MC(t)},ze.prototype.lngLatToPoint=function(t){var i=ze.convertLL2MC(t);return new Rd(i.lng,i.lat)},ze.prototype.mercatorToLngLat=function(t){return ze.convertMC2LL(t)},ze.prototype.PointToLngLat=function(t){var i=new vi(t.x,t.y);return ze.convertMC2LL(i)},ze.prototype.PointToPixel=function(t,i,e,n,o){if(t){t=this.lngLatToMercator(t,o);var s=this.getZoomUnits(i),r=Math.round((t.lng-e.lng)/s+n[Twidth]/2),l=Math.round((e.lat-t.lat)/s+n[Theight]/2);return new Rd(r,l)}},ze.prototype.PixelToPoint=function(t,i,e,n,o){if(t){var s=this.getZoomUnits(i),r=e.lng+s*(t.x-n[Twidth]/2),l=e.lat-s*(t.y-n[Theight]/2),c=new vi(r,l);return this.mercatorToLngLat(c,o)}},ze.prototype.getZoomUnits=function(t){return Math.pow(2,18-t)};function On(t){t=t||{},this._ellipsoid=t.ellipsoid??re.WGS84;var i=!0;T(t.wgs84)&&(i=t.wgs84),this._projection=new Nt(this._ellipsoid);var e=new ze;this._projection.project=function(r){var l={};return i?(l=Md(F.toDegrees(r.longitude),F.toDegrees(r.latitude)),l=Jv(l[0],l[1])):l=Jv(F.toDegrees(r.longitude),F.toDegrees(r.latitude)),l[0]=Math.min(l[0],180),l[0]=Math.max(l[0],-180),l[1]=Math.min(l[1],74.000022),l[1]=Math.max(l[1],-71.988531),l=e.lngLatToPoint(new vi(l[0],l[1])),new j(l.x,l.y)},this._projection.unproject=function(r){var l=e.mercatorToLngLat(new vi(r.x,r.y));return l[0]=(l[0]+180)%360-180,i?(l=Kv(l.lng,l.lat),l=Dd(l[0],l[1])):l=Kv(l.lng,l.lat),new de(F.toRadians(l[0]),F.toRadians(l[1]))},this._rectangleSouthwestInMeters=new j(-2003772637e-2,-1170804166e-2),this._rectangleNortheastInMeters=new j(2003772637e-2,1247410417e-2);var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ie(n.longitude,n.latitude,o.longitude,o.latitude),this.levelWidth=[];for(var s=0;s<19;s++)this.levelWidth[s]=Math.pow(2,18-s)*256}Object.defineProperties(On.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),On.prototype.getNumberOfXTilesAtLevel=function(t){return(1<<t)*.7},On.prototype.getNumberOfYTilesAtLevel=function(t){return 1<<t},On.prototype.rectangleToNativeRectangle=function(t,i){var e=this._projection,n=e.project(ie.southwest(t)),o=e.project(ie.northeast(t));return T(i)?(i.west=n.x,i.south=n.y,i.east=o.x,i.north=o.y,i):new ie(n.x,n.y,o.x,o.y)},On.prototype.tileXYToNativeRectangle=function(t,i,e,n){var o=this.levelWidth[e],s=t*o,r=(t+1)*o;i=-i;var l=(i+1)*o,c=i*o;return T(n)?(n.west=s,n.south=c,n.east=r,n.north=l,n):new ie(s,c,r,l)},On.prototype.tileXYToRectangle=function(t,i,e,n){var o=this.tileXYToNativeRectangle(t,i,e,n),s=this._projection,r=s.unproject(new j(o.west,o.south)),l=s.unproject(new j(o.east,o.north));return o.west=r.longitude,o.south=r.latitude,o.east=l.longitude,o.north=l.latitude,o},On.prototype.positionToTileXY=function(t,i,e){var n=this._rectangle;if(ie.contains(n,t)){var o=this._projection,s=o.project(t);if(T(s)){var r=this.levelWidth[i],l=Math.floor(s.x/r),c=-Math.floor(s.y/r);return T(e)?(e.x=l,e.y=c,e):new j(l,c)}}};function dh(t){this._url=t.url||"http://online2.map.bdimg.com/onlinelabel/?qt=tile&styles=pl&x={x}&y={y}&z={z}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new On(t),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function Gx(t,i,e,n){var o=t._url;return o=o.replace("{x}",i).replace("{y}",-e).replace("{z}",n),o}Object.defineProperties(dh.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 3}},tilingScheme:{get:function(){if(!this._ready)throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),dh.prototype.getTileCredits=function(t,i,e){},dh.prototype.requestImage=function(t,i,e){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=Gx(this,t,i,e);return Es.loadImage(this,n)};class Ux extends h.UrlTemplateImageryProvider{constructor(e){super(e);m(this,"_indexTime",0);e.url="https://tileser.giiiis.com/timetile/",e.minimumLevel=1,e.maximumLevel=18,e.tilingScheme=new h.GeographicTilingScheme,this.indexTime=e.indexTime||0}get indexTime(){return this._indexTime}set indexTime(e){this._indexTime=e}async requestImage(e,n,o,s){try{let r=this.buildImageUrl(this.indexTime,e,n,o);return h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://tileser.giiiis.com/timetile/${e}/${s}/${n}/${o}.jpg`}}class Hx extends h.UrlTemplateImageryProvider{constructor(e){super(e);m(this,"_indexTimeID",0);e.url="https://wayback.maptiles.arcgis.com/",e.minimumLevel=1,e.maximumLevel=18,this.indexTimeID=e.indexTimeID||0}get indexTimeID(){return this._indexTimeID}set indexTimeID(e){this._indexTimeID=e}async requestImage(e,n,o,s){try{let r;return this.indexTimeID!==0?r=this.buildImageUrl(this.indexTimeID,e,n,o):r=`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${o}/${n}/${e}`,h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${e}/${s}/${o}/${n}`}}const $x="https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf",qx=document.createElement("canvas");class Fd{constructor(i){m(this,"viewer");m(this,"esSceneObjectId");m(this,"vectorTileManager");m(this,"mapboxRenderer");m(this,"ready");m(this,"readyPromise");m(this,"rectangle");m(this,"tileSize");m(this,"tileWidth");m(this,"tileHeight");m(this,"maximumLevel");m(this,"minimumLevel");m(this,"tileDiscardPolicy");m(this,"credit");m(this,"proxy");m(this,"layerStyle");m(this,"hasAlphaChannel");m(this,"sourceFilter");m(this,"tilingScheme");m(this,"_destroyed",!1);m(this,"_error");m(this,"_style");m(this,"_accessToken");m(this,"_enablePickFeatures");var e;this.viewer=i.viewer,this.viewer&&(this.vectorTileManager=(e=Ke(this.viewer))==null?void 0:e.vectorTIlesManager),this.esSceneObjectId=i.esSceneObjectId,this.ready=!1,this.tilingScheme=i.tilingScheme??new we.WebMercatorTilingScheme,this.rectangle=i.rectangle??this.tilingScheme.rectangle,this.rectangle=we.Rectangle.intersection(this.rectangle,this.tilingScheme.rectangle),this.tileSize=this.tileWidth=this.tileHeight=i.tileSize||256,this.maximumLevel=i.maximumLevel??18,this.minimumLevel=i.minimumLevel??0,this.tileDiscardPolicy=void 0,this._error=new we.Event,this.credit=new we.Credit(i.credit||"",!1),this.proxy=new we.DefaultProxy(""),this.hasAlphaChannel=i.hasAlphaChannel??!0,this.sourceFilter=i.sourceFilter,this._accessToken=i.accessToken,this._enablePickFeatures=i.enablePickFeatures??!0,this.layerStyle=i.layerStyle??[],we.defined(i.style)&&(this.readyPromise=this._build(i.style,i).then(()=>!0))}get style(){return this._style}get isDestroyed(){return this._destroyed}get errorEvent(){return this._error}async _build(i,e={}){const n=await this._preLoad(i,e.scheme??"tms");n.layers=this.layerStyle.length!=0?this.layerStyle:n.layers,Reflect.has(n,"glyphs")||(n.glyphs=$x),this._style=n,this.mapboxRenderer=new C_.BasicRenderer({style:n,canvas:qx,token:e.accessToken,transformRequest:e.transformRequest}),e.showCanvas&&this.mapboxRenderer.showCanvasForDebug(),await this.mapboxRenderer._style.loadedPromise,this.readyPromise=Promise.resolve(!0),this.ready=!0}static async fromUrl(i,e={}){const n=new Fd(e);return await n._build(i,e),n}_preLoad(i,e){let n=i;if(typeof i=="string"&&(i.endsWith(".json")||i.startsWith("mapbox://")?i=new we.Resource({url:i}):(i={version:8,sources:{customSource:{type:"vector",scheme:e,tiles:[i]}},layers:this.layerStyle},n=i)),i instanceof we.Resource){const o="https://api.mapbox.com/";i.url.startsWith("mapbox://")&&(i.url=i.url.replace("mapbox://",o)),this._accessToken&&i.appendQueryParameters({access_token:this._accessToken}),n=i.fetchJson()}return Promise.resolve(n).catch(o=>{throw this._error.raiseEvent(o),o})}_createTile(){const i=document.createElement("canvas");return i.width=this.tileSize,i.height=this.tileSize,i.style.imageRendering="pixelated",i}_resetTileCache(){Object.values(this.mapboxRenderer._style.sourceCaches).forEach(i=>i._tileCache.reset())}_getTilesSpec(i,e){const{x:n,y:o,level:s}=i,r=this.tileSize,l=[],c=this.tilingScheme.getNumberOfXTilesAtLevel(s)-1,u=this.tilingScheme.getNumberOfYTilesAtLevel(s)-1;for(let d=-1;d<=1;d++){let p=n+d;p<0&&(p=c),p>c&&(p=0);for(let f=-1;f<=1;f++){let g=o+f;g<0||g>u||l.push({source:e,z:s,x:p,y:g,left:0+d*r,top:0+f*r,size:r})}}return l}requestImage(i,e,n,o=!0){if(n<this.minimumLevel||n>this.maximumLevel)return;this.mapboxRenderer.filterForZoom(n);const s=this.mapboxRenderer.getVisibleSources(n).reduce((r,l)=>r.concat(this._getTilesSpec({x:i,y:e,level:n},l)),[]);return new Promise((r,l)=>{const c=this._createTile(),u=c.getContext("2d");u&&(u.globalCompositeOperation="copy");const d=this.mapboxRenderer.renderTiles(u,{srcLeft:0,srcTop:0,width:this.tileSize,height:this.tileSize,destLeft:0,destTop:0},s,p=>{typeof p=="string"&&!p.endsWith("tiles not available")?l(void 0):o?(d.consumer.ctx=null,r(c),this.mapboxRenderer.releaseRender(d),this._resetTileCache()):r(d)})})}pickFeatures(i,e,n,o,s){var r;if(this._enablePickFeatures)return(r=this.requestImage(i,e,n,!1))==null?void 0:r.then(l=>{let c=this.mapboxRenderer.getVisibleSources(n);c=this.sourceFilter?this.sourceFilter(c):c;const u=[],d=we.Math.toDegrees(o),p=we.Math.toDegrees(s);return c.forEach(f=>{const g=new we.ImageryLayerFeatureInfo;g.data=this.mapboxRenderer.queryRenderedFeatures({source:f,renderedZoom:n,lng:d,lat:p,tileZ:n});const v=Object.keys(g.data)[0];g.name=v;const y=g.data[v];y&&(g.configureDescriptionFromProperties((y==null?void 0:y.length)===1?y[0]:y),u.push(g))}),l.consumer.ctx=void 0,this.mapboxRenderer.releaseRender(l),this._resetTileCache(),u.length?u:void 0})}destroy(){this.mapboxRenderer._cancelAllPendingRenders(),this._resetTileCache(),this._destroyed=!0}}function Xx(t,i){let e;return i===0?e=h.JulianDate.toIso8601(t.stop):e=h.JulianDate.toIso8601(t.start),{Time:e}}function iy(t){if(t.type==="fromIso8601")return h.TimeIntervalCollection.fromIso8601({iso8601:t.iso8601,isStartIncluded:t.isStartIncluded,isStopIncluded:t.isStopIncluded,leadingInterval:t.leadingInterval,trailingInterval:t.trailingInterval,dataCallback:Xx})}const{getStrFromEnv:ph}=a.ESSceneObject.context;function Yx(t){const i=Object.entries(t).map(([e,n])=>{try{const o=n&&Function(`"use strict";return (${n})`)();return[e,o]}catch(o){console.error(`getCustomTagsFromJson error: ${o}`,o);return}}).filter(e=>!!e);return Object.fromEntries(i)}async function Zx(t,i,e){var n,o;if(t.type==="WebMapTileServiceImageryProvider")return new h.WebMapTileServiceImageryProvider({url:jt(t.url),format:t.format??"image/jpeg",layer:t.layer,style:t.style,tileMatrixSetID:t.tileMatrixSetID,tileMatrixLabels:t.tileMatrixLabels,clock:t.times&&((n=i.viewer)==null?void 0:n.clock),times:t.times&&iy(t.times),dimensions:t.dimensions,tileWidth:t.tileWidth??256,tileHeight:t.tileHeight??256,tilingScheme:t.tilingScheme&&di(t.tilingScheme),rectangle:t.rectangle&&Ve(t.rectangle),minimumLevel:t.minimumLevel??0,maximumLevel:t.maximumLevel,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit,subdomains:t.subdomains});if(t.type==="TileMapServiceImageryProvider")return t.url?await h.TileMapServiceImageryProvider.fromUrl(jt(t.url),{fileExtension:t.fileExtension,credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ve(t.rectangle),tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,flipXY:t.flipXY}):void 0;if(t.type==="UrlTemplateImageryProvider"){const s=t.customTags&&Yx(t.customTags);return new h.UrlTemplateImageryProvider({url:jt(t.url),credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ve(t.rectangle),tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,subdomains:t.subdomains,hasAlphaChannel:t.hasAlphaChannel,pickFeaturesUrl:t.pickFeaturesUrl,enablePickFeatures:t.enablePickFeatures,urlSchemeZeroPadding:t.urlSchemeZeroPadding,customTags:s})}else{if(t.type==="GridImageryProvider")return new h.GridImageryProvider({tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,cells:t.cells,color:t.color&&te(t.color),glowColor:t.glowColor&&te(t.glowColor),backgroundColor:t.backgroundColor&&te(t.backgroundColor),canvasSize:t.canvasSize,glowWidth:t.glowWidth});if(t.type==="ArcGisMapServerImageryProvider")return t.url?await h.ArcGisMapServerImageryProvider.fromUrl(jt(t.url),{token:t.token,usePreCachedTilesIfAvailable:t.usePreCachedTilesIfAvailable,layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ve(t.rectangle),tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit,tileWidth:t.tileWidth,tileHeight:t.tileHeight,maximumLevel:t.maximumLevel}):void 0;if(t.type==="BingMapsImageryProvider")return t.url?await h.BingMapsImageryProvider.fromUrl(jt(t.url),{key:t.key,tileProtocol:t.tileProtocol,mapStyle:t.mapStyle&&h.BingMapsStyle[t.mapStyle],culture:t.culture,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid)}):void 0;if(t.type==="GoogleEarthEnterpriseImageryProvider"){if(!t.url)return;const s=await h.GoogleEarthEnterpriseMetadata.fromUrl(jt(t.url));return await h.GoogleEarthEnterpriseImageryProvider.fromMetadata(s,{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}else{if(t.type==="IonImageryProvider")return await h.IonImageryProvider.fromAssetId(t.assetId,{accessToken:t.accessToken,server:t.server});if(t.type==="MapboxImageryProvider")return new h.MapboxImageryProvider({url:t.url&&ph(t.url),mapId:t.mapId,accessToken:t.accessToken,format:t.format,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ve(t.rectangle),credit:t.credit});if(t.type==="MapboxStyleImageryProvider")return new h.MapboxStyleImageryProvider({url:t.url&&ph(t.url),username:t.username,styleId:t.styleId,accessToken:t.accessToken,tilesize:t.tilesize,scaleFactor:t.scaleFactor,rectangle:t.rectangle&&Ve(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel});if(t.type==="OpenStreetMapImageryProvider")return new h.OpenStreetMapImageryProvider({url:ph(t.url),rectangle:t.rectangle&&Ve(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,fileExtension:t.fileExtension});if(t.type==="SingleTileImageryProvider")return new h.SingleTileImageryProvider({url:jt(t.url),rectangle:t.rectangle&&Ve(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid)});if(t.type==="TileCoordinatesImageryProvider")return new h.TileCoordinatesImageryProvider({tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),color:t.color&&te(t.color),tileWidth:t.tileWidth,tileHeight:t.tileHeight});if(t.type==="WebMapServiceImageryProvider")return new h.WebMapServiceImageryProvider({url:jt(t.url),layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ve(t.rectangle),tilingScheme:t.tilingScheme&&di(t.tilingScheme),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,tileWidth:t.tileWidth,tileHeight:t.tileHeight,crs:t.crs,srs:t.srs,credit:t.credit,subdomains:t.subdomains,clock:t.times&&((o=i.viewer)==null?void 0:o.clock),times:t.times&&iy(t.times),parameters:t.parameters,getFeatureInfoParameters:t.getFeatureInfoParameters});if(t.type==="BDImageryProvider")return new dh({url:t.url&&ph(t.url),ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),wgs84:t.wgs84});if(t.type==="GeHistoryImagery")return new Ux({indexTime:t.indexTime});if(t.type==="ArcgisHistoryImagery")return new Hx({indexTimeID:t.indexTimeID});if(t.type==="MVTImageryProvider")return t.url?await Fd.fromUrl(t.url,{maximumLevel:t.maximumLevel,minimumLevel:t.minimumLevel,tileSize:t.tileSize,accessToken:t.accessToken,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ve(t.rectangle),layerStyle:t.style,scheme:t.scheme,viewer:i.viewer,esSceneObjectId:e}):void 0}}}function Qx(t,i){i.type}class ny extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(s){var r={};return r=Dd(h.Math.toDegrees(s.longitude),h.Math.toDegrees(s.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(r[0]),h.Math.toRadians(r[1])))},e.s_unproject=e.unproject,e.unproject=function(s){var r=e.s_unproject(s),l={};return l=Md(h.Math.toDegrees(r.longitude),h.Math.toDegrees(r.latitude)),new h.Cartographic(h.Math.toRadians(l[0]),h.Math.toRadians(l[1]))};var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new h.Rectangle(n.longitude,n.latitude,o.longitude,o.latitude)}}class oy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(n){var o={};return o=Md(h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(o[0]),h.Math.toRadians(o[1])))},e.s_unproject=e.unproject,e.unproject=function(n){var o=e.s_unproject(n),s={};return s=Dd(h.Math.toDegrees(o.longitude),h.Math.toDegrees(o.latitude)),new h.Cartographic(h.Math.toRadians(s[0]),h.Math.toRadians(s[1]))}}}function kx(t){if(t.type==="GeographicTilingScheme")return"new Cesium.GeographicTilingScheme()";if(t.type==="WebMercatorTilingScheme")return"new Cesium.WebMercatorTilingScheme()"}class Bn extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_innerImageryProvider",this.disposeVar(a.react(void 0)));m(this,"_layer",this.disposeVar(a.react(void 0)));const o=e.viewer;if(!o)return;const s=Ke(o);if(!s)return;const{imageriesManager:r}=s;r.add(this),this.dispose(()=>{r.has(this)&&r.delete(this)});const l=()=>{this.layer&&(this.layer=void 0)};this.dispose(l);const c=()=>{this.layer&&(this.layer.alpha=this.alpha??1,this.layer.nightAlpha=this.nightAlpha??1,this.layer.dayAlpha=this.dayAlpha??1,this.layer.brightness=this.brightness??1,this.layer.contrast=this.contrast??1,this.layer.hue=this.hue??0,this.layer.saturation=this.saturation??1,this.layer.gamma=this.gamma??1,this.layer.splitDirection=this.splitDirection&&h.SplitDirection[this.splitDirection]||h.SplitDirection.NONE,this.layer.minificationFilter=this.minificationFilter&&h.TextureMinificationFilter[this.minificationFilter]||h.TextureMinificationFilter.LINEAR,this.layer.magnificationFilter=this.magnificationFilter&&h.TextureMagnificationFilter[this.magnificationFilter]||h.TextureMagnificationFilter.LINEAR,this.layer.show=this.show??!0,this.layer.maximumAnisotropy=this.maximumAnisotropy,this.layer.minimumTerrainLevel=this.minimumTerrainLevel,this.layer.maximumTerrainLevel=this.maximumTerrainLevel,this.layer.colorToAlpha=this.colorToAlpha&&toColor(this.colorToAlpha),this.layer.colorToAlphaThreshold=this.colorToAlphaThreshold??.004,this.imageryProvider&&Qx(this.layer.imageryProvider,this.imageryProvider))};let u=!1;const d=this.disposeVar(a.createProcessingFromAsyncFunc(async(y,w)=>{if(w){if(u=!0,l(),!this.innerImageryProvider)return;const P=await y.promise(Zx(this.innerImageryProvider,e,n));if(!P)return;this.layer=new h.ImageryLayer(P),h.ImageryLayer.prototype&&(this.layer.ESSceneObjectID=n),u=!1}c()}));d.restart(void 0,!0);const p=this.disposeVar(new a.Event),f=this.disposeVar(new a.Event);this.ad(this.layerChanged.don(()=>{if(!this.innerImageryProvider||!this.layer||!Reflect.has(this.innerImageryProvider,"rectangle")||this.innerImageryProvider.rectangle[0]!=this.imageryProvider.rectangle[0]||this.innerImageryProvider.rectangle[1]!=this.imageryProvider.rectangle[1]||this.innerImageryProvider.rectangle[2]!=this.imageryProvider.rectangle[2]||this.innerImageryProvider.rectangle[3]!=this.imageryProvider.rectangle[3])return;const y=this.layer.imageryProvider.tilingScheme.rectangle,w=this.innerImageryProvider.rectangle&&Ve(this.innerImageryProvider.rectangle);(w.west<y.west||w.south<y.south||w.east>y.east||w.north>y.north)&&(this.innerImageryProvider.rectangle=[h.Math.toDegrees(Math.max(y.west,parseFloat(w.west.toFixed(7)))),h.Math.toDegrees(Math.max(y.south,parseFloat(w.south.toFixed(7)))),h.Math.toDegrees(Math.min(y.east,parseFloat(w.east.toFixed(7)))),h.Math.toDegrees(Math.min(y.north,parseFloat(w.north.toFixed(7))))],p.emit())})),this.dispose(this.imageryProviderChanged.disposableOn(()=>{this.innerImageryProvider=structuredClone(this.imageryProvider),p.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{p.emit()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.rectangleChanged,p));this.dispose(g.disposableOn(()=>{d.restart(void 0,!0)}));const v=this.disposeVar(a.createNextAnimateFrameEvent(this.alphaChanged,this.nightAlphaChanged,this.dayAlphaChanged,this.brightnessChanged,this.contrastChanged,this.hueChanged,this.saturationChanged,this.gammaChanged,this.splitDirectionChanged,this.minificationFilterChanged,this.magnificationFilterChanged,this.showChanged,this.maximumAnisotropyChanged,this.minimumTerrainLevelChanged,this.maximumTerrainLevelChanged,this.cutoutRectangleChanged,this.colorToAlphaChanged,this.colorToAlphaThresholdChanged,f));this.dispose(v.disposableOn(()=>{u||d.restart(void 0,!1)})),this.dispose(this.flyToEvent.disposableOn(y=>{if(!e.actived)return;const{viewer:w}=e;w&&(this.rectangle&&!bu(this.rectangle)?w.camera.flyTo({destination:Ve(this.rectangle),duration:y}):w.camera.flyHome(y))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get innerImageryProvider(){return this._innerImageryProvider.value}set innerImageryProvider(e){this._innerImageryProvider.value=e}get innerImageryProviderChanged(){return this._innerImageryProvider.changed}get layer(){return this._layer.value}set layer(e){this._layer.value=e}get layerChanged(){return this._layer.changed}}m(Bn,"defaults",{show:!0,rectangle:[-180,-90,180,90],alpha:1,nightAlpha:1,dayAlpha:1,brightness:1,contrast:1,hue:0,saturation:1,gamma:1,splitDirection:"NONE",minificationFilter:"LINEAR",magnificationFilter:"LINEAR",maximumAnisotropy:0,minimumTerrainLevel:0,maximumTerrainLevel:0,cutoutRectangle:[1,1,1,1],colorToAlpha:[1,1,1,.5],colorToAlphaThreshold:.004,imageryProvider:{type:"TileMapServiceImageryProvider"},zIndex:0,hasAlphaChannel:!0,pickFeaturesUrl:""}),(t=>{t.createDefaultProps=()=>({show:void 0,rectangle:a.reactArrayWithUndefined(void 0),alpha:void 0,nightAlpha:void 0,dayAlpha:void 0,brightness:void 0,contrast:void 0,hue:void 0,saturation:void 0,gamma:void 0,splitDirection:void 0,minificationFilter:void 0,magnificationFilter:void 0,maximumAnisotropy:void 0,minimumTerrainLevel:void 0,maximumTerrainLevel:void 0,cutoutRectangle:a.reactArrayWithUndefined(void 0),colorToAlpha:a.reactArrayWithUndefined(void 0),colorToAlphaThreshold:void 0,imageryProvider:a.reactJsonWithUndefined(void 0),zIndex:0,hasAlphaChannel:void 0,pickFeaturesUrl:void 0,targetID:void 0})})(Bn||(Bn={})),a.extendClassProps(Bn.prototype,Bn.createDefaultProps);const zd=h.ApproximateTerrainHeights,Kx=h.ComponentDatatype,dt=h.defined,Jx=h.destroyObject,Ld=h.DeveloperError,jx=h.deprecationWarning,eA=h.GeometryInstance,tA=h.GeometryInstanceAttribute,iA=h.GroundPolylineGeometry,Hr=h.DrawCommand,sy=h.Pass,ry=h.RenderState,nA=h.ShaderProgram,$r=h.ShaderSource;let Nd=h._shadersPolylineShadowVolumeFS;const oA=h._shadersPolylineShadowVolumeMorphFS,sA=h._shadersPolylineShadowVolumeMorphVS;let Od=h._shadersPolylineShadowVolumeVS;const ay=h.BlendingState,Bd=h.ClassificationType,rA=h.CullFace,ly=h.PolylineColorAppearance,aA=h.PolylineMaterialAppearance,Vn=h.Primitive,Ts=h.SceneMode,cy=h.StencilConstants,hy=h.StencilFunction,Is=h.StencilOperation;Od=Od.replace("width = width * max(0.0, czm_metersPerPixel(positionEC));",""),Nd=Nd.replace("float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);","float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w;");function Ti(t){t=t??h.Frozen.EMPTY_OBJECT,this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let i=t.appearance;dt(i)||(i=new aA),this.appearance=i,this.show=t.show??!0,this.classificationType=t.classificationType??Bd.BOTH,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._debugShowShadowVolume=t.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:t.interleave??!1,releaseGeometryInstances:t.releaseGeometryInstances??!0,allowPicking:t.allowPicking??!0,asynchronous:t.asynchronous??!0,compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;const e=this;this._readyPromise=new Promise((n,o)=>{e._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const s=this._error;dt(s)?o(s):n(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=uy(!1),this._renderState3DTiles=uy(!0),this._renderStateMorph=ry.fromCache({cull:{enabled:!0,face:rA.FRONT},depthTest:{enabled:!0},blending:ay.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Ti.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return jx("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),Ti.initializeTerrainHeights=function(){return zd.initialize()};function lA(t,i,e){const n=i.context,o=t._primitive,s=o._attributeLocations;let r=o._batchTable.getVertexShaderCallback()(Od);r=Vn._appendShowToShader(o,r),r=Vn._appendDistanceDisplayConditionToShader(o,r),r=Vn._modifyShaderPosition(t,r,i.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(sA);l=Vn._appendShowToShader(o,l),l=Vn._appendDistanceDisplayConditionToShader(o,l),l=Vn._modifyShaderPosition(t,l,i.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Nd);const u=[`GLOBE_MINIMUM_ALTITUDE ${i.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let d="",p="";dt(e.material)?(p=dt(e.material)?e.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",u.push(d);const f=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],g=new $r({defines:u,sources:[r]}),v=new $r({defines:f,sources:[p,c]});t._sp=nA.replaceCache({context:n,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:s});let y=n.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!dt(y)){const P=new $r({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[r]});y=n.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:n,shaderProgram:t._sp2D,vertexShaderSource:P,fragmentShaderSource:v,attributeLocations:s})}t._sp2D=y;let w=n.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!dt(w)){const P=new $r({defines:u.concat([`MAX_TERRAIN_HEIGHT ${zd._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[l]});c=o._batchTable.getVertexShaderCallback()(oA);const C=new $r({defines:f,sources:[p,c]});w=n.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:n,shaderProgram:t._spMorph,vertexShaderSource:P,fragmentShaderSource:C,attributeLocations:s})}t._spMorph=w}function uy(t){return ry.fromCache({cull:{enabled:!0},blending:ay.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:hy.EQUAL,frontOperation:{fail:Is.KEEP,zFail:Is.KEEP,zPass:Is.KEEP},backFunction:hy.EQUAL,backOperation:{fail:Is.KEEP,zFail:Is.KEEP,zPass:Is.KEEP},reference:cy.CESIUM_3D_TILE_MASK,mask:cy.CESIUM_3D_TILE_MASK}})}function cA(t,i,e,n,o,s){const r=t._primitive,l=r._va.length;o.length=l,s.length=l;const u=i instanceof ly?{}:e._uniforms,d=r._batchTable.getUniformMapCallback()(u);for(let p=0;p<l;p++){const f=r._va[p];let g=o[p];dt(g)||(g=o[p]=new Hr({owner:t,primitiveType:r._primitiveType})),g.vertexArray=f,g.renderState=t._renderState,g.shaderProgram=t._sp,g.uniformMap=d,g.pass=sy.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const v=Hr.shallowClone(g,g.derivedCommands.tileset);v.renderState=t._renderState3DTiles,v.pass=sy.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=v;const y=Hr.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=t._sp2D,g.derivedCommands.color2D=y;const w=Hr.shallowClone(v,v.derivedCommands.color2D);w.shaderProgram=t._sp2D,v.derivedCommands.color2D=w;const P=Hr.shallowClone(g,g.derivedCommands.colorMorph);P.renderState=t._renderStateMorph,P.shaderProgram=t._spMorph,P.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=P}}function dy(t,i,e,n,o,s,r){e.mode===Ts.MORPHING?i=i.derivedCommands.colorMorph:e.mode!==Ts.SCENE3D&&(i=i.derivedCommands.color2D),i.modelMatrix=n,i.boundingVolume=s,i.cull=o,i.debugShowBoundingVolume=r,e.commandList.push(i)}function hA(t,i,e,n,o,s,r){const l=t._primitive;Vn._updateBoundingVolumes(l,i,o);let c;i.mode===Ts.SCENE3D?c=l._boundingSphereWC:i.mode===Ts.COLUMBUS_VIEW?c=l._boundingSphereCV:i.mode===Ts.SCENE2D&&dt(l._boundingSphere2D)?c=l._boundingSphere2D:dt(l._boundingSphereMorph)&&(c=l._boundingSphereMorph);const u=i.mode===Ts.MORPHING,d=t.classificationType,p=d!==Bd.CESIUM_3D_TILE,f=d!==Bd.TERRAIN&&!u;let g;const v=i.passes;if(v.render||v.pick&&l.allowPicking){const y=e.length;for(let w=0;w<y;++w){const P=c[w];p&&(g=e[w],dy(t,g,i,o,s,P,r)),f&&(g=e[w].derivedCommands.tileset,dy(t,g,i,o,s,P,r))}}}Ti.prototype.update=function(t){if(!dt(this._primitive)&&!dt(this.geometryInstances))return;if(!zd.initialized){if(!this.asynchronous)throw new Ld("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");Ti.initializeTerrainHeights();return}let i;const e=this,n=this._primitiveOptions;if(!dt(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],s=o.length,r=new Array(s);let l;for(i=0;i<s;++i)if(l=o[i].attributes,!dt(l)||!dt(l.color)){this._hasPerInstanceColors=!1;break}for(i=0;i<s;++i){const c=o[i];l={};const u=c.attributes;for(const d in u)u.hasOwnProperty(d)&&(l[d]=u[d]);dt(l.width)||(l.width=new tA({componentDatatype:Kx.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=t.scene3DOnly,iA.setProjectionAndEllipsoid(c.geometry,t.mapProjection),r[i]=new eA({geometry:c.geometry,attributes:l,id:c.id,pickPrimitive:e})}n.geometryInstances=r,n.appearance=this.appearance,n._createShaderProgramFunction=function(c,u,d){lA(e,u,d)},n._createCommandsFunction=function(c,u,d,p,f,g,v){cA(e,u,d,p,g,v)},n._updateAndQueueCommandsFunction=function(c,u,d,p,f,g,v,y){hA(e,u,d,p,f,g,v)},this._primitive=new Vn(n)}if(this.appearance instanceof ly&&!this._hasPerInstanceColors)throw new Ld("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(t),t.afterRender.push(()=>{!this._ready&&dt(this._primitive)&&this._primitive.ready&&this._completeLoad()})},Ti.prototype.getGeometryInstanceAttributes=function(t){if(!dt(this._primitive))throw new Ld("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},Ti.isSupported=function(t){return t.frameState.context.depthTexture},Ti.prototype.isDestroyed=function(){return!1},Ti.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,Jx(this)};class xo extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.globe,o=-414,s=8777;let r={};const l=()=>{var p,f,g,v,y;if(!e)return;let u;const d=this.shadingMode||"none";if((this.show??!0)&&!(d==="none"&&!this.enableContour)){let w;this.enableContour?(d==="elevation"?(u=uA(),w=u.materials.elevationRampMaterial.uniforms,w.minimumHeight=((p=this.elevationParam)==null?void 0:p.minHeight)??o,w.maximumHeight=((f=this.elevationParam)==null?void 0:f.maxHeight)??s,r=u.materials.contourMaterial.uniforms):d==="slope"?(u=dA(),w=u.materials.slopeRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):d==="aspect"?(u=pA(),w=u.materials.aspectRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):(u=h.Material.fromType("ElevationContour"),r=u.uniforms),r.width=this.contourWidth,r.spacing=this.contourSpacing,r.color=h.Color.fromCartesian4(h.Cartesian4.fromArray(this.contourColor))):d==="elevation"?(u=h.Material.fromType("ElevationRamp"),w=u.uniforms,w.minimumHeight=((g=this.elevationParam)==null?void 0:g.minHeight)??o,w.maximumHeight=((v=this.elevationParam)==null?void 0:v.maxHeight)??s):d==="slope"?(u=h.Material.fromType("SlopeRamp"),w=u.uniforms):d==="aspect"&&(u=h.Material.fromType("AspectRamp"),w=u.uniforms),d!=="none"&&(w.image=py(d),d==="elevation"&&((y=this.elevationParam)==null?void 0:y.color)!==void 0&&(w.image=Array.isArray(this.elevationParam.color)?py(d,this.elevationParam.color):this.elevationParam.color))}n.material=u};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.contourColorChanged,this.contourSpacingChanged,this.contourWidthChanged,this.enableContourChanged,this.shadingModeChanged,this.showChanged,this.elevationParamChanged));this.dispose(c.disposableOn(l)),this.dispose(()=>n.material=void 0)}}m(xo,"defaults",{show:!1,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],shadingMode:"none"}),(t=>{t.createDefaultProps=()=>({show:void 0,shadingMode:void 0,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],elevationParam:a.reactJsonWithUndefined(void 0)})})(xo||(xo={})),a.extendClassProps(xo.prototype,xo.createDefaultProps);function uA(){return new h.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1})}function dA(){return new h.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1})}function pA(){return new h.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1})}const fA=[0,.045,.1,.15,.37,.54,1],gA=[0,.29,.5,Math.sqrt(2)/2,.87,.91,1],mA=[0,.2,.4,.6,.8,.9,1];function py(t,i){const e=document.createElement("canvas");e.width=100,e.height=1;const n=e.getContext("2d");let o;if(t==="elevation")o=fA;else if(t==="slope")o=gA;else if(t==="aspect")o=mA;else throw new Error("values未赋值!");const s=n.createLinearGradient(0,0,100,0);return s.addColorStop(o[0],i!=null&&i[0]?_n(i==null?void 0:i[0]):"#000000"),s.addColorStop(o[1],i!=null&&i[1]?_n(i==null?void 0:i[1]):"#2747E0"),s.addColorStop(o[2],i!=null&&i[2]?_n(i==null?void 0:i[2]):"#D33B7D"),s.addColorStop(o[3],i!=null&&i[3]?_n(i==null?void 0:i[3]):"#D33038"),s.addColorStop(o[4],i!=null&&i[4]?_n(i==null?void 0:i[4]):"#FF9742"),s.addColorStop(o[5],i!=null&&i[5]?_n(i==null?void 0:i[5]):"#ffd700"),s.addColorStop(o[6],i!=null&&i[6]?_n(i==null?void 0:i[6]):"#ffffff"),n.fillStyle=s,n.fillRect(0,0,100,1),e}class Ms extends a.Destroyable{constructor(e){super();m(this,"_geoPath");m(this,"_geoPolyline");m(this,"_geoCanvasPointPoi");m(this,"_player");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));m(this,"_ratio",this.disposeVar(a.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new a.ESPathImpl),this._geoPolyline=this.disposeVar(new xe(e)),this._geoCanvasPointPoi=this.disposeVar(new Sn(e)),this._player=this.disposeVar(new a.Player),this._geoPolyline.show=!1,this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(a.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPath,"show"],[this,"show"])),this.dispose(a.track([this._geoPath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.track([this._geoPath,"width"],[this,"width"])),this.dispose(a.track([this._geoPath,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPath,"color"],[this,"color"])),this.dispose(a.track([this._geoPath,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPath,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPath,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPath,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPath,"allowPicking"],[this,"allowPicking"]));{const n=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};n(),this.dispose(this.showChanged.disposableOn(n)),this.dispose(this.currentPoiShowChanged.disposableOn(n))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const n=()=>{if(this.positions){const s=this.granularity*Math.PI/180,r=mu(this.positions,this.arcType??"GEODESIC",s);if(r){this._geoPath.timePosRots=r.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};n();const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(o.disposableOn(n))}{const n=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const o=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(o-this.currentDistance)>.01&&(this.currentDistance=o)};n(),this.dispose(this._player.currentTimeChanged.disposableOn(n))}{const n=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const o=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(o-(this._player.currentTime??0))>.01&&(this._player.currentTime=o)};n(),this.dispose(this.currentDistanceChanged.disposableOn(n))}this.dispose(a.bind([this._player,"loop"],[this,"loop"])),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._player,"duration"],[this,"duration"])),this.dispose(a.bind([this._player,"playing"],[this,"playing"])),this.dispose(a.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(n=>{this._geoPolyline.flyTo(n)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(s=>s[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Ms||(Ms={})),a.extendClassProps(Ms.prototype,Ms.createDefaultProps);class me extends Jt{constructor(e,n){super(e,n);m(this,"_smoothMoving");if(this._smoothMoving=this.disposeVar(new a.SmoothMoveController(this.czmViewer)),this.d(this._smoothMoving.currentPositionChanged.don(s=>{s&&(this.sceneObject.position=s)})),this.d(this._smoothMoving.currentRotationChanged.don(s=>{s&&this._smoothMoving.isRotating&&(this.sceneObject.rotation=s)})),this.d(this._smoothMoving.currentHeadingChanged.don(s=>{if(s!==void 0&&!this._smoothMoving.isRotating){const r=this.sceneObject.rotation;this.sceneObject.rotation=[s-90,r[1],r[2]]}})),!n.viewer){console.warn("viewer is undefined!");return}this.d(e.smoothMoveEvent.don((s,r)=>{this.smoothMove(s,r*1e3)})),this.d(e.smoothMoveWithRotationEvent.don((s,r,l)=>{this.smoothMoveWithRotation(s,r,l*1e3)})),this.d(e.smoothMoveOnGroundEvent.don((s,r,l)=>{this.smoothMoveOnGround(s,r,l*1e3)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((s,r,l,c)=>{this.smoothMoveWithRotationOnGround(s,r,l,c*1e3)})),this.d(e.calcFlyToParamEvent.don(()=>{if(!e.useCalcFlyToParamInESObjectWithLocation)return;if(!e.position){console.warn(`!sceneObject(${e.name}-${e.id}).position`);return}const s=n.calcFlyToParam(e.position);if(!s){console.warn("czmViewer.calcFlyToParam error.");return}e.flyToParam=s})),this.d(e.automaticLandingEvent.don(async s=>{const r=[e.position[0],e.position[1]],l=await n.getTerrainHeight(r);l?e.position=[...r,l]:console.warn("不存在相交"),e.collision=s})),this.d(a.createEventsCallFunc([e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged,n.cameraChanged],()=>this.visibleDistance(e,n)))}smoothMove(e,n){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,this.sceneObject.rotation,n)}smoothMoveWithRotation(e,n,o){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,n,o)}async smoothMoveOnGround(e,n,o){const s=await this.czmViewer.getTerrainHeight([e,n])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([e,n,s],this.sceneObject.rotation,o)}async smoothMoveWithRotationOnGround(e,n,o,s){const r=await this.czmViewer.getTerrainHeight([n,o])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([n,o,r],e,s)}visibleDistance(e,n){var s;if(!e.show||!((s=n.viewer)!=null&&s.camera))return;const o=me.getInnerCzmObjects(this);if(o.length!=0){const r=a.getDistancesFromPositions([e.position,Ht(n.viewer.camera)],"NONE")[0];let l=!1;e.minVisibleDistance<e.maxVisibleDistance?l=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(l=r>e.minVisibleDistance),o.forEach(c=>{if(c instanceof Ne)return;const u=e.show&&l;Reflect.has(c,"showHelper")&&(c.showHelper=u),Reflect.has(c,"enabled")&&(c.enabled=u),Reflect.has(c,"show")&&(c.show=u)})}}static getInnerCzmObjects(e){const n=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(!o.includes("czmViewer")&&o.includes("czm")||!Number.isNaN(+o)?Array.isArray(e[o])?n.push(...me.getInnerCzmObjects(e[o])):n.push(e[o]):e[o]&&e[o].obj&&n.push(...me.getInnerCzmObjects(e[o].obj)));return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&o.position){const{position:r,flyToParam:l}=o,{distance:c,heading:u,pitch:d,flyDuration:p,hDelta:f,pDelta:g}=l;return this.flyToWithPromise(n,r,c,[u,d,0],e??p,f,g),!0}return super.flyTo(e,n)}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(!o.flyInParam&&o.position&&o.rotation){const r=e??1,l=[...o.rotation];return l[0]+=90,this.flyToWithPromise(n,o.position,void 0,l,r),!0}return super.flyIn(e,n)}}class yt extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}class qr extends me{constructor(e,n){super(e,n);m(this,"_lastHoverResult",this.disposeVar(a.react(void 0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.ad(a.createProcessingFromAsyncFunc(async(r,l)=>{const c=await r.promise(n.pick(l.screenPosition,"innerHoverEvent"));this.lastHoverResult=Object.assign({},c,l)}));this.ad(n.pointerMoveEvent.don(async r=>{!s.isRunning&&s.restart(void 0,r)}))}get lastHoverResult(){return this._lastHoverResult.value}set lastHoverResult(e){this._lastHoverResult.value=e}get lastHoverResultChanged(){return this._lastHoverResult.changed}}class fh extends me{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}function vA(t,i,e){const n=t,o=i,s=(o[0]-n[0]+(o[1]-n[1]))/4,r=[[n[0],0,n[1]],[o[0],0,n[1]],[o[0],0,o[1]],[n[0],0,o[1]],[0,s,0]],l=h.Math.toDegrees,c=r.map(d=>{const p=h.Matrix4.multiplyByPoint(e,h.Cartesian3.fromElements(...d),new h.Cartesian3),f=h.Cartographic.fromCartesian(p);return[l(f.longitude),l(f.latitude),f.height]});return[[[c[0],c[1],c[2],c[3],c[0]]],c[4]]}class Ao extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_polylines");m(this,"_axis");n&&(this.id=n),this._polylines=this.disposeVar(new qt(e,n)),this._axis=this.disposeVar(new xe(e,n)),this._axis.hasArrow=!0,this._axis.width=10,this._polylines.arcType=this._axis.arcType="NONE",this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Me)||!e.actived)return;if(!this.position){console.warn("CzmPlane warning: 没有位置,无法飞入!");return}const s=this.minSize,r=this.maxSize,l=[r[0]-s[0],r[1]-s[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);ne(e.viewer,this.position,c*2,void 0,o)}));{const o=()=>{let r=[],l;if(this.position){const c=Re({position:this.position,rotation:this.rotation});if(c){const u=vA(this.minSize,this.maxSize,c);r=u[0],l=u[1]}}this.polylines.positions=r,!(!this.position||!l)&&(this.axis.positions=[this.position,l])};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(s.disposableOn(o))}this.dispose(a.track([this.polylines,"color"],[this,"color"])),this.dispose(a.track([this.polylines,"width"],[this,"width"])),this.dispose(a.track([this.polylines,"show"],[this,"show"])),this.dispose(a.track([this.axis,"color"],[this,"color"]));{const o=()=>{this.axis.show=this.show&&this.showArrow};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.showArrowChanged.disposableOn(o))}}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylines(){return this._polylines}get axis(){return this._axis}}m(Ao,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,showArrow:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),color:a.reactArray([1,1,1,1]),width:2,minSize:a.reactArray([-100,-100]),maxSize:a.reactArray([100,100])})})(Ao||(Ao={})),a.extendClassProps(Ao.prototype,Ao.createDefaultProps);class yA extends a.Destroyable{constructor(e,n,o){super();m(this,"_centerMatrix",this.disposeVar(a.react(void 0)));m(this,"_inverseCenterMatrix",this.disposeVar(a.react(void 0)));m(this,"_czmPlaneWrappers");m(this,"_czmPlaneWrappersChanged",this.disposeVar(a.createNextAnimateFrameEvent()));m(this,"_computedPlanesChanged",this.disposeVar(a.createNextAnimateFrameEvent()));this._czmClippingPlanes=n,this._planeIds=o,this._czmPlaneWrappers=this._planeIds.map(s=>this.disposeVar(new CA(e,this,s)));{const s=()=>{let r,l;const c=this._czmPlaneWrappers.filter(u=>u.position&&u.rotation);if(c.length!==0){const u=c.map(p=>p.position),d=a.getMinMaxCorner(u);r=Re({position:d.center}),r&&(l=h.Matrix4.inverseTransformation(r,new h.Matrix4))}this.centerMatrix=r,this.inverseCenterMatrix=l};s(),this.dispose(this.czmPlaneWrappersChanged.disposableOn(s))}{const s=()=>{if(!this.centerMatrix){this._czmClippingPlanes.computedClippingPlanes=void 0;return}const l=h.Matrix4.toArray(this.centerMatrix),c=this._czmPlaneWrappers.filter(u=>!!u.computedPlane).map(u=>u.computedPlane);this._czmClippingPlanes.computedClippingPlanes={planes:c,enabled:this._czmClippingPlanes.enabled,modelMatrix:l,unionClippingRegions:this._czmClippingPlanes.unionClippingRegions,edgeColor:this._czmClippingPlanes.edgeColor,edgeWidth:this._czmClippingPlanes.edgeWidth}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._czmClippingPlanes.enabledChanged,this.centerMatrixChanged,this.inverseCenterMatrixChanged,this.computedPlanesChanged,this._czmClippingPlanes.unionClippingRegionsChanged,this._czmClippingPlanes.edgeColorChanged,this._czmClippingPlanes.edgeWidthChanged));this.dispose(r.disposableOn(s))}}get centerMatrix(){return this._centerMatrix.value}set centerMatrix(e){this._centerMatrix.value=e}get centerMatrixChanged(){return this._centerMatrix.changed}get inverseCenterMatrix(){return this._inverseCenterMatrix.value}set inverseCenterMatrix(e){this._inverseCenterMatrix.value=e}get inverseCenterMatrixChanged(){return this._inverseCenterMatrix.changed}get czmPlaneWrappers(){return this._czmPlaneWrappers}get czmPlaneWrappersChanged(){return this._czmPlaneWrappersChanged}get computedPlanesChanged(){return this._computedPlanesChanged}get czmClippingPlanes(){return this._czmClippingPlanes}}class wA extends a.Destroyable{constructor(i,e){super(),this._czmPlaneWrapper=i,this._czmPlane=e,this._czmPlaneWrapper.position=this._czmPlane.position,this.dispose(()=>this._czmPlaneWrapper.position=void 0),this.dispose(a.track([this._czmPlaneWrapper,"position"],[this._czmPlane,"position"])),this._czmPlaneWrapper.rotation=this._czmPlane.rotation,this.dispose(()=>this._czmPlaneWrapper.rotation=[0,0,0]),this.dispose(a.track([this._czmPlaneWrapper,"rotation"],[this._czmPlane,"rotation"]))}}class CA extends a.Destroyable{constructor(e,n,o){super();m(this,"_sowi");m(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_rotation",this.disposeVar(a.reactArray([0,0,0])));m(this,"_computedPlane",this.disposeVar(a.reactJson(void 0)));this._planesResetting=n,this._planeId=o,this._sowi=this.disposeVar(new a.ESSceneObjectWithId),this._sowi.id=this._planeId,this.disposeVar(new a.ObjResettingWithEvent(this.sowi.sceneObjectChanged,()=>{const{sceneObject:s}=this.sowi;if(!s)return;let r;a.engineObjectCreatedUpdate(this,s,()=>{const l=e.getEngineObject(s);if(s instanceof a.ESClippingPlane&&(r=l.czmPlane),!!r&&r instanceof Ao)return new wA(this,r)})})),this.dispose(this.positionChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next())),this.dispose(this.rotationChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next()));{const s=()=>{const{inverseCenterMatrix:l}=this._planesResetting;if(!l)return this.computedPlane=void 0;const{position:c,rotation:u}=this;if(!c)return this.computedPlane=void 0;const d=Re({position:c,rotation:u});if(!d)return this.computedPlane=void 0;const f=h.Matrix4.multiply(l,d,new h.Matrix4),g=new h.Cartesian3(f[4],f[5],f[6]),v=new h.Cartesian3(f[12],f[13],f[14]);h.Cartesian3.normalize(g,g);let y=-h.Cartesian3.dot(g,v);const w=[g.x,g.y,g.z];this._planesResetting.czmClippingPlanes.reverseNormal&&(a.Vector.negate(w,w),y=-y),this.computedPlane={normal:w,distance:y}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._planesResetting.inverseCenterMatrixChanged,this.positionChanged,this.rotationChanged,this._planesResetting.czmClippingPlanes.reverseNormalChanged));this.dispose(r.disposableOn(s))}this.dispose(this.computedPlaneChanged.disposableOn(()=>this._planesResetting.computedPlanesChanged.next()))}get sowi(){return this._sowi}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get rotation(){return this._rotation.value}set rotation(e){this._rotation.value=e}get rotationChanged(){return this._rotation.changed}get computedPlane(){return this._computedPlane.value}set computedPlane(e){this._computedPlane.value=e}get computedPlaneChanged(){return this._computedPlane.changed}}class Ds extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_computedClippingPlanes",this.disposeVar(a.react(void 0)));n&&(this.id=n),this.disposeVar(new a.ObjResettingWithEvent(this.planeIdsChanged,()=>new yA(e,this,this.planeIds)))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,planeIds:a.reactArray([]),reverseNormal:!1,unionClippingRegions:!0,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Ds||(Ds={})),a.extendClassProps(Ds.prototype,Ds.createDefaultProps);let _A=class extends a.Destroyable{constructor(i,e){super(),this._czmESClippingPlane=i,this._eS3DTileset=e;const o=[this._czmESClippingPlane.czmPlane.id,...this._eS3DTileset.clippingPlaneIds];this._eS3DTileset.clippingPlaneIds=o,this.dispose(()=>{const s=[...this._eS3DTileset.clippingPlaneIds],r=this._czmESClippingPlane.czmPlane.id;s.includes(r)&&(s.splice(s.indexOf(r),1),this._eS3DTileset.clippingPlaneIds=s)})}},PA=class extends a.Destroyable{constructor(i){if(super(),this._czmESClippingPlane=i,!this._czmESClippingPlane.viewer)return;this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId=this._czmESClippingPlane.czmPlane.id;const e=()=>{if(!this._czmESClippingPlane.viewer)return;const o=Re({position:this._czmESClippingPlane.sceneObject.position});if(!o)return;const s=em(this._czmESClippingPlane.sceneObject.rotation);this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes={planes:[{normal:s,distance:0}],enabled:!0,modelMatrix:h.Matrix4.toArray(o),unionClippingRegions:!1,edgeColor:this._czmESClippingPlane.sceneObject.edgeColor,edgeWidth:this._czmESClippingPlane.sceneObject.edgetWidth}};e();const n=this.dv(a.createNextAnimateFrameEvent(this._czmESClippingPlane.sceneObject.positionChanged,this._czmESClippingPlane.sceneObject.rotationChanged,this._czmESClippingPlane.sceneObject.edgeColorChanged,this._czmESClippingPlane.sceneObject.edgetWidthChanged));this.d(n.don(e)),this.dispose(()=>{this._czmESClippingPlane.viewer&&(this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId="",this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes=void 0)})}};const ba=class ba extends me{constructor(e,n){super(e,n);m(this,"_innerPositionReact",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_czmPlane");m(this,"_tilesSceneObjectWithId");this._czmPlane=this.disposeVar(new Ao(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),!n.viewer)return;const r=this._czmPlane;a.engineObjectCreatedUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmPlane.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(!(!this.sceneObject.show||!this.czmPlane.show))return u===""?new PA(this):!c||!(c instanceof a.ES3DTileset)?void 0:new _A(this,c)}))}),this.dispose(a.track([r,"show"],[e,"show"])),this.dispose(a.bind([r,"position"],[e,"position"])),this.dispose(je([r,"rotation"],[e,"rotation"])),this.dispose(a.track([r,"showArrow"],[e,"showArrow"])),this.dispose(a.track([r,"color"],[e,"edgeColor"])),this.dispose(a.track([r,"width"],[e,"edgetWidth"]));{const l=()=>{r.minSize=[-e.width/2,-e.height/2],r.maxSize=[e.width/2,e.height/2]};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.widthChanged,e.heightChanged));this.dispose(c.disposableOn(l))}{const l=()=>{a.Vector.equals(e.position,[0,0,0])?this._innerPositionReact.value=void 0:this._innerPositionReact.value=e.position};l(),this.dispose(this.sceneObject.positionChanged.disposableOn(l))}{const l=()=>{this._innerPositionReact.value==null?e.position=[0,0,0]:e.position=this._innerPositionReact.value};this.dispose(this._innerPositionReact.changed.disposableOn(l))}}get czmPlane(){return this._czmPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.position?($t(s,o,n,o.position,Math.max(o.width,o.height),e,!0),!0):!1:!1}};m(ba,"type",ba.register("ESCesiumViewer",a.ESClippingPlane.type,ba));let Vd=ba;function bA(t){t.toBlob(i=>{if(!i){console.warn("canvas.toBlob error!");return}var e=new ClipboardItem({"image/png":i});navigator.clipboard.write([e]).then(function(){alert("图像已复制到剪切板")}).catch(function(n){console.error("复制到剪切板失败: ",n)})})}const Jh=class Jh extends a.Destroyable{constructor(i,e){super(),this._geoPolygonCanvas=i,this._geoPolygon=e;{const n=(r,l)=>{const{canvas:c,canvasCtx:u,canvasWidth:d}=this._geoPolygonCanvas,{toMercatorPos:p}=Jh,f=p(r),g=p(l),v=g[0]-f[0],y=g[1]-f[1],w=d>8192?8192:d;if(v<=0)return;const P=w*y/v|0;if(P<=0||P>8192)return;const{points:C}=this._geoPolygon;if(!C)throw new Error("!positions");const S=C.map(A=>{const E=p(A);return[(E[0]-f[0])*w/v,P-(E[1]-f[1])*P/y]});c.width=w,c.height=P,u.clearRect(0,0,w,P),u.beginPath();for(const A of S)u.lineTo(A[0],A[1]);u.closePath(),u.fillStyle="#FFFFFF",u.fill()},o=()=>{let r;const{canvas:l,canvasCtx:c,canvasWidth:u}=this._geoPolygonCanvas;c.clearRect(0,0,l.width,l.height);const{points:d}=this._geoPolygon;if(d&&d.length>=3){const p=a.getMinMaxCorner(d),{minPos:f,maxPos:g}=p;n(f,g),r={rect:[f[0],f[1],g[0],g[1]],height:d[0][2]}}this._geoPolygonCanvas.canvasGeoInfo=r,this.ad(a.nextAnimateFrame(()=>{this._geoPolygonCanvas.canvasChanged.emit()}))};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._geoPolygon.pointsChanged,this._geoPolygonCanvas.canvasWidthChanged));this.dispose(s.disposableOn(o))}}};m(Jh,"toMercatorPos",function(i){const[e,n,o]=i;return[e,n/Math.cos(n*Math.PI/180),o]});let Wd=Jh;const Sa=class Sa extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_geoPolygonWithId");m(this,"_canvas",document.createElement("canvas"));m(this,"_canvasCtx",this._canvas.getContext("2d"));m(this,"_canvasChanged",this.disposeVar(new a.Event));m(this,"_canvasGeoInfo",this.disposeVar(a.reactJsonWithUndefined(void 0)));this._geoPolygonWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._geoPolygonWithId,"id"],[this,"geoPolygonId"])),this.disposeVar(new a.ObjResettingWithEvent(this.geoPolygonWithId.sceneObjectChanged,()=>{const{sceneObject:o}=this.geoPolygonWithId;if(o&&o instanceof a.ESGeoPolygon)return new Sa.PolygonCanvasResetting(this,o)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygonWithId(){return this._geoPolygonWithId}get canvas(){return this._canvas}get canvasCtx(){return this._canvasCtx}get canvasChanged(){return this._canvasChanged}get canvasGeoInfo(){return this._canvasGeoInfo.value}set canvasGeoInfo(e){this._canvasGeoInfo.value=e}get canvasGeoInfoChanged(){return this._canvasGeoInfo.changed}};m(Sa,"saveCanvasToClipboard",bA),m(Sa,"PolygonCanvasResetting",Wd);let Eo=Sa;(t=>{t.createDefaultProps=()=>({enabled:!0,geoPolygonId:"",canvasWidth:512})})(Eo||(Eo={})),a.extendClassProps(Eo.prototype,Eo.createDefaultProps);function SA(t,i){return class extends a.Destroyable{constructor(o,s){super();m(this,"_customShader",this.disposeVar(new h.CustomShader({uniforms:{u_discardRatio:{value:new h.Cartesian2(0,1),type:h.UniformType.VEC2},u_topColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4},u_bottomColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4}},varyings:{v_xbsjPos:h.VaryingType.VEC3,v_m:h.VaryingType.FLOAT},vertexShaderText:` // IMPORTANT: the function signature must use these parameter names. This
|
|
367
367
|
// makes it easier for the runtime to generate the shader and make optimizations.
|
|
368
368
|
void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {
|
|
369
369
|
// code goes here. An empty body is a no-op.
|
|
@@ -403,7 +403,7 @@ ${this.stack.toString()}`),t};function X(t,i,e,n,o,s,r,l,c,u,d,p,f,g,v,y){this[0
|
|
|
403
403
|
material.diffuse *= (u_topColor.rgb * u_topColor.a);
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
|
-
`})));this._sceneObject=o,this._viewer=s;{const r=()=>{this._customShader.uniforms.u_discardRatio.value=h.Cartesian2.fromArray(i.discard)};r(),this.dispose(i.discardChanged.disposableOn(r))}{const r=()=>{this._customShader.uniforms.u_bottomColor.value=new h.Color(...i.bottomColor)};r(),this.dispose(i.bottomColorChanged.disposableOn(r))}{const r=()=>{this._customShader.uniforms.u_topColor.value=new h.Color(...i.topColor)};r(),this.dispose(i.topColorChanged.disposableOn(r))}}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get customShader(){return this._customShader}update(){alert("暂未实现!")}}}function xA(t,i,e){const n=t,o=i,s=[[n[0],n[1],0],[o[0],n[1],0],[o[0],o[1],0],[n[0],o[1],0]],r=h.Math.toDegrees,l=s.map(u=>{const d=h.Matrix4.multiplyByPoint(e,h.Cartesian3.fromElements(...u),new h.Cartesian3),p=h.Cartographic.fromCartesian(d);return[r(p.longitude),r(p.latitude),p.height]});return[[l[0],l[1],l[2],l[3],l[0]]]}class AA extends a.Destroyable{constructor(e,n){super();m(this,"_customShader");this._czmFlattenedPlane=e,this._reverse=n,this._customShader=SA(this._reverse,this._czmFlattenedPlane),this._czmFlattenedPlane.computedCustomShader=this.customShader,this.dispose(()=>{this._czmFlattenedPlane.computedCustomShader=void 0})}get customShader(){return this._customShader}}class Wn extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_computedCustomShader",this.disposeVar(a.react(void 0)));m(this,"_polylines");m(this,"_finalMatrix",this.disposeVar(a.react(void 0)));m(this,"_czmTextureWithId");n&&(this.id=n),this._czmTextureWithId=this.disposeVar(new a.ESSceneObjectWithId),this._polylines=this.disposeVar(new qt(e)),this._polylines.arcType="NONE",this.dispose(a.track([this._czmTextureWithId,"id"],[this,"czmTextureId"])),this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Me)||!e.actived)return;if(!this.position){console.warn("CzmFlattenedPlane warning: 没有位置,无法飞入!");return}const s=this.minSize,r=this.maxSize,l=[r[0]-s[0],r[1]-s[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);ne(e.viewer,this.position,c*2,void 0,o)}));{const o=()=>{if(!this.enabled){this.finalMatrix=void 0,this.polylines.positions=void 0;return}const r=[...this.modelMatrix];let l=[];if(this.finalMatrix=void 0,this.position){const c=Re({position:this.position,rotation:this.rotation});if(c){const u=h.Matrix4.fromArray(this.modelMatrix),d=h.Matrix4.multiply(c,u,new h.Matrix4);h.Matrix4.toArray(d,r),this.finalMatrix=d,l=xA(this.minSize,this.maxSize,d)}}this.polylines.positions=l};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(s.disposableOn(o))}{const o=this.disposeVar(a.createNextAnimateFrameEvent(this.enabledChanged,this.reverseChanged));this.disposeVar(new a.ObjResettingWithEvent(o,()=>{if(this.enabled)return new AA(this,this.reverse)}))}this.dispose(a.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(a.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(a.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedCustomShader(){return this._computedCustomShader.value}set computedCustomShader(e){this._computedCustomShader.value=e}get computedCustomShaderChanged(){return this._computedCustomShader.changed}get polylines(){return this._polylines}get finalMatrix(){return this._finalMatrix.value}set finalMatrix(e){this._finalMatrix.value=e}get finalMatrixChanged(){return this._finalMatrix.changed}get czmTextureWithId(){return this._czmTextureWithId}}m(Wn,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),modelMatrix:a.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,discard:a.reactArray([0,1]),topColor:a.reactArray([1,1,1,1]),bottomColor:a.reactArray([1,1,1,1]),edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2,minSize:a.reactArray([-100,-100]),maxSize:a.reactArray([100,100]),sceneObjectIds:a.reactArray([]),czmTextureId:""})})(Wn||(Wn={})),a.extendClassProps(Wn.prototype,Wn.createDefaultProps);class EA extends a.Destroyable{constructor(i,e){super(),this._czmPolygonFlattenedPlane=i,this._czmFlattenedPlane=e;{const{polygonCanvas:n}=this._czmPolygonFlattenedPlane,o=6378137,s=h.Math.toRadians,r=()=>{const{canvasGeoInfo:l}=n;if(!l)return;const{rect:c,height:u}=l,d=[(c[0]+c[2])/2,(c[1]+c[3])/2,u],p=s(c[2]-c[0])*o*Math.cos(s(d[1])),f=s(c[3]-c[1])*o;this._czmFlattenedPlane.position=d,this._czmFlattenedPlane.minSize=[-p*.5,-f*.5],this._czmFlattenedPlane.maxSize=[p*.5,f*.5]};r(),this.dispose(n.canvasGeoInfoChanged.disposableOn(r))}this._czmFlattenedPlane.czmTextureWithId.id=this._czmPolygonFlattenedPlane.czmTexture.id,this.dispose(()=>this._czmFlattenedPlane.czmTextureWithId.id=void 0);{const n=this._czmFlattenedPlane.showHelper;this._czmFlattenedPlane.showHelper=!1,this.dispose(()=>this._czmFlattenedPlane.showHelper=n)}this.dispose(a.track([this._czmFlattenedPlane,"enabled"],[this._czmPolygonFlattenedPlane,"enabled"]))}}class Xr extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_czmTexture");m(this,"_polygon");m(this,"_polygonCanvas");m(this,"_czmFlattenedPlaneWithId");m(this,"_czmFlattendPlaneWithIdResetting");n&&(this._id.value=n);{this._czmTexture=this.disposeVar(new Ne(e,n)),this._polygon=this.disposeVar(new a.ESGeoPolygon(`${n}_polygon`)),e.add(this._polygon),this.ad(()=>{e.delete(this._polygon)}),this.dispose(a.track([this._polygon,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([this._polygon,"points"],[this,"positions"])),this.dispose(a.track([this._polygon,"show"],[this,"show"])),this._polygonCanvas=this.disposeVar(new Eo(e,n)),this._polygonCanvas.geoPolygonWithId.sceneObject=this._polygon;const o=()=>{this._czmTexture.copyFromCanvas(this._polygonCanvas.canvas)};o(),this.dispose(this._polygonCanvas.canvasChanged.disposableOn(o)),this.dispose(this._czmTexture.readyEvent.disposableOn(o)),this._czmFlattenedPlaneWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._czmFlattenedPlaneWithId,"id"],[this,"czmFlattenedPlaneId"])),this._czmFlattendPlaneWithIdResetting=this.disposeVar(new a.ObjResettingWithEvent(this.czmFlattenedPlaneWithId.sceneObjectChanged,()=>{const{sceneObject:s}=this.czmFlattenedPlaneWithId;if(!s)return;let r;a.registerCreatedEventUpdate(this,s,()=>{const l=e.getEngineObject(s);if(s instanceof a.ES3DTileset&&(r=l.flattenedPlane),r instanceof Wn)return new EA(this,r)})}))}this.dispose(this._flyToEvent.disposableOn(o=>{this._polygon.flyTo(o)}))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmTexture(){return this._czmTexture}get polygon(){return this._polygon}get polygonCanvas(){return this._polygonCanvas}get czmFlattenedPlaneWithId(){return this._czmFlattenedPlaneWithId}get czmFlattendPlaneWithIdResetting(){return this._czmFlattendPlaneWithIdResetting}}(t=>{t.createDefaultProps=()=>({enabled:!0,show:!0,positions:a.reactPositions([]),allowPicking:!1,czmFlattenedPlaneId:""})})(Xr||(Xr={})),a.extendClassProps(Xr.prototype,Xr.createDefaultProps);class Ii extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));if(!e.viewer)return;const s=this.ad(new as(e,n)),r=this.ad(new xe(e,n));r.loop=!0,this.ad(a.bind([r,"depthTest"],[this,"depthTest"])),this.dispose(a.track([s,"allowPicking"],[this,"allowPicking"]));{const u=()=>{s.ground=this.ground,r.ground=this.strokeGround,r.arcType=this.strokeGround?"NONE":"GEODESIC"};u();const d=this.ad(a.createNextAnimateFrameEvent(this.groundChanged,this.strokeGroundChanged));this.ad(d.don(u))}const l=()=>{r.show=this.show&&this.outline,s.show=this.show&&this.fill,r.positions=this.positions,s.polygonHierarchy=s.show?{positions:this.positions||[]}:{positions:[]},r.color=this.outlineColor,r.width=this.outlineWidth,s.material={type:"Color",color:this.color||[1,1,1,.5]}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.outlineColorChanged,this.outlineWidthChanged,this.fillChanged,this.colorChanged,this.positionsChanged));this.dispose(c.disposableOn(l)),this.dispose(this.flyToEvent.disposableOn(u=>{this.viewDistanceRange||(s.flyTo(u),this.fill||r.flyTo(u))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}m(Ii,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4],positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,outline:!0,strokeGround:!1,ground:!1,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:a.reactArray([1,1,1,.5]),positions:a.reactPositions(void 0),viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(Ii||(Ii={})),a.extendClassProps(Ii.prototype,Ii.createDefaultProps);const xa=class xa extends yt{constructor(e,n){super(e,n);m(this,"_geoPolygon");if(!n.viewer){console.warn("viewer is undefined!");return}this._geoPolygon=this.ad(new Ii(n,e.id));const s=this.geoPolygon;s&&(this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"fill"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])))}get geoPolygon(){return this._geoPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r!=null&&r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):r!=null&&r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(xa,"type",xa.register("ESCesiumViewer",a.ESGeoPolygon.type,xa));let Xt=xa,TA=class extends a.Destroyable{constructor(i,e){super(),this._czmESPolygonFlattenedPlane=i,this._eS3DTileset=e,this._eS3DTileset.flattenedPlaneEnabled=!0,this._czmESPolygonFlattenedPlane.polygonFlattenedPlane.czmFlattenedPlaneId=this._eS3DTileset.flattenedPlaneId,this.dispose(()=>this._eS3DTileset.flattenedPlaneEnabled=!1)}};const Aa=class Aa extends Xt{constructor(e,n){super(e,n);m(this,"_polygonFlattenedPlane");m(this,"_tilesSceneObjectWithId");this._polygonFlattenedPlane=this.disposeVar(new Xr(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const c=a.ESSceneObject.getSceneObject(e.targetID);o.value=c?(c.components.main??c).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._polygonFlattenedPlane;r.enabled=!0,this.dispose(a.track([r,"show"],[e,"show"])),this.dispose(a.bind([r,"positions"],[e,"points"])),this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([r,"czmFlattenedPlaneId"],[e,"czmFlattenedPlaneId"])),this.dispose(a.track([r.polygon,"stroked"],[e,"stroked"])),this.dispose(a.track([r.polygon,"strokeColor"],[e,"strokeColor"])),this.dispose(a.track([r.polygon,"strokeWidth"],[e,"strokeWidth"])),this.dispose(a.track([r.polygon,"filled"],[e,"filled"])),this.dispose(a.track([r.polygon,"fillColor"],[e,"fillColor"])),this.dispose(a.track([r.polygon,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([r.polygon,"fillGround"],[e,"fillGround"]));const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c}=this.tilesSceneObjectWithId;if(c&&c instanceof a.ES3DTileset&&this.sceneObject.show)return new TA(this,c)}))}get polygonFlattenedPlane(){return this._polygonFlattenedPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s,polygonFlattenedPlane:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Aa,"type",Aa.register("ESCesiumViewer",a.ESPolygonFlattenedPlane.type,Aa));let Gd=Aa;function IA(t){return[t.urlChanged,t.classificationTypeChanged,t.ellipsoidChanged,t.modelUpAxisChanged,t.modelForwardAxisChanged,t.cullWithChildrenBoundsChanged,t.enableShowOutlineChanged,t.projectTo2DChanged,t.debugHeatmapTilePropertyNameChanged,t.enableDebugWireframeChanged,t.vectorClassificationOnlyChanged,t.vectorKeepDecodedPositionsChanged]}function fy(t,i){const e=i;if(e.modelMatrix){h.Matrix4.clone(h.Matrix4.fromArray(e.modelMatrix),t.modelMatrix);return}if(!e.position){h.Matrix4.clone(h.Matrix4.IDENTITY,t.modelMatrix);return}let n=t._root.transform;const o=Re({initialRotation:"yForwardzUp",rotation:[0,0,0],position:e.origin});(o&&!o.equalsEpsilon(n,.001)||n.equals(h.Matrix4.IDENTITY))&&o&&(n=o);const s=Re({initialRotation:"yForwardzUp",rotation:e.rotation,position:e.position});if(!s){console.warn("modelMatrix is undefined!");return}const r=h.Matrix4.inverseTransformation(n,new h.Matrix4);h.Matrix4.multiply(s,r,t.modelMatrix)}class MA extends a.Destroyable{constructor(i,e,n){super(),this._tileset=i,this._czm3DTiles=e,this._updateMatrixEvent=n;{const o=()=>{const r=h.Matrix4.inverseTransformation(i.clippingPlanesOriginMatrix,new h.Matrix4);if(!i.clippingPlanes){i.clippingPlanes=_r(e.clippingPlanes??{enabled:!1},r);return}fc(i.clippingPlanes,e.clippingPlanes,r)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(e.clippingPlanesChanged,e.originRootTransformInvChanged,this._updateMatrixEvent));this.dispose(s.disposableOn(o))}}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}}class DA extends a.Destroyable{constructor(i,e){super(),this._tileset=i,this._czm3DTiles=e;const{tileset:n,czm3DTiles:o}=this;{const s=()=>{if(!n.clippingPlanes){n.clippingPlanes=_r(o.clippingPlanes??{enabled:!1});return}fc(n.clippingPlanes,o.clippingPlanes)};s(),this.dispose(o.clippingPlanesChanged.disposableOn(s))}}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}}class RA extends a.Destroyable{constructor(i,e){super(),this._tileset=i,this._czm3DTiles=e;const{tileset:n,czmCzm3DTiles:o}=this;{const s=()=>{n.clippingPolygons=o.clippingPolygons?gc(o.clippingPolygons):new h.ClippingPolygonCollection};s(),this.dispose(o.clippingPolygonsChanged.disposableOn(s))}}get tileset(){return this._tileset}get czmCzm3DTiles(){return this._czm3DTiles}}class FA extends a.Destroyable{constructor(i,e){super(),this._nativeTilesetReadyResetting=i,this._czmFlattenedPlane=e;const{tileset:n}=this;this.setFlattened(!0),this.dispose(()=>{this.setFlattened(!1)});{const o=()=>{const s=this._czmFlattenedPlane.finalMatrix?h.Matrix4.toArray(this._czmFlattenedPlane.finalMatrix):[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];this.setElevationMatrix(s)};o(),this.dispose(this._czmFlattenedPlane.finalMatrixChanged.disposableOn(o))}{const o=()=>{const r=[...this._czmFlattenedPlane.minSize,...this._czmFlattenedPlane.maxSize];this.setFlattenedBound(r)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._czmFlattenedPlane.minSizeChanged,this._czmFlattenedPlane.maxSizeChanged));this.dispose(s.disposableOn(o))}n.xbsjGetFlattenedTextureFunc=()=>{const{sceneObject:o}=this._czmFlattenedPlane.czmTextureWithId;return o?globalThis.czmTexture[o.id].texture:void 0},this.dispose(()=>n.xbsjGetFlattenedTextureFunc=void 0);{const o=()=>{const s=this._czmFlattenedPlane.computedCustomShader;this._nativeTilesetReadyResetting.flattenedCustomShader=s&&new s(this.czm3DTiles,this.czm3DTiles.czmViewer)};o(),this.dispose(this._czmFlattenedPlane.computedCustomShaderChanged.disposableOn(o)),this.dispose(()=>this._nativeTilesetReadyResetting.flattenedCustomShader=void 0)}}get czm3DTiles(){return this._nativeTilesetReadyResetting.czm3DTiles}get tileset(){return this._nativeTilesetReadyResetting.tileset}get czmFlattenedPlane(){return this._czmFlattenedPlane}setFlattened(i){this.tileset.xbsjFlattened=i}setFlattenedBound(i){this.tileset.xbsjFlattenedBound=h.Cartesian4.fromArray(i)}setElevationMatrix(i){this.tileset.xbsjElevationMatrix=h.Matrix4.fromArray(i)}}function zA(t,i){t.show=i.show??!0,t.colorBlendMode=h.Cesium3DTileColorBlendMode[i.colorBlendMode??"HIGHLIGHT"],t.shadows=(i.shadows&&I.czmPropMaps.shadowPropsMap[i.shadows])??I.czmPropMaps.shadowPropsMap.ENABLED,t.maximumScreenSpaceError=i.maximumScreenSpaceError??16,t.maximumMemoryUsage=i.maximumMemoryUsage??be.defaults.maximumMemoryUsage,t.cacheBytes=i.cacheBytes??be.defaults.cacheBytes,t.maximumCacheOverflowBytes=i.maximumCacheOverflowBytes??be.defaults.maximumCacheOverflowBytes,t.cullRequestsWhileMoving=i.cullRequestsWhileMoving??!0,t.cullRequestsWhileMovingMultiplier=i.cullRequestsWhileMovingMultiplier??60,t.preloadWhenHidden=i.preloadWhenHidden??!1,t.preloadFlightDestinations=i.preloadFlightDestinations??!0,t.preferLeaves=i.preferLeaves??!1,t.dynamicScreenSpaceError=i.dynamicScreenSpaceError??!1,t.dynamicScreenSpaceErrorDensity=i.dynamicScreenSpaceErrorDensity??.00278,t.dynamicScreenSpaceErrorFactor=i.dynamicScreenSpaceErrorFactor??4,t.dynamicScreenSpaceErrorHeightFalloff=i.dynamicScreenSpaceErrorHeightFalloff??.25,t.progressiveResolutionHeightFraction=i.progressiveResolutionHeightFraction??.3,t.foveatedScreenSpaceError=i.foveatedScreenSpaceError??!0,t.foveatedConeSize=i.foveatedConeSize??.1,t.foveatedMinimumScreenSpaceErrorRelaxation=i.foveatedMinimumScreenSpaceErrorRelaxation??0,t.foveatedTimeDelay=i.foveatedTimeDelay??.2,t.skipLevelOfDetail=i.skipLevelOfDetail??!1,t.baseScreenSpaceError=i.baseScreenSpaceError??1024,t.skipScreenSpaceErrorFactor=i.skipScreenSpaceErrorFactor??16,t.skipLevels=i.skipLevels??1,t.immediatelyLoadDesiredLevelOfDetail=i.immediatelyLoadDesiredLevelOfDetail??!1,t.loadSiblings=i.loadSiblings??!1,t.lightColor=(i.lightColor&&ui(i.lightColor))??be.defaults.lightColor,t.backFaceCulling=i.backFaceCulling??!0,t.showOutline=i.showOutline??!0,t.outlineColor=te(i.outlineColor??be.defaults.outlineColor),t.featureIdLabel=i.featureIdLabel??be.defaults.featureIdLabel,t.instanceFeatureIdLabel=i.instanceFeatureIdLabel??be.defaults.instanceFeatureIdLabel,t.showCreditsOnScreen=i.showCreditsOnScreen??!1,t.splitDirection=h.SplitDirection[i.splitDirection??be.defaults.splitDirection],t.debugFreezeFrame=i.debugFreezeFrame??!1,t.debugColorizeTiles=i.debugColorizeTiles??!1,t.debugWireframe=i.debugWireframe??!1,t.debugShowBoundingVolume=i.debugShowBoundingVolume??!1,t.debugShowContentBoundingVolume=i.debugShowContentBoundingVolume??!1,t.debugShowViewerRequestVolume=i.debugShowViewerRequestVolume??!1,t.debugShowGeometricError=i.debugShowGeometricError??!1,t.debugShowRenderingStatistics=i.debugShowRenderingStatistics??!1,t.debugShowMemoryUsage=i.debugShowMemoryUsage??!1,t.debugShowUrl=i.debugShowUrl??!1}function LA(t){return[t.showChanged,t.colorBlendModeChanged,t.shadowsChanged,t.maximumScreenSpaceErrorChanged,t.maximumMemoryUsageChanged,t.cacheBytesChanged,t.maximumCacheOverflowBytesChanged,t.cullRequestsWhileMovingChanged,t.cullRequestsWhileMovingMultiplierChanged,t.preloadWhenHiddenChanged,t.preloadFlightDestinationsChanged,t.preferLeavesChanged,t.dynamicScreenSpaceErrorChanged,t.dynamicScreenSpaceErrorDensityChanged,t.dynamicScreenSpaceErrorFactorChanged,t.dynamicScreenSpaceErrorHeightFalloffChanged,t.progressiveResolutionHeightFractionChanged,t.foveatedScreenSpaceErrorChanged,t.foveatedConeSizeChanged,t.foveatedMinimumScreenSpaceErrorRelaxationChanged,t.foveatedTimeDelayChanged,t.skipLevelOfDetailChanged,t.baseScreenSpaceErrorChanged,t.skipScreenSpaceErrorFactorChanged,t.skipLevelsChanged,t.immediatelyLoadDesiredLevelOfDetailChanged,t.loadSiblingsChanged,t.lightColorChanged,t.backFaceCullingChanged,t.showOutlineChanged,t.outlineColorChanged,t.featureIdLabelChanged,t.instanceFeatureIdLabelChanged,t.showCreditsOnScreenChanged,t.splitDirectionChanged,t.debugFreezeFrameChanged,t.debugColorizeTilesChanged,t.debugWireframeChanged,t.debugShowBoundingVolumeChanged,t.debugShowContentBoundingVolumeChanged,t.debugShowViewerRequestVolumeChanged,t.debugShowGeometricErrorChanged,t.debugShowRenderingStatisticsChanged,t.debugShowMemoryUsageChanged,t.debugShowUrlChanged,t.enableShowOutlineChanged]}function NA(t,i){console.warn("Czm3DTiles暂不支持pointCloudShading属性"),t.pointCloudShading=new h.PointCloudShading(i.pointCloudShading)}function OA(t,i){var n,o,s;t.imageBasedLighting.imageBasedLightingFactor=Pe(((n=i.imageBasedLighting)==null?void 0:n.imageBasedLightingFactor)??[1,1]),t.imageBasedLighting.specularEnvironmentMaps=(o=i.imageBasedLighting)==null?void 0:o.specularEnvironmentMaps;const e=(s=i.imageBasedLighting)==null?void 0:s.sphericalHarmonicCoefficients;t.imageBasedLighting.sphericalHarmonicCoefficients=e&&Pu(e)}class BA extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_clippingPlanesCollectionResetting");m(this,"_clippingPolygonCollectionResetting");m(this,"_flattenedCustomShader",this.disposeVar(a.react(void 0)));this._tileset=e,this._czm3DTiles=n,this._czmNativeViewer=o,this._czmViewer=s,this._clippingPolygonCollectionResetting=new RA(this.tileset,this.czm3DTiles);const{tileset:r,czm3DTiles:l}=this;{const w=this.disposeVar(a.createNextAnimateFrameEvent(this.czm3DTiles.positionChanged,this.czm3DTiles.rotationChanged,this.czm3DTiles.modelMatrixChanged,this.czm3DTiles.originChanged));fy(this.tileset,this.czm3DTiles),this.dispose(w.disposableOn(()=>fy(this.tileset,this.czm3DTiles))),this._clippingPlanesCollectionResetting=this.disposeVar(new a.ObjResettingWithEvent(this.czm3DTiles.absoluteClippingPlanesChanged,()=>this.czm3DTiles.absoluteClippingPlanes?new MA(this.tileset,this.czm3DTiles,w):new DA(this.tileset,this.czm3DTiles)))}this.disposeVar(new a.ObjResettingWithEvent(this.czm3DTiles.czmFlattenedPlaneWithId.sceneObjectChanged,()=>{const{sceneObject:w}=this.czm3DTiles.czmFlattenedPlaneWithId;if(!w)return;let P;a.registerCreatedEventUpdate(this,w,()=>{const C=s.getEngineObject(w);if(w instanceof a.ES3DTileset&&(P=C.flattenedPlane),!!P)return new FA(this,P)})}));const c=this.disposeVar(a.createNextAnimateFrameEvent(...LA(l)));a.registerEventUpdate(this,c,()=>{zA(r,l)}),a.registerEventUpdate(this,l.foveatedInterpolationCallbackChanged,()=>{r.foveatedInterpolationCallback=l.foveatedInterpolationCallback}),a.registerEventUpdate(this,l.styleChanged,()=>{r.style=l.style}),a.registerEventUpdate(this,l.pointCloudShadingChanged,()=>{NA(r,l)}),a.registerEventUpdate(this,l.imageBasedLightingChanged,()=>{OA(r,l)}),a.registerEventUpdate(this,l.environmentMapManagerChanged,()=>{_u(r.environmentMapManager,l)});let u=[],d,p,f=!0,g=()=>{var w;return(w=s.viewer)==null?void 0:w.scene.postUpdate.addEventListener(P=>{r._selectedTiles.length===u.length&&u.every(C=>r._selectedTiles.includes(C))||(u.splice(0,u.length,...r._selectedTiles),r._selectedTiles.forEach(C=>{Sr(C.content._model,d)}))})};const v=()=>{p&&(p(),p=void 0),u=[],d=void 0};this.ad(v);const y=(w,P)=>{P=="default"?w._contentState=h.Cesium3DTileContentState.UNLOADED:w.content&&Reflect.has(w.content,"_model")&&!Sr(w.content._model,P)&&f&&(f=!1),w.children&&w.children.forEach(C=>{y(C,P)})};this.ad(l.setMaterialEvent.don(async w=>{if(f=!0,w=="default")v(),y(r.root,"default");else{d={};for(const C in w){let S,A,E;const R=w[C];d[C]={...R},Reflect.has(R,"baseColorTexture")&&(R.baseColorTexture==null?d[C].baseColorTexture=void 0:R.baseColorTexture.value!=""&&(S=co(this._czmViewer.viewer,R.baseColorTexture,{magFilter:R.magFilter,minFilter:R.minFilter}))),Reflect.has(R,"normalTexture")&&(R.normalTexture==null?d[C].normalTexture=void 0:R.normalTexture.value!=""&&(A=co(this._czmViewer.viewer,R.normalTexture,{magFilter:R.magFilter,minFilter:R.minFilter}))),Reflect.has(R,"metallicRoughnessTexture")&&(R.metallicRoughnessTexture==null?d[C].metallicRoughnessTexture=void 0:R.metallicRoughnessTexture.value!=""&&(E=co(this._czmViewer.viewer,R.metallicRoughnessTexture,{magFilter:R.magFilter,minFilter:R.minFilter})));const N=await Promise.allSettled([S,A,E]);S=N[0].value,A=N[1].value,E=N[2].value,E!=null&&(d[C].metallicRoughnessTexture=E),S!=null&&(d[C].baseColorTexture=S),A!=null&&(d[C].normalTexture=A)}y(r.root,d),p||(p=g())}const P=a.ESSceneObject.getSceneObject(this.czm3DTiles.id);P&&P instanceof a.ES3DTileset&&P.setMaterialInfoEvent.emit({type:f?"success":"warn",message:f?"完成":"部分材质颜色纹理设置失败,请检查原始模型中材质是否具有baseColorTexture属性"})}));{const w=()=>{var C,S;if(this.flattenedCustomShader){r.customShader=(C=this.flattenedCustomShader)==null?void 0:C.customShader,l.customShaderInstance&&console.warn("压平shader和Czm3DTiles的customShader冲突,优先使用压平shader!");return}r.customShader=(S=l.customShaderInstance)==null?void 0:S.customShader};w();const P=this.disposeVar(a.createNextAnimateFrameEvent(l.customShaderInstanceChanged,this.flattenedCustomShaderChanged));this.dispose(P.disposableOn(w))}this.dispose(l.flyToEvent.disposableOn(w=>{l.czmViewer.actived&&this.tileset&&this._czmNativeViewer.camera.flyToBoundingSphere(this.tileset.boundingSphere,{duration:(w??1e3)/1e3})}))}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}get clippingPlanesCollectionResetting(){return this._clippingPlanesCollectionResetting}get clippingPolygonCollectionResetting(){return this._clippingPolygonCollectionResetting}get flattenedCustomShader(){return this._flattenedCustomShader.value}set flattenedCustomShader(e){this._flattenedCustomShader.value=e}get flattenedCustomShaderChanged(){return this._flattenedCustomShader.changed}}function VA(t){const{imageBasedLightingFactor:i,sphericalHarmonicCoefficients:e,specularEnvironmentMaps:n}=t,o={imageBasedLightingFactor:i&&new h.Cartesian2(i[0],i[1]),sphericalHarmonicCoefficients:e&&e.map(s=>new h.Cartesian3(s[0],s[1],s[2])),specularEnvironmentMaps:n&&a.ESSceneObject.context.getStrFromEnv(n)};return new h.ImageBasedLighting(o)}async function WA(t,i,e){let n="";if(typeof i!="string"?typeof i=="object"&&i.url&&(n=new h.Resource({url:i.url,headers:i.headers,queryParameters:i.queryParameters,templateValues:i.templateValues,proxy:i.proxy,retryCallback:i.retryCallback,retryAttempts:i.retryAttempts,request:i.request,parseUrl:i.parseUrl})):n=i,typeof i=="string"&&i.startsWith("ion://")){const r=+i.substring(6);try{n=await h.IonResource.fromAssetId(r)}catch(l){console.error(`Ion资源未能获取到 error: ${l}`,l);return}}const o=await h.Cesium3DTileset.fromUrl(n,{show:t.show,shadows:t.shadows&&I.czmPropMaps.shadowPropsMap[t.shadows],maximumScreenSpaceError:t.maximumScreenSpaceError,maximumMemoryUsage:t.maximumMemoryUsage,cacheBytes:t.cacheBytes,maximumCacheOverflowBytes:t.maximumCacheOverflowBytes,cullWithChildrenBounds:t.cullWithChildrenBounds,cullRequestsWhileMoving:t.cullRequestsWhileMoving,cullRequestsWhileMovingMultiplier:t.cullRequestsWhileMovingMultiplier,preloadWhenHidden:t.preloadWhenHidden,preloadFlightDestinations:t.preloadFlightDestinations,preferLeaves:t.preferLeaves,dynamicScreenSpaceError:t.dynamicScreenSpaceError,dynamicScreenSpaceErrorDensity:t.dynamicScreenSpaceErrorDensity,dynamicScreenSpaceErrorFactor:t.dynamicScreenSpaceErrorFactor,dynamicScreenSpaceErrorHeightFalloff:t.dynamicScreenSpaceErrorHeightFalloff,progressiveResolutionHeightFraction:t.progressiveResolutionHeightFraction,foveatedScreenSpaceError:t.foveatedScreenSpaceError,foveatedConeSize:t.foveatedConeSize,foveatedMinimumScreenSpaceErrorRelaxation:t.foveatedMinimumScreenSpaceErrorRelaxation,foveatedInterpolationCallback:t.foveatedInterpolationCallbackStr&&Function('"use strict";return ('+t.foveatedInterpolationCallbackStr+")")(),foveatedTimeDelay:t.foveatedTimeDelay,skipLevelOfDetail:t.skipLevelOfDetail,baseScreenSpaceError:t.baseScreenSpaceError,skipScreenSpaceErrorFactor:t.skipScreenSpaceErrorFactor,skipLevels:t.skipLevels,immediatelyLoadDesiredLevelOfDetail:t.immediatelyLoadDesiredLevelOfDetail,loadSiblings:t.loadSiblings,classificationType:I.czmPropMaps.classificationTypeMap[t.classificationType??be.defaults.classificationType],lightColor:t.lightColor&&hi(t.lightColor),backFaceCulling:t.backFaceCulling??be.defaults.backFaceCulling,showOutline:t.showOutline??be.defaults.showOutline,debugHeatmapTilePropertyName:t.debugHeatmapTilePropertyName,debugFreezeFrame:t.debugFreezeFrame,debugColorizeTiles:t.debugColorizeTiles,debugWireframe:t.debugWireframe,debugShowBoundingVolume:t.debugShowBoundingVolume,debugShowContentBoundingVolume:t.debugShowContentBoundingVolume,debugShowViewerRequestVolume:t.debugShowViewerRequestVolume,debugShowGeometricError:t.debugShowGeometricError,debugShowRenderingStatistics:t.debugShowRenderingStatistics,debugShowMemoryUsage:t.debugShowMemoryUsage,debugShowUrl:t.debugShowUrl,customShader:e,ellipsoid:Ce(t.ellipsoid??be.defaults.ellipsoid),modelMatrix:t.modelMatrix&&h.Matrix4.fromArray(t.modelMatrix),clippingPlanes:t.clippingPlanes&&_r(t.clippingPlanes),clippingPolygons:t.clippingPolygons&&gc(t.clippingPolygons),imageBasedLighting:t.imageBasedLighting&&VA(t.imageBasedLighting),splitDirection:h.SplitDirection[t.splitDirection??be.defaults.splitDirection],modelUpAxis:t.modelUpAxis&&h.Axis[t.modelUpAxis],modelForwardAxis:t.modelForwardAxis&&h.Axis[t.modelForwardAxis],featureIdLabel:t.featureIdLabel??be.defaults.featureIdLabel,instanceFeatureIdLabel:t.instanceFeatureIdLabel??be.defaults.instanceFeatureIdLabel,outlineColor:t.outlineColor&&te(t.outlineColor),pointCloudShading:t.pointCloudShading,enableShowOutline:t.enableShowOutline,vectorClassificationOnly:t.vectorClassificationOnly,vectorKeepDecodedPositions:t.vectorKeepDecodedPositions,showCreditsOnScreen:t.showCreditsOnScreen,projectTo2D:t.projectTo2D,enableDebugWireframe:t.enableDebugWireframe});return h.Cesium3DTileset.prototype&&(o.ESSceneObjectID=t.id),o}class GA extends a.Destroyable{constructor(e,n,o,s){var c;super();m(this,"_tileset",this.disposeVar(a.react(void 0)));m(this,"_readyResetting");if(this._url=e,this._czm3DTiles=n,this._czmNativeViewer=o,this._czmViewer=s,this._readyResetting=this.disposeVar(new a.ObjResettingWithEvent(this.tilesetChanged,()=>{if(this.tileset)return new BA(this.tileset,this.czm3DTiles,this._czmNativeViewer,this._czmViewer)})),!this.url)throw new Error("!url");const r=(c=this.czm3DTiles.customShaderInstance)==null?void 0:c.customShader;this.disposeVar(a.createProcessingFromAsyncFunc(async u=>{const d=await u.promise(WA(this.czm3DTiles,this.url,r));d&&(d.style=this.czm3DTiles.style,d.foveatedInterpolationCallback=this.czm3DTiles.foveatedInterpolationCallback,this._czmNativeViewer.scene.primitives.add(d),this.dispose(()=>this._czmNativeViewer.scene.primitives.remove(d)),this._tileset.value=d,this.czm3DTiles.notifyCzmTilesetReady(d,this.czm3DTiles))})).start()}get url(){return this._url}get czm3DTiles(){return this._czm3DTiles}get czmViewer(){return this.czm3DTiles.czmViewer}get tileset(){return this._tileset.value}set tileset(e){this._tileset.value=e}get tilesetChanged(){return this._tileset.changed}get readyResetting(){return this._readyResetting}}function UA(t){if(t)try{return new h.Cesium3DTileStyle(t)}catch(i){console.error(`Cesium3DTiles style error: ${i}`,i);return}}let HA=class extends a.Destroyable{constructor(i,e){super(),this.dv(new a.ObjResettingWithEvent(e.clippingPolygonsIdChanged,(n,o)=>{if(!(!n||n===o||n&&n.length===0))return new $A(i,e)}))}},$A=class extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=e.clippingPolygonsId;this.d(()=>e.clippingPolygons=void 0);const o=r=>{const l=this.dv(a.createNextAnimateFrameEvent(r.positionsChanged,r.reverseChanged,r.enabledChanged,r.showHelperChanged));this.dv(new a.ObjResettingWithEvent(l,()=>new qA(i,r,e)))},s=r=>{let l;r instanceof a.ESExcavate&&a.registerCreatedEventUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,l&&o(l)}),r instanceof a.ESHole&&a.registerCreatedEventUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,l&&o(l)})};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);c&&s(c)}}},qA=class extends a.Destroyable{constructor(i,e,n){super(),this._czmViewer=i;const o=n.clippingPolygonsId,s=e.enabled?e.reverse:void 0;if(o&&o.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let l=0;l<o.length;l++){const c=o[l],u=a.ESSceneObject.getSceneObjById(c);if(!u)return;let d;if(u instanceof a.ESExcavate?d=i.getEngineObject(u).czmPolygonClipping:u instanceof a.ESHole&&(d=i.getEngineObject(u.excavate).czmPolygonClipping),!d)return;d&&d.positions&&d.positions.length>=3&&d.enabled&&(r.polygons[l]={positions:d.positions},r.inverse=s??d.reverse)}n.clippingPolygons=r}}};function gy(t){let i;try{i=t&&Function('"use strict";return ('+t+")")()}catch{i=void 0}return i||h.Math.lerp}const my=`
|
|
406
|
+
`})));this._sceneObject=o,this._viewer=s;{const r=()=>{this._customShader.uniforms.u_discardRatio.value=h.Cartesian2.fromArray(i.discard)};r(),this.dispose(i.discardChanged.disposableOn(r))}{const r=()=>{this._customShader.uniforms.u_bottomColor.value=new h.Color(...i.bottomColor)};r(),this.dispose(i.bottomColorChanged.disposableOn(r))}{const r=()=>{this._customShader.uniforms.u_topColor.value=new h.Color(...i.topColor)};r(),this.dispose(i.topColorChanged.disposableOn(r))}}get sceneObject(){return this._sceneObject}get viewer(){return this._viewer}get customShader(){return this._customShader}update(){alert("暂未实现!")}}}function xA(t,i,e){const n=t,o=i,s=[[n[0],n[1],0],[o[0],n[1],0],[o[0],o[1],0],[n[0],o[1],0]],r=h.Math.toDegrees,l=s.map(u=>{const d=h.Matrix4.multiplyByPoint(e,h.Cartesian3.fromElements(...u),new h.Cartesian3),p=h.Cartographic.fromCartesian(d);return[r(p.longitude),r(p.latitude),p.height]});return[[l[0],l[1],l[2],l[3],l[0]]]}class AA extends a.Destroyable{constructor(e,n){super();m(this,"_customShader");this._czmFlattenedPlane=e,this._reverse=n,this._customShader=SA(this._reverse,this._czmFlattenedPlane),this._czmFlattenedPlane.computedCustomShader=this.customShader,this.dispose(()=>{this._czmFlattenedPlane.computedCustomShader=void 0})}get customShader(){return this._customShader}}class Wn extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_computedCustomShader",this.disposeVar(a.react(void 0)));m(this,"_polylines");m(this,"_finalMatrix",this.disposeVar(a.react(void 0)));m(this,"_czmTextureWithId");n&&(this.id=n),this._czmTextureWithId=this.disposeVar(new a.ESSceneObjectWithId),this._polylines=this.disposeVar(new qt(e)),this._polylines.arcType="NONE",this.dispose(a.track([this._czmTextureWithId,"id"],[this,"czmTextureId"])),this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Me)||!e.actived)return;if(!this.position){console.warn("CzmFlattenedPlane warning: 没有位置,无法飞入!");return}const s=this.minSize,r=this.maxSize,l=[r[0]-s[0],r[1]-s[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);ne(e.viewer,this.position,c*2,void 0,o)}));{const o=()=>{if(!this.enabled){this.finalMatrix=void 0,this.polylines.positions=void 0;return}const r=[...this.modelMatrix];let l=[];if(this.finalMatrix=void 0,this.position){const c=Re({position:this.position,rotation:this.rotation});if(c){const u=h.Matrix4.fromArray(this.modelMatrix),d=h.Matrix4.multiply(c,u,new h.Matrix4);h.Matrix4.toArray(d,r),this.finalMatrix=d,l=xA(this.minSize,this.maxSize,d)}}this.polylines.positions=l};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(s.disposableOn(o))}{const o=this.disposeVar(a.createNextAnimateFrameEvent(this.enabledChanged,this.reverseChanged));this.disposeVar(new a.ObjResettingWithEvent(o,()=>{if(this.enabled)return new AA(this,this.reverse)}))}this.dispose(a.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(a.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(a.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedCustomShader(){return this._computedCustomShader.value}set computedCustomShader(e){this._computedCustomShader.value=e}get computedCustomShaderChanged(){return this._computedCustomShader.changed}get polylines(){return this._polylines}get finalMatrix(){return this._finalMatrix.value}set finalMatrix(e){this._finalMatrix.value=e}get finalMatrixChanged(){return this._finalMatrix.changed}get czmTextureWithId(){return this._czmTextureWithId}}m(Wn,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),modelMatrix:a.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,discard:a.reactArray([0,1]),topColor:a.reactArray([1,1,1,1]),bottomColor:a.reactArray([1,1,1,1]),edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2,minSize:a.reactArray([-100,-100]),maxSize:a.reactArray([100,100]),sceneObjectIds:a.reactArray([]),czmTextureId:""})})(Wn||(Wn={})),a.extendClassProps(Wn.prototype,Wn.createDefaultProps);class EA extends a.Destroyable{constructor(i,e){super(),this._czmPolygonFlattenedPlane=i,this._czmFlattenedPlane=e;{const{polygonCanvas:n}=this._czmPolygonFlattenedPlane,o=6378137,s=h.Math.toRadians,r=()=>{const{canvasGeoInfo:l}=n;if(!l)return;const{rect:c,height:u}=l,d=[(c[0]+c[2])/2,(c[1]+c[3])/2,u],p=s(c[2]-c[0])*o*Math.cos(s(d[1])),f=s(c[3]-c[1])*o;this._czmFlattenedPlane.position=d,this._czmFlattenedPlane.minSize=[-p*.5,-f*.5],this._czmFlattenedPlane.maxSize=[p*.5,f*.5]};r(),this.dispose(n.canvasGeoInfoChanged.disposableOn(r))}this._czmFlattenedPlane.czmTextureWithId.id=this._czmPolygonFlattenedPlane.czmTexture.id,this.dispose(()=>this._czmFlattenedPlane.czmTextureWithId.id=void 0);{const n=this._czmFlattenedPlane.showHelper;this._czmFlattenedPlane.showHelper=!1,this.dispose(()=>this._czmFlattenedPlane.showHelper=n)}this.dispose(a.track([this._czmFlattenedPlane,"enabled"],[this._czmPolygonFlattenedPlane,"enabled"]))}}class Xr extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_czmTexture");m(this,"_polygon");m(this,"_polygonCanvas");m(this,"_czmFlattenedPlaneWithId");m(this,"_czmFlattendPlaneWithIdResetting");n&&(this._id.value=n);{this._czmTexture=this.disposeVar(new Ne(e,n)),this._polygon=this.disposeVar(new a.ESGeoPolygon(`${n}_polygon`)),e.add(this._polygon),this.ad(()=>{e.delete(this._polygon)}),this.dispose(a.track([this._polygon,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([this._polygon,"points"],[this,"positions"])),this.dispose(a.track([this._polygon,"show"],[this,"show"])),this._polygonCanvas=this.disposeVar(new Eo(e,n)),this._polygonCanvas.geoPolygonWithId.sceneObject=this._polygon;const o=()=>{this._czmTexture.copyFromCanvas(this._polygonCanvas.canvas)};o(),this.dispose(this._polygonCanvas.canvasChanged.disposableOn(o)),this.dispose(this._czmTexture.readyEvent.disposableOn(o)),this._czmFlattenedPlaneWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._czmFlattenedPlaneWithId,"id"],[this,"czmFlattenedPlaneId"])),this._czmFlattendPlaneWithIdResetting=this.disposeVar(new a.ObjResettingWithEvent(this.czmFlattenedPlaneWithId.sceneObjectChanged,()=>{const{sceneObject:s}=this.czmFlattenedPlaneWithId;if(!s)return;let r;a.engineObjectCreatedUpdate(this,s,()=>{const l=e.getEngineObject(s);if(s instanceof a.ES3DTileset&&(r=l.flattenedPlane),r instanceof Wn)return new EA(this,r)})}))}this.dispose(this._flyToEvent.disposableOn(o=>{this._polygon.flyTo(o)}))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmTexture(){return this._czmTexture}get polygon(){return this._polygon}get polygonCanvas(){return this._polygonCanvas}get czmFlattenedPlaneWithId(){return this._czmFlattenedPlaneWithId}get czmFlattendPlaneWithIdResetting(){return this._czmFlattendPlaneWithIdResetting}}(t=>{t.createDefaultProps=()=>({enabled:!0,show:!0,positions:a.reactPositions([]),allowPicking:!1,czmFlattenedPlaneId:""})})(Xr||(Xr={})),a.extendClassProps(Xr.prototype,Xr.createDefaultProps);class Ii extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));if(!e.viewer)return;const s=this.ad(new as(e,n)),r=this.ad(new xe(e,n));r.loop=!0,this.ad(a.bind([r,"depthTest"],[this,"depthTest"])),this.dispose(a.track([s,"allowPicking"],[this,"allowPicking"]));{const u=()=>{s.ground=this.ground,r.ground=this.strokeGround,r.arcType=this.strokeGround?"NONE":"GEODESIC"};u();const d=this.ad(a.createNextAnimateFrameEvent(this.groundChanged,this.strokeGroundChanged));this.ad(d.don(u))}const l=()=>{r.show=this.show&&this.outline,s.show=this.show&&this.fill,r.positions=this.positions,s.polygonHierarchy=s.show?{positions:this.positions||[]}:{positions:[]},r.color=this.outlineColor,r.width=this.outlineWidth,s.material={type:"Color",color:this.color||[1,1,1,.5]}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.outlineChanged,this.outlineColorChanged,this.outlineWidthChanged,this.fillChanged,this.colorChanged,this.positionsChanged));this.dispose(c.disposableOn(l)),this.dispose(this.flyToEvent.disposableOn(u=>{this.viewDistanceRange||(s.flyTo(u),this.fill||r.flyTo(u))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}m(Ii,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4],positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,outline:!0,strokeGround:!1,ground:!1,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:a.reactArray([1,1,1,.5]),positions:a.reactPositions(void 0),viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,depthTest:!1})})(Ii||(Ii={})),a.extendClassProps(Ii.prototype,Ii.createDefaultProps);const xa=class xa extends yt{constructor(e,n){super(e,n);m(this,"_geoPolygon");if(!n.viewer){console.warn("viewer is undefined!");return}this._geoPolygon=this.ad(new Ii(n,e.id));const s=this.geoPolygon;s&&(this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"fill"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])))}get geoPolygon(){return this._geoPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r!=null&&r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):r!=null&&r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(xa,"type",xa.register("ESCesiumViewer",a.ESGeoPolygon.type,xa));let Xt=xa,TA=class extends a.Destroyable{constructor(i,e){super(),this._czmESPolygonFlattenedPlane=i,this._eS3DTileset=e,this._eS3DTileset.flattenedPlaneEnabled=!0,this._czmESPolygonFlattenedPlane.polygonFlattenedPlane.czmFlattenedPlaneId=this._eS3DTileset.flattenedPlaneId,this.dispose(()=>this._eS3DTileset.flattenedPlaneEnabled=!1)}};const Aa=class Aa extends Xt{constructor(e,n){super(e,n);m(this,"_polygonFlattenedPlane");m(this,"_tilesSceneObjectWithId");this._polygonFlattenedPlane=this.disposeVar(new Xr(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const c=a.ESSceneObject.getSceneObject(e.targetID);o.value=c?(c.components.main??c).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),!n.viewer){console.warn("viewer is undefined!");return}const r=this._polygonFlattenedPlane;r.enabled=!0,this.dispose(a.track([r,"show"],[e,"show"])),this.dispose(a.bind([r,"positions"],[e,"points"])),this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([r,"czmFlattenedPlaneId"],[e,"czmFlattenedPlaneId"])),this.dispose(a.track([r.polygon,"stroked"],[e,"stroked"])),this.dispose(a.track([r.polygon,"strokeColor"],[e,"strokeColor"])),this.dispose(a.track([r.polygon,"strokeWidth"],[e,"strokeWidth"])),this.dispose(a.track([r.polygon,"filled"],[e,"filled"])),this.dispose(a.track([r.polygon,"fillColor"],[e,"fillColor"])),this.dispose(a.track([r.polygon,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([r.polygon,"fillGround"],[e,"fillGround"]));const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c}=this.tilesSceneObjectWithId;if(c&&c instanceof a.ES3DTileset&&this.sceneObject.show)return new TA(this,c)}))}get polygonFlattenedPlane(){return this._polygonFlattenedPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s,polygonFlattenedPlane:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Aa,"type",Aa.register("ESCesiumViewer",a.ESPolygonFlattenedPlane.type,Aa));let Gd=Aa;function IA(t){return[t.urlChanged,t.classificationTypeChanged,t.ellipsoidChanged,t.modelUpAxisChanged,t.modelForwardAxisChanged,t.cullWithChildrenBoundsChanged,t.enableShowOutlineChanged,t.projectTo2DChanged,t.debugHeatmapTilePropertyNameChanged,t.enableDebugWireframeChanged,t.vectorClassificationOnlyChanged,t.vectorKeepDecodedPositionsChanged]}function fy(t,i){const e=i;if(e.modelMatrix){h.Matrix4.clone(h.Matrix4.fromArray(e.modelMatrix),t.modelMatrix);return}if(!e.position){h.Matrix4.clone(h.Matrix4.IDENTITY,t.modelMatrix);return}let n=t._root.transform;const o=Re({initialRotation:"yForwardzUp",rotation:[0,0,0],position:e.origin});(o&&!o.equalsEpsilon(n,.001)||n.equals(h.Matrix4.IDENTITY))&&o&&(n=o);const s=Re({initialRotation:"yForwardzUp",rotation:e.rotation,position:e.position});if(!s){console.warn("modelMatrix is undefined!");return}const r=h.Matrix4.inverseTransformation(n,new h.Matrix4);h.Matrix4.multiply(s,r,t.modelMatrix)}class MA extends a.Destroyable{constructor(i,e,n){super(),this._tileset=i,this._czm3DTiles=e,this._updateMatrixEvent=n;{const o=()=>{const r=h.Matrix4.inverseTransformation(i.clippingPlanesOriginMatrix,new h.Matrix4);if(!i.clippingPlanes){i.clippingPlanes=_r(e.clippingPlanes??{enabled:!1},r);return}fc(i.clippingPlanes,e.clippingPlanes,r)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(e.clippingPlanesChanged,e.originRootTransformInvChanged,this._updateMatrixEvent));this.dispose(s.disposableOn(o))}}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}}class DA extends a.Destroyable{constructor(i,e){super(),this._tileset=i,this._czm3DTiles=e;const{tileset:n,czm3DTiles:o}=this;{const s=()=>{if(!n.clippingPlanes){n.clippingPlanes=_r(o.clippingPlanes??{enabled:!1});return}fc(n.clippingPlanes,o.clippingPlanes)};s(),this.dispose(o.clippingPlanesChanged.disposableOn(s))}}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}}class RA extends a.Destroyable{constructor(i,e){super(),this._tileset=i,this._czm3DTiles=e;const{tileset:n,czmCzm3DTiles:o}=this;{const s=()=>{n.clippingPolygons=o.clippingPolygons?gc(o.clippingPolygons):new h.ClippingPolygonCollection};s(),this.dispose(o.clippingPolygonsChanged.disposableOn(s))}}get tileset(){return this._tileset}get czmCzm3DTiles(){return this._czm3DTiles}}class FA extends a.Destroyable{constructor(i,e){super(),this._nativeTilesetReadyResetting=i,this._czmFlattenedPlane=e;const{tileset:n}=this;this.setFlattened(!0),this.dispose(()=>{this.setFlattened(!1)});{const o=()=>{const s=this._czmFlattenedPlane.finalMatrix?h.Matrix4.toArray(this._czmFlattenedPlane.finalMatrix):[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];this.setElevationMatrix(s)};o(),this.dispose(this._czmFlattenedPlane.finalMatrixChanged.disposableOn(o))}{const o=()=>{const r=[...this._czmFlattenedPlane.minSize,...this._czmFlattenedPlane.maxSize];this.setFlattenedBound(r)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._czmFlattenedPlane.minSizeChanged,this._czmFlattenedPlane.maxSizeChanged));this.dispose(s.disposableOn(o))}n.xbsjGetFlattenedTextureFunc=()=>{const{sceneObject:o}=this._czmFlattenedPlane.czmTextureWithId;return o?globalThis.czmTexture[o.id].texture:void 0},this.dispose(()=>n.xbsjGetFlattenedTextureFunc=void 0);{const o=()=>{const s=this._czmFlattenedPlane.computedCustomShader;this._nativeTilesetReadyResetting.flattenedCustomShader=s&&new s(this.czm3DTiles,this.czm3DTiles.czmViewer)};o(),this.dispose(this._czmFlattenedPlane.computedCustomShaderChanged.disposableOn(o)),this.dispose(()=>this._nativeTilesetReadyResetting.flattenedCustomShader=void 0)}}get czm3DTiles(){return this._nativeTilesetReadyResetting.czm3DTiles}get tileset(){return this._nativeTilesetReadyResetting.tileset}get czmFlattenedPlane(){return this._czmFlattenedPlane}setFlattened(i){this.tileset.xbsjFlattened=i}setFlattenedBound(i){this.tileset.xbsjFlattenedBound=h.Cartesian4.fromArray(i)}setElevationMatrix(i){this.tileset.xbsjElevationMatrix=h.Matrix4.fromArray(i)}}function zA(t,i){t.show=i.show??!0,t.colorBlendMode=h.Cesium3DTileColorBlendMode[i.colorBlendMode??"HIGHLIGHT"],t.shadows=(i.shadows&&I.czmPropMaps.shadowPropsMap[i.shadows])??I.czmPropMaps.shadowPropsMap.ENABLED,t.maximumScreenSpaceError=i.maximumScreenSpaceError??16,t.maximumMemoryUsage=i.maximumMemoryUsage??be.defaults.maximumMemoryUsage,t.cacheBytes=i.cacheBytes??be.defaults.cacheBytes,t.maximumCacheOverflowBytes=i.maximumCacheOverflowBytes??be.defaults.maximumCacheOverflowBytes,t.cullRequestsWhileMoving=i.cullRequestsWhileMoving??!0,t.cullRequestsWhileMovingMultiplier=i.cullRequestsWhileMovingMultiplier??60,t.preloadWhenHidden=i.preloadWhenHidden??!1,t.preloadFlightDestinations=i.preloadFlightDestinations??!0,t.preferLeaves=i.preferLeaves??!1,t.dynamicScreenSpaceError=i.dynamicScreenSpaceError??!1,t.dynamicScreenSpaceErrorDensity=i.dynamicScreenSpaceErrorDensity??.00278,t.dynamicScreenSpaceErrorFactor=i.dynamicScreenSpaceErrorFactor??4,t.dynamicScreenSpaceErrorHeightFalloff=i.dynamicScreenSpaceErrorHeightFalloff??.25,t.progressiveResolutionHeightFraction=i.progressiveResolutionHeightFraction??.3,t.foveatedScreenSpaceError=i.foveatedScreenSpaceError??!0,t.foveatedConeSize=i.foveatedConeSize??.1,t.foveatedMinimumScreenSpaceErrorRelaxation=i.foveatedMinimumScreenSpaceErrorRelaxation??0,t.foveatedTimeDelay=i.foveatedTimeDelay??.2,t.skipLevelOfDetail=i.skipLevelOfDetail??!1,t.baseScreenSpaceError=i.baseScreenSpaceError??1024,t.skipScreenSpaceErrorFactor=i.skipScreenSpaceErrorFactor??16,t.skipLevels=i.skipLevels??1,t.immediatelyLoadDesiredLevelOfDetail=i.immediatelyLoadDesiredLevelOfDetail??!1,t.loadSiblings=i.loadSiblings??!1,t.lightColor=(i.lightColor&&ui(i.lightColor))??be.defaults.lightColor,t.backFaceCulling=i.backFaceCulling??!0,t.showOutline=i.showOutline??!0,t.outlineColor=te(i.outlineColor??be.defaults.outlineColor),t.featureIdLabel=i.featureIdLabel??be.defaults.featureIdLabel,t.instanceFeatureIdLabel=i.instanceFeatureIdLabel??be.defaults.instanceFeatureIdLabel,t.showCreditsOnScreen=i.showCreditsOnScreen??!1,t.splitDirection=h.SplitDirection[i.splitDirection??be.defaults.splitDirection],t.debugFreezeFrame=i.debugFreezeFrame??!1,t.debugColorizeTiles=i.debugColorizeTiles??!1,t.debugWireframe=i.debugWireframe??!1,t.debugShowBoundingVolume=i.debugShowBoundingVolume??!1,t.debugShowContentBoundingVolume=i.debugShowContentBoundingVolume??!1,t.debugShowViewerRequestVolume=i.debugShowViewerRequestVolume??!1,t.debugShowGeometricError=i.debugShowGeometricError??!1,t.debugShowRenderingStatistics=i.debugShowRenderingStatistics??!1,t.debugShowMemoryUsage=i.debugShowMemoryUsage??!1,t.debugShowUrl=i.debugShowUrl??!1}function LA(t){return[t.showChanged,t.colorBlendModeChanged,t.shadowsChanged,t.maximumScreenSpaceErrorChanged,t.maximumMemoryUsageChanged,t.cacheBytesChanged,t.maximumCacheOverflowBytesChanged,t.cullRequestsWhileMovingChanged,t.cullRequestsWhileMovingMultiplierChanged,t.preloadWhenHiddenChanged,t.preloadFlightDestinationsChanged,t.preferLeavesChanged,t.dynamicScreenSpaceErrorChanged,t.dynamicScreenSpaceErrorDensityChanged,t.dynamicScreenSpaceErrorFactorChanged,t.dynamicScreenSpaceErrorHeightFalloffChanged,t.progressiveResolutionHeightFractionChanged,t.foveatedScreenSpaceErrorChanged,t.foveatedConeSizeChanged,t.foveatedMinimumScreenSpaceErrorRelaxationChanged,t.foveatedTimeDelayChanged,t.skipLevelOfDetailChanged,t.baseScreenSpaceErrorChanged,t.skipScreenSpaceErrorFactorChanged,t.skipLevelsChanged,t.immediatelyLoadDesiredLevelOfDetailChanged,t.loadSiblingsChanged,t.lightColorChanged,t.backFaceCullingChanged,t.showOutlineChanged,t.outlineColorChanged,t.featureIdLabelChanged,t.instanceFeatureIdLabelChanged,t.showCreditsOnScreenChanged,t.splitDirectionChanged,t.debugFreezeFrameChanged,t.debugColorizeTilesChanged,t.debugWireframeChanged,t.debugShowBoundingVolumeChanged,t.debugShowContentBoundingVolumeChanged,t.debugShowViewerRequestVolumeChanged,t.debugShowGeometricErrorChanged,t.debugShowRenderingStatisticsChanged,t.debugShowMemoryUsageChanged,t.debugShowUrlChanged,t.enableShowOutlineChanged]}function NA(t,i){console.warn("Czm3DTiles暂不支持pointCloudShading属性"),t.pointCloudShading=new h.PointCloudShading(i.pointCloudShading)}function OA(t,i){var n,o,s;t.imageBasedLighting.imageBasedLightingFactor=Pe(((n=i.imageBasedLighting)==null?void 0:n.imageBasedLightingFactor)??[1,1]),t.imageBasedLighting.specularEnvironmentMaps=(o=i.imageBasedLighting)==null?void 0:o.specularEnvironmentMaps;const e=(s=i.imageBasedLighting)==null?void 0:s.sphericalHarmonicCoefficients;t.imageBasedLighting.sphericalHarmonicCoefficients=e&&Pu(e)}class BA extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_clippingPlanesCollectionResetting");m(this,"_clippingPolygonCollectionResetting");m(this,"_flattenedCustomShader",this.disposeVar(a.react(void 0)));this._tileset=e,this._czm3DTiles=n,this._czmNativeViewer=o,this._czmViewer=s,this._clippingPolygonCollectionResetting=new RA(this.tileset,this.czm3DTiles);const{tileset:r,czm3DTiles:l}=this;{const w=this.disposeVar(a.createNextAnimateFrameEvent(this.czm3DTiles.positionChanged,this.czm3DTiles.rotationChanged,this.czm3DTiles.modelMatrixChanged,this.czm3DTiles.originChanged));fy(this.tileset,this.czm3DTiles),this.dispose(w.disposableOn(()=>fy(this.tileset,this.czm3DTiles))),this._clippingPlanesCollectionResetting=this.disposeVar(new a.ObjResettingWithEvent(this.czm3DTiles.absoluteClippingPlanesChanged,()=>this.czm3DTiles.absoluteClippingPlanes?new MA(this.tileset,this.czm3DTiles,w):new DA(this.tileset,this.czm3DTiles)))}this.disposeVar(new a.ObjResettingWithEvent(this.czm3DTiles.czmFlattenedPlaneWithId.sceneObjectChanged,()=>{const{sceneObject:w}=this.czm3DTiles.czmFlattenedPlaneWithId;if(!w)return;let P;a.engineObjectCreatedUpdate(this,w,()=>{const C=s.getEngineObject(w);if(w instanceof a.ES3DTileset&&(P=C.flattenedPlane),!!P)return new FA(this,P)})}));const c=this.disposeVar(a.createNextAnimateFrameEvent(...LA(l)));a.registerEventUpdate(this,c,()=>{zA(r,l)}),a.registerEventUpdate(this,l.foveatedInterpolationCallbackChanged,()=>{r.foveatedInterpolationCallback=l.foveatedInterpolationCallback}),a.registerEventUpdate(this,l.styleChanged,()=>{r.style=l.style}),a.registerEventUpdate(this,l.pointCloudShadingChanged,()=>{NA(r,l)}),a.registerEventUpdate(this,l.imageBasedLightingChanged,()=>{OA(r,l)}),a.registerEventUpdate(this,l.environmentMapManagerChanged,()=>{_u(r.environmentMapManager,l)});let u=[],d,p,f=!0,g=()=>{var w;return(w=s.viewer)==null?void 0:w.scene.postUpdate.addEventListener(P=>{r._selectedTiles.length===u.length&&u.every(C=>r._selectedTiles.includes(C))||(u.splice(0,u.length,...r._selectedTiles),r._selectedTiles.forEach(C=>{Sr(C.content._model,d)}))})};const v=()=>{p&&(p(),p=void 0),u=[],d=void 0};this.ad(v);const y=(w,P)=>{P=="default"?w._contentState=h.Cesium3DTileContentState.UNLOADED:w.content&&Reflect.has(w.content,"_model")&&!Sr(w.content._model,P)&&f&&(f=!1),w.children&&w.children.forEach(C=>{y(C,P)})};this.ad(l.setMaterialEvent.don(async w=>{if(f=!0,w=="default")v(),y(r.root,"default");else{d={};for(const C in w){let S,A,E;const R=w[C];d[C]={...R},Reflect.has(R,"baseColorTexture")&&(R.baseColorTexture==null?d[C].baseColorTexture=void 0:R.baseColorTexture.value!=""&&(S=co(this._czmViewer.viewer,R.baseColorTexture,{magFilter:R.magFilter,minFilter:R.minFilter}))),Reflect.has(R,"normalTexture")&&(R.normalTexture==null?d[C].normalTexture=void 0:R.normalTexture.value!=""&&(A=co(this._czmViewer.viewer,R.normalTexture,{magFilter:R.magFilter,minFilter:R.minFilter}))),Reflect.has(R,"metallicRoughnessTexture")&&(R.metallicRoughnessTexture==null?d[C].metallicRoughnessTexture=void 0:R.metallicRoughnessTexture.value!=""&&(E=co(this._czmViewer.viewer,R.metallicRoughnessTexture,{magFilter:R.magFilter,minFilter:R.minFilter})));const N=await Promise.allSettled([S,A,E]);S=N[0].value,A=N[1].value,E=N[2].value,E!=null&&(d[C].metallicRoughnessTexture=E),S!=null&&(d[C].baseColorTexture=S),A!=null&&(d[C].normalTexture=A)}y(r.root,d),p||(p=g())}const P=a.ESSceneObject.getSceneObject(this.czm3DTiles.id);P&&P instanceof a.ES3DTileset&&P.setMaterialInfoEvent.emit({type:f?"success":"warn",message:f?"完成":"部分材质颜色纹理设置失败,请检查原始模型中材质是否具有baseColorTexture属性"})}));{const w=()=>{var C,S;if(this.flattenedCustomShader){r.customShader=(C=this.flattenedCustomShader)==null?void 0:C.customShader,l.customShaderInstance&&console.warn("压平shader和Czm3DTiles的customShader冲突,优先使用压平shader!");return}r.customShader=(S=l.customShaderInstance)==null?void 0:S.customShader};w();const P=this.disposeVar(a.createNextAnimateFrameEvent(l.customShaderInstanceChanged,this.flattenedCustomShaderChanged));this.dispose(P.disposableOn(w))}this.dispose(l.flyToEvent.disposableOn(w=>{l.czmViewer.actived&&this.tileset&&this._czmNativeViewer.camera.flyToBoundingSphere(this.tileset.boundingSphere,{duration:(w??1e3)/1e3})}))}get tileset(){return this._tileset}get czm3DTiles(){return this._czm3DTiles}get clippingPlanesCollectionResetting(){return this._clippingPlanesCollectionResetting}get clippingPolygonCollectionResetting(){return this._clippingPolygonCollectionResetting}get flattenedCustomShader(){return this._flattenedCustomShader.value}set flattenedCustomShader(e){this._flattenedCustomShader.value=e}get flattenedCustomShaderChanged(){return this._flattenedCustomShader.changed}}function VA(t){const{imageBasedLightingFactor:i,sphericalHarmonicCoefficients:e,specularEnvironmentMaps:n}=t,o={imageBasedLightingFactor:i&&new h.Cartesian2(i[0],i[1]),sphericalHarmonicCoefficients:e&&e.map(s=>new h.Cartesian3(s[0],s[1],s[2])),specularEnvironmentMaps:n&&a.ESSceneObject.context.getStrFromEnv(n)};return new h.ImageBasedLighting(o)}async function WA(t,i,e){let n="";if(typeof i!="string"?typeof i=="object"&&i.url&&(n=new h.Resource({url:i.url,headers:i.headers,queryParameters:i.queryParameters,templateValues:i.templateValues,proxy:i.proxy,retryCallback:i.retryCallback,retryAttempts:i.retryAttempts,request:i.request,parseUrl:i.parseUrl})):n=i,typeof i=="string"&&i.startsWith("ion://")){const r=+i.substring(6);try{n=await h.IonResource.fromAssetId(r)}catch(l){console.error(`Ion资源未能获取到 error: ${l}`,l);return}}const o=await h.Cesium3DTileset.fromUrl(n,{show:t.show,shadows:t.shadows&&I.czmPropMaps.shadowPropsMap[t.shadows],maximumScreenSpaceError:t.maximumScreenSpaceError,maximumMemoryUsage:t.maximumMemoryUsage,cacheBytes:t.cacheBytes,maximumCacheOverflowBytes:t.maximumCacheOverflowBytes,cullWithChildrenBounds:t.cullWithChildrenBounds,cullRequestsWhileMoving:t.cullRequestsWhileMoving,cullRequestsWhileMovingMultiplier:t.cullRequestsWhileMovingMultiplier,preloadWhenHidden:t.preloadWhenHidden,preloadFlightDestinations:t.preloadFlightDestinations,preferLeaves:t.preferLeaves,dynamicScreenSpaceError:t.dynamicScreenSpaceError,dynamicScreenSpaceErrorDensity:t.dynamicScreenSpaceErrorDensity,dynamicScreenSpaceErrorFactor:t.dynamicScreenSpaceErrorFactor,dynamicScreenSpaceErrorHeightFalloff:t.dynamicScreenSpaceErrorHeightFalloff,progressiveResolutionHeightFraction:t.progressiveResolutionHeightFraction,foveatedScreenSpaceError:t.foveatedScreenSpaceError,foveatedConeSize:t.foveatedConeSize,foveatedMinimumScreenSpaceErrorRelaxation:t.foveatedMinimumScreenSpaceErrorRelaxation,foveatedInterpolationCallback:t.foveatedInterpolationCallbackStr&&Function('"use strict";return ('+t.foveatedInterpolationCallbackStr+")")(),foveatedTimeDelay:t.foveatedTimeDelay,skipLevelOfDetail:t.skipLevelOfDetail,baseScreenSpaceError:t.baseScreenSpaceError,skipScreenSpaceErrorFactor:t.skipScreenSpaceErrorFactor,skipLevels:t.skipLevels,immediatelyLoadDesiredLevelOfDetail:t.immediatelyLoadDesiredLevelOfDetail,loadSiblings:t.loadSiblings,classificationType:I.czmPropMaps.classificationTypeMap[t.classificationType??be.defaults.classificationType],lightColor:t.lightColor&&hi(t.lightColor),backFaceCulling:t.backFaceCulling??be.defaults.backFaceCulling,showOutline:t.showOutline??be.defaults.showOutline,debugHeatmapTilePropertyName:t.debugHeatmapTilePropertyName,debugFreezeFrame:t.debugFreezeFrame,debugColorizeTiles:t.debugColorizeTiles,debugWireframe:t.debugWireframe,debugShowBoundingVolume:t.debugShowBoundingVolume,debugShowContentBoundingVolume:t.debugShowContentBoundingVolume,debugShowViewerRequestVolume:t.debugShowViewerRequestVolume,debugShowGeometricError:t.debugShowGeometricError,debugShowRenderingStatistics:t.debugShowRenderingStatistics,debugShowMemoryUsage:t.debugShowMemoryUsage,debugShowUrl:t.debugShowUrl,customShader:e,ellipsoid:Ce(t.ellipsoid??be.defaults.ellipsoid),modelMatrix:t.modelMatrix&&h.Matrix4.fromArray(t.modelMatrix),clippingPlanes:t.clippingPlanes&&_r(t.clippingPlanes),clippingPolygons:t.clippingPolygons&&gc(t.clippingPolygons),imageBasedLighting:t.imageBasedLighting&&VA(t.imageBasedLighting),splitDirection:h.SplitDirection[t.splitDirection??be.defaults.splitDirection],modelUpAxis:t.modelUpAxis&&h.Axis[t.modelUpAxis],modelForwardAxis:t.modelForwardAxis&&h.Axis[t.modelForwardAxis],featureIdLabel:t.featureIdLabel??be.defaults.featureIdLabel,instanceFeatureIdLabel:t.instanceFeatureIdLabel??be.defaults.instanceFeatureIdLabel,outlineColor:t.outlineColor&&te(t.outlineColor),pointCloudShading:t.pointCloudShading,enableShowOutline:t.enableShowOutline,vectorClassificationOnly:t.vectorClassificationOnly,vectorKeepDecodedPositions:t.vectorKeepDecodedPositions,showCreditsOnScreen:t.showCreditsOnScreen,projectTo2D:t.projectTo2D,enableDebugWireframe:t.enableDebugWireframe});return h.Cesium3DTileset.prototype&&(o.ESSceneObjectID=t.id),o}class GA extends a.Destroyable{constructor(e,n,o,s){var c;super();m(this,"_tileset",this.disposeVar(a.react(void 0)));m(this,"_readyResetting");if(this._url=e,this._czm3DTiles=n,this._czmNativeViewer=o,this._czmViewer=s,this._readyResetting=this.disposeVar(new a.ObjResettingWithEvent(this.tilesetChanged,()=>{if(this.tileset)return new BA(this.tileset,this.czm3DTiles,this._czmNativeViewer,this._czmViewer)})),!this.url)throw new Error("!url");const r=(c=this.czm3DTiles.customShaderInstance)==null?void 0:c.customShader;this.disposeVar(a.createProcessingFromAsyncFunc(async u=>{const d=await u.promise(WA(this.czm3DTiles,this.url,r));d&&(d.style=this.czm3DTiles.style,d.foveatedInterpolationCallback=this.czm3DTiles.foveatedInterpolationCallback,this._czmNativeViewer.scene.primitives.add(d),this.dispose(()=>this._czmNativeViewer.scene.primitives.remove(d)),this._tileset.value=d,this.czm3DTiles.notifyCzmTilesetReady(d,this.czm3DTiles))})).start()}get url(){return this._url}get czm3DTiles(){return this._czm3DTiles}get czmViewer(){return this.czm3DTiles.czmViewer}get tileset(){return this._tileset.value}set tileset(e){this._tileset.value=e}get tilesetChanged(){return this._tileset.changed}get readyResetting(){return this._readyResetting}}function UA(t){if(t)try{return new h.Cesium3DTileStyle(t)}catch(i){console.error(`Cesium3DTiles style error: ${i}`,i);return}}let HA=class extends a.Destroyable{constructor(i,e){super(),this.dv(new a.ObjResettingWithEvent(e.clippingPolygonsIdChanged,(n,o)=>{if(!(!n||n===o||n&&n.length===0))return new $A(i,e)}))}},$A=class extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=e.clippingPolygonsId;this.d(()=>e.clippingPolygons=void 0);const o=r=>{const l=this.dv(a.createNextAnimateFrameEvent(r.positionsChanged,r.reverseChanged,r.enabledChanged,r.showHelperChanged));this.dv(new a.ObjResettingWithEvent(l,()=>new qA(i,r,e)))},s=r=>{let l;r instanceof a.ESExcavate&&a.engineObjectCreatedUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,l&&o(l)}),r instanceof a.ESHole&&a.engineObjectCreatedUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,l&&o(l)})};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);c&&s(c)}}},qA=class extends a.Destroyable{constructor(i,e,n){super(),this._czmViewer=i;const o=n.clippingPolygonsId,s=e.enabled?e.reverse:void 0;if(o&&o.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let l=0;l<o.length;l++){const c=o[l],u=a.ESSceneObject.getSceneObjById(c);if(!u)return;let d;if(u instanceof a.ESExcavate?d=i.getEngineObject(u).czmPolygonClipping:u instanceof a.ESHole&&(d=i.getEngineObject(u.excavate).czmPolygonClipping),!d)return;d&&d.positions&&d.positions.length>=3&&d.enabled&&(r.polygons[l]={positions:d.positions},r.inverse=s??d.reverse)}n.clippingPolygons=r}}};function gy(t){let i;try{i=t&&Function('"use strict";return ('+t+")")()}catch{i=void 0}return i||h.Math.lerp}const my=`
|
|
407
407
|
// shader定义请参见文档:https://github.com/CesiumGS/cesium/tree/main/Documentation/CustomShaderGuide#customshader-documentation
|
|
408
408
|
class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
409
409
|
constructor(sceneObject, viewer) {
|
|
@@ -544,7 +544,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
544
544
|
\`\`\`
|
|
545
545
|
`,ZA=`function (p, q, time) {
|
|
546
546
|
return (1.0 - time) * p + time * q;
|
|
547
|
-
};`,QA={color:"vec4(1,0,0,1)"},vy={planes:[{normal:[1,0,0],distance:0}],enabled:!0,modelMatrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],unionClippingRegions:!1,edgeColor:[1,1,1,1],edgeWidth:2};`${JSON.stringify(vy,void 0," ")}`;const yy={attenuation:!1,geometricErrorScale:1,maximumAttenuation:16,baseResolution:void 0,eyeDomeLighting:!0,eyeDomeLightingStrength:1,eyeDomeLightingRadius:1,backFaceCulling:!1,normalShading:!0};`${JSON.stringify(yy,void 0," ")}`;const wy={imageBasedLightingFactor:[1,1],luminanceAtZenith:2,sphericalHarmonicCoefficients:[[1.234709620475769,1.221461296081543,1.273156881332397],[1.135921120643616,1.171217799186707,1.287644743919373],[1.245193719863892,1.245591878890991,1.282818794250488],[-1.106930732727051,-1.112522482872009,-1.153198838233948],[-1.086226940155029,-1.079731941223145,-1.101912498474121],[1.189834713935852,1.185906887054443,1.214385271072388],[.01778045296669,.02013735473156,.025313569232821],[-1.086826920509338,-1.084611177444458,-1.111204028129578],[-.05241484940052,-.048303380608559,-.041960217058659]],specularEnvironmentMaps:""},kA={enabled:!0,mipmapLevels:7,maximumSecondsDifference:3600,maximumPositionEpsilon:1e3,atmosphereScatteringIntensity:2,gamma:1,brightness:1,saturation:1,groundColor:[.44313725490196076,.44313725490196076,.27058823529411763,1],groundAlbedo:.31};`${JSON.stringify(wy,void 0," ")}`;const KA=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];let JA=class extends a.Destroyable{constructor(i,e){super(),this._czm3DTiles=i,this._czmClippingPlanes=e,this.dispose(a.track([this._czm3DTiles,"clippingPlanes"],[this._czmClippingPlanes,"computedClippingPlanes"])),this.dispose(()=>this._czm3DTiles.clippingPlanes=void 0)}};const Kt=class Kt extends a.Destroyable{constructor(e,n,o){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_supportEdit",this.disposeVar(a.react(!0)));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_customShaderInstanceClass",this.disposeVar(a.react(void 0)));m(this,"_updateCustomShaderEvent",this.disposeVar(new a.Event));m(this,"_foveatedInterpolationCallback",this.disposeVar(a.react(Kt.defaultFoveatedInterpolationCallback)));m(this,"_origin",this.disposeVar(a.react(void 0)));m(this,"_czmTilesetReadyEvent",this.disposeVar(new a.Event));m(this,"_czmFlattenedPlaneWithId");m(this,"_clippingPlanesSceneObjectWithId");m(this,"_customShaderInstance",this.disposeVar(a.react(void 0)));m(this,"_style",this.disposeVar(a.react(void 0)));m(this,"_originRootTransform",this.disposeVar(a.react(void 0)));m(this,"_originRootTransformInv",this.disposeVar(a.react(void 0)));m(this,"_recreateEvent",this.disposeVar(a.createNextAnimateFrameEvent(...IA(this))));m(this,"_nativeTilesetResetting");m(this,"_setMaterialEvent",this.disposeVar(new a.Event));this._czmViewer=e,o&&(this.id=o),this._nativeTilesetResetting=this.disposeVar(new a.ObjResettingWithEvent(this._recreateEvent,()=>{typeof this.url=="string"?this.url=a.ESSceneObject.context.getStrFromEnv(this.url):this.url&&(this.url.url=a.ESSceneObject.context.getStrFromEnv(this.url.url));const l=this.url;if(l)return new GA(l,this,e.viewer,e)})),this._clippingPlanesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[this,"clippingPlanesId"])),this.ad(new HA(this.czmViewer,this));const s=l=>{if(l&&"computedClippingPlanes"in l&&"computedClippingPlanesChanged"in l)return new JA(this,l)};this.disposeVar(new a.ObjResettingWithEvent(this.clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:l}=this.clippingPlanesSceneObjectWithId;if(!l){this.clippingPlanes=void 0;return}let c,u;return l instanceof a.ESBoxClipping&&a.registerCreatedEventUpdate(this,l,()=>{c=e.getEngineObject(l).czmBoxClippingPlanes,u=s(c)}),l instanceof a.ES3DTileset&&(c=n.clippingPlanes,u=s(c)),u})),this._czmFlattenedPlaneWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._czmFlattenedPlaneWithId,"id"],[this,"czmFlattenedPlaneId"])),this.dispose(this.originChanged.disposableOn(()=>{this.origin&&(this.position=this.origin)}));const r=()=>{try{this.customShaderInstanceClass=this.customShaderInstanceClassStr&&Function(`"use strict";return (${this.customShaderInstanceClassStr})`)()}catch{this.customShaderInstanceClass=void 0}};r(),this.dispose(this.customShaderInstanceClassStrChanged.disposableOn(r)),a.registerEventUpdate(this,this.foveatedInterpolationCallbackStrChanged,()=>{this.foveatedInterpolationCallback=gy(this.foveatedInterpolationCallbackStr)}),this.dispose(this.urlChanged.disposableOn(()=>{this._origin.value=void 0})),this.dispose(this._czmTilesetReadyEvent.disposableOn((l,c)=>{if(!this._origin.value){let u=l.root.transform;const d=h.Matrix4.getTranslation(u,new h.Cartesian3),p=se(d),f=Re({initialRotation:"yForwardzUp",rotation:[0,0,0],position:p});f&&!f.equalsEpsilon(u,.001)||u.equals(h.Matrix4.IDENTITY)?(u=l.clippingPlanesOriginMatrix,this._origin.value=se(h.Matrix4.getTranslation(u,new h.Cartesian3))):this._origin.value=p}})),a.registerEventUpdate(this,this.styleJsonChanged,()=>this.style=UA(this.styleJson)),a.registerEventUpdate(this,this.customShaderInstanceClassChanged,()=>{const l=this.customShaderInstanceClass;this.customShaderInstance=l&&new l(this,e)}),this.dispose(this.updateCustomShaderEvent.disposableOn(l=>{this.customShaderInstance&&l(this.customShaderInstance,this,e)}))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get czmViewer(){return this._czmViewer}get supportEdit(){return this._supportEdit.value}set supportEdit(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customShaderInstanceClass(){return this._customShaderInstanceClass.value}set customShaderInstanceClass(e){this._customShaderInstanceClass.value=e}get customShaderInstanceClassChanged(){return this._customShaderInstanceClass.changed}get updateCustomShaderEvent(){return this._updateCustomShaderEvent}updateCustomShader(e){this._updateCustomShaderEvent.emit(e)}get foveatedInterpolationCallback(){return this._foveatedInterpolationCallback.value}get foveatedInterpolationCallbackChanged(){return this._foveatedInterpolationCallback.changed}set foveatedInterpolationCallback(e){this._foveatedInterpolationCallback.value=e}get imageBasedLightingFactor(){return this.imageBasedLighting&&this.imageBasedLighting.imageBasedLightingFactor}get imageBasedLightingFactorChanged(){return this.imageBasedLightingChanged}set imageBasedLightingFactor(e){this.imageBasedLighting=this.imageBasedLighting&&{...this.imageBasedLighting,imageBasedLightingFactor:e}||{imageBasedLightingFactor:e}}get origin(){return this._origin.value}get originChanged(){return this._origin.changed}setPositionAsOrigin(){this.position=this.origin}get czmTilesetReadyEvent(){return this._czmTilesetReadyEvent}notifyCzmTilesetReady(e,n){this._czmTilesetReadyEvent.emit(e,n)}get czmFlattenedPlaneWithId(){return this._czmFlattenedPlaneWithId}get clippingPlanesSceneObjectWithId(){return this._clippingPlanesSceneObjectWithId}get customShaderInstance(){return this._customShaderInstance.value}get customShaderInstanceChanged(){return this._customShaderInstance.changed}set customShaderInstance(e){this._customShaderInstance.value=e}get style(){return this._style.value}get styleChanged(){return this._style.changed}set style(e){this._style.value=e}get originRootTransform(){return this._originRootTransform.value}set originRootTransform(e){this._originRootTransform.value=e}get originRootTransformChanged(){return this._originRootTransform.changed}get originRootTransformInv(){return this._originRootTransformInv.value}set originRootTransformInv(e){this._originRootTransformInv.value=e}get originRootTransformInvChanged(){return this._originRootTransformInv.changed}get recreateEvent(){return this._recreateEvent}get nativeTilesetResetting(){return this._nativeTilesetResetting}get tileset(){var e;return(e=this.nativeTilesetResetting.obj)==null?void 0:e.tileset}get tilesetChanged(){return this.nativeTilesetResetting.objChanged}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){this._setMaterialEvent.emit(e)}async openLocalDir(){const e=await a.defaultLocalFileServer.getRootDirId("3dtiles");if(e===void 0){console.warn("openLocalDir failed!");return}const n=`https://${e}/tileset.json`;this.url=n}};m(Kt,"defaultCustomShaderInstanceClassStr",my),m(Kt,"customShaderInstanceClassStrMd",XA),m(Kt,"styleMd",YA),m(Kt,"defaultFoveatedInterpolationCallbackStr",ZA),m(Kt,"defaultStyleJson",QA),m(Kt,"defaultFoveatedInterpolationCallback",h.Math.lerp),m(Kt,"defaults",{url:"",show:!0,colorBlendMode:"HIGHLIGHT",modelMatrix:KA,modelUpAxis:"Y",modelForwardAxis:"X",shadows:"ENABLED",maximumScreenSpaceError:16,maximumMemoryUsage:512,cacheBytes:512*1024*1024,maximumCacheOverflowBytes:512*1024*1024,cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:60,preloadWhenHidden:!1,preloadFlightDestinations:!0,preferLeaves:!1,dynamicScreenSpaceError:!1,dynamicScreenSpaceErrorDensity:.00278,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceErrorHeightFalloff:.25,progressiveResolutionHeightFraction:.3,foveatedScreenSpaceError:!0,foveatedConeSize:.1,foveatedMinimumScreenSpaceErrorRelaxation:0,foveatedTimeDelay:.2,skipLevelOfDetail:!1,baseScreenSpaceError:1024,skipScreenSpaceErrorFactor:16,skipLevels:1,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!1,clippingPlanes:vy,classificationType:"NONE",ellipsoid:Im,pointCloudShading:yy,lightColor:void 0,imageBasedLighting:wy,environmentMapManager:kA,backFaceCulling:!0,enableShowOutline:!0,showOutline:!0,outlineColor:[0,0,0,1],vectorClassificationOnly:!1,vectorKeepDecodedPositions:!1,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0",showCreditsOnScreen:!1,splitDirection:"NONE",projectTo2D:!1,debugHeatmapTilePropertyName:"",debugFreezeFrame:!1,debugColorizeTiles:!1,enableDebugWireframe:!1,debugWireframe:!1,debugShowBoundingVolume:!1,debugShowContentBoundingVolume:!1,debugShowViewerRequestVolume:!1,debugShowGeometricError:!1,debugShowRenderingStatistics:!1,debugShowMemoryUsage:!1,debugShowUrl:!1,customShaderInstanceClassStr:Kt.defaultCustomShaderInstanceClassStr,styleJson:Kt.defaultStyleJson,foveatedInterpolationCallbackStr:Kt.defaultFoveatedInterpolationCallbackStr});let be=Kt;(t=>{t.createDefaultProps=()=>({position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined([0,0,0]),allowPicking:!1,czmFlattenedPlaneId:"",url:void 0,show:void 0,colorBlendMode:void 0,modelMatrix:a.reactArrayWithUndefined(void 0),modelUpAxis:void 0,modelForwardAxis:void 0,shadows:void 0,maximumScreenSpaceError:void 0,maximumMemoryUsage:void 0,cacheBytes:void 0,maximumCacheOverflowBytes:void 0,cullWithChildrenBounds:void 0,cullRequestsWhileMoving:void 0,cullRequestsWhileMovingMultiplier:void 0,preloadWhenHidden:void 0,preloadFlightDestinations:void 0,preferLeaves:void 0,dynamicScreenSpaceError:void 0,dynamicScreenSpaceErrorDensity:void 0,dynamicScreenSpaceErrorFactor:void 0,dynamicScreenSpaceErrorHeightFalloff:void 0,progressiveResolutionHeightFraction:void 0,foveatedScreenSpaceError:void 0,foveatedConeSize:void 0,foveatedMinimumScreenSpaceErrorRelaxation:void 0,foveatedInterpolationCallbackStr:void 0,foveatedTimeDelay:void 0,skipLevelOfDetail:void 0,baseScreenSpaceError:void 0,skipScreenSpaceErrorFactor:void 0,skipLevels:void 0,immediatelyLoadDesiredLevelOfDetail:void 0,loadSiblings:void 0,clippingPlanes:a.reactJsonWithUndefined(void 0),clippingPlanesId:"",clippingPolygons:a.reactJsonWithUndefined(void 0),clippingPolygonsId:a.reactArray([]),absoluteClippingPlanes:!1,classificationType:void 0,ellipsoid:a.reactArrayWithUndefined(void 0),pointCloudShading:a.reactJsonWithUndefined(void 0),lightColor:a.reactArrayWithUndefined(void 0),imageBasedLighting:a.reactJsonWithUndefined(void 0),environmentMapManager:a.reactJsonWithUndefined(void 0),backFaceCulling:void 0,enableShowOutline:void 0,showOutline:void 0,outlineColor:a.reactArrayWithUndefined(void 0),vectorClassificationOnly:void 0,vectorKeepDecodedPositions:void 0,featureIdLabel:void 0,instanceFeatureIdLabel:void 0,showCreditsOnScreen:void 0,splitDirection:void 0,projectTo2D:void 0,debugHeatmapTilePropertyName:void 0,debugFreezeFrame:void 0,debugColorizeTiles:void 0,enableDebugWireframe:void 0,debugWireframe:void 0,debugShowBoundingVolume:void 0,debugShowContentBoundingVolume:void 0,debugShowViewerRequestVolume:void 0,debugShowGeometricError:void 0,debugShowRenderingStatistics:void 0,debugShowMemoryUsage:void 0,debugShowUrl:void 0,customShaderInstanceClassStr:void 0,styleJson:a.reactJsonWithUndefined(void 0),autoSetPositionAsOrigin:void 0})})(be||(be={})),a.extendClassProps(be.prototype,be.createDefaultProps);class jA extends a.Destroyable{constructor(){super();m(this,"strokeSilhouette",h.PostProcessStageLibrary.createEdgeDetectionStage());m(this,"_viewer",this.disposeVar(a.react(void 0)));m(this,"_featureMap",new Map);const e=()=>{this.viewer&&(this.viewer.scene.postProcessStages.add(h.PostProcessStageLibrary.createSilhouetteStage([this.strokeSilhouette])),this.strokeSilhouette.uniforms.length=.01,this.strokeSilhouette.uniforms.color=h.Color.RED,this.strokeSilhouette.selected=[],this.ad(()=>{this.viewer&&this.viewer.scene.postProcessStages.remove(this.strokeSilhouette)}))};e(),this.ad(this.viewerChanged.don(e))}get viewer(){return this._viewer.value}set viewer(e){this.viewer instanceof h.Viewer||(this._viewer.value=e)}get viewerChanged(){return this._viewer.changed}get selected(){return[...this._featureMap.values()].flat()}setStrokeLength(e){this.strokeSilhouette.uniforms.length=e??.01}setStrokeColor(e){this.strokeSilhouette.uniforms.color=h.Color.fromBytes(e[0]*255,e[1]*255,e[2]*255,e[3]*255)}setStrokeSelect(e,n,o=!1){if(!this._featureMap.has(e))return;let s=this._featureMap.get(e);o&&(s==null||s.push(...n)),s=n,this._featureMap.set(e,s),this.strokeSilhouette.selected=this.selected}register(e){this.viewer=e.viewer.viewer,!this._featureMap.has(e)&&this._featureMap.set(e,[])}unregister(e){this._featureMap.has(e)&&(this._featureMap.delete(e),this.strokeSilhouette.selected=this.selected)}}const eE=(t,i)=>h.Color.fromBytes(t[0]*255,t[1]*255,t[2]*255,t[3]*255,i),tE=(t,i)=>{const e=t;let n=!1;switch(e.op){case"==":i===e.value&&(n=!0);break;case"!=":i!==e.value&&(n=!0);break;case"contain":i&&i.includes(e.value)&&(n=!0);break;case"empty":(i===""||i===null||i===void 0||!i)&&(n=!0);break;default:n=!1;break}return n},iE=(t,i)=>{const e=t;let n=!1;switch(e.op){case"==":i===e.value&&(n=!0);break;case"!=":i!==e.value&&(n=!0);break;case">":i>e.value&&(n=!0);break;case">=":i>=e.value&&(n=!0);break;case"<":i<e.value&&(n=!0);break;case"<=":i<=e.value&&(n=!0);break;default:n=!1;break}return n},nE=(t,i)=>{const e=[];for(let n of t.condition){if(typeof n=="boolean"){e.push(n);continue}const s=typeof n.value=="string",r=typeof n.value=="number";if(!s&&!r){e.push(!1);continue}const l=n.field;let c;if(l.includes("."))try{const u=l.split(".");c=JSON.parse(i.getProperty(u[0]));for(let d of u.slice(1))if(c=c==null?void 0:c[d],c===void 0)throw new Error(`${c}上不存在属性${d},将使用默认颜色!`)}catch{e.push(!1);continue}else c=i.getProperty(l);if(s){e.push(tE(n,c));continue}else if(r){e.push(iE(n,c));continue}else{e.push(!1);continue}}return e},oE=(t,i)=>{const e=[];for(let n of t.condition){if(typeof n=="boolean"){e.push(n);continue}const s=typeof n.value=="string",r=typeof n.value=="number";if(!s&&!r){e.push(!1);continue}const l=n.field;let c;if(l.includes("."))try{const u=l.split(".");c=JSON.parse(i.getProperty(u[0]));for(let d of u.slice(1))if(c=c==null?void 0:c[d],c===void 0)throw new Error(`${c}上不存在属性${d},将使用默认颜色!`)}catch{e.push(!1);continue}else c=i.getProperty(l);if(s){e.push(sE(n,c));continue}else if(r){e.push(rE(n,c));continue}else{e.push(!1);continue}}return e},sE=(t,i)=>{const e=t;let n=!1;switch(e.op){case"==":i===e.value&&(n=!0);break;case"!=":i!==e.value&&(n=!0);break;case"contain":i.includes(e.value)&&(n=!0);break;case"empty":(i===""||i===null||i===void 0||!i)&&(n=!0);break;default:n=!1;break}return n},rE=(t,i)=>{const e=t;let n=!1;switch(e.op){case"==":i===e.value&&(n=!0);break;case"!=":i!==e.value&&(n=!0);break;case">":i>e.value&&(n=!0);break;case">=":i>=e.value&&(n=!0);break;case"<":i<e.value&&(n=!0);break;case"<=":i<=e.value&&(n=!0);break;default:n=!1;break}return n};let Cy=[1,1,1];class aE extends a.Destroyable{constructor(e,n){super();m(this,"_customShader");const o=new h.CustomShader({uniforms:{u_baseColor:{type:h.UniformType.VEC3,value:h.Cartesian3.fromArray(Cy)}},fragmentShaderText:`
|
|
547
|
+
};`,QA={color:"vec4(1,0,0,1)"},vy={planes:[{normal:[1,0,0],distance:0}],enabled:!0,modelMatrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],unionClippingRegions:!1,edgeColor:[1,1,1,1],edgeWidth:2};`${JSON.stringify(vy,void 0," ")}`;const yy={attenuation:!1,geometricErrorScale:1,maximumAttenuation:16,baseResolution:void 0,eyeDomeLighting:!0,eyeDomeLightingStrength:1,eyeDomeLightingRadius:1,backFaceCulling:!1,normalShading:!0};`${JSON.stringify(yy,void 0," ")}`;const wy={imageBasedLightingFactor:[1,1],luminanceAtZenith:2,sphericalHarmonicCoefficients:[[1.234709620475769,1.221461296081543,1.273156881332397],[1.135921120643616,1.171217799186707,1.287644743919373],[1.245193719863892,1.245591878890991,1.282818794250488],[-1.106930732727051,-1.112522482872009,-1.153198838233948],[-1.086226940155029,-1.079731941223145,-1.101912498474121],[1.189834713935852,1.185906887054443,1.214385271072388],[.01778045296669,.02013735473156,.025313569232821],[-1.086826920509338,-1.084611177444458,-1.111204028129578],[-.05241484940052,-.048303380608559,-.041960217058659]],specularEnvironmentMaps:""},kA={enabled:!0,mipmapLevels:7,maximumSecondsDifference:3600,maximumPositionEpsilon:1e3,atmosphereScatteringIntensity:2,gamma:1,brightness:1,saturation:1,groundColor:[.44313725490196076,.44313725490196076,.27058823529411763,1],groundAlbedo:.31};`${JSON.stringify(wy,void 0," ")}`;const KA=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];let JA=class extends a.Destroyable{constructor(i,e){super(),this._czm3DTiles=i,this._czmClippingPlanes=e,this.dispose(a.track([this._czm3DTiles,"clippingPlanes"],[this._czmClippingPlanes,"computedClippingPlanes"])),this.dispose(()=>this._czm3DTiles.clippingPlanes=void 0)}};const Kt=class Kt extends a.Destroyable{constructor(e,n,o){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_supportEdit",this.disposeVar(a.react(!0)));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_customShaderInstanceClass",this.disposeVar(a.react(void 0)));m(this,"_updateCustomShaderEvent",this.disposeVar(new a.Event));m(this,"_foveatedInterpolationCallback",this.disposeVar(a.react(Kt.defaultFoveatedInterpolationCallback)));m(this,"_origin",this.disposeVar(a.react(void 0)));m(this,"_czmTilesetReadyEvent",this.disposeVar(new a.Event));m(this,"_czmFlattenedPlaneWithId");m(this,"_clippingPlanesSceneObjectWithId");m(this,"_customShaderInstance",this.disposeVar(a.react(void 0)));m(this,"_style",this.disposeVar(a.react(void 0)));m(this,"_originRootTransform",this.disposeVar(a.react(void 0)));m(this,"_originRootTransformInv",this.disposeVar(a.react(void 0)));m(this,"_recreateEvent",this.disposeVar(a.createNextAnimateFrameEvent(...IA(this))));m(this,"_nativeTilesetResetting");m(this,"_setMaterialEvent",this.disposeVar(new a.Event));this._czmViewer=e,o&&(this.id=o),this._nativeTilesetResetting=this.disposeVar(new a.ObjResettingWithEvent(this._recreateEvent,()=>{typeof this.url=="string"?this.url=a.ESSceneObject.context.getStrFromEnv(this.url):this.url&&(this.url.url=a.ESSceneObject.context.getStrFromEnv(this.url.url));const l=this.url;if(l)return new GA(l,this,e.viewer,e)})),this._clippingPlanesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[this,"clippingPlanesId"])),this.ad(new HA(this.czmViewer,this));const s=l=>{if(l&&"computedClippingPlanes"in l&&"computedClippingPlanesChanged"in l)return new JA(this,l)};this.disposeVar(new a.ObjResettingWithEvent(this.clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:l}=this.clippingPlanesSceneObjectWithId;if(!l){this.clippingPlanes=void 0;return}let c,u;return l instanceof a.ESBoxClipping&&a.engineObjectCreatedUpdate(this,l,()=>{c=e.getEngineObject(l).czmBoxClippingPlanes,u=s(c)}),l instanceof a.ES3DTileset&&(c=n.clippingPlanes,u=s(c)),u})),this._czmFlattenedPlaneWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._czmFlattenedPlaneWithId,"id"],[this,"czmFlattenedPlaneId"])),this.dispose(this.originChanged.disposableOn(()=>{this.origin&&(this.position=this.origin)}));const r=()=>{try{this.customShaderInstanceClass=this.customShaderInstanceClassStr&&Function(`"use strict";return (${this.customShaderInstanceClassStr})`)()}catch{this.customShaderInstanceClass=void 0}};r(),this.dispose(this.customShaderInstanceClassStrChanged.disposableOn(r)),a.registerEventUpdate(this,this.foveatedInterpolationCallbackStrChanged,()=>{this.foveatedInterpolationCallback=gy(this.foveatedInterpolationCallbackStr)}),this.dispose(this.urlChanged.disposableOn(()=>{this._origin.value=void 0})),this.dispose(this._czmTilesetReadyEvent.disposableOn((l,c)=>{if(!this._origin.value){let u=l.root.transform;const d=h.Matrix4.getTranslation(u,new h.Cartesian3),p=se(d),f=Re({initialRotation:"yForwardzUp",rotation:[0,0,0],position:p});f&&!f.equalsEpsilon(u,.001)||u.equals(h.Matrix4.IDENTITY)?(u=l.clippingPlanesOriginMatrix,this._origin.value=se(h.Matrix4.getTranslation(u,new h.Cartesian3))):this._origin.value=p}})),a.registerEventUpdate(this,this.styleJsonChanged,()=>this.style=UA(this.styleJson)),a.registerEventUpdate(this,this.customShaderInstanceClassChanged,()=>{const l=this.customShaderInstanceClass;this.customShaderInstance=l&&new l(this,e)}),this.dispose(this.updateCustomShaderEvent.disposableOn(l=>{this.customShaderInstance&&l(this.customShaderInstance,this,e)}))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get czmViewer(){return this._czmViewer}get supportEdit(){return this._supportEdit.value}set supportEdit(e){this._supportEdit.value=e}get supportEditChanged(){return this._supportEdit.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get customShaderInstanceClass(){return this._customShaderInstanceClass.value}set customShaderInstanceClass(e){this._customShaderInstanceClass.value=e}get customShaderInstanceClassChanged(){return this._customShaderInstanceClass.changed}get updateCustomShaderEvent(){return this._updateCustomShaderEvent}updateCustomShader(e){this._updateCustomShaderEvent.emit(e)}get foveatedInterpolationCallback(){return this._foveatedInterpolationCallback.value}get foveatedInterpolationCallbackChanged(){return this._foveatedInterpolationCallback.changed}set foveatedInterpolationCallback(e){this._foveatedInterpolationCallback.value=e}get imageBasedLightingFactor(){return this.imageBasedLighting&&this.imageBasedLighting.imageBasedLightingFactor}get imageBasedLightingFactorChanged(){return this.imageBasedLightingChanged}set imageBasedLightingFactor(e){this.imageBasedLighting=this.imageBasedLighting&&{...this.imageBasedLighting,imageBasedLightingFactor:e}||{imageBasedLightingFactor:e}}get origin(){return this._origin.value}get originChanged(){return this._origin.changed}setPositionAsOrigin(){this.position=this.origin}get czmTilesetReadyEvent(){return this._czmTilesetReadyEvent}notifyCzmTilesetReady(e,n){this._czmTilesetReadyEvent.emit(e,n)}get czmFlattenedPlaneWithId(){return this._czmFlattenedPlaneWithId}get clippingPlanesSceneObjectWithId(){return this._clippingPlanesSceneObjectWithId}get customShaderInstance(){return this._customShaderInstance.value}get customShaderInstanceChanged(){return this._customShaderInstance.changed}set customShaderInstance(e){this._customShaderInstance.value=e}get style(){return this._style.value}get styleChanged(){return this._style.changed}set style(e){this._style.value=e}get originRootTransform(){return this._originRootTransform.value}set originRootTransform(e){this._originRootTransform.value=e}get originRootTransformChanged(){return this._originRootTransform.changed}get originRootTransformInv(){return this._originRootTransformInv.value}set originRootTransformInv(e){this._originRootTransformInv.value=e}get originRootTransformInvChanged(){return this._originRootTransformInv.changed}get recreateEvent(){return this._recreateEvent}get nativeTilesetResetting(){return this._nativeTilesetResetting}get tileset(){var e;return(e=this.nativeTilesetResetting.obj)==null?void 0:e.tileset}get tilesetChanged(){return this.nativeTilesetResetting.objChanged}get setMaterialEvent(){return this._setMaterialEvent}setMaterial(e){this._setMaterialEvent.emit(e)}async openLocalDir(){const e=await a.defaultLocalFileServer.getRootDirId("3dtiles");if(e===void 0){console.warn("openLocalDir failed!");return}const n=`https://${e}/tileset.json`;this.url=n}};m(Kt,"defaultCustomShaderInstanceClassStr",my),m(Kt,"customShaderInstanceClassStrMd",XA),m(Kt,"styleMd",YA),m(Kt,"defaultFoveatedInterpolationCallbackStr",ZA),m(Kt,"defaultStyleJson",QA),m(Kt,"defaultFoveatedInterpolationCallback",h.Math.lerp),m(Kt,"defaults",{url:"",show:!0,colorBlendMode:"HIGHLIGHT",modelMatrix:KA,modelUpAxis:"Y",modelForwardAxis:"X",shadows:"ENABLED",maximumScreenSpaceError:16,maximumMemoryUsage:512,cacheBytes:512*1024*1024,maximumCacheOverflowBytes:512*1024*1024,cullWithChildrenBounds:!0,cullRequestsWhileMoving:!0,cullRequestsWhileMovingMultiplier:60,preloadWhenHidden:!1,preloadFlightDestinations:!0,preferLeaves:!1,dynamicScreenSpaceError:!1,dynamicScreenSpaceErrorDensity:.00278,dynamicScreenSpaceErrorFactor:4,dynamicScreenSpaceErrorHeightFalloff:.25,progressiveResolutionHeightFraction:.3,foveatedScreenSpaceError:!0,foveatedConeSize:.1,foveatedMinimumScreenSpaceErrorRelaxation:0,foveatedTimeDelay:.2,skipLevelOfDetail:!1,baseScreenSpaceError:1024,skipScreenSpaceErrorFactor:16,skipLevels:1,immediatelyLoadDesiredLevelOfDetail:!1,loadSiblings:!1,clippingPlanes:vy,classificationType:"NONE",ellipsoid:Im,pointCloudShading:yy,lightColor:void 0,imageBasedLighting:wy,environmentMapManager:kA,backFaceCulling:!0,enableShowOutline:!0,showOutline:!0,outlineColor:[0,0,0,1],vectorClassificationOnly:!1,vectorKeepDecodedPositions:!1,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0",showCreditsOnScreen:!1,splitDirection:"NONE",projectTo2D:!1,debugHeatmapTilePropertyName:"",debugFreezeFrame:!1,debugColorizeTiles:!1,enableDebugWireframe:!1,debugWireframe:!1,debugShowBoundingVolume:!1,debugShowContentBoundingVolume:!1,debugShowViewerRequestVolume:!1,debugShowGeometricError:!1,debugShowRenderingStatistics:!1,debugShowMemoryUsage:!1,debugShowUrl:!1,customShaderInstanceClassStr:Kt.defaultCustomShaderInstanceClassStr,styleJson:Kt.defaultStyleJson,foveatedInterpolationCallbackStr:Kt.defaultFoveatedInterpolationCallbackStr});let be=Kt;(t=>{t.createDefaultProps=()=>({position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined([0,0,0]),allowPicking:!1,czmFlattenedPlaneId:"",url:void 0,show:void 0,colorBlendMode:void 0,modelMatrix:a.reactArrayWithUndefined(void 0),modelUpAxis:void 0,modelForwardAxis:void 0,shadows:void 0,maximumScreenSpaceError:void 0,maximumMemoryUsage:void 0,cacheBytes:void 0,maximumCacheOverflowBytes:void 0,cullWithChildrenBounds:void 0,cullRequestsWhileMoving:void 0,cullRequestsWhileMovingMultiplier:void 0,preloadWhenHidden:void 0,preloadFlightDestinations:void 0,preferLeaves:void 0,dynamicScreenSpaceError:void 0,dynamicScreenSpaceErrorDensity:void 0,dynamicScreenSpaceErrorFactor:void 0,dynamicScreenSpaceErrorHeightFalloff:void 0,progressiveResolutionHeightFraction:void 0,foveatedScreenSpaceError:void 0,foveatedConeSize:void 0,foveatedMinimumScreenSpaceErrorRelaxation:void 0,foveatedInterpolationCallbackStr:void 0,foveatedTimeDelay:void 0,skipLevelOfDetail:void 0,baseScreenSpaceError:void 0,skipScreenSpaceErrorFactor:void 0,skipLevels:void 0,immediatelyLoadDesiredLevelOfDetail:void 0,loadSiblings:void 0,clippingPlanes:a.reactJsonWithUndefined(void 0),clippingPlanesId:"",clippingPolygons:a.reactJsonWithUndefined(void 0),clippingPolygonsId:a.reactArray([]),absoluteClippingPlanes:!1,classificationType:void 0,ellipsoid:a.reactArrayWithUndefined(void 0),pointCloudShading:a.reactJsonWithUndefined(void 0),lightColor:a.reactArrayWithUndefined(void 0),imageBasedLighting:a.reactJsonWithUndefined(void 0),environmentMapManager:a.reactJsonWithUndefined(void 0),backFaceCulling:void 0,enableShowOutline:void 0,showOutline:void 0,outlineColor:a.reactArrayWithUndefined(void 0),vectorClassificationOnly:void 0,vectorKeepDecodedPositions:void 0,featureIdLabel:void 0,instanceFeatureIdLabel:void 0,showCreditsOnScreen:void 0,splitDirection:void 0,projectTo2D:void 0,debugHeatmapTilePropertyName:void 0,debugFreezeFrame:void 0,debugColorizeTiles:void 0,enableDebugWireframe:void 0,debugWireframe:void 0,debugShowBoundingVolume:void 0,debugShowContentBoundingVolume:void 0,debugShowViewerRequestVolume:void 0,debugShowGeometricError:void 0,debugShowRenderingStatistics:void 0,debugShowMemoryUsage:void 0,debugShowUrl:void 0,customShaderInstanceClassStr:void 0,styleJson:a.reactJsonWithUndefined(void 0),autoSetPositionAsOrigin:void 0})})(be||(be={})),a.extendClassProps(be.prototype,be.createDefaultProps);class jA extends a.Destroyable{constructor(){super();m(this,"strokeSilhouette",h.PostProcessStageLibrary.createEdgeDetectionStage());m(this,"_viewer",this.disposeVar(a.react(void 0)));m(this,"_featureMap",new Map);const e=()=>{this.viewer&&(this.viewer.scene.postProcessStages.add(h.PostProcessStageLibrary.createSilhouetteStage([this.strokeSilhouette])),this.strokeSilhouette.uniforms.length=.01,this.strokeSilhouette.uniforms.color=h.Color.RED,this.strokeSilhouette.selected=[],this.ad(()=>{this.viewer&&this.viewer.scene.postProcessStages.remove(this.strokeSilhouette)}))};e(),this.ad(this.viewerChanged.don(e))}get viewer(){return this._viewer.value}set viewer(e){this.viewer instanceof h.Viewer||(this._viewer.value=e)}get viewerChanged(){return this._viewer.changed}get selected(){return[...this._featureMap.values()].flat()}setStrokeLength(e){this.strokeSilhouette.uniforms.length=e??.01}setStrokeColor(e){this.strokeSilhouette.uniforms.color=h.Color.fromBytes(e[0]*255,e[1]*255,e[2]*255,e[3]*255)}setStrokeSelect(e,n,o=!1){if(!this._featureMap.has(e))return;let s=this._featureMap.get(e);o&&(s==null||s.push(...n)),s=n,this._featureMap.set(e,s),this.strokeSilhouette.selected=this.selected}register(e){this.viewer=e.viewer.viewer,!this._featureMap.has(e)&&this._featureMap.set(e,[])}unregister(e){this._featureMap.has(e)&&(this._featureMap.delete(e),this.strokeSilhouette.selected=this.selected)}}const eE=(t,i)=>h.Color.fromBytes(t[0]*255,t[1]*255,t[2]*255,t[3]*255,i),tE=(t,i)=>{const e=t;let n=!1;switch(e.op){case"==":i===e.value&&(n=!0);break;case"!=":i!==e.value&&(n=!0);break;case"contain":i&&i.includes(e.value)&&(n=!0);break;case"empty":(i===""||i===null||i===void 0||!i)&&(n=!0);break;default:n=!1;break}return n},iE=(t,i)=>{const e=t;let n=!1;switch(e.op){case"==":i===e.value&&(n=!0);break;case"!=":i!==e.value&&(n=!0);break;case">":i>e.value&&(n=!0);break;case">=":i>=e.value&&(n=!0);break;case"<":i<e.value&&(n=!0);break;case"<=":i<=e.value&&(n=!0);break;default:n=!1;break}return n},nE=(t,i)=>{const e=[];for(let n of t.condition){if(typeof n=="boolean"){e.push(n);continue}const s=typeof n.value=="string",r=typeof n.value=="number";if(!s&&!r){e.push(!1);continue}const l=n.field;let c;if(l.includes("."))try{const u=l.split(".");c=JSON.parse(i.getProperty(u[0]));for(let d of u.slice(1))if(c=c==null?void 0:c[d],c===void 0)throw new Error(`${c}上不存在属性${d},将使用默认颜色!`)}catch{e.push(!1);continue}else c=i.getProperty(l);if(s){e.push(tE(n,c));continue}else if(r){e.push(iE(n,c));continue}else{e.push(!1);continue}}return e},oE=(t,i)=>{const e=[];for(let n of t.condition){if(typeof n=="boolean"){e.push(n);continue}const s=typeof n.value=="string",r=typeof n.value=="number";if(!s&&!r){e.push(!1);continue}const l=n.field;let c;if(l.includes("."))try{const u=l.split(".");c=JSON.parse(i.getProperty(u[0]));for(let d of u.slice(1))if(c=c==null?void 0:c[d],c===void 0)throw new Error(`${c}上不存在属性${d},将使用默认颜色!`)}catch{e.push(!1);continue}else c=i.getProperty(l);if(s){e.push(sE(n,c));continue}else if(r){e.push(rE(n,c));continue}else{e.push(!1);continue}}return e},sE=(t,i)=>{const e=t;let n=!1;switch(e.op){case"==":i===e.value&&(n=!0);break;case"!=":i!==e.value&&(n=!0);break;case"contain":i.includes(e.value)&&(n=!0);break;case"empty":(i===""||i===null||i===void 0||!i)&&(n=!0);break;default:n=!1;break}return n},rE=(t,i)=>{const e=t;let n=!1;switch(e.op){case"==":i===e.value&&(n=!0);break;case"!=":i!==e.value&&(n=!0);break;case">":i>e.value&&(n=!0);break;case">=":i>=e.value&&(n=!0);break;case"<":i<e.value&&(n=!0);break;case"<=":i<=e.value&&(n=!0);break;default:n=!1;break}return n};let Cy=[1,1,1];class aE extends a.Destroyable{constructor(e,n){super();m(this,"_customShader");const o=new h.CustomShader({uniforms:{u_baseColor:{type:h.UniformType.VEC3,value:h.Cartesian3.fromArray(Cy)}},fragmentShaderText:`
|
|
548
548
|
// Color tiles by distance to the camera
|
|
549
549
|
void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
|
|
550
550
|
{
|
|
@@ -603,7 +603,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
|
|
|
603
603
|
function (particle, dt) {
|
|
604
604
|
particle.velocity = Cesium.Cartesian3.ZERO;
|
|
605
605
|
}
|
|
606
|
-
`;const r={emitter:{type:"CircleEmitter",radius:.1},startColor:[1,0,0,1],endColor:[1,.5,0,.5],particleLife:1,emissionRate:2,lifetime:1,imageSize:[1,1],sizeInMeters:!0},l=Object.keys(r);for(const c of l)s[c]=r[c]}{const r=()=>{s.startScale=1*(e.scale[0]>0?e.scale[0]:1),s.endScale=10*(e.scale[0]>0?e.scale[0]:1)};r(),this.ad(e.scaleChanged.don(r))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"translation"],[e,"translation"])),this.d(je([s,"rotation"],[e,"rotation"])),this.d(a.track([s,"image"],[e,"image"]))}get czmBlastParticeSystem(){return this._czmBlastParticeSystem}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmBlastParticeSystem:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,ei,e),o.flyOverEvent.emit(n,"over",s),!0}}};m(Ma,"type",Ma.register("ESCesiumViewer",a.ESBlastParticleSystem.type,Ma));let qd=Ma;function gE(t,i,e){const n=t,o=i,s=[[n[0],n[1],n[2]],[o[0],n[1],n[2]],[o[0],o[1],n[2]],[n[0],o[1],n[2]],[n[0],n[1],o[2]],[o[0],n[1],o[2]],[o[0],o[1],o[2]],[n[0],o[1],o[2]]],r=h.Math.toDegrees,l=s.map(u=>{const d=h.Matrix4.multiplyByPoint(e,h.Cartesian3.fromElements(...u),new h.Cartesian3),p=h.Cartographic.fromCartesian(d);return[r(p.longitude),r(p.latitude),p.height]});return[[l[0],l[1],l[2],l[3],l[0]],[l[4],l[5],l[6],l[7],l[4]],[l[0],l[4]],[l[1],l[5]],[l[2],l[6]],[l[3],l[7]]]}class zs extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_computedClippingPlanes",this.disposeVar(a.react(void 0)));m(this,"_polylines");n&&(this.id=n),this._polylines=this.disposeVar(new qt(e,n)),this._polylines.arcType="NONE",this.ad(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Me)||!e.actived)return;if(!this.position){console.warn("CzmBoxClippingPlanes warning: 没有位置,无法飞入!");return}const s=this.minSize,r=this.maxSize,l=[r[0]-s[0],r[1]-s[1],r[2]-s[2]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]+l[2]*l[2]);ne(e.viewer,this.position,c*2,void 0,o)}));{const o=()=>{e instanceof Me&&(e.sceneGlobeClippingPlanesId=this.applyOnTerrain&&n||"")};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.applyOnTerrainChanged,this.computedClippingPlanesChanged));this.ad(s.disposableOn(o)),this.ad(()=>{e instanceof Me&&e.sceneGlobeClippingPlanesId===n&&(e.sceneGlobeClippingPlanes=void 0)})}{const o=()=>{const r=this.minSize,l=this.maxSize,c=[l[0]-r[0],l[1]-r[1],l[2]-r[2]],u=this.reverse?-1:1,d=[...this.modelMatrix];let p=[];if(this.position){const f=Re({position:this.position,rotation:this.rotation});if(f){const g=h.Matrix4.fromArray(this.modelMatrix),v=h.Matrix4.multiply(f,g,new h.Matrix4);h.Matrix4.toArray(v,d),p=gE(this.minSize,this.maxSize,v)}}this.polylines.positions=p,this._computedClippingPlanes.value={planes:[{normal:[-1*u,0,0],distance:(c[0]+r[0])*u},{normal:[1*u,0,0],distance:-r[0]*u},{normal:[0,-1*u,0],distance:(c[1]+r[1])*u},{normal:[0,1*u,0],distance:-r[1]*u},{normal:[0,0,-1*u],distance:(c[2]+r[2])*u},{normal:[0,0,1*u],distance:-r[2]*u}],enabled:this.enabled,modelMatrix:d,unionClippingRegions:!this.reverse,edgeColor:this.edgeColor,edgeWidth:this.edgeWidth}};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.reverseChanged,this.edgeColorChanged,this.edgeWidthChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(s.disposableOn(o))}this.dispose(a.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(a.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(a.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}get polylines(){return this._polylines}}m(zs,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,applyOnTerrain:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),modelMatrix:a.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2,minSize:a.reactArray([-100,-100,-100]),maxSize:a.reactArray([100,100,100])})})(zs||(zs={})),a.extendClassProps(zs.prototype,zs.createDefaultProps);let mE=class extends a.Destroyable{constructor(i,e){super(),this._czmESBoxClippingPlanes=i,this._eS3DTileset=e;const n=this._czmESBoxClippingPlanes.czmBoxClippingPlanes.id;this._eS3DTileset.clippingPlaneId=n,this.dispose(()=>{this._eS3DTileset.clippingPlaneId=""})}};const Da=class Da extends me{constructor(e,n){super(e,n);m(this,"_czmBoxClippingPlanes");m(this,"_tilesSceneObjectWithId");this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this._czmBoxClippingPlanes=this.ad(new zs(n,e.id)),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmBoxClippingPlanes.enabledChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c}=this.tilesSceneObjectWithId;if(c&&c instanceof a.ES3DTileset&&this.sceneObject.show)return new mE(this,c)}))}),!n.viewer){console.warn("viewer is undefined!");return}const{czmBoxClippingPlanes:r}=this;{const l=()=>{r.enabled=e.show,r.showHelper=e.show};l(),this.dispose(e.showChanged.don(l))}{const l=()=>{r.reverse=!e.reverse};l(),this.dispose(e.reverseChanged.don(l))}{const l=()=>{e.targetID?r.applyOnTerrain=!1:r.applyOnTerrain=!0};l(),this.dispose(e.targetIDChanged.don(l))}{const l=()=>{const[c,u,d]=e.size;r.minSize=[-.5*c,-.5*u,-.5*d],r.maxSize=[.5*c,.5*u,.5*d]};l(),this.dispose(e.sizeChanged.don(l))}this.dispose(a.bind([r,"position"],[e,"position"])),this.dispose(a.bind([r,"rotation"],[e,"rotation"])),this.dispose(a.track([r,"edgeColor"],[e,"edgeColor"])),this.dispose(a.track([r,"edgeWidth"],[e,"edgeWidth"]))}get czmBoxClippingPlanes(){return this._czmBoxClippingPlanes}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,n):o.position?($t(s,o,n,o.position,Math.max(...o.size),e,!0),!0):!1}};m(Da,"type",Da.register("ESCesiumViewer",a.ESBoxClipping.type,Da));let Xd=Da;const Ra=class Ra extends me{constructor(e,n){super(e,n);m(this,"_view");if(this._view=this.disposeVar(new Ft(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{view:s}=this;this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"thumbnail"],[e,"thumbnail"])),this.dispose(a.bind([s,"duration"],[e,"duration"])),s.show=!1,this.dispose(e.flyInEvent.disposableOn((r,l,c="default")=>{s.flyTo(e.duration??r??1,void 0,c)})),!s.position&&!s.rotation&&s.resetWithCurrentCamera(Ft.ResetFlag.Position|Ft.ResetFlag.Rotation|Ft.ResetFlag.ViewDistance),this.dispose(e.resetWithCurrentCameraEvent.disposableOn(()=>{s.resetWithCurrentCamera(Ft.ResetFlag.Position|Ft.ResetFlag.Rotation|Ft.ResetFlag.ViewDistance)})),this.dispose(e.captureEvent.disposableOn((r,l)=>{s.capture(r??64,l??64)}))}get view(){return this._view}flyTo(e,n){const{sceneObject:o,czmViewer:s,view:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Ra,"type",Ra.register("ESCesiumViewer",a.ESCameraView.type,Ra));let Yd=Ra;const Fa=class Fa extends me{constructor(e,n){super(e,n);m(this,"_czmESCustomPrimitive");m(this,"_czmTexture");if(!n.viewer){console.warn("viewer is undefined!");return}this._czmESCustomPrimitive=this.disposeVar(new Fe(n,e.id)),this._czmTexture=this.dv(new Ne(n,e.id));const s=this._czmESCustomPrimitive,r=this._czmTexture;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"]));{const l=()=>{const u=e.far*Math.tan(Math.PI*(e.fov/360))*2,d=u/e.aspectRatio,p=e.far,f=e.near*Math.tan(Math.PI*(e.fov/360))*2,g=f/e.aspectRatio,v=e.near,y=[v,-f/2,-g/2],w=[v,-f/2,g/2],P=[v,f/2,g/2],C=[v,f/2,-g/2],S=[p,-u/2,-d/2],A=[p,-u/2,d/2],E=[p,u/2,d/2],R=[p,u/2,-d/2],N=[...y,...w,...P,...C,...S,...A,...E,...R],B=[0,4,5,0,5,1,1,5,6,1,6,2,2,6,7,2,7,3,3,7,4,3,4,0],V=[...B,...B.reverse()],G=[1,0],z=[1,1],O=[1,0],_=[1,1],x=[0,0],M=[0,1],L=[0,0],U=[0,1],Y=[...G,...z,...O,..._,...x,...M,...L,...U];s.indexTypedArray=new Uint16Array(V),s.attributes={position:{typedArray:new Float32Array(N),componentsPerAttribute:3},st:{typedArray:new Float32Array(Y),componentsPerAttribute:2}},r.uri=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/visible_img.png"),s.uniformMap={u_image:{type:"texture",id:r.id},u_color:[1,1,1,1]};const q=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!q)return;const{min:$,max:Q}=q;s.setLocalAxisedBoundingBox($,Q)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged,e.farChanged,e.nearChanged));this.dispose(c.disposableOn(()=>l()))}}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n),!0;{const r=Math.max(o.far,o.near)??a.ESCameraVisibleRange.defaults.far;return o.position?($t(s,o,n,o.position,r,e),!0):!1}}};m(Fa,"type",Fa.register("ESCesiumViewer",a.ESCameraVisibleRange.type,Fa));let Zd=Fa;const za=class za extends me{constructor(e,n){super(e,n);m(this,"_czmModelPrimitive");if(!n.viewer){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new ct(n,e.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};u(),this.d(c.don(u))}const r=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/car/PoliceCar.glb"),l=()=>{switch(e.mode){case"policeCar":s.url=r;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>l())),l()}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r):!1}};m(za,"type",za.register("ESCesiumViewer",a.ESCar.type,za));let Qd=za;const kd={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},La=class La extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_circleCustomPrimitive");m(this,"_cylinderCustomPrimitive");m(this,"_cylinderParticlesCustomPrimitive");this._circleCustomPrimitive=this.disposeVar(new Fe(e,n)),this._cylinderCustomPrimitive=this.disposeVar(new Fe(e,n)),this._cylinderParticlesCustomPrimitive=this.disposeVar(new Fe(e,n));const{circleCustomPrimitive:o}=this;Pm(o,{width:120,height:120}),o.fragmentShaderSource=`
|
|
606
|
+
`;const r={emitter:{type:"CircleEmitter",radius:.1},startColor:[1,0,0,1],endColor:[1,.5,0,.5],particleLife:1,emissionRate:2,lifetime:1,imageSize:[1,1],sizeInMeters:!0},l=Object.keys(r);for(const c of l)s[c]=r[c]}{const r=()=>{s.startScale=1*(e.scale[0]>0?e.scale[0]:1),s.endScale=10*(e.scale[0]>0?e.scale[0]:1)};r(),this.ad(e.scaleChanged.don(r))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"translation"],[e,"translation"])),this.d(je([s,"rotation"],[e,"rotation"])),this.d(a.track([s,"image"],[e,"image"]))}get czmBlastParticeSystem(){return this._czmBlastParticeSystem}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmBlastParticeSystem:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,ei,e),o.flyOverEvent.emit(n,"over",s),!0}}};m(Ma,"type",Ma.register("ESCesiumViewer",a.ESBlastParticleSystem.type,Ma));let qd=Ma;function gE(t,i,e){const n=t,o=i,s=[[n[0],n[1],n[2]],[o[0],n[1],n[2]],[o[0],o[1],n[2]],[n[0],o[1],n[2]],[n[0],n[1],o[2]],[o[0],n[1],o[2]],[o[0],o[1],o[2]],[n[0],o[1],o[2]]],r=h.Math.toDegrees,l=s.map(u=>{const d=h.Matrix4.multiplyByPoint(e,h.Cartesian3.fromElements(...u),new h.Cartesian3),p=h.Cartographic.fromCartesian(d);return[r(p.longitude),r(p.latitude),p.height]});return[[l[0],l[1],l[2],l[3],l[0]],[l[4],l[5],l[6],l[7],l[4]],[l[0],l[4]],[l[1],l[5]],[l[2],l[6]],[l[3],l[7]]]}class zs extends a.Destroyable{constructor(e,n){super();m(this,"_id",this.disposeVar(a.react(a.createGuid())));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_computedClippingPlanes",this.disposeVar(a.react(void 0)));m(this,"_polylines");n&&(this.id=n),this._polylines=this.disposeVar(new qt(e,n)),this._polylines.arcType="NONE",this.ad(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Me)||!e.actived)return;if(!this.position){console.warn("CzmBoxClippingPlanes warning: 没有位置,无法飞入!");return}const s=this.minSize,r=this.maxSize,l=[r[0]-s[0],r[1]-s[1],r[2]-s[2]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]+l[2]*l[2]);ne(e.viewer,this.position,c*2,void 0,o)}));{const o=()=>{e instanceof Me&&(e.sceneGlobeClippingPlanesId=this.applyOnTerrain&&n||"")};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.applyOnTerrainChanged,this.computedClippingPlanesChanged));this.ad(s.disposableOn(o)),this.ad(()=>{e instanceof Me&&e.sceneGlobeClippingPlanesId===n&&(e.sceneGlobeClippingPlanes=void 0)})}{const o=()=>{const r=this.minSize,l=this.maxSize,c=[l[0]-r[0],l[1]-r[1],l[2]-r[2]],u=this.reverse?-1:1,d=[...this.modelMatrix];let p=[];if(this.position){const f=Re({position:this.position,rotation:this.rotation});if(f){const g=h.Matrix4.fromArray(this.modelMatrix),v=h.Matrix4.multiply(f,g,new h.Matrix4);h.Matrix4.toArray(v,d),p=gE(this.minSize,this.maxSize,v)}}this.polylines.positions=p,this._computedClippingPlanes.value={planes:[{normal:[-1*u,0,0],distance:(c[0]+r[0])*u},{normal:[1*u,0,0],distance:-r[0]*u},{normal:[0,-1*u,0],distance:(c[1]+r[1])*u},{normal:[0,1*u,0],distance:-r[1]*u},{normal:[0,0,-1*u],distance:(c[2]+r[2])*u},{normal:[0,0,1*u],distance:-r[2]*u}],enabled:this.enabled,modelMatrix:d,unionClippingRegions:!this.reverse,edgeColor:this.edgeColor,edgeWidth:this.edgeWidth}};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.reverseChanged,this.edgeColorChanged,this.edgeWidthChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(s.disposableOn(o))}this.dispose(a.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(a.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(a.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}get polylines(){return this._polylines}}m(zs,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,applyOnTerrain:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),modelMatrix:a.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2,minSize:a.reactArray([-100,-100,-100]),maxSize:a.reactArray([100,100,100])})})(zs||(zs={})),a.extendClassProps(zs.prototype,zs.createDefaultProps);let mE=class extends a.Destroyable{constructor(i,e){super(),this._czmESBoxClippingPlanes=i,this._eS3DTileset=e;const n=this._czmESBoxClippingPlanes.czmBoxClippingPlanes.id;this._eS3DTileset.clippingPlaneId=n,this.dispose(()=>{this._eS3DTileset.clippingPlaneId=""})}};const Da=class Da extends me{constructor(e,n){super(e,n);m(this,"_czmBoxClippingPlanes");m(this,"_tilesSceneObjectWithId");this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this._czmBoxClippingPlanes=this.ad(new zs(n,e.id)),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),a.engineObjectCreatedUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmBoxClippingPlanes.enabledChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c}=this.tilesSceneObjectWithId;if(c&&c instanceof a.ES3DTileset&&this.sceneObject.show)return new mE(this,c)}))}),!n.viewer){console.warn("viewer is undefined!");return}const{czmBoxClippingPlanes:r}=this;{const l=()=>{r.enabled=e.show,r.showHelper=e.show};l(),this.dispose(e.showChanged.don(l))}{const l=()=>{r.reverse=!e.reverse};l(),this.dispose(e.reverseChanged.don(l))}{const l=()=>{e.targetID?r.applyOnTerrain=!1:r.applyOnTerrain=!0};l(),this.dispose(e.targetIDChanged.don(l))}{const l=()=>{const[c,u,d]=e.size;r.minSize=[-.5*c,-.5*u,-.5*d],r.maxSize=[.5*c,.5*u,.5*d]};l(),this.dispose(e.sizeChanged.don(l))}this.dispose(a.bind([r,"position"],[e,"position"])),this.dispose(a.bind([r,"rotation"],[e,"rotation"])),this.dispose(a.track([r,"edgeColor"],[e,"edgeColor"])),this.dispose(a.track([r,"edgeWidth"],[e,"edgeWidth"]))}get czmBoxClippingPlanes(){return this._czmBoxClippingPlanes}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,n):o.position?($t(s,o,n,o.position,Math.max(...o.size),e,!0),!0):!1}};m(Da,"type",Da.register("ESCesiumViewer",a.ESBoxClipping.type,Da));let Xd=Da;const Ra=class Ra extends me{constructor(e,n){super(e,n);m(this,"_view");if(this._view=this.disposeVar(new Ft(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{view:s}=this;this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"thumbnail"],[e,"thumbnail"])),this.dispose(a.bind([s,"duration"],[e,"duration"])),s.show=!1,this.dispose(e.flyInEvent.disposableOn((r,l,c="default")=>{s.flyTo(e.duration??r??1,void 0,c)})),!s.position&&!s.rotation&&s.resetWithCurrentCamera(Ft.ResetFlag.Position|Ft.ResetFlag.Rotation|Ft.ResetFlag.ViewDistance),this.dispose(e.resetWithCurrentCameraEvent.disposableOn(()=>{s.resetWithCurrentCamera(Ft.ResetFlag.Position|Ft.ResetFlag.Rotation|Ft.ResetFlag.ViewDistance)})),this.dispose(e.captureEvent.disposableOn((r,l)=>{s.capture(r??64,l??64)}))}get view(){return this._view}flyTo(e,n){const{sceneObject:o,czmViewer:s,view:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(Ra,"type",Ra.register("ESCesiumViewer",a.ESCameraView.type,Ra));let Yd=Ra;const Fa=class Fa extends me{constructor(e,n){super(e,n);m(this,"_czmESCustomPrimitive");m(this,"_czmTexture");if(!n.viewer){console.warn("viewer is undefined!");return}this._czmESCustomPrimitive=this.disposeVar(new Fe(n,e.id)),this._czmTexture=this.dv(new Ne(n,e.id));const s=this._czmESCustomPrimitive,r=this._czmTexture;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"]));{const l=()=>{const u=e.far*Math.tan(Math.PI*(e.fov/360))*2,d=u/e.aspectRatio,p=e.far,f=e.near*Math.tan(Math.PI*(e.fov/360))*2,g=f/e.aspectRatio,v=e.near,y=[v,-f/2,-g/2],w=[v,-f/2,g/2],P=[v,f/2,g/2],C=[v,f/2,-g/2],S=[p,-u/2,-d/2],A=[p,-u/2,d/2],E=[p,u/2,d/2],R=[p,u/2,-d/2],N=[...y,...w,...P,...C,...S,...A,...E,...R],B=[0,4,5,0,5,1,1,5,6,1,6,2,2,6,7,2,7,3,3,7,4,3,4,0],V=[...B,...B.reverse()],G=[1,0],z=[1,1],O=[1,0],_=[1,1],x=[0,0],M=[0,1],L=[0,0],U=[0,1],Y=[...G,...z,...O,..._,...x,...M,...L,...U];s.indexTypedArray=new Uint16Array(V),s.attributes={position:{typedArray:new Float32Array(N),componentsPerAttribute:3},st:{typedArray:new Float32Array(Y),componentsPerAttribute:2}},r.uri=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/visible_img.png"),s.uniformMap={u_image:{type:"texture",id:r.id},u_color:[1,1,1,1]};const q=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!q)return;const{min:$,max:Q}=q;s.setLocalAxisedBoundingBox($,Q)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged,e.farChanged,e.nearChanged));this.dispose(c.disposableOn(()=>l()))}}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n),!0;{const r=Math.max(o.far,o.near)??a.ESCameraVisibleRange.defaults.far;return o.position?($t(s,o,n,o.position,r,e),!0):!1}}};m(Fa,"type",Fa.register("ESCesiumViewer",a.ESCameraVisibleRange.type,Fa));let Zd=Fa;const za=class za extends me{constructor(e,n){super(e,n);m(this,"_czmModelPrimitive");if(!n.viewer){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new ct(n,e.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};u(),this.d(c.don(u))}const r=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/car/PoliceCar.glb"),l=()=>{switch(e.mode){case"policeCar":s.url=r;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>l())),l()}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r):!1}};m(za,"type",za.register("ESCesiumViewer",a.ESCar.type,za));let Qd=za;const kd={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},La=class La extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_circleCustomPrimitive");m(this,"_cylinderCustomPrimitive");m(this,"_cylinderParticlesCustomPrimitive");this._circleCustomPrimitive=this.disposeVar(new Fe(e,n)),this._cylinderCustomPrimitive=this.disposeVar(new Fe(e,n)),this._cylinderParticlesCustomPrimitive=this.disposeVar(new Fe(e,n));const{circleCustomPrimitive:o}=this;Pm(o,{width:120,height:120}),o.fragmentShaderSource=`
|
|
607
607
|
in vec2 v_st;
|
|
608
608
|
uniform vec4 u_color;
|
|
609
609
|
void main()
|
|
@@ -740,7 +740,7 @@ ${by}
|
|
|
740
740
|
// out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, (a + .1)*4.);
|
|
741
741
|
out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, a);
|
|
742
742
|
}
|
|
743
|
-
`,s.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let l=this.disposeVar(a.react(void 0));{const c=this.disposeVar(a.createProcessingFromAsyncFunc(async d=>{l.value=void 0;const p=e.url??a.ESDataMesh.defaults.url;if(!p)return;await d.promise(a.sleep(200));const f=(e.maxTime??23)|0;l.value=await d.promise(_E(a.ESSceneObject.context.getStrFromEnv(typeof p=="string"?p:p.url),f+1))}));c.start();const u=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>c.restart()))}{class c{constructor(p){this._buffer=p}[Symbol.iterator](){return PE(this._buffer)}}const u=()=>{if(!l.value)return;const{vertexBuffer:d,propBuffers:p,indexBuffer:f}=l.value,{minPos:g,maxPos:v}=a.getMinMaxCorner(new c(d));s.setLocalAxisedBoundingBox(g,v);const y=(e.maxTime??23)|0;let w=(e.currentTime??a.ESDataMesh.defaults.currentTime)/y;w=w<0?0:w>1?1:w;const P=w*y;let C=w*y|0,S=P-C;if(C>=y&&(C=y-1,S=1),!Number.isFinite(S)){console.error("!Number.isFinite(rr)");debugger;return}if(s.indexTypedArray=f,!p[C]||!p[C+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}s.attributes={a_position:{typedArray:d,componentsPerAttribute:3},a_prop:{typedArray:p[C],componentsPerAttribute:3},a_prop2:{typedArray:p[C+1],componentsPerAttribute:3}},s.uniformMap={u_gradientMap:{type:"texture",id:`${r.id}`},u_stripMinMaxValue:[e.minPropValue??a.ESDataMesh.defaults.minPropValue,e.maxPropValue??a.ESDataMesh.defaults.maxPropValue],u_ratio:S}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(l.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r,!0),!0):!1}};m(Wa,"type",Wa.register("ESCesiumViewer",a.ESDataMesh.type,Wa));let ep=Wa;const qo=class qo extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_heading",this.disposeVar(a.react(0)));m(this,"_textFunc",this.disposeVar(a.react(void 0)));const o=this;{const l=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=a.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=a.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=a.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?a.clampN180_180(u):a.clamp0_360(u)}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(c.disposableOn(l))}const s=this.disposeVar(new xe(e,n));s.loop=!1,this.dispose(a.track([s,"allowPicking"],[o,"allowPicking"])),this.dispose(a.bind([s,"arcType"],[o,"arcType"])),this.dispose(a.bind([s,"color"],[o,"color"])),this.dispose(a.bind([s,"dashLength"],[o,"dashLength"])),this.dispose(a.bind([s,"dashPattern"],[o,"dashPattern"])),this.dispose(a.bind([s,"gapColor"],[o,"gapColor"])),this.dispose(a.bind([s,"hasArrow"],[o,"hasArrow"])),this.dispose(a.bind([s,"hasDash"],[o,"hasDash"])),this.dispose(a.bind([s,"positions"],[o,"positions"])),this.dispose(a.bind([s,"show"],[o,"show"])),this.dispose(a.bind([s,"width"],[o,"width"])),this.dispose(a.bind([s,"depthTest"],[o,"depthTest"])),this.dispose(a.bind([s,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const r=this.disposeVar(new Ue(e,n));this.dispose(a.bind([r,"shadowDom"],[o,"shadowDom"])),this.dispose(a.bind([r,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(a.bind([r,"show"],[o,"show"]));{const l=()=>{o.positions&&o.positions.length>=2?r.position=o.positions[1]:r.position=void 0};l(),this.dispose(o.positionsChanged.disposableOn(l))}{const l=()=>{const{heading:u}=o,d=(o.textFunc??qo.defaultTextFunc_度格式)(u);r.innerHTML=uo(`方向: ${d}`,24)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(c.disposableOn(l))}this.ad(r.pickedEvent.don(l=>{$i(l)===0&&this.pickedEvent.emit(l)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};m(qo,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),m(qo,"defaultTextFunc_度分格式",e=>`${xr(e,!0)}`),m(qo,"defaultTextFunc_度分秒格式",e=>`${xr(e,!1)}`),m(qo,"defaults",{positions:[]});let Do=qo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:8,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(Do||(Do={})),a.extendClassProps(Do.prototype,Do.createDefaultProps);const Ga=class Ga extends yt{constructor(e,n){super(e,n);m(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new Do(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmDirectionMeasurement;s.angleMode="0~360",this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):u==="normal"?(s.hasDash=!1,s.hasArrow=!1):(s.hasDash=!1,s.hasArrow=!0);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{$i(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ga,"type",Ga.register("ESCesiumViewer",a.ESDirectionMeasurement.type,Ga));let tp=Ga;class Ns extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_distances",this.disposeVar(a.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await Am(e.viewer,this.positions??[]):this._distances.value=a.getDistancesFromPositions(this.positions??[],this.arcType)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(s.disposableOn(o));const r=this.disposeVar(new xe(e,n));r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"positions"],[this,"positions"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"])),this.dispose(a.bind([r,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&r.flyTo(l)}));{const l=[],c=()=>{for(let d of l)d.destroy();l.length=0};this.dispose(c);const u=()=>{if(c(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const p=Tu("起点",this.positions[0],e,n);p.dispose(a.track([p,"show"],[this,"show"])),p.dispose(a.track([p,"shadowDom"],[this,"shadowDom"])),p.dispose(a.track([p,"cssAllInitial"],[this,"cssAllInitial"])),l.push(p)}const d=this.distances.length;for(let p=0;p<d;++p){const f=this.distances[p],g=this.positions[p+1],v=Tu(`长度: ${xc(f)}`,g,e,n);v.dispose(a.track([v,"show"],[this,"show"])),v.dispose(a.track([v,"shadowDom"],[this,"shadowDom"])),v.dispose(a.track([v,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(v.pickedEvent.don(y=>{$i(y)===0&&this.pickedEvent.emit(y)})),l.push(v)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>a.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}m(Ns,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(Ns||(Ns={})),a.extendClassProps(Ns.prototype,Ns.createDefaultProps);const Ua=class Ua extends yt{constructor(e,n){super(e,n);m(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new xe(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoPolyline;this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]));{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}}get geoPolyline(){return this._geoPolyline}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolyline:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolyline:r}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ua,"type",Ua.register("ESCesiumViewer",a.ESGeoLineString.type,Ua));let Os=Ua;const Ha=class Ha extends Os{constructor(e,n){super(e,n);m(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new Ns(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{$i(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ha,"type",Ha.register("ESCesiumViewer",a.ESDistanceMeasurement.type,Ha));let ip=Ha;class Bs extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:a.reactPositions(void 0),reverse:!1,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Bs||(Bs={})),a.extendClassProps(Bs.prototype,Bs.createDefaultProps);class bE extends a.Destroyable{constructor(i,e){super(),this._czmESExcavate=i,this._eS3DTileset=e;for(let n=0;n<this._eS3DTileset.excavateId.length;n++){const o=this._eS3DTileset.excavateId[n];a.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(n,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(n=>n!==this._czmESExcavate.czmPolygonClipping.id)]})}}class SE extends a.Destroyable{constructor(i){if(super(),this._czmESExcavate=i,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const n=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];a.ESSceneObject.getSceneObjById(n)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const $a=class $a extends Xt{constructor(e,n){super(e,n);m(this,"_czmPolygonClipping");m(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new Bs(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!n.viewer)return;const r=this._czmPolygonClipping;r.showHelper=!1,this.dispose(a.bind([r,"positions"],[e,"points"])),this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.reverse=e.mode!=="in"};l(),this.dispose(e.modeChanged.disposableOn(l))}a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new SE(this):!c||!(c instanceof a.ES3DTileset)?void 0:new bE(this,c)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonClipping:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m($a,"type",$a.register("ESCesiumViewer",a.ESExcavate.type,$a));let np=$a;const qa=class qa extends me{constructor(e,n){super(e,n);m(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new bi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmFireParticleSystem;s.endColor=[1,1,0,.4],s.startColor=[1,0,0,.5],s.particleLife=1,s.emissionRate=30,s.lifetime=1,s.imageSize=[1,1],s.emitter={type:"CircleEmitter",radius:.1},s.sizeInMeters=!0;{const r=()=>{s.startScale=10*(e.scale[0]>0?e.scale[0]:1),s.endScale=5*(e.scale[0]>0?e.scale[0]:1),s.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),s.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};r(),this.ad(e.scaleChanged.don(r))}this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"translation"],[e,"translation"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmFireParticleSystem:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,ei,e),o.flyOverEvent.emit(n,"over",s),!0}}};m(qa,"type",qa.register("ESCesiumViewer",a.ESFireParticleSystem.type,qa));let op=qa;class Vs extends a.Destroyable{constructor(e,n){super();m(this,"_geoPath");m(this,"_geoPolyline");m(this,"_geoCanvasPointPoi");m(this,"_player");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));m(this,"_ratio",this.disposeVar(a.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new a.ESPathImpl),this._geoPolyline=this.disposeVar(new xe(e,n)),this._geoCanvasPointPoi=this.disposeVar(new Sn(e,n)),this._player=this.disposeVar(new a.Player),this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(a.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(a.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(a.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(a.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPath,"show"],[this,"show"])),this.dispose(a.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const r=this.granularity*Math.PI/180,l=mu(this.positions,this.arcType??"GEODESIC",r);if(l){this._geoPath.timePosRots=l.timePosRots,this.rotationRadius.some(c=>c>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(s.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const s=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(s-this.currentDistance)>.01&&(this.currentDistance=s)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const s=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(s-(this._player.currentTime??0))>.01&&(this._player.currentTime=s)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(a.bind([this._player,"loop"],[this,"loop"])),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._player,"duration"],[this,"duration"])),this.dispose(a.bind([this._player,"playing"],[this,"playing"])),this.dispose(a.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(s=>s[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Vs||(Vs={})),a.extendClassProps(Vs.prototype,Vs.createDefaultProps);class Yr extends a.Destroyable{constructor(e,n){super();m(this,"_geoPolylinePath");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));this._geoPolylinePath=this.disposeVar(new Vs(e,n)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(a.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(a.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(a.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(a.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(a.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(a.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(a.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(a.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(a.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(a.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(a.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),s=()=>{try{if(this.positions&&this.positions.length>=2){const r=Iu(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=r}else this._geoPolylinePath.positions=void 0}catch(r){console.error(r),this._geoPolylinePath.positions=void 0}};s(),this.dispose(o.disposableOn(s)),this.dispose(this._flyToEvent.disposableOn(r=>{this._geoPolylinePath.flyTo(r)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(Yr||(Yr={})),a.extendClassProps(Yr.prototype,Yr.createDefaultProps);const xE=[["256",256],["512",512],["1024",1024]],AE=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Wt=class Wt extends a.ESVisualObject{constructor(e){super(e);m(this,"_pickFeaturesEvent",this.dv(new a.Event));this.ad(a.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(a.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"accessToken"],"令牌",Wt.defaults.accessToken),new a.Number4Property([this,"rectangle"],"矩形范围",Wt.defaults.rectangle),new a.JsonProperty([this,"url"],"服务地址",Wt.defaults.url),new a.JsonProperty([this,"style"],"样式配置",Wt.defaults.style),new a.NumberProperty([this,"zIndex"],"层级序号",Wt.defaults.zIndex),new a.EnumProperty([this,"tileSize"],xE,"瓦片大小",256),new a.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Wt.defaults.maximumLevel),new a.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Wt.defaults.minimumLevel),new a.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Wt.defaults.scheme),new a.EnumProperty([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考")],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EnumProperty([this,"splitDirection"],AE,"splitDirection","NONE"),new a.GroupProperty([],"czm","czm"),new a.NumberProperty([this,"czmAlpha"],"透明度"),new a.NumberProperty([this,"czmBrightness"],"亮度"),new a.NumberProperty([this,"czmContrast"],"对比度"),new a.NumberProperty([this,"czmHue"],"色相"),new a.NumberProperty([this,"czmSaturation"],"饱和度"),new a.NumberProperty([this,"czmGamma"],"伽马值")]}}};m(Wt,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),rectangle:a.reactJsonWithUndefined([-180,-90,180,90]),url:a.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:a.reactArrayWithUndefined([]),scheme:a.react("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),m(Wt,"type",Wt.register("ESMVTLayer",Wt,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let mh=Wt;const EE=t=>{const i=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:n}of i)if(t>=e)return n;return 20},TE=async(t,i,e)=>(await fetch(`http://tileser.giiiis.com/xyzinfo/${e}/${t}/${i}`)).json(),IE=async t=>{var u;const i=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!i)return;const e=i[0],n=i[1],o=i[2],s=EE(o);let r=Math.floor((e+180)/360*Math.pow(2,s+1)),l=Math.floor((90-n)/180*Math.pow(2,s));return await TE(r,l,s)};class ME extends a.Destroyable{constructor(i,e,n){super();const o=async()=>{const r=await IE(i);e.datesEvent.emit(r,i)};o();let s;s=setInterval(()=>{o()},3e3),this.d(()=>s&&clearInterval(s));{const r=()=>{const l=e.currentDate?e.currentDate:0;n.url=`http://tileser.giiiis.com/timetile/tms/${l}/tilemapresource.xml`};r(),this.d(e.currentDateChanged.don(r))}}}const fr=class fr extends a.ESVisualObject{constructor(e){super(e);m(this,"_esImageryLayer",this.dv(new a.ESImageryLayer));m(this,"_datesEvent",this.dv(new a.Event));const n=this._esImageryLayer;this.d(this.components.disposableAdd(n)),n.zIndex=1,n.minimumLevel=1,n.maximumLevel=18,this.d(a.track([n,"show"],[this,"show"])),this.d(a.track([n,"zIndex"],[this,"zIndex"])),this.d(a.track([n,"rectangle"],[this,"rectangle"])),this.d(a.bind([n,"flyInParam"],[this,"flyInParam"])),this.d(a.bind([n,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new ME(o,this,n)),this.d(this.flyInEvent.don(o=>{n.flyIn(o)})),this.d(this.flyToEvent.don(o=>{n.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"currentDate"],"时间","0"),new a.NumberProperty([this,"zIndex"],"层级",0),new a.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};m(fr,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:a.reactArray([-180,-90,180,90])})),m(fr,"type",fr.register("ESGeHistoryImagery",fr,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let vh=fr;const xy=`async (dataSource, viewer) => {
|
|
743
|
+
`,s.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let l=this.disposeVar(a.react(void 0));{const c=this.disposeVar(a.createProcessingFromAsyncFunc(async d=>{l.value=void 0;const p=e.url??a.ESDataMesh.defaults.url;if(!p)return;await d.promise(a.sleep(200));const f=(e.maxTime??23)|0;l.value=await d.promise(_E(a.ESSceneObject.context.getStrFromEnv(typeof p=="string"?p:p.url),f+1))}));c.start();const u=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>c.restart()))}{class c{constructor(p){this._buffer=p}[Symbol.iterator](){return PE(this._buffer)}}const u=()=>{if(!l.value)return;const{vertexBuffer:d,propBuffers:p,indexBuffer:f}=l.value,{minPos:g,maxPos:v}=a.getMinMaxCorner(new c(d));s.setLocalAxisedBoundingBox(g,v);const y=(e.maxTime??23)|0;let w=(e.currentTime??a.ESDataMesh.defaults.currentTime)/y;w=w<0?0:w>1?1:w;const P=w*y;let C=w*y|0,S=P-C;if(C>=y&&(C=y-1,S=1),!Number.isFinite(S)){console.error("!Number.isFinite(rr)");debugger;return}if(s.indexTypedArray=f,!p[C]||!p[C+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}s.attributes={a_position:{typedArray:d,componentsPerAttribute:3},a_prop:{typedArray:p[C],componentsPerAttribute:3},a_prop2:{typedArray:p[C+1],componentsPerAttribute:3}},s.uniformMap={u_gradientMap:{type:"texture",id:`${r.id}`},u_stripMinMaxValue:[e.minPropValue??a.ESDataMesh.defaults.minPropValue,e.maxPropValue??a.ESDataMesh.defaults.maxPropValue],u_ratio:S}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(l.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,r,!0),!0):!1}};m(Wa,"type",Wa.register("ESCesiumViewer",a.ESDataMesh.type,Wa));let ep=Wa;const qo=class qo extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_heading",this.disposeVar(a.react(0)));m(this,"_textFunc",this.disposeVar(a.react(void 0)));const o=this;{const l=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=a.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=a.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=a.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?a.clampN180_180(u):a.clamp0_360(u)}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(c.disposableOn(l))}const s=this.disposeVar(new xe(e,n));s.loop=!1,this.dispose(a.track([s,"allowPicking"],[o,"allowPicking"])),this.dispose(a.bind([s,"arcType"],[o,"arcType"])),this.dispose(a.bind([s,"color"],[o,"color"])),this.dispose(a.bind([s,"dashLength"],[o,"dashLength"])),this.dispose(a.bind([s,"dashPattern"],[o,"dashPattern"])),this.dispose(a.bind([s,"gapColor"],[o,"gapColor"])),this.dispose(a.bind([s,"hasArrow"],[o,"hasArrow"])),this.dispose(a.bind([s,"hasDash"],[o,"hasDash"])),this.dispose(a.bind([s,"positions"],[o,"positions"])),this.dispose(a.bind([s,"show"],[o,"show"])),this.dispose(a.bind([s,"width"],[o,"width"])),this.dispose(a.bind([s,"depthTest"],[o,"depthTest"])),this.dispose(a.bind([s,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const r=this.disposeVar(new Ue(e,n));this.dispose(a.bind([r,"shadowDom"],[o,"shadowDom"])),this.dispose(a.bind([r,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(a.bind([r,"show"],[o,"show"]));{const l=()=>{o.positions&&o.positions.length>=2?r.position=o.positions[1]:r.position=void 0};l(),this.dispose(o.positionsChanged.disposableOn(l))}{const l=()=>{const{heading:u}=o,d=(o.textFunc??qo.defaultTextFunc_度格式)(u);r.innerHTML=uo(`方向: ${d}`,24)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(c.disposableOn(l))}this.ad(r.pickedEvent.don(l=>{$i(l)===0&&this.pickedEvent.emit(l)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};m(qo,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),m(qo,"defaultTextFunc_度分格式",e=>`${xr(e,!0)}`),m(qo,"defaultTextFunc_度分秒格式",e=>`${xr(e,!1)}`),m(qo,"defaults",{positions:[]});let Do=qo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:8,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(Do||(Do={})),a.extendClassProps(Do.prototype,Do.createDefaultProps);const Ga=class Ga extends yt{constructor(e,n){super(e,n);m(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new Do(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmDirectionMeasurement;s.angleMode="0~360",this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):u==="normal"?(s.hasDash=!1,s.hasArrow=!1):(s.hasDash=!1,s.hasArrow=!0);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{$i(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ga,"type",Ga.register("ESCesiumViewer",a.ESDirectionMeasurement.type,Ga));let tp=Ga;class Ns extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_distances",this.disposeVar(a.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await Am(e.viewer,this.positions??[]):this._distances.value=a.getDistancesFromPositions(this.positions??[],this.arcType)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(s.disposableOn(o));const r=this.disposeVar(new xe(e,n));r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"positions"],[this,"positions"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"])),this.dispose(a.bind([r,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&r.flyTo(l)}));{const l=[],c=()=>{for(let d of l)d.destroy();l.length=0};this.dispose(c);const u=()=>{if(c(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const p=Tu("起点",this.positions[0],e,n);p.dispose(a.track([p,"show"],[this,"show"])),p.dispose(a.track([p,"shadowDom"],[this,"shadowDom"])),p.dispose(a.track([p,"cssAllInitial"],[this,"cssAllInitial"])),l.push(p)}const d=this.distances.length;for(let p=0;p<d;++p){const f=this.distances[p],g=this.positions[p+1],v=Tu(`长度: ${xc(f)}`,g,e,n);v.dispose(a.track([v,"show"],[this,"show"])),v.dispose(a.track([v,"shadowDom"],[this,"shadowDom"])),v.dispose(a.track([v,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(v.pickedEvent.don(y=>{$i(y)===0&&this.pickedEvent.emit(y)})),l.push(v)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>a.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}m(Ns,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(Ns||(Ns={})),a.extendClassProps(Ns.prototype,Ns.createDefaultProps);const Ua=class Ua extends yt{constructor(e,n){super(e,n);m(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new xe(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoPolyline;this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]));{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}}get geoPolyline(){return this._geoPolyline}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolyline:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolyline:r}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ua,"type",Ua.register("ESCesiumViewer",a.ESGeoLineString.type,Ua));let Os=Ua;const Ha=class Ha extends Os{constructor(e,n){super(e,n);m(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new Ns(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{$i(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ha,"type",Ha.register("ESCesiumViewer",a.ESDistanceMeasurement.type,Ha));let ip=Ha;class Bs extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:a.reactPositions(void 0),reverse:!1,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Bs||(Bs={})),a.extendClassProps(Bs.prototype,Bs.createDefaultProps);class bE extends a.Destroyable{constructor(i,e){super(),this._czmESExcavate=i,this._eS3DTileset=e;for(let n=0;n<this._eS3DTileset.excavateId.length;n++){const o=this._eS3DTileset.excavateId[n];a.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(n,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(n=>n!==this._czmESExcavate.czmPolygonClipping.id)]})}}class SE extends a.Destroyable{constructor(i){if(super(),this._czmESExcavate=i,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const n=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];a.ESSceneObject.getSceneObjById(n)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const $a=class $a extends Xt{constructor(e,n){super(e,n);m(this,"_czmPolygonClipping");m(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new Bs(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!n.viewer)return;const r=this._czmPolygonClipping;r.showHelper=!1,this.dispose(a.bind([r,"positions"],[e,"points"])),this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.reverse=e.mode!=="in"};l(),this.dispose(e.modeChanged.disposableOn(l))}a.engineObjectCreatedUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new SE(this):!c||!(c instanceof a.ES3DTileset)?void 0:new bE(this,c)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonClipping:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m($a,"type",$a.register("ESCesiumViewer",a.ESExcavate.type,$a));let np=$a;const qa=class qa extends me{constructor(e,n){super(e,n);m(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new bi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmFireParticleSystem;s.endColor=[1,1,0,.4],s.startColor=[1,0,0,.5],s.particleLife=1,s.emissionRate=30,s.lifetime=1,s.imageSize=[1,1],s.emitter={type:"CircleEmitter",radius:.1},s.sizeInMeters=!0;{const r=()=>{s.startScale=10*(e.scale[0]>0?e.scale[0]:1),s.endScale=5*(e.scale[0]>0?e.scale[0]:1),s.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),s.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};r(),this.ad(e.scaleChanged.don(r))}this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"translation"],[e,"translation"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmFireParticleSystem:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,ei,e),o.flyOverEvent.emit(n,"over",s),!0}}};m(qa,"type",qa.register("ESCesiumViewer",a.ESFireParticleSystem.type,qa));let op=qa;class Vs extends a.Destroyable{constructor(e,n){super();m(this,"_geoPath");m(this,"_geoPolyline");m(this,"_geoCanvasPointPoi");m(this,"_player");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));m(this,"_ratio",this.disposeVar(a.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new a.ESPathImpl),this._geoPolyline=this.disposeVar(new xe(e,n)),this._geoCanvasPointPoi=this.disposeVar(new Sn(e,n)),this._player=this.disposeVar(new a.Player),this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(a.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(a.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(a.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(a.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPath,"show"],[this,"show"])),this.dispose(a.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const r=this.granularity*Math.PI/180,l=mu(this.positions,this.arcType??"GEODESIC",r);if(l){this._geoPath.timePosRots=l.timePosRots,this.rotationRadius.some(c=>c>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(s.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const s=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(s-this.currentDistance)>.01&&(this.currentDistance=s)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const s=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(s-(this._player.currentTime??0))>.01&&(this._player.currentTime=s)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(a.bind([this._player,"loop"],[this,"loop"])),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._player,"duration"],[this,"duration"])),this.dispose(a.bind([this._player,"playing"],[this,"playing"])),this.dispose(a.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(o=>{this._geoPolyline.flyTo(o)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(s=>s[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Vs||(Vs={})),a.extendClassProps(Vs.prototype,Vs.createDefaultProps);class Yr extends a.Destroyable{constructor(e,n){super();m(this,"_geoPolylinePath");m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_currentDistance",this.disposeVar(a.react(0)));this._geoPolylinePath=this.disposeVar(new Vs(e,n)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(a.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(a.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(a.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(a.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(a.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(a.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(a.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(a.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(a.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(a.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(a.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),s=()=>{try{if(this.positions&&this.positions.length>=2){const r=Iu(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=r}else this._geoPolylinePath.positions=void 0}catch(r){console.error(r),this._geoPolylinePath.positions=void 0}};s(),this.dispose(o.disposableOn(s)),this.dispose(this._flyToEvent.disposableOn(r=>{this._geoPolylinePath.flyTo(r)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(Yr||(Yr={})),a.extendClassProps(Yr.prototype,Yr.createDefaultProps);const xE=[["256",256],["512",512],["1024",1024]],AE=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Wt=class Wt extends a.ESVisualObject{constructor(e){super(e);m(this,"_pickFeaturesEvent",this.dv(new a.Event));this.ad(a.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(a.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"accessToken"],"令牌",Wt.defaults.accessToken),new a.Number4Property([this,"rectangle"],"矩形范围",Wt.defaults.rectangle),new a.JsonProperty([this,"url"],"服务地址",Wt.defaults.url),new a.JsonProperty([this,"style"],"样式配置",Wt.defaults.style),new a.NumberProperty([this,"zIndex"],"层级序号",Wt.defaults.zIndex),new a.EnumProperty([this,"tileSize"],xE,"瓦片大小",256),new a.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Wt.defaults.maximumLevel),new a.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Wt.defaults.minimumLevel),new a.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Wt.defaults.scheme),new a.EnumProperty([this,"heightReference"],[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]],"高度参考")],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EnumProperty([this,"splitDirection"],AE,"splitDirection","NONE"),new a.GroupProperty([],"czm","czm"),new a.NumberProperty([this,"czmAlpha"],"透明度"),new a.NumberProperty([this,"czmBrightness"],"亮度"),new a.NumberProperty([this,"czmContrast"],"对比度"),new a.NumberProperty([this,"czmHue"],"色相"),new a.NumberProperty([this,"czmSaturation"],"饱和度"),new a.NumberProperty([this,"czmGamma"],"伽马值")]}}};m(Wt,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),rectangle:a.reactJsonWithUndefined([-180,-90,180,90]),url:a.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:a.reactArrayWithUndefined([]),scheme:a.react("xyz"),czmSplitDirection:"NONE",heightReference:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),m(Wt,"type",Wt.register("ESMVTLayer",Wt,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let mh=Wt;const EE=t=>{const i=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:n}of i)if(t>=e)return n;return 20},TE=async(t,i,e)=>(await fetch(`http://tileser.giiiis.com/xyzinfo/${e}/${t}/${i}`)).json(),IE=async t=>{var u;const i=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!i)return;const e=i[0],n=i[1],o=i[2],s=EE(o);let r=Math.floor((e+180)/360*Math.pow(2,s+1)),l=Math.floor((90-n)/180*Math.pow(2,s));return await TE(r,l,s)};class ME extends a.Destroyable{constructor(i,e,n){super();const o=async()=>{const r=await IE(i);e.datesEvent.emit(r,i)};o();let s;s=setInterval(()=>{o()},3e3),this.d(()=>s&&clearInterval(s));{const r=()=>{const l=e.currentDate?e.currentDate:0;n.url=`http://tileser.giiiis.com/timetile/tms/${l}/tilemapresource.xml`};r(),this.d(e.currentDateChanged.don(r))}}}const fr=class fr extends a.ESVisualObject{constructor(e){super(e);m(this,"_esImageryLayer",this.dv(new a.ESImageryLayer));m(this,"_datesEvent",this.dv(new a.Event));const n=this._esImageryLayer;this.d(this.components.disposableAdd(n)),n.zIndex=1,n.minimumLevel=1,n.maximumLevel=18,this.d(a.track([n,"show"],[this,"show"])),this.d(a.track([n,"zIndex"],[this,"zIndex"])),this.d(a.track([n,"rectangle"],[this,"rectangle"])),this.d(a.bind([n,"flyInParam"],[this,"flyInParam"])),this.d(a.bind([n,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new ME(o,this,n)),this.d(this.flyInEvent.don(o=>{n.flyIn(o)})),this.d(this.flyToEvent.don(o=>{n.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"currentDate"],"时间","0"),new a.NumberProperty([this,"zIndex"],"层级",0),new a.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};m(fr,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:a.reactArray([-180,-90,180,90])})),m(fr,"type",fr.register("ESGeHistoryImagery",fr,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let vh=fr;const xy=`async (dataSource, viewer) => {
|
|
744
744
|
viewer.clock.shouldAnimate = false;
|
|
745
745
|
const rider = dataSource.entities.getById("tour");
|
|
746
746
|
await viewer.flyTo(rider)
|
|
@@ -1251,7 +1251,7 @@ export type IndexJsonType = {
|
|
|
1251
1251
|
\`\`\`
|
|
1252
1252
|
${Ly}
|
|
1253
1253
|
\`\`\`
|
|
1254
|
-
`,$e=class $e extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));m(this,"_dataSource",this.disposeVar(a.react(void 0)));m(this,"_data");m(this,"_defaultHeight",{});m(this,"defaultBoundingSphere");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{s()});{const r=this.dv(a.createProcessingFromAsyncFunc(async u=>{this.dataSource&&s(),this.url&&(typeof this.url=="object"?this._data=this.url:a.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(a.ESSceneObject.context.getStrFromEnv(this.url)).then(d=>d.json()).then(d=>{this._data=d}).catch(d=>{console.warn("ESGeoJson数据加载失败",d)}),this.dataSource=await h.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(d=>{var f,g;const p=[];for(const v of d.entities.values){h.Entity.prototype&&(v.ESSceneObjectID=n),this._isEntityShow(v,e);do{if(v.polygon){p.push(...(f=v.polygon.hierarchy)==null?void 0:f.getValue(h.JulianDate.now()).positions);break}if(v.polyline){p.push(...(g=v.polyline.positions)==null?void 0:g.getValue(h.JulianDate.now()));break}if(v.position){const y=v.position.getValue(h.JulianDate.now());y&&p.push(y);break}}while(!1)}p.length>0&&(this.defaultBoundingSphere=h.BoundingSphere.fromPoints(p))}))})),l=()=>{r.isRunning&&r.cancel(),r.restart()};l();const c=this.dv(a.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(c.don(l))}{const r=()=>{var c,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(d){console.error(d)}else{const d=this.dataSource.entities.values;for(let p=0;p<d.length;p++){const f=d[p];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(c=f.polygon.height)==null?void 0:c.getValue(h.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new h.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new h.ConstantProperty(!this.fillGround),f.polygon.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new h.ConstantProperty(this.filled??$e.defaults.filled),f.polygon.material=new h.ColorMaterialProperty(new h.Color(...this.fillColor??$e.defaults.fillColor)),f.polygon.outline=new h.ConstantProperty(!1),f.polygon.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new h.PolylineGraphics;const g=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(h.JulianDate.now()).positions));h.Cartesian3.equals(g[0],g[g.length-1])||g.push(g[0]),f.polyline.positions=g,f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new h.ConstantProperty(this.stroked??$e.defaults.stroked),f.polyline.width=new h.ConstantProperty(this.strokeWidth??$e.defaults.strokeWidth),f.polyline.material=new h.ColorMaterialProperty(new h.Color(...this.strokeColor??$e.defaults.strokeColor)),f.polyline.clampToGround=new h.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new h.ConstantProperty(this.imageShow??$e.defaults.imageShow),f.billboard.width=new h.ConstantProperty(this.imageSize?this.imageSize[0]:$e.defaults.imageSize[0]),f.billboard.height=new h.ConstantProperty(this.imageSize?this.imageSize[1]:$e.defaults.imageSize[1]);const g=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:$e.defaults.imageUrl;f.billboard.image=new h.ConstantProperty(a.ESSceneObject.context.getStrFromEnv(g)),f.billboard.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.billboard.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND);const v=this.imageAnchor??$e.defaults.imageAnchor,y=this.imageOffset??$e.defaults.imageOffset;if(f.billboard.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-v[0]*f.billboard.width.getValue(h.JulianDate.now())+y[0],-v[1]*f.billboard.height.getValue(h.JulianDate.now())+y[1]])),f.label=new h.LabelGraphics,!f.label)return;f.label.show=new h.ConstantProperty(this.textShow??$e.defaults.textShow),f.label.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.label.text=new h.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??$e.defaults.textDefaultText),f.label.fillColor=new h.ConstantProperty(new h.Color(...this.textColor??$e.defaults.textColor)),f.label.showBackground=new h.ConstantProperty(this.textBackgroundColor!=null);const w=this.textFontSize&&this.textFontSize!=0?this.textFontSize:$e.defaults.textFontSize,P=this.textOffset??$e.defaults.textOffset;f.label.backgroundColor=new h.ConstantProperty(new h.Color(...this.textBackgroundColor??$e.defaults.textBackgroundColor)),f.label.font=new h.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${w}px ${this.textFontFamily??$e.defaults.textFontFamily}`),f.label.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.label.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.label.eyeOffset=new h.ConstantProperty(h.Cartesian3.fromArray([0,0,-1]));const C=this.textAnchor??$e.defaults.textAnchor;f.label.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-C[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(h.JulianDate.now()),f.label.font.getValue(h.JulianDate.now())))+P[0],-C[1]*((this.textBackgroundColor?10:0)+w)+P[1]]))}}}};r();const l=this.dv(a.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged));this.dispose(l.don(r))}{const r=()=>{if(!this.dataSource)return;const c=this.dataSource.entities.values;for(let u=0;u<c.length;u++){const d=c[u];this._isEntityShow(d,e)}};r();const l=this.ad(a.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(l.don(r))}{const r=()=>{if(this.loadFuncStr)try{const l=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=l}catch(l){console.error(l),this.loadFun=void 0}else this.loadFun=void 0};r(),this.dispose(this.loadFuncStrChanged.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&o.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:r?r/1e3:void 0})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0)e.show=this.show;else if((o=n.viewer)!=null&&o.camera){if(!this.show){e.show=this.show;return}const s=h.JulianDate.now();let r;if(e.polygon&&e.polygon.hierarchy)r=a.getMinMaxCorner(e.polygon.hierarchy.getValue(s).positions.map(u=>se(u))).center;else if(e.polyline&&e.polyline.positions)r=a.getMinMaxCorner(e.polyline.positions.getValue(s).map(u=>se(u))).center;else if(e.position){const u=e.position.getValue(s);u&&(r=se(u))}if(!r||isNaN(r[0]))return;const l=a.getDistancesFromPositions([r,Ht(n.viewer.camera)],"NONE")[0];let c=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?c=this.minFeatureVisibleDistance<l&&l<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?c=l>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(c=l<this.maxFeatureVisibleDistance),e.show=this.show&&c}}};m($e,"defaults",{show:!0,allowPicking:!0,url:Ny,defaultLoadFuncStr:Ly,defaultLoadFuncDocStr:qE,data:HE,dataMd:$E,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Ro=$e;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:a.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:a.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:a.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:a.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:a.reactArrayWithUndefined(void 0),imageAnchor:a.reactArrayWithUndefined(void 0),imageOffset:a.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:a.reactArrayWithUndefined(void 0),textBackgroundColor:a.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:a.reactArrayWithUndefined(void 0),textOffset:a.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Ro||(Ro={})),a.extendClassProps(Ro.prototype,Ro.createDefaultProps);const Qa=class Qa extends Jt{constructor(e,n){super(e,n);m(this,"_pointFeatures",this.disposeVar(a.react(void 0)));m(this,"_defaultPointsBoundingSphere");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=Ke(o);if(!s)return;const{screenManager:r}=s,l=this.disposeVar(new Ro(n,e.id));{const c=()=>{if(!e.features)return;const u=a.toGeoJson(e.features),d={type:u.type,features:[]};l.url={type:u.type,features:u.features.filter(p=>p.geometry.type.toLowerCase().includes("point")?(d.features.push(p),!1):!0)},this.pointFeatures=d};c(),this.ad(e.featuresChanged.don(c))}this.ad(a.track([l,"show"],[e,"show"])),this.ad(a.track([l,"allowPicking"],[e,"allowPicking"])),this.ad(a.track([l,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(a.track([l,"stroked"],[e,"stroked"])),this.ad(a.track([l,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.track([l,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(a.track([l,"strokeColor"],[e,"strokeColor"])),this.ad(a.track([l,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(a.track([l,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(a.track([l,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([l,"filled"],[e,"filled"])),this.ad(a.track([l,"fillColor"],[e,"fillColor"])),this.ad(a.track([l,"fillMaterial"],[e,"fillMaterial"])),this.ad(a.track([l,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(a.track([l,"fillGround"],[e,"fillGround"])),this.ad(a.track([l,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(a.track([l,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(a.track([l,"heightReference"],[e,"heightReference"])),this.ad(a.track([l,"classificationType"],[e,"classificationType"]));{const c=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=h.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(p=>Se(p))).flat(1/0)))};c(),this.ad(this.pointFeaturesChanged.don(c))}{let c={id:"",layer:"",screenObjectIds:new Set};const u=()=>{c.id!=""&&(r.remove(c.layer,c.id,{label:c.screenObjectIds}),c={id:"",layer:"",screenObjectIds:new Set})};this.ad(()=>{u()});const d=()=>{if(u(),!((e.textShow??a.ESGeoJson.defaults.textShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.textFontSize&&e.textFontSize!=0?e.textFontSize:a.ESGeoJson.defaults.textFontSize,g=e.textOffset??a.ESGeoJson.defaults.textOffset,v=e.textAnchor??a.ESGeoJson.defaults.textAnchor,y={show:!0,heightReference:h.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],fillColor:new h.Color(...e.textColor??a.ESGeoJson.defaults.textColor),showBackground:e.textBackgroundColor!=null,backgroundColor:new h.Color(...e.textBackgroundColor??a.ESGeoJson.defaults.textBackgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${f}px ${e.textFontFamily??a.ESGeoJson.defaults.textFontFamily}`,horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.TOP,eyeOffset:h.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new h.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((w,P)=>{const C=e.textProperty&&e.textProperty!==""&&(w!=null&&w.properties)&&w.properties[e.textProperty]?w.properties[e.textProperty]:e.textDefaultText??a.ESGeoJson.defaults.textDefaultText;y.pixelOffset=h.Cartesian2.fromArray([-v[0]*((e.textBackgroundColor?-14:0)+this._getTextPixelWidth(C,y.font))+g[0],-v[1]*((e.textBackgroundColor?10:0)+f)+g[1]]),(w.geometry.type=="Point"?[w.geometry.coordinates]:w.geometry.coordinates).forEach((A,E)=>{const R={index:`${P}${E}`,name:C,position:A,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:w.properties},N=r.addLabel(e.id,e.typeName,y,R);c.id=N.id,c.layer=N.layer,c.screenObjectIds.add(N.screenObjectId)})})};d();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(p.don(d))}{this.ad(()=>{u()});let c={id:"",layer:"",screenObjectIds:new Set};const u=()=>{c.id!=""&&(r.remove(c.layer,c.id,{billboard:c.screenObjectIds}),c={id:"",layer:"",screenObjectIds:new Set})},d=()=>{if(u(),!((e.imageShow??a.ESGeoJson.defaults.imageShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.imageAnchor??a.ESGeoJson.defaults.imageAnchor,g=e.imageOffset??a.ESGeoJson.defaults.imageOffset,v=e.imageSize?e.imageSize[0]:a.ESGeoJson.defaults.imageSize[0],y=e.imageSize?e.imageSize[1]:a.ESGeoJson.defaults.imageSize[1],w={show:!0,width:v,height:y,image:a.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:a.ESGeoJson.defaults.imageUrl),horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.TOP,heightReference:h.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],pixelOffset:h.Cartesian2.fromArray([-f[0]*v+g[0],-f[1]*y+g[1]]),distanceDisplayCondition:new h.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((P,C)=>{(P.geometry.type=="Point"?[P.geometry.coordinates]:P.geometry.coordinates).forEach((A,E)=>{const R={index:`${C}${E}`,name:"",position:A,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:P.properties},N=r.addImage(e.id,e.typeName,w,R);c.id=N.id,c.layer=N.layer,c.screenObjectIds.add(N.screenObjectId)})})};d();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(p.don(d))}this.ad(e.flyToEvent.disposableOn(c=>{if(!n.actived)return;if(e.flyInParam){const{position:d,rotation:p,flyDuration:f}=e.flyInParam;return ne(n.viewer,d,void 0,p,f),!0}let u;l.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=h.BoundingSphere.fromBoundingSpheres([l.defaultBoundingSphere,this._defaultPointsBoundingSphere]):l.defaultBoundingSphere?u=l.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&$t(n,e,this.id,se(u.center),u.radius,c)}));{const c=async(u,d,p)=>{if(!n.actived)return;const f=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,d)));if(!(!f||!(f!=null&&f.positions)))if(f.type=="Point"||f.type=="MultiPoint")$t(n,e,this.id,await this._calculateFeatureHeight(f.type=="MultiPoint"?f.positions.flat():f.positions,e.heightReference,n),1e3,p);else{const g=f.type=="Polygon"||f.type=="MultiPolygon"||f.type=="MultiLineString";let v=[];g?v=f.positions.flat(f.type=="MultiPolygon"?2:1).map(C=>this._calculateFeatureHeight(C,e.fillGround?"CLAMP_TO_GROUND":"NONE",n)):v=f.positions.map(C=>this._calculateFeatureHeight(C,e.strokeGround?"CLAMP_TO_GROUND":"NONE",n));const{minPos:y,maxPos:w,center:P}=a.getMinMaxCorner(v);$t(n,e,this.id,P,a.getDistancesFromPositions([y,w],"NONE")[0],p)}};this.d(e.flyToFeatureEvent.don((u,d,p)=>c(u,d,p))),this.d(e.flyToFeatureIndexEvent.don((u,d)=>c(u,void 0,d)))}}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}_getFeatureByIndexOrProperties(e,n){var l,c,u,d,p,f,g,v;const{sceneObject:o}=this,s=o.features;if(!s)return;const r=Reflect.get(s,"features")||Reflect.get(s,"geometries");if(r){if(n){let y=r.find(w=>(w==null?void 0:w.properties[e])==n);return{type:y!=null&&y.coordinates?y.type:(l=y==null?void 0:y.geometry)==null?void 0:l.type,positions:(y==null?void 0:y.coordinates)||((c=y==null?void 0:y.geometry)==null?void 0:c.coordinates)}}else if(typeof e=="number")return{type:(u=r[e])!=null&&u.coordinates?r[e].type:(p=(d=r[e])==null?void 0:d.geometry)==null?void 0:p.type,positions:((f=r[e])==null?void 0:f.coordinates)||((v=(g=r[e])==null?void 0:g.geometry)==null?void 0:v.coordinates)}}}async _calculateFeatureHeight(e,n,o){const s=[...e];return n=="NONE"?s[2]=s[2]??0:n=="CLAMP_TO_GROUND"||!s[2]?s[2]=await o.getTerrainHeight(s)??0:s[2]+=await o.getTerrainHeight(s)??0,s}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}};m(Qa,"type",Qa.register("ESCesiumViewer",a.ESGeoJson.type,Qa));let cp=Qa;const ka=class ka extends yt{constructor(e,n){super(e,n);m(this,"_czmGeoESRectangle");m(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new xe(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,r=this._geoPolyline;r.arcType="RHUMB",this.dispose(a.track([r,"color"],[e,"strokeColor"])),this.dispose(a.track([r,"width"],[e,"strokeWidth"])),this.dispose(a.track([r,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{const c=e.points;if(c&&c.length>=2){const{minPos:u,maxPos:d}=a.getMinMaxCorner(c);s.rectangle=[u[0],u[1],d[0],d[1]],s.height=c[0][2],s.extrudedHeight=c[0][2];const p=c.map(y=>(c&&(y[2]=c[0][2]),y)),f=p[0],g=p[1],v=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];r.positions=[...v,f]}else s.rectangle=void 0,r.positions=void 0,s.height=0,s.extrudedHeight=0};l(),this.dispose(e.pointsChanged.disposableOn(()=>l()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmGeoESRectangle:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};m(ka,"type",ka.register("ESCesiumViewer",a.ESGeoRectangle.type,ka));let hp=ka;class kr extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new En(e,n));const{geoPolygon:o}=this;this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"fill"],[this,"filled"])),this.dispose(a.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(a.bind([o,"ground"],[this,"ground"])),this.dispose(a.bind([o,"outline"],[this,"outline"])),this.dispose(a.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(a.bind([o,"color"],[this,"color"])),this.dispose(a.bind([o,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const r=Iu([...this.positions,this.positions[0]]);o.positions=r}else o.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:1,color:a.reactArrayWithUndefined([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0})})(kr||(kr={})),a.extendClassProps(kr.prototype,kr.createDefaultProps);const Ka=class Ka extends yt{constructor(e,n){super(e,n);m(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new kr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"ground"],[e,"ground"]));{const r=()=>{s.ground=e.ground||e.fillGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(l.don(r))}{const r=()=>{s.color=e.filled?e.fillColor:Qr.defaults.fillStyle.color};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ka,"type",Ka.register("ESCesiumViewer",Qr.type,Ka));let up=Ka;const Ja=class Ja extends me{constructor(e,n){super(e,n);m(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new ct(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(l=>{var c;s.activeAnimationsJson=(c=s.gltf.animations)==null?void 0:c.map((u,d)=>({index:d,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(l),e.readyEvent.emit(l)})),this.ad(new bc(o,this._czmModel)),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"color"],[e,"czmColor"])),this.d(a.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(a.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(a.track([s,"scale"],[e,"scale"])),this.ad(a.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const l=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};l(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>l(c)))}{const l=()=>{var c,u;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const c=[...e.rotation??[0,0,0]];c[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=c};l(),this.d(e.rotationChanged.don(l));{const c=()=>{if(l(),!e.instances||e.instances.length==0){s.instances=void 0;return}s.instances=e.instances.map(u=>{const d=JSON.parse(JSON.stringify(u));return!d.rotation&&(d.rotation=[0,0,0]),d.rotation[0]+=90,d})};c(),this.ad(e.instancesChanged.don(c))}}this.ad(e.setMaterialEvent.don(l=>{s.setMaterial(l)}));{const l=()=>{const c=[...s.rotation];c[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=c};l(),this.d(s.rotationChanged.don(l))}{const l=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};c(),this.d(l.don(c))}const r=()=>{var l;s.url=a.ESSceneObject.context.getStrFromEnv(Sc(typeof e.url=="string"?e.url:((l=e.url)==null?void 0:l.url)??a.ESGltfModel.defaults.url))};r(),this.d(e.urlChanged.don(r)),this.d(e.setNodePositionEvent.don((l,c)=>{s.setNodeTranslation(l,c)})),this.d(e.setNodeRotationEvent.don((l,c)=>{s.setNodeRotation(l,c)})),this.d(e.setNodeScaleEvent.don((l,c)=>{s.setNodeScale(l,c)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:s,model:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r):!1}};m(Ja,"type",Ja.register("ESCesiumViewer",a.ESGltfModel.type,Ja));let dp=Ja;function Oy(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class Kr extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_distance",this.disposeVar(a.react(0)));m(this,"_surfaceDistance",this.disposeVar(a.react(0)));m(this,"_height",this.disposeVar(a.react(0)));m(this,"_middlePosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_heightPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const r=this._surfaceDistance.value=a.geoDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="RHUMB"){const r=this._surfaceDistance.value=a.geoRhumbDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="NONE"){const r=a.lbhToXyz(this.positions[0]),l=a.lbhToXyz(this.positions[1]);this._distance.value=Oy(r,l),this._surfaceDistance.value=Oy(a.lbhToXyz(this._middlePosition.value),l),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(o));{const r=this.disposeVar(new xe(e,n));r.ground=!1,r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"]));{r.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[u,d]=this.positions;r.positions=[u,d,[u[0],u[1],d[2]]]}else r.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&r.flyTo(c)}));const l=this.disposeVar(new Ue(e,n));this.dispose(a.track([l,"shadowDom"],[this,"shadowDom"])),this.dispose(a.track([l,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(a.track([l,"show"],[this,"show"]));{const c=()=>{l.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{l.innerHTML=uo(`高度: ${xc(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(l.pickedEvent.don(c=>{$i(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Kr||(Kr={})),a.extendClassProps(Kr.prototype,Kr.createDefaultProps);const ja=class ja extends yt{constructor(e,n){super(e,n);m(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Kr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{$i(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(ja,"type",ja.register("ESCesiumViewer",a.ESHeightMeasurement.type,ja));let pp=ja;const fp={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},el=class el extends me{constructor(e,n){super(e,n);m(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new ct(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(y=>{e.readyEvent.emit(y)}));{const y=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),w=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};w(),this.d(y.don(w))}const r=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),d=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":s.url=r;break;case"police":s.url=l;break;case"pedestrian":s.url=c;break;case"stranger":s.url=u;break;case"suitMan":s.url=d;break;case"suitWoman":s.url=p;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const g=()=>{const y=e.animation??a.ESHuman.defaults.animation;if(!e.show){s.activeAnimationsJson=void 0;return}y==="walking"?s.activeAnimationsJson=fp.czmAnimationsWalk:y==="standing"?s.activeAnimationsJson=fp.czmAnimationsStand:y==="running"&&(s.activeAnimationsJson=fp.czmAnimationsRun)};g();const v=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(v.disposableOn(()=>g())),this.ad(new bc(o,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r)}};m(el,"type",el.register("ESCesiumViewer",a.ESHuman.type,el));let gp=el;class By extends a.Destroyable{constructor(e,n){super();m(this,"_czmGeoCanvasImagePoi");m(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ne(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,ei,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new _i(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=d=>{let p=d;return d.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+d.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(Sc(p))},r=()=>{const d=s(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=d,e.sizeByContent){const f=new Image;f.src=d,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},l=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(l.disposableOn(()=>r())),r(),this.d(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.ad(a.bind([o,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(a.bind([o,"hoverHighlight"],[e,"hoverHighlight"]));{const d=()=>{o.scale=[e.scale[1],e.scale[2]]};d(),this.dispose(e.scaleChanged.don(d))}const c=()=>{const d=e.anchor,p=e.offset;d?o.originRatioAndOffset=[...d,-p[0],-p[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>c())),c(),this.dispose(o.clickEvent.disposableOn(d=>{const{offsetX:p,offsetY:f}=d,v={type:d.button===0?"leftClick":d.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(v)})),this.dispose(o.hoveredChanged.disposableOn(d=>{if(d===void 0)return;const p={type:d?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Vy extends a.Destroyable{constructor(e,n,o){super();m(this,"_czmGeoImageModel");m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return $t(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new Xi(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,v,y;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((v=this._eventInfo.add)==null?void 0:v.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((y=this._eventInfo.add)==null?void 0:y.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,v)=>{(g==null?void 0:g.sceneObject)==(v==null?void 0:v.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(v==null?void 0:v.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),v!=null&&v.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},v.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&v.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const r=e.sizeByContent,c=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(Sc(g))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=c,u.onload=()=>{if(r)s.size=[u.width/100,u.height/100];else{const f=e.size;s.size=[f[0]/100,f[1]/100]}},s.uri=c,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const f=()=>{s.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(je([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const d=()=>{const f=e.anchor,g=e.offset;f?s.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:s.originRatioAndOffset=[0,0,0,0]},p=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>d())),d()}get czmGeoImageModel(){return this._czmGeoImageModel}}const tl=class tl extends qr{constructor(e,n){super(e,n);m(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new a.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new By(this.sceneObject,this.czmViewer):new Vy(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(tl,"type",tl.register("ESCesiumViewer",a.ESImageLabel.type,tl));let mp=tl;function XE(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const il=class il extends Jt{constructor(e,n){super(e,n);m(this,"_czmImagery");if(this._czmImagery=this.dv(new Bn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;{const r=this.ad(a.reactJson(""));{const u=()=>{if(typeof e.url=="string")r.value=a.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=a.ESSceneObject.context.getStrFromEnv(d.url),r.value=d}};u(),this.ad(e.urlChanged.don(u))}const l=()=>{var v;if(!r.value)return;const u=(((v=e.options)==null?void 0:v.type)??"auto").toLowerCase(),d=e.options??{};let p={type:"UrlTemplateImageryProvider",url:r.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...d},f=r.value,g=typeof f=="string"?f:f.url;if(u==="auto"){const y=g.toLowerCase();if(y.startsWith("ion://")){const P=+y.substring(6);p={...d,assetId:P,type:"IonImageryProvider"}}else if(y.includes("{x}")||y.includes("{y}")||y.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(y.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(y.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const w=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=w:f.url=w,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&g.includes("/tilemapresource.xml")){const y=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=y:f.url=y,p.url=f}else if(u==="ion"&&g.startsWith("ion://")){const w=+g.substring(6);p={...d,assetId:w,type:"IonImageryProvider"}}p.type=XE(u)}console.log("imageryProvider",p),s.imageryProvider=p};l();const c=this.dv(a.createNextAnimateFrameEvent(r.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(c.don(l))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"alpha"],[e,"opacity"])),this.d(a.bind([s,"alpha"],[e,"czmAlpha"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.ad(a.track([s,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(il,"type",il.register("ESCesiumViewer",a.ESImageryLayer.type,il));let vp=il;class YE extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_show");m(this,"_czmESCustomPrimitive");m(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(a.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new Fe(n,this._sceneObject.id)),this._czmTexture=this.dv(new Ne(n));const r=e,l=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(a.track([l,"show"],[this,"show"])),this.dispose(a.track([l,"show"],[r,"show"])),this.dispose(a.track([l,"allowPicking"],[r,"allowPicking"])),this.dispose(a.track([l,"rotation"],[r,"rotation"])),this.dispose(a.track([l,"position"],[r,"position"])),this.dispose(a.track([l,"scale"],[r,"scale"])),this.ad(r.allowPickingChanged.don(()=>{l.allowPicking=r.allowPicking,l.pass=r.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const p=r.size/2,f=s[0].map(z=>z*p),g=s[1].map(z=>z*p),v=s[2].map(z=>z*p),y=s[3].map(z=>z*p),w=[...f,...g,...v,...y];let P=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(P=P.reverse());const C=[0,0],S=[1,0],A=[1,1],E=[0,1];let R=[];o=="east"||o=="south"?R=[...S,...C,...E,...A]:o=="west"?R=[...S,...A,...E,...C]:o=="top"?R=[...E,...A,...S,...C]:R=[...C,...S,...A,...E],l.indexTypedArray=new Uint16Array(P),l.attributes={position:{typedArray:new Float32Array(w),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},c.uri=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/${o}.${r.mode!="blueSky"?"png":"jpg"}`);const N=n.getCameraInfo();if(N!=null){const O=a.getDistancesFromPositions([r.position,N.position],"NONE")[0]/(r.size/2*r.autoOpacityFactor);this.changeOpacity(r.autoFollow?1:O)}const B=l.computeLocalAxisedBoundingBoxFromAttribute("position");if(!B)return;const{min:V,max:G}=B;l.setLocalAxisedBoundingBox(V,G)};u();const d=this.disposeVar(a.createNextAnimateFrameEvent(r.sizeChanged,r.modeChanged));this.dispose(d.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class ZE extends a.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{r()}));function r(){var c;if(!((c=e.viewer)!=null&&c.camera))return;const l=e.getCameraInfo();if(l!=null&&(s==null||s.position[0]!=l.position[0]||s.position[1]!=l.position[1]||s.position[2]!=l.position[2]||s.rotation[0]!=l.rotation[0]||s.rotation[1]!=l.rotation[1]||s.rotation[2]!=l.rotation[2])){s=l;const d=a.getDistancesFromPositions([i.position,s.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=s.position,o&&(o=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(d)})}}r()}}const Ze=class Ze extends me{constructor(e,n){super(e,n);m(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ze._defaultLocalBox&&Ze._firstLoad&&(Ze._firstLoad=!1,Ze._defaultLocalBox=n.xbsjLocalBoxSources),Ze._eSLocalSkyBoxArr.push(e),this.d(()=>{Ze._eSLocalSkyBoxArr.includes(e)&&Ze._eSLocalSkyBoxArr.splice(Ze._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){const l=s[r];this._czmSkyBoxComponents.push(this.dv(new YE(e,n,r,l)))}{const r=this.disposeVar(a.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new a.ObjResettingWithEvent(r,()=>(this.ChangeAutoFollow(),new ZE(e,n,this._czmSkyBoxComponents))))}{const r=()=>{this.ChangeAutoFollow()},l=this.disposeVar(a.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(l.disposableOn(r))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ze._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=Ze._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ze._defaultLocalBox)}Ze._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ze._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.size??a.ESLocalSkyBox.defaults.size;return o.position?($t(s,o,n,o.position,r,e,!0),!0):!1}}};m(Ze,"type",Ze.register("ESCesiumViewer",a.ESLocalSkyBox.type,Ze)),m(Ze,"_defaultLocalBox"),m(Ze,"_firstLoad",!0),m(Ze,"_eSLocalSkyBoxArr",[]);let yp=Ze;const li=class li extends me{constructor(e,n){super(e,n);m(this,"_geoCustomDivPoi");m(this,"_textFunc",this.disposeVar(a.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new Ue(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(r=>{(e.allowPicking??a.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(r)})),this.dispose(s.innerHtmlMounted.disposableOn(r=>{const l=r.firstElementChild;l&&(l.style.pointerEvents="auto",l.style.cursor="default",l.onclick=c=>s.pickFromDiv(l,{type:"viewerPicking",pointerEvent:c}))}));{const r=()=>{if(!e.position)return;const c=(this.textFunc??li.defaultTextFunc_度格式)(e.position);s.innerHTML=uo(c)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(l.disposableOn(r))}{const r=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?li.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?li.defaultTextFunc_度分格式:li.defaultTextFunc_度分秒格式};r(),this.d(n.lonLatFormatChanged.don(()=>{r()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(li,"type",li.register("ESCesiumViewer",a.ESLocationMeasurement.type,li)),m(li,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,s=0]=e;return`经度: ${n.toFixed(5)}°
|
|
1254
|
+
`,$e=class $e extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));m(this,"_dataSource",this.disposeVar(a.react(void 0)));m(this,"_data");m(this,"_defaultHeight",{});m(this,"defaultBoundingSphere");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{s()});{const r=this.dv(a.createProcessingFromAsyncFunc(async u=>{this.dataSource&&s(),this.url&&(typeof this.url=="object"?this._data=this.url:a.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(a.ESSceneObject.context.getStrFromEnv(this.url)).then(d=>d.json()).then(d=>{this._data=d}).catch(d=>{console.warn("ESGeoJson数据加载失败",d)}),this.dataSource=await h.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(d=>{var f,g;const p=[];for(const v of d.entities.values){h.Entity.prototype&&(v.ESSceneObjectID=n),this._isEntityShow(v,e);do{if(v.polygon){p.push(...(f=v.polygon.hierarchy)==null?void 0:f.getValue(h.JulianDate.now()).positions);break}if(v.polyline){p.push(...(g=v.polyline.positions)==null?void 0:g.getValue(h.JulianDate.now()));break}if(v.position){const y=v.position.getValue(h.JulianDate.now());y&&p.push(y);break}}while(!1)}p.length>0&&(this.defaultBoundingSphere=h.BoundingSphere.fromPoints(p))}))})),l=()=>{r.isRunning&&r.cancel(),r.restart()};l();const c=this.dv(a.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(c.don(l))}{const r=()=>{var c,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(d){console.error(d)}else{const d=this.dataSource.entities.values;for(let p=0;p<d.length;p++){const f=d[p];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(c=f.polygon.height)==null?void 0:c.getValue(h.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new h.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new h.ConstantProperty(!this.fillGround),f.polygon.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new h.ConstantProperty(this.filled??$e.defaults.filled),f.polygon.material=new h.ColorMaterialProperty(new h.Color(...this.fillColor??$e.defaults.fillColor)),f.polygon.outline=new h.ConstantProperty(!1),f.polygon.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new h.PolylineGraphics;const g=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(h.JulianDate.now()).positions));h.Cartesian3.equals(g[0],g[g.length-1])||g.push(g[0]),f.polyline.positions=g,f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new h.ConstantProperty(this.stroked??$e.defaults.stroked),f.polyline.width=new h.ConstantProperty(this.strokeWidth??$e.defaults.strokeWidth),f.polyline.material=new h.ColorMaterialProperty(new h.Color(...this.strokeColor??$e.defaults.strokeColor)),f.polyline.clampToGround=new h.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new h.ConstantProperty(this.imageShow??$e.defaults.imageShow),f.billboard.width=new h.ConstantProperty(this.imageSize?this.imageSize[0]:$e.defaults.imageSize[0]),f.billboard.height=new h.ConstantProperty(this.imageSize?this.imageSize[1]:$e.defaults.imageSize[1]);const g=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:$e.defaults.imageUrl;f.billboard.image=new h.ConstantProperty(a.ESSceneObject.context.getStrFromEnv(g)),f.billboard.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.billboard.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND);const v=this.imageAnchor??$e.defaults.imageAnchor,y=this.imageOffset??$e.defaults.imageOffset;if(f.billboard.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-v[0]*f.billboard.width.getValue(h.JulianDate.now())+y[0],-v[1]*f.billboard.height.getValue(h.JulianDate.now())+y[1]])),f.label=new h.LabelGraphics,!f.label)return;f.label.show=new h.ConstantProperty(this.textShow??$e.defaults.textShow),f.label.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.label.text=new h.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??$e.defaults.textDefaultText),f.label.fillColor=new h.ConstantProperty(new h.Color(...this.textColor??$e.defaults.textColor)),f.label.showBackground=new h.ConstantProperty(this.textBackgroundColor!=null);const w=this.textFontSize&&this.textFontSize!=0?this.textFontSize:$e.defaults.textFontSize,P=this.textOffset??$e.defaults.textOffset;f.label.backgroundColor=new h.ConstantProperty(new h.Color(...this.textBackgroundColor??$e.defaults.textBackgroundColor)),f.label.font=new h.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${w}px ${this.textFontFamily??$e.defaults.textFontFamily}`),f.label.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.label.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.label.eyeOffset=new h.ConstantProperty(h.Cartesian3.fromArray([0,0,-1]));const C=this.textAnchor??$e.defaults.textAnchor;f.label.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-C[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(h.JulianDate.now()),f.label.font.getValue(h.JulianDate.now())))+P[0],-C[1]*((this.textBackgroundColor?10:0)+w)+P[1]]))}}}};r();const l=this.dv(a.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged));this.dispose(l.don(r))}{const r=()=>{if(!this.dataSource)return;const c=this.dataSource.entities.values;for(let u=0;u<c.length;u++){const d=c[u];this._isEntityShow(d,e)}};r();const l=this.ad(a.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(l.don(r))}{const r=()=>{if(this.loadFuncStr)try{const l=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=l}catch(l){console.error(l),this.loadFun=void 0}else this.loadFun=void 0};r(),this.dispose(this.loadFuncStrChanged.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{e.actived&&this.dataSource&&this.defaultBoundingSphere&&o.camera.flyToBoundingSphere(this.defaultBoundingSphere,{duration:r?r/1e3:void 0})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0)e.show=this.show;else if((o=n.viewer)!=null&&o.camera){if(!this.show){e.show=this.show;return}const s=h.JulianDate.now();let r;if(e.polygon&&e.polygon.hierarchy)r=a.getMinMaxCorner(e.polygon.hierarchy.getValue(s).positions.map(u=>se(u))).center;else if(e.polyline&&e.polyline.positions)r=a.getMinMaxCorner(e.polyline.positions.getValue(s).map(u=>se(u))).center;else if(e.position){const u=e.position.getValue(s);u&&(r=se(u))}if(!r||isNaN(r[0]))return;const l=a.getDistancesFromPositions([r,Ht(n.viewer.camera)],"NONE")[0];let c=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?c=this.minFeatureVisibleDistance<l&&l<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?c=l>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(c=l<this.maxFeatureVisibleDistance),e.show=this.show&&c}}};m($e,"defaults",{show:!0,allowPicking:!0,url:Ny,defaultLoadFuncStr:Ly,defaultLoadFuncDocStr:qE,data:HE,dataMd:$E,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Ro=$e;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:a.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:a.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:a.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:a.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:a.reactArrayWithUndefined(void 0),imageAnchor:a.reactArrayWithUndefined(void 0),imageOffset:a.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:a.reactArrayWithUndefined(void 0),textBackgroundColor:a.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:a.reactArrayWithUndefined(void 0),textOffset:a.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Ro||(Ro={})),a.extendClassProps(Ro.prototype,Ro.createDefaultProps);const Qa=class Qa extends Jt{constructor(e,n){super(e,n);m(this,"_pointFeatures",this.disposeVar(a.react(void 0)));m(this,"_defaultPointsBoundingSphere");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=Ke(o);if(!s)return;const{screenManager:r}=s,l=this.disposeVar(new Ro(n,e.id));{const c=()=>{if(!e.features)return;const u=a.toGeoJson(e.features),d={type:u.type,features:[]};l.url={type:u.type,features:u.features.filter(p=>p.geometry.type.toLowerCase().includes("point")?(d.features.push(p),!1):!0)},this.pointFeatures=d};c(),this.ad(e.featuresChanged.don(c))}this.ad(a.track([l,"show"],[e,"show"])),this.ad(a.track([l,"allowPicking"],[e,"allowPicking"])),this.ad(a.track([l,"loadFuncStr"],[e,"loadFuncStr"])),this.ad(a.track([l,"stroked"],[e,"stroked"])),this.ad(a.track([l,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.track([l,"strokeWidthType"],[e,"strokeWidthType"])),this.ad(a.track([l,"strokeColor"],[e,"strokeColor"])),this.ad(a.track([l,"strokeMaterial"],[e,"strokeMaterial"])),this.ad(a.track([l,"strokeMaterialParams"],[e,"strokeMaterialParams"])),this.ad(a.track([l,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([l,"filled"],[e,"filled"])),this.ad(a.track([l,"fillColor"],[e,"fillColor"])),this.ad(a.track([l,"fillMaterial"],[e,"fillMaterial"])),this.ad(a.track([l,"fillMaterialParams"],[e,"fillMaterialParams"])),this.ad(a.track([l,"fillGround"],[e,"fillGround"])),this.ad(a.track([l,"minFeatureVisibleDistance"],[e,"minFeatureVisibleDistance"])),this.ad(a.track([l,"maxFeatureVisibleDistance"],[e,"maxFeatureVisibleDistance"])),this.ad(a.track([l,"heightReference"],[e,"heightReference"])),this.ad(a.track([l,"classificationType"],[e,"classificationType"]));{const c=()=>{!this.pointFeatures||this.pointFeatures.features.length==0||(this._defaultPointsBoundingSphere=h.BoundingSphere.fromPoints(this.pointFeatures.features.map(u=>(u.geometry.type=="Point"?[u.geometry.coordinates]:u.geometry.coordinates).map(p=>Se(p))).flat(1/0)))};c(),this.ad(this.pointFeaturesChanged.don(c))}{let c={id:"",layer:"",screenObjectIds:new Set};const u=()=>{c.id!=""&&(r.remove(c.layer,c.id,{label:c.screenObjectIds}),c={id:"",layer:"",screenObjectIds:new Set})};this.ad(()=>{u()});const d=()=>{if(u(),!((e.textShow??a.ESGeoJson.defaults.textShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.textFontSize&&e.textFontSize!=0?e.textFontSize:a.ESGeoJson.defaults.textFontSize,g=e.textOffset??a.ESGeoJson.defaults.textOffset,v=e.textAnchor??a.ESGeoJson.defaults.textAnchor,y={show:!0,heightReference:h.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],fillColor:new h.Color(...e.textColor??a.ESGeoJson.defaults.textColor),showBackground:e.textBackgroundColor!=null,backgroundColor:new h.Color(...e.textBackgroundColor??a.ESGeoJson.defaults.textBackgroundColor??[1,1,1,1]),font:`${e.textFontStyle} ${e.textFontWeight} ${f}px ${e.textFontFamily??a.ESGeoJson.defaults.textFontFamily}`,horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.TOP,eyeOffset:h.Cartesian3.fromArray([0,0,-1]),distanceDisplayCondition:new h.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((w,P)=>{const C=e.textProperty&&e.textProperty!==""&&(w!=null&&w.properties)&&w.properties[e.textProperty]?w.properties[e.textProperty]:e.textDefaultText??a.ESGeoJson.defaults.textDefaultText;y.pixelOffset=h.Cartesian2.fromArray([-v[0]*((e.textBackgroundColor?-14:0)+this._getTextPixelWidth(C,y.font))+g[0],-v[1]*((e.textBackgroundColor?10:0)+f)+g[1]]),(w.geometry.type=="Point"?[w.geometry.coordinates]:w.geometry.coordinates).forEach((A,E)=>{const R={index:`${P}${E}`,name:C,position:A,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:w.properties},N=r.addLabel(e.id,e.typeName,y,R);c.id=N.id,c.layer=N.layer,c.screenObjectIds.add(N.screenObjectId)})})};d();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.textShowChanged,e.textPropertyChanged,e.textDefaultTextChanged,e.textColorChanged,e.textBackgroundColorChanged,e.textFontFamilyChanged,e.textFontSizeChanged,e.textFontStyleChanged,e.textFontWeightChanged,e.textAnchorChanged,e.textOffsetChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(p.don(d))}{this.ad(()=>{u()});let c={id:"",layer:"",screenObjectIds:new Set};const u=()=>{c.id!=""&&(r.remove(c.layer,c.id,{billboard:c.screenObjectIds}),c={id:"",layer:"",screenObjectIds:new Set})},d=()=>{if(u(),!((e.imageShow??a.ESGeoJson.defaults.imageShow)&&(e.show??a.ESGeoJson.defaults.show))||!this.pointFeatures)return;const f=e.imageAnchor??a.ESGeoJson.defaults.imageAnchor,g=e.imageOffset??a.ESGeoJson.defaults.imageOffset,v=e.imageSize?e.imageSize[0]:a.ESGeoJson.defaults.imageSize[0],y=e.imageSize?e.imageSize[1]:a.ESGeoJson.defaults.imageSize[1],w={show:!0,width:v,height:y,image:a.ESSceneObject.context.getStrFromEnv(e.imageUrl?typeof e.imageUrl=="string"?e.imageUrl:e.imageUrl.url:a.ESGeoJson.defaults.imageUrl),horizontalOrigin:h.HorizontalOrigin.LEFT,verticalOrigin:h.VerticalOrigin.TOP,heightReference:h.HeightReference[e.heightReference??a.ESGeoJson.defaults.heightReference],pixelOffset:h.Cartesian2.fromArray([-f[0]*v+g[0],-f[1]*y+g[1]]),distanceDisplayCondition:new h.DistanceDisplayCondition(e.minFeatureVisibleDistance||0,e.maxFeatureVisibleDistance||Number.MAX_VALUE)};this.pointFeatures.features.forEach((P,C)=>{(P.geometry.type=="Point"?[P.geometry.coordinates]:P.geometry.coordinates).forEach((A,E)=>{const R={index:`${C}${E}`,name:"",position:A,zOrder:e.zIndex??a.ESGeoJson.defaults.zIndex,properties:P.properties},N=r.addImage(e.id,e.typeName,w,R);c.id=N.id,c.layer=N.layer,c.screenObjectIds.add(N.screenObjectId)})})};d();const p=this.ad(a.createNextAnimateFrameEvent(this.pointFeaturesChanged,e.showChanged,e.imageAnchorChanged,e.imageOffsetChanged,e.imageShowChanged,e.imageSizeChanged,e.imageUrlChanged,e.heightReferenceChanged,e.minFeatureVisibleDistanceChanged,e.maxFeatureVisibleDistanceChanged,e.zIndexChanged));this.ad(p.don(d))}this.ad(e.flyToEvent.disposableOn(c=>{if(!n.actived)return;if(e.flyInParam){const{position:d,rotation:p,flyDuration:f}=e.flyInParam;return ne(n.viewer,d,void 0,p,f),!0}let u;l.defaultBoundingSphere&&this._defaultPointsBoundingSphere?u=h.BoundingSphere.fromBoundingSpheres([l.defaultBoundingSphere,this._defaultPointsBoundingSphere]):l.defaultBoundingSphere?u=l.defaultBoundingSphere:this._defaultPointsBoundingSphere&&(u=this._defaultPointsBoundingSphere),u&&$t(n,e,this.id,se(u.center),u.radius,c)}));{const c=async(u,d,p)=>{if(!n.actived)return;const f=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(u,d)));if(!(!f||!(f!=null&&f.positions)))if(f.type=="Point"||f.type=="MultiPoint")$t(n,e,this.id,await this._calculateFeatureHeight(f.type=="MultiPoint"?f.positions.flat():f.positions,e.heightReference,n),1e3,p);else{const g=f.type=="Polygon"||f.type=="MultiPolygon"||f.type=="MultiLineString";let v=[];g?v=f.positions.flat(f.type=="MultiPolygon"?2:1).map(C=>this._calculateFeatureHeight(C,e.fillGround?"CLAMP_TO_GROUND":"NONE",n)):v=f.positions.map(C=>this._calculateFeatureHeight(C,e.strokeGround?"CLAMP_TO_GROUND":"NONE",n));const{minPos:y,maxPos:w,center:P}=a.getMinMaxCorner(v);$t(n,e,this.id,P,a.getDistancesFromPositions([y,w],"NONE")[0],p)}};this.d(e.flyToFeatureEvent.don((u,d,p)=>c(u,d,p))),this.d(e.flyToFeatureIndexEvent.don((u,d)=>c(u,void 0,d)))}}get pointFeatures(){return this._pointFeatures.value}set pointFeatures(e){this._pointFeatures.value=e}get pointFeaturesChanged(){return this._pointFeatures.changed}_getFeatureByIndexOrProperties(e,n){var l,c,u,d,p,f,g,v;const{sceneObject:o}=this,s=o.features;if(!s)return;const r=Reflect.get(s,"features")||Reflect.get(s,"geometries");if(r){if(n){let y=r.find(w=>(w==null?void 0:w.properties[e])==n);return{type:y!=null&&y.coordinates?y.type:(l=y==null?void 0:y.geometry)==null?void 0:l.type,positions:(y==null?void 0:y.coordinates)||((c=y==null?void 0:y.geometry)==null?void 0:c.coordinates)}}else if(typeof e=="number")return{type:(u=r[e])!=null&&u.coordinates?r[e].type:(p=(d=r[e])==null?void 0:d.geometry)==null?void 0:p.type,positions:((f=r[e])==null?void 0:f.coordinates)||((v=(g=r[e])==null?void 0:g.geometry)==null?void 0:v.coordinates)}}}async _calculateFeatureHeight(e,n,o){const s=[...e];return n=="NONE"?s[2]=s[2]??0:n=="CLAMP_TO_GROUND"||!s[2]?s[2]=await o.getTerrainHeight(s)??0:s[2]+=await o.getTerrainHeight(s)??0,s}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}};m(Qa,"type",Qa.register("ESCesiumViewer",a.ESGeoJson.type,Qa));let cp=Qa;const ka=class ka extends yt{constructor(e,n){super(e,n);m(this,"_czmGeoESRectangle");m(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new xe(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,r=this._geoPolyline;r.arcType="RHUMB",this.dispose(a.track([r,"color"],[e,"strokeColor"])),this.dispose(a.track([r,"width"],[e,"strokeWidth"])),this.dispose(a.track([r,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{const c=e.points;if(c&&c.length>=2){const{minPos:u,maxPos:d}=a.getMinMaxCorner(c);s.rectangle=[u[0],u[1],d[0],d[1]],s.height=c[0][2],s.extrudedHeight=c[0][2];const p=c.map(y=>(c&&(y[2]=c[0][2]),y)),f=p[0],g=p[1],v=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];r.positions=[...v,f]}else s.rectangle=void 0,r.positions=void 0,s.height=0,s.extrudedHeight=0};l(),this.dispose(e.pointsChanged.disposableOn(()=>l()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmGeoESRectangle:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};m(ka,"type",ka.register("ESCesiumViewer",a.ESGeoRectangle.type,ka));let hp=ka;class kr extends a.Destroyable{constructor(e,n){super();m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new En(e,n));const{geoPolygon:o}=this;this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"fill"],[this,"filled"])),this.dispose(a.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(a.bind([o,"ground"],[this,"ground"])),this.dispose(a.bind([o,"outline"],[this,"outline"])),this.dispose(a.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(a.bind([o,"color"],[this,"color"])),this.dispose(a.bind([o,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const r=Iu([...this.positions,this.positions[0]]);o.positions=r}else o.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:1,color:a.reactArrayWithUndefined([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0})})(kr||(kr={})),a.extendClassProps(kr.prototype,kr.createDefaultProps);const Ka=class Ka extends yt{constructor(e,n){super(e,n);m(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new kr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"ground"],[e,"ground"]));{const r=()=>{s.ground=e.ground||e.fillGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(l.don(r))}{const r=()=>{s.color=e.filled?e.fillColor:Qr.defaults.fillStyle.color};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(Ka,"type",Ka.register("ESCesiumViewer",Qr.type,Ka));let up=Ka;const Ja=class Ja extends me{constructor(e,n){super(e,n);m(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new ct(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(l=>{var c;s.activeAnimationsJson=(c=s.gltf.animations)==null?void 0:c.map((u,d)=>({index:d,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"})),e.czmModelReadyEvent.emit(l),e.readyEvent.emit(l)})),this.ad(new bc(o,this._czmModel)),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"color"],[e,"czmColor"])),this.d(a.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(a.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(a.track([s,"scale"],[e,"scale"])),this.ad(a.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const l=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};l(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>l(c)))}{const l=()=>{var c,u;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const c=[...e.rotation??[0,0,0]];c[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=c};l(),this.d(e.rotationChanged.don(l));{const c=()=>{if(l(),!e.instances||e.instances.length==0){s.instances=void 0;return}s.instances=e.instances.map(u=>{const d=JSON.parse(JSON.stringify(u));return!d.rotation&&(d.rotation=[0,0,0]),d.rotation[0]+=90,d})};c(),this.ad(e.instancesChanged.don(c))}}this.ad(e.setMaterialEvent.don(l=>{s.setMaterial(l)}));{const l=()=>{const c=[...s.rotation];c[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=c};l(),this.d(s.rotationChanged.don(l))}{const l=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};c(),this.d(l.don(c))}const r=()=>{var l;s.url=a.ESSceneObject.context.getStrFromEnv(Sc(typeof e.url=="string"?e.url:((l=e.url)==null?void 0:l.url)??a.ESGltfModel.defaults.url))};r(),this.d(e.urlChanged.don(r)),this.d(e.setNodePositionEvent.don((l,c)=>{s.setNodeTranslation(l,c)})),this.d(e.setNodeRotationEvent.don((l,c)=>{s.setNodeRotation(l,c)})),this.d(e.setNodeScaleEvent.don((l,c)=>{s.setNodeScale(l,c)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:s,model:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r):!1}};m(Ja,"type",Ja.register("ESCesiumViewer",a.ESGltfModel.type,Ja));let dp=Ja;function Oy(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class Kr extends a.Destroyable{constructor(e,n){super();m(this,"_pickedEvent",this.disposeVar(new a.Event));m(this,"_flyToEvent",this.disposeVar(new a.Event));m(this,"_distance",this.disposeVar(a.react(0)));m(this,"_surfaceDistance",this.disposeVar(a.react(0)));m(this,"_height",this.disposeVar(a.react(0)));m(this,"_middlePosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_heightPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const r=this._surfaceDistance.value=a.geoDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="RHUMB"){const r=this._surfaceDistance.value=a.geoRhumbDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="NONE"){const r=a.lbhToXyz(this.positions[0]),l=a.lbhToXyz(this.positions[1]);this._distance.value=Oy(r,l),this._surfaceDistance.value=Oy(a.lbhToXyz(this._middlePosition.value),l),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(o));{const r=this.disposeVar(new xe(e,n));r.ground=!1,r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"]));{r.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[u,d]=this.positions;r.positions=[u,d,[u[0],u[1],d[2]]]}else r.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&r.flyTo(c)}));const l=this.disposeVar(new Ue(e,n));this.dispose(a.track([l,"shadowDom"],[this,"shadowDom"])),this.dispose(a.track([l,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(a.track([l,"show"],[this,"show"]));{const c=()=>{l.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{l.innerHTML=uo(`高度: ${xc(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(l.pickedEvent.don(c=>{$i(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Kr||(Kr={})),a.extendClassProps(Kr.prototype,Kr.createDefaultProps);const ja=class ja extends yt{constructor(e,n){super(e,n);m(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Kr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{$i(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};m(ja,"type",ja.register("ESCesiumViewer",a.ESHeightMeasurement.type,ja));let pp=ja;const fp={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},el=class el extends me{constructor(e,n){super(e,n);m(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new ct(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(je([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(y=>{e.readyEvent.emit(y)}));{const y=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),w=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};w(),this.d(y.don(w))}const r=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),d=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":s.url=r;break;case"police":s.url=l;break;case"pedestrian":s.url=c;break;case"stranger":s.url=u;break;case"suitMan":s.url=d;break;case"suitWoman":s.url=p;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const g=()=>{const y=e.animation??a.ESHuman.defaults.animation;if(!e.show){s.activeAnimationsJson=void 0;return}y==="walking"?s.activeAnimationsJson=fp.czmAnimationsWalk:y==="standing"?s.activeAnimationsJson=fp.czmAnimationsStand:y==="running"&&(s.activeAnimationsJson=fp.czmAnimationsRun)};g();const v=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(v.disposableOn(()=>g())),this.ad(new bc(o,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Rt(s,o,n,e,r,!0),!!r)}};m(el,"type",el.register("ESCesiumViewer",a.ESHuman.type,el));let gp=el;class By extends a.Destroyable{constructor(e,n){super();m(this,"_czmGeoCanvasImagePoi");m(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ne(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,ei,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new _i(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=d=>{let p=d;return d.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+d.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(Sc(p))},r=()=>{const d=s(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=d,e.sizeByContent){const f=new Image;f.src=d,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},l=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(l.disposableOn(()=>r())),r(),this.d(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.ad(a.bind([o,"isHoverZoom"],[e,"isHoverZoom"])),this.ad(a.bind([o,"hoverHighlight"],[e,"hoverHighlight"]));{const d=()=>{o.scale=[e.scale[1],e.scale[2]]};d(),this.dispose(e.scaleChanged.don(d))}const c=()=>{const d=e.anchor,p=e.offset;d?o.originRatioAndOffset=[...d,-p[0],-p[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>c())),c(),this.dispose(o.clickEvent.disposableOn(d=>{const{offsetX:p,offsetY:f}=d,v={type:d.button===0?"leftClick":d.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(v)})),this.dispose(o.hoveredChanged.disposableOn(d=>{if(d===void 0)return;const p={type:d?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Vy extends a.Destroyable{constructor(e,n,o){super();m(this,"_czmGeoImageModel");m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return $t(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new Xi(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,v,y;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((v=this._eventInfo.add)==null?void 0:v.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((y=this._eventInfo.add)==null?void 0:y.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.engineObjectCreatedUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,v)=>{(g==null?void 0:g.sceneObject)==(v==null?void 0:v.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(v==null?void 0:v.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),v!=null&&v.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},v.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&v.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const r=e.sizeByContent,c=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(Sc(g))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=c,u.onload=()=>{if(r)s.size=[u.width/100,u.height/100];else{const f=e.size;s.size=[f[0]/100,f[1]/100]}},s.uri=c,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const f=()=>{s.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(je([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const d=()=>{const f=e.anchor,g=e.offset;f?s.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:s.originRatioAndOffset=[0,0,0,0]},p=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>d())),d()}get czmGeoImageModel(){return this._czmGeoImageModel}}const tl=class tl extends qr{constructor(e,n){super(e,n);m(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new a.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new By(this.sceneObject,this.czmViewer):new Vy(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(tl,"type",tl.register("ESCesiumViewer",a.ESImageLabel.type,tl));let mp=tl;function XE(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const il=class il extends Jt{constructor(e,n){super(e,n);m(this,"_czmImagery");if(this._czmImagery=this.dv(new Bn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;{const r=this.ad(a.reactJson(""));{const u=()=>{if(typeof e.url=="string")r.value=a.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=a.ESSceneObject.context.getStrFromEnv(d.url),r.value=d}};u(),this.ad(e.urlChanged.don(u))}const l=()=>{var v;if(!r.value)return;const u=(((v=e.options)==null?void 0:v.type)??"auto").toLowerCase(),d=e.options??{};let p={type:"UrlTemplateImageryProvider",url:r.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...d},f=r.value,g=typeof f=="string"?f:f.url;if(u==="auto"){const y=g.toLowerCase();if(y.startsWith("ion://")){const P=+y.substring(6);p={...d,assetId:P,type:"IonImageryProvider"}}else if(y.includes("{x}")||y.includes("{y}")||y.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(y.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(y.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const w=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=w:f.url=w,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&g.includes("/tilemapresource.xml")){const y=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=y:f.url=y,p.url=f}else if(u==="ion"&&g.startsWith("ion://")){const w=+g.substring(6);p={...d,assetId:w,type:"IonImageryProvider"}}p.type=XE(u)}console.log("imageryProvider",p),s.imageryProvider=p};l();const c=this.dv(a.createNextAnimateFrameEvent(r.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(c.don(l))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"alpha"],[e,"opacity"])),this.d(a.bind([s,"alpha"],[e,"czmAlpha"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.ad(a.track([s,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(il,"type",il.register("ESCesiumViewer",a.ESImageryLayer.type,il));let vp=il;class YE extends a.Destroyable{constructor(e,n,o,s){super();m(this,"_show");m(this,"_czmESCustomPrimitive");m(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(a.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new Fe(n,this._sceneObject.id)),this._czmTexture=this.dv(new Ne(n));const r=e,l=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(a.track([l,"show"],[this,"show"])),this.dispose(a.track([l,"show"],[r,"show"])),this.dispose(a.track([l,"allowPicking"],[r,"allowPicking"])),this.dispose(a.track([l,"rotation"],[r,"rotation"])),this.dispose(a.track([l,"position"],[r,"position"])),this.dispose(a.track([l,"scale"],[r,"scale"])),this.ad(r.allowPickingChanged.don(()=>{l.allowPicking=r.allowPicking,l.pass=r.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const p=r.size/2,f=s[0].map(z=>z*p),g=s[1].map(z=>z*p),v=s[2].map(z=>z*p),y=s[3].map(z=>z*p),w=[...f,...g,...v,...y];let P=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(P=P.reverse());const C=[0,0],S=[1,0],A=[1,1],E=[0,1];let R=[];o=="east"||o=="south"?R=[...S,...C,...E,...A]:o=="west"?R=[...S,...A,...E,...C]:o=="top"?R=[...E,...A,...S,...C]:R=[...C,...S,...A,...E],l.indexTypedArray=new Uint16Array(P),l.attributes={position:{typedArray:new Float32Array(w),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},c.uri=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/${o}.${r.mode!="blueSky"?"png":"jpg"}`);const N=n.getCameraInfo();if(N!=null){const O=a.getDistancesFromPositions([r.position,N.position],"NONE")[0]/(r.size/2*r.autoOpacityFactor);this.changeOpacity(r.autoFollow?1:O)}const B=l.computeLocalAxisedBoundingBoxFromAttribute("position");if(!B)return;const{min:V,max:G}=B;l.setLocalAxisedBoundingBox(V,G)};u();const d=this.disposeVar(a.createNextAnimateFrameEvent(r.sizeChanged,r.modeChanged));this.dispose(d.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class ZE extends a.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{r()}));function r(){var c;if(!((c=e.viewer)!=null&&c.camera))return;const l=e.getCameraInfo();if(l!=null&&(s==null||s.position[0]!=l.position[0]||s.position[1]!=l.position[1]||s.position[2]!=l.position[2]||s.rotation[0]!=l.rotation[0]||s.rotation[1]!=l.rotation[1]||s.rotation[2]!=l.rotation[2])){s=l;const d=a.getDistancesFromPositions([i.position,s.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=s.position,o&&(o=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(d)})}}r()}}const Ze=class Ze extends me{constructor(e,n){super(e,n);m(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ze._defaultLocalBox&&Ze._firstLoad&&(Ze._firstLoad=!1,Ze._defaultLocalBox=n.xbsjLocalBoxSources),Ze._eSLocalSkyBoxArr.push(e),this.d(()=>{Ze._eSLocalSkyBoxArr.includes(e)&&Ze._eSLocalSkyBoxArr.splice(Ze._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){const l=s[r];this._czmSkyBoxComponents.push(this.dv(new YE(e,n,r,l)))}{const r=this.disposeVar(a.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new a.ObjResettingWithEvent(r,()=>(this.ChangeAutoFollow(),new ZE(e,n,this._czmSkyBoxComponents))))}{const r=()=>{this.ChangeAutoFollow()},l=this.disposeVar(a.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(l.disposableOn(r))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ze._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=Ze._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ze._defaultLocalBox)}Ze._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ze._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.size??a.ESLocalSkyBox.defaults.size;return o.position?($t(s,o,n,o.position,r,e,!0),!0):!1}}};m(Ze,"type",Ze.register("ESCesiumViewer",a.ESLocalSkyBox.type,Ze)),m(Ze,"_defaultLocalBox"),m(Ze,"_firstLoad",!0),m(Ze,"_eSLocalSkyBoxArr",[]);let yp=Ze;const li=class li extends me{constructor(e,n){super(e,n);m(this,"_geoCustomDivPoi");m(this,"_textFunc",this.disposeVar(a.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new Ue(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(r=>{(e.allowPicking??a.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(r)})),this.dispose(s.innerHtmlMounted.disposableOn(r=>{const l=r.firstElementChild;l&&(l.style.pointerEvents="auto",l.style.cursor="default",l.onclick=c=>s.pickFromDiv(l,{type:"viewerPicking",pointerEvent:c}))}));{const r=()=>{if(!e.position)return;const c=(this.textFunc??li.defaultTextFunc_度格式)(e.position);s.innerHTML=uo(c)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(l.disposableOn(r))}{const r=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?li.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?li.defaultTextFunc_度分格式:li.defaultTextFunc_度分秒格式};r(),this.d(n.lonLatFormatChanged.don(()=>{r()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(li,"type",li.register("ESCesiumViewer",a.ESLocationMeasurement.type,li)),m(li,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,s=0]=e;return`经度: ${n.toFixed(5)}°
|
|
1255
1255
|
纬度: ${o.toFixed(5)}°
|
|
1256
1256
|
高度: ${s.toFixed(2)}m`}),m(li,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[n,o,s]=Au(e,!0);return`经度: ${n}
|
|
1257
1257
|
纬度: ${o}
|
|
@@ -1420,7 +1420,7 @@ ${Ly}
|
|
|
1420
1420
|
out_FragColor.rgb *= vec3(clamp((distance - realDistance)*.5, 0.5, 1.0));
|
|
1421
1421
|
out_FragColor.a = 0.9;
|
|
1422
1422
|
}
|
|
1423
|
-
`;{const d=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),p=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??a.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??a.ESSubmergingAnalysis.defaults.flowSpeed});else{const f=Object.assign({},Ec[e.waterType]);f.frequency&&(f.frequency/=10),f.waveVelocity&&(f.waveVelocity/=100),f.amplitude&&(f.amplitude*=10),this.updateWater(f)}};p(),this.d(d.don(p))}{const d=f=>{if(f==0||!this.isTimestamp(f))return;const g=e.getAllMoments(),v=e.getSubmergingData;if(g.length==0||!v)return;const y=this.getClosestTimestampIndex(f,g);s.attributes={position:{typedArray:v[y].posBuffer,componentsPerAttribute:3}},s.indexTypedArray=v[y].indicesBuffer;const w=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!w)return;const{min:P,max:C}=w;s.setLocalAxisedBoundingBox(P,C)},p=this.dv(a.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(p.don(()=>{d(e.currentTime)}))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get causticsTexture(){return this._causticsTexture}get foamTexture(){return this._foamTexture}get heightMapTexture(){return this._heightMapTexture}get normalMapTexture(){return this._normalMapTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:n,sceneObject:o,heightMapTexture:s,normalMapTexture:r,foamTexture:l,causticsTexture:c}=this,u=o.materialParams[Object.keys(o.materialParams).filter(d=>d.toUpperCase().includes("BASECOLOR"))[0]];n.uniformMap={u_image:{type:"texture",id:s.id},u_heightmap_image:{type:"texture",id:s.id},u_normalmap_image:{type:"texture",id:r.id},u_foam_image:{type:"texture",id:l.id},u_caustics_image:{type:"texture",id:c.id},u_color:e.waterColor??u??a.ESSubmergingAnalysis.defaults.waterColor}}};m(sl,"type",sl.register("ESCesiumViewer",a.ESSubmergingAnalysis.type,sl));let bp=sl;const{getStrFromEnv:Wy}=a.ESSceneObject.context;function aT(t){let i;if(t.startsWith("ion://")){const n=+t.substring(6);Number.isFinite(n)&&(i=h.IonResource.fromAssetId(n))}else i=Wy(t);return i}async function lT(t,i){if(t.type==="EllipsoidTerrainProvider")return new h.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tilingScheme:t.tilingScheme&&di(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=aT(typeof t.url=="string"?t.url:t.url.url);return e?await h.CesiumTerrainProvider.fromUrl(typeof e=="string"?jt(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await h.GoogleEarthEnterpriseMetadata.fromUrl(Wy(t.url));return await h.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await h.ArcGISTiledElevationTerrainProvider.fromUrl(jt(t.url),{token:t.token,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new h.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&di(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await h.VRTheWorldTerrainProvider.fromUrl(jt(t.url),{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}}const rl=class rl extends Jt{constructor(e,n){super(e,n);m(this,"_provider",this.disposeVar(a.react(void 0)));m(this,"_czmProvider",this.dv(a.react(void 0)));const o=n.viewer;if(!o)return;const s=Ke(o);if(!s)return;const{terrainManager:r}=s,l=()=>{r.delete(this),this.provider=void 0};this.dispose(l);let c=!1;const u=this.disposeVar(a.createProcessingFromAsyncFunc(async(p,f)=>{if(f){if(c=!0,l(),!this.czmProvider)return;this.provider=await p.promise(lT(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),r.add(this),c=!1}}));u.restart(void 0,!0);const d=this.disposeVar(new a.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{d.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{d.emit()})),this.dispose(d.disposableOn(()=>{u.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{c||u.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((p,f)=>this.flyTo(p,f)));{const p=this.ad(a.reactJson(""));{const g=()=>{if(typeof e.url=="string")p.value=a.ESSceneObject.context.getStrFromEnv(e.url??a.ESTerrainLayer.defaults.url);else{const v=e.url;v.url=a.ESSceneObject.context.getStrFromEnv(v.url??a.ESTerrainLayer.defaults.url),p.value=v}};g(),this.ad(e.urlChanged.don(g))}const f=()=>{if(!p.value)return;let g=p.value,v=typeof g=="string"?g:g.url;if(v.includes(a.ESTerrainLayer.defaults.url)){const y=cT(v);if(y&&y.h){const w=Number(y.h),P={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[P.x+w,P.y+w,P.z+w]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else v.includes("/layer.json")&&(typeof g=="string"?g=v.replace("/layer.json",""):g.url=v.replace("/layer.json","")),this._czmProvider.value={type:"CesiumTerrainProvider",url:g,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};f(),this.dispose(p.changed.disposableOn(f))}}get provider(){return this._provider.value}set provider(e){this._provider.value=e}get providerChanged(){return this._provider.changed}get czmProvider(){return this._czmProvider.value}get czmProviderChanged(){return this._czmProvider.changed}flyTo(e,n){const{czmViewer:o,sceneObject:s}=this;if(!o.actived)return!1;const{viewer:r}=o;return r?(s.rectangle&&!bu(s.rectangle)?r.camera.flyTo({destination:Ve(s.rectangle),duration:e}):r.camera.flyHome(e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?super.flyIn(e,n):this.flyTo(e,n):!1}};m(rl,"type",rl.register("ESCesiumViewer",a.ESTerrainLayer.type,rl));let Sp=rl;function cT(t){const i=t.indexOf("?"),n=t.slice(i+1).split("&"),o={};for(var s=0;s<n.length;s++){var r=n[s].split("=");o[r[0]]=r[1]}return o}class Gy extends a.Destroyable{constructor(e,n){super();m(this,"_czmTextLabel");m(this,"flyTo",(e,n)=>{if(this.czmTextLabel.position){ne(this.czmViewer.viewer,this.czmTextLabel.position,1e3,ei,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id));const o=this._czmTextLabel,s=()=>{const l=e.anchor,c=e.offset;l?o.originRatioAndOffset=[...l,-c[0],-c[1]]:o.originRatioAndOffset=[0,0,0,0]},r=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(r.disposableOn(()=>s())),s(),this.dispose(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"text"],[e,"text"])),this.dispose(a.track([o,"color"],[e,"color"])),this.dispose(a.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(a.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(a.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.dispose(a.track([o,"width"],[e,"width"])),this.dispose(a.track([o,"opacity"],[e,"opacity"])),this.dispose(a.track([o,"padding"],[e,"padding"])),this.dispose(a.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(a.track([o,"borderColor"],[e,"borderColor"])),this.dispose(a.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(a.track([o,"textAlign"],[e,"textAlign"])),this.dispose(a.track([o,"fontSize"],[e,"fontSize"])),this.dispose(a.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(a.track([o,"pickOnClick"],[e,"allowPicking"]));{const l=()=>{o.scale=[e.scale[1],e.scale[2]]};l(),this.dispose(e.scaleChanged.don(l))}{const l=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};l(),this.dispose(e.sizeByContentChanged.don(l)),this.dispose(e.sizeChanged.don(l))}this.d(o.pickedEvent.don(l=>{var d;const c=(d=po(l,"pickResult"))==null?void 0:d.pointerEvent;if(!c)return;const u={type:c.buttons!=0&&c.button==0?"leftClick":c.button==2?"rightClick":void 0,add:{mousePos:[c.offsetX,c.offsetY]}};u.type==null&&(u.type=c.type),e.widgetEvent.emit(u)}));{let l;const c=u=>{u&&(l=u),l&&(l.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>c(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(u=>c(u)))}}get czmTextLabel(){return this._czmTextLabel}}class Uy extends a.Destroyable{constructor(e,n){super();m(this,"_czmTextLabel");m(this,"_czmImageModel");m(this,"_url",this.disposeVar(a.react("")));m(this,"_defaultSize",this.disposeVar(a.react([1,1])));m(this,"_size",this.disposeVar(a.react([1,1])));m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"flyTo",(e,n)=>{if(this.czmImageModel.position)return $t(this._czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id)),this._czmImageModel=this.disposeVar(new Xi(n,e.id));const o=this._czmViewer,s=this._czmTextLabel;s.originRatioAndOffset=[1e3,0,0,0],this.dispose(s.divCreatedEvent.disposableOn(c=>{const u=setTimeout(()=>{tu(c,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:c.offsetWidth,height:c.offsetHeight,scale:1}).then(d=>{if(clearTimeout(u),this.isDestroyed())return;const p=new Image;p.onload=()=>{e.sizeByContent?this._size.value=[p.width/100,p.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},p.src=d.toDataURL("image/png"),this._url.value=d.toDataURL("image/png")}).catch(d=>{clearTimeout(u),console.error(d)})},50);this.dispose(()=>clearTimeout(u))})),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"text"],[e,"text"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"fontSize"],[e,"fontSize"]));const r=()=>{const c=e.anchor,u=e.offset;c?this.czmImageModel.originRatioAndOffset=[...c,-u[0]/100,-u[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r();{const c=()=>{this._czmTextLabel.show=!1;const u=this._czmImageModel;u.uri=this._url.value,u.pixelSize=void 0,u.useAxis="XZ",this.dispose(this.sizeChanged.disposableOn(()=>{u.size=this._size.value})),this.dispose(a.track([u,"show"],[e,"show"])),this.dispose(a.bind([u,"position"],[e,"position"])),this.dispose(a.track([u,"allowPicking"],[e,"allowPicking"]));{const d=()=>{u.scale=[e.scale[1],e.scale[2]]};d(),this.d(e.scaleChanged.don(d))}{const d=()=>{e.rotationType===0&&(u.rotationMode="WithProp",this.d(je([u,"rotation"],[e,"rotation"]))),e.rotationType===1&&(u.rotationMode="WithCamera"),e.rotationType===2&&(u.rotationMode="WithCameraOnlyZ")};d(),this.dispose(e.rotationTypeChanged.disposableOn(d))}};this.dispose(this._url.changed.disposableOn(c))}this.ad(o.clickEvent.don(c=>{const u=c==null?void 0:c.pointerEvent;u&&(this._isPointEvent=!0,this._eventInfo={type:u.button==0?"leftClick":u.button==2?"rightClick":"leftClick",add:{mousePos:[u.offsetX,u.offsetY]}})})),this.d(e.pickedEvent.don(c=>{var u,d,p;c.screenPosition&&this._isPointEvent&&c.attachedInfo!="innerHoverEvent"&&((u=this._eventInfo.add)!=null&&u.mousePos)&&Math.abs(c.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(c.screenPosition[1]-((p=this._eventInfo.add)==null?void 0:p.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const c=o.getEngineObject(e);this.ad(c.lastHoverResultChanged.don((u,d)=>{(u==null?void 0:u.sceneObject)==(d==null?void 0:d.sceneObject)||(u==null?void 0:u.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(u!=null&&u.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:u==null?void 0:u.screenPosition}},u.sceneObject.widgetEvent.emit(this._eventInfo)),d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:u==null?void 0:u.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo)))}))})}get czmTextLabel(){return this._czmTextLabel}get czmImageModel(){return this._czmImageModel}get url(){return this._url.value}get defaultSize(){return this._defaultSize.value}get defaultSizeChanged(){return this._defaultSize.changed}get size(){return this._size.value}get sizeChanged(){return this._size.changed}}const al=class al extends qr{constructor(e,n){super(e,n);m(this,"_event",this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));m(this,"_resetting",this.disposeVar(new a.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new Gy(this.sceneObject,this.czmViewer):new Uy(this.sceneObject,this.czmViewer))));if(!n.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(al,"type",al.register("ESCesiumViewer",a.ESTextLabel.type,al));let xp=al;const ll=class ll extends me{constructor(e,n){super(e,n);m(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new fo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoDivSwitchPoi;s.showIcon=!1,this.d(a.track([s,"zOrder"],[e,"zOrder"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"text"],[e,"info"],c=>Object.values(c??{title:"请输入内容"}).join())),this.dispose(a.bind([s,"position"],[e,"position"]));const r=()=>{const c=e.anchor,u=e.offset;c?s.originRatioAndOffset=[...c,-u[0],-u[1]]:s.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoDivSwitchPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.position?(ne(this.czmViewer.viewer,r.position,1e3,ei,e),!0):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(ll,"type",ll.register("ESCesiumViewer",a.ESUEWidget.type,ll));let Ap=ll;const cl=class cl extends me{constructor(e,n){super(e,n);m(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(cl,"type",cl.register("ESCesiumViewer",a.ESUnrealActor.type,cl));let Ep=cl;var hT=h.Primitive._modifyShaderPosition;h.Primitive._modifyShaderPosition=function(t,n,e){var n=hT(t,n,e);return t.isCameraVideo&&n.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(n=n.replace("void main()",`
|
|
1423
|
+
`;{const d=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),p=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??a.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??a.ESSubmergingAnalysis.defaults.flowSpeed});else{const f=Object.assign({},Ec[e.waterType]);f.frequency&&(f.frequency/=10),f.waveVelocity&&(f.waveVelocity/=100),f.amplitude&&(f.amplitude*=10),this.updateWater(f)}};p(),this.d(d.don(p))}{const d=f=>{if(f==0||!this.isTimestamp(f))return;const g=e.getAllMoments(),v=e.getSubmergingData;if(g.length==0||!v)return;const y=this.getClosestTimestampIndex(f,g);s.attributes={position:{typedArray:v[y].posBuffer,componentsPerAttribute:3}},s.indexTypedArray=v[y].indicesBuffer;const w=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!w)return;const{min:P,max:C}=w;s.setLocalAxisedBoundingBox(P,C)},p=this.dv(a.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(p.don(()=>{d(e.currentTime)}))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get causticsTexture(){return this._causticsTexture}get foamTexture(){return this._foamTexture}get heightMapTexture(){return this._heightMapTexture}get normalMapTexture(){return this._normalMapTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Rt(s,o,n,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:n,sceneObject:o,heightMapTexture:s,normalMapTexture:r,foamTexture:l,causticsTexture:c}=this,u=o.materialParams[Object.keys(o.materialParams).filter(d=>d.toUpperCase().includes("BASECOLOR"))[0]];n.uniformMap={u_image:{type:"texture",id:s.id},u_heightmap_image:{type:"texture",id:s.id},u_normalmap_image:{type:"texture",id:r.id},u_foam_image:{type:"texture",id:l.id},u_caustics_image:{type:"texture",id:c.id},u_color:e.waterColor??u??a.ESSubmergingAnalysis.defaults.waterColor}}};m(sl,"type",sl.register("ESCesiumViewer",a.ESSubmergingAnalysis.type,sl));let bp=sl;const{getStrFromEnv:Wy}=a.ESSceneObject.context;function aT(t){let i;if(t.startsWith("ion://")){const n=+t.substring(6);Number.isFinite(n)&&(i=h.IonResource.fromAssetId(n))}else i=Wy(t);return i}async function lT(t,i){if(t.type==="EllipsoidTerrainProvider")return new h.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),tilingScheme:t.tilingScheme&&di(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=aT(typeof t.url=="string"?t.url:t.url.url);return e?await h.CesiumTerrainProvider.fromUrl(typeof e=="string"?jt(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await h.GoogleEarthEnterpriseMetadata.fromUrl(Wy(t.url));return await h.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await h.ArcGISTiledElevationTerrainProvider.fromUrl(jt(t.url),{token:t.token,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new h.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&di(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await h.VRTheWorldTerrainProvider.fromUrl(jt(t.url),{ellipsoid:t.ellipsoid&&Ce(t.ellipsoid),credit:t.credit})}}const rl=class rl extends Jt{constructor(e,n){super(e,n);m(this,"_provider",this.disposeVar(a.react(void 0)));m(this,"_czmProvider",this.dv(a.react(void 0)));const o=n.viewer;if(!o)return;const s=Ke(o);if(!s)return;const{terrainManager:r}=s,l=()=>{r.delete(this),this.provider=void 0};this.dispose(l);let c=!1;const u=this.disposeVar(a.createProcessingFromAsyncFunc(async(p,f)=>{if(f){if(c=!0,l(),!this.czmProvider)return;this.provider=await p.promise(lT(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),r.add(this),c=!1}}));u.restart(void 0,!0);const d=this.disposeVar(new a.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{d.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{d.emit()})),this.dispose(d.disposableOn(()=>{u.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{c||u.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((p,f)=>this.flyTo(p,f)));{const p=this.ad(a.reactJson(""));{const g=()=>{if(typeof e.url=="string")p.value=a.ESSceneObject.context.getStrFromEnv(e.url??a.ESTerrainLayer.defaults.url);else{const v=e.url;v.url=a.ESSceneObject.context.getStrFromEnv(v.url??a.ESTerrainLayer.defaults.url),p.value=v}};g(),this.ad(e.urlChanged.don(g))}const f=()=>{if(!p.value)return;let g=p.value,v=typeof g=="string"?g:g.url;if(v.includes(a.ESTerrainLayer.defaults.url)){const y=cT(v);if(y&&y.h){const w=Number(y.h),P={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[P.x+w,P.y+w,P.z+w]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else v.includes("/layer.json")&&(typeof g=="string"?g=v.replace("/layer.json",""):g.url=v.replace("/layer.json","")),this._czmProvider.value={type:"CesiumTerrainProvider",url:g,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};f(),this.dispose(p.changed.disposableOn(f))}}get provider(){return this._provider.value}set provider(e){this._provider.value=e}get providerChanged(){return this._provider.changed}get czmProvider(){return this._czmProvider.value}get czmProviderChanged(){return this._czmProvider.changed}flyTo(e,n){const{czmViewer:o,sceneObject:s}=this;if(!o.actived)return!1;const{viewer:r}=o;return r?(s.rectangle&&!bu(s.rectangle)?r.camera.flyTo({destination:Ve(s.rectangle),duration:e}):r.camera.flyHome(e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?super.flyIn(e,n):this.flyTo(e,n):!1}};m(rl,"type",rl.register("ESCesiumViewer",a.ESTerrainLayer.type,rl));let Sp=rl;function cT(t){const i=t.indexOf("?"),n=t.slice(i+1).split("&"),o={};for(var s=0;s<n.length;s++){var r=n[s].split("=");o[r[0]]=r[1]}return o}class Gy extends a.Destroyable{constructor(e,n){super();m(this,"_czmTextLabel");m(this,"flyTo",(e,n)=>{if(this.czmTextLabel.position){ne(this.czmViewer.viewer,this.czmTextLabel.position,1e3,ei,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id));const o=this._czmTextLabel,s=()=>{const l=e.anchor,c=e.offset;l?o.originRatioAndOffset=[...l,-c[0],-c[1]]:o.originRatioAndOffset=[0,0,0,0]},r=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(r.disposableOn(()=>s())),s(),this.dispose(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"text"],[e,"text"])),this.dispose(a.track([o,"color"],[e,"color"])),this.dispose(a.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(a.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(a.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.dispose(a.track([o,"width"],[e,"width"])),this.dispose(a.track([o,"opacity"],[e,"opacity"])),this.dispose(a.track([o,"padding"],[e,"padding"])),this.dispose(a.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(a.track([o,"borderColor"],[e,"borderColor"])),this.dispose(a.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(a.track([o,"textAlign"],[e,"textAlign"])),this.dispose(a.track([o,"fontSize"],[e,"fontSize"])),this.dispose(a.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(a.track([o,"pickOnClick"],[e,"allowPicking"]));{const l=()=>{o.scale=[e.scale[1],e.scale[2]]};l(),this.dispose(e.scaleChanged.don(l))}{const l=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};l(),this.dispose(e.sizeByContentChanged.don(l)),this.dispose(e.sizeChanged.don(l))}this.d(o.pickedEvent.don(l=>{var d;const c=(d=po(l,"pickResult"))==null?void 0:d.pointerEvent;if(!c)return;const u={type:c.buttons!=0&&c.button==0?"leftClick":c.button==2?"rightClick":void 0,add:{mousePos:[c.offsetX,c.offsetY]}};u.type==null&&(u.type=c.type),e.widgetEvent.emit(u)}));{let l;const c=u=>{u&&(l=u),l&&(l.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>c(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(u=>c(u)))}}get czmTextLabel(){return this._czmTextLabel}}class Uy extends a.Destroyable{constructor(e,n){super();m(this,"_czmTextLabel");m(this,"_czmImageModel");m(this,"_url",this.disposeVar(a.react("")));m(this,"_defaultSize",this.disposeVar(a.react([1,1])));m(this,"_size",this.disposeVar(a.react([1,1])));m(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});m(this,"_isPointEvent",!1);m(this,"flyTo",(e,n)=>{if(this.czmImageModel.position)return $t(this._czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id)),this._czmImageModel=this.disposeVar(new Xi(n,e.id));const o=this._czmViewer,s=this._czmTextLabel;s.originRatioAndOffset=[1e3,0,0,0],this.dispose(s.divCreatedEvent.disposableOn(c=>{const u=setTimeout(()=>{tu(c,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:c.offsetWidth,height:c.offsetHeight,scale:1}).then(d=>{if(clearTimeout(u),this.isDestroyed())return;const p=new Image;p.onload=()=>{e.sizeByContent?this._size.value=[p.width/100,p.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},p.src=d.toDataURL("image/png"),this._url.value=d.toDataURL("image/png")}).catch(d=>{clearTimeout(u),console.error(d)})},50);this.dispose(()=>clearTimeout(u))})),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"text"],[e,"text"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"fontSize"],[e,"fontSize"]));const r=()=>{const c=e.anchor,u=e.offset;c?this.czmImageModel.originRatioAndOffset=[...c,-u[0]/100,-u[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r();{const c=()=>{this._czmTextLabel.show=!1;const u=this._czmImageModel;u.uri=this._url.value,u.pixelSize=void 0,u.useAxis="XZ",this.dispose(this.sizeChanged.disposableOn(()=>{u.size=this._size.value})),this.dispose(a.track([u,"show"],[e,"show"])),this.dispose(a.bind([u,"position"],[e,"position"])),this.dispose(a.track([u,"allowPicking"],[e,"allowPicking"]));{const d=()=>{u.scale=[e.scale[1],e.scale[2]]};d(),this.d(e.scaleChanged.don(d))}{const d=()=>{e.rotationType===0&&(u.rotationMode="WithProp",this.d(je([u,"rotation"],[e,"rotation"]))),e.rotationType===1&&(u.rotationMode="WithCamera"),e.rotationType===2&&(u.rotationMode="WithCameraOnlyZ")};d(),this.dispose(e.rotationTypeChanged.disposableOn(d))}};this.dispose(this._url.changed.disposableOn(c))}this.ad(o.clickEvent.don(c=>{const u=c==null?void 0:c.pointerEvent;u&&(this._isPointEvent=!0,this._eventInfo={type:u.button==0?"leftClick":u.button==2?"rightClick":"leftClick",add:{mousePos:[u.offsetX,u.offsetY]}})})),this.d(e.pickedEvent.don(c=>{var u,d,p;c.screenPosition&&this._isPointEvent&&c.attachedInfo!="innerHoverEvent"&&((u=this._eventInfo.add)!=null&&u.mousePos)&&Math.abs(c.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(c.screenPosition[1]-((p=this._eventInfo.add)==null?void 0:p.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.engineObjectCreatedUpdate(this,e,()=>{const c=o.getEngineObject(e);this.ad(c.lastHoverResultChanged.don((u,d)=>{(u==null?void 0:u.sceneObject)==(d==null?void 0:d.sceneObject)||(u==null?void 0:u.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(u!=null&&u.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:u==null?void 0:u.screenPosition}},u.sceneObject.widgetEvent.emit(this._eventInfo)),d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:u==null?void 0:u.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo)))}))})}get czmTextLabel(){return this._czmTextLabel}get czmImageModel(){return this._czmImageModel}get url(){return this._url.value}get defaultSize(){return this._defaultSize.value}get defaultSizeChanged(){return this._defaultSize.changed}get size(){return this._size.value}get sizeChanged(){return this._size.changed}}const al=class al extends qr{constructor(e,n){super(e,n);m(this,"_event",this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));m(this,"_resetting",this.disposeVar(new a.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new Gy(this.sceneObject,this.czmViewer):new Uy(this.sceneObject,this.czmViewer))));if(!n.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(al,"type",al.register("ESCesiumViewer",a.ESTextLabel.type,al));let xp=al;const ll=class ll extends me{constructor(e,n){super(e,n);m(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new fo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoDivSwitchPoi;s.showIcon=!1,this.d(a.track([s,"zOrder"],[e,"zOrder"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"text"],[e,"info"],c=>Object.values(c??{title:"请输入内容"}).join())),this.dispose(a.bind([s,"position"],[e,"position"]));const r=()=>{const c=e.anchor,u=e.offset;c?s.originRatioAndOffset=[...c,-u[0],-u[1]]:s.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoDivSwitchPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.position?(ne(this.czmViewer.viewer,r.position,1e3,ei,e),!0):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(ll,"type",ll.register("ESCesiumViewer",a.ESUEWidget.type,ll));let Ap=ll;const cl=class cl extends me{constructor(e,n){super(e,n);m(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};m(cl,"type",cl.register("ESCesiumViewer",a.ESUnrealActor.type,cl));let Ep=cl;var hT=h.Primitive._modifyShaderPosition;h.Primitive._modifyShaderPosition=function(t,n,e){var n=hT(t,n,e);return t.isCameraVideo&&n.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(n=n.replace("void main()",`
|
|
1424
1424
|
#ifdef XBSJ_CAMERA_VIDEO
|
|
1425
1425
|
uniform mat4 u_boxMV;
|
|
1426
1426
|
#endif
|
|
@@ -1922,7 +1922,7 @@ void main()
|
|
|
1922
1922
|
{
|
|
1923
1923
|
out_FragColor = u_color;
|
|
1924
1924
|
}
|
|
1925
|
-
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},Fe,t)}class vF extends a.HasOwner{constructor(i){super(i);const{czmViewer:e}=this.owner;let n;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(s=>{const r=n=this._getStartInfo(s.pointerEvent);r&&(this.owner.hoveredPlaneType=r.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(s=>{n&&n.currentPlaneType!=="none"&&(o.restart(void 0,e,n),n=void 0)})),this.dispose(e.dblclickEvent.disposableOn(s=>{const r=this._getStartInfo(s.pointerEvent);if(r&&r.currentPlaneType!=="none"){const{currentPlaneType:l}=r,c=[...this.owner.selfRotation];c[wi.rotationNum[l]]=0,this.owner.selfRotation=c;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(a.createProcessingFromAsyncFunc(async(i,e,n)=>{const o=this.owner.circles[n.currentPlaneType];e.incrementDisabledInputStack(),i.disposer.dispose(()=>e.decrementDisabledInputStack()),i.disposer.dispose(e.pointerMoveEvent.don(s=>{if(n&&s.pointerEvent){const{offsetX:r,offsetY:l}=s.pointerEvent,c=[r,l],{currentPlaneType:u}=n;if(u==="none")return;const d=this.owner.getPlane(u);if(!n.currentV)return;const p=d.pick(c);if(!p||!this.owner.cartesian)return;const f=h.Cartesian3.subtract(n.currentV,this.owner.cartesian,new h.Cartesian3);h.Cartesian3.normalize(f,f);const g=h.Cartesian3.subtract(p,this.owner.cartesian,new h.Cartesian3);if(h.Cartesian3.normalize(g,g),!d.normal||!d.origin)return;const v=lg(f,g,d.normal),y=lg(d.origin,f,d.normal),w=lg(d.origin,g,d.normal);{const P=[...this.owner.selfRotation];P[wi.rotationNum[u]]=n.startRotation+v,this.owner.selfRotation=P,o.circleStartRotation=y,o.circleEndRotation=w}}})),this.owner.movingPlaneType=n.currentPlaneType,i.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),i.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await a.step(i,s=>new Promise((r,l)=>{s.disposer.dispose(l),s.disposer.dispose(e.pointerUpEvent.don(()=>{r()})),s.disposer.dispose(e.pointerOutEvent.don(()=>{r()}))}))}))}_pickPlane(i,e,n,o,s){const r=this.owner.cartesian;if(!r)return;const{selfRotation:l}=this.owner,c=this.owner.getPlane(n).pick(o);if(!c)return;const u=h.Cartesian3.distance(r,c),d=s/4,p=d*3/128;if(!(u>=d-p&&u<=d+p))return;const g=h.Cartesian3.distance(e.camera.positionWC,c);i.currentD2c<=g||(i.currentPlaneType=n,i.currentD2c=g,i.currentV=c,i.startRotation=l[wi.rotationNum[n]])}_getStartInfo(i){var d;const{czmViewer:e}=this.owner,n=(d=e.viewer)==null?void 0:d.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Ui(n,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:s,offsetY:r}=i,l=[s,r],c=i.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:c};return this._pickPlane(u,n,"heading",l,o),this._pickPlane(u,n,"pitch",l,o),this._pickPlane(u,n,"roll",l,o),u}}function lg(t,i,e){const n=h.Cartesian3.cross(i,t,new h.Cartesian3);if(n.equals(h.Cartesian3.ZERO))return 0;h.Cartesian3.normalize(n,n);const o=h.Cartesian3.dot(n,e);let s=Math.acos(h.Cartesian3.dot(t,i))*180/Math.PI;return s=o>0?s:-s,s}const ko=class ko extends Qt{constructor(e){super();m(this,"_hoveredPlaneType",this.disposeVar(a.react("none")));m(this,"_movingPlaneType",this.disposeVar(a.react("none")));m(this,"_circles");m(this,"_czmCameraModel");m(this,"_cartesian");m(this,"_planes",{heading:this.disposeVar(new dF(this)),pitch:this.disposeVar(new pF(this)),roll:this.disposeVar(new fF(this))});m(this,"_rotatorRunningResetting");this._czmViewer=e;const n=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new vF(this)})),this._circles={heading:this._createRotatorCircle(n,"heading"),pitch:this._createRotatorCircle(n,"pitch"),roll:this._createRotatorCircle(n,"roll")},!!n.viewer){{const s=()=>{this._cartesian=this.position&&Se(this.position)||void 0};s(),this.dispose(this.positionChanged.disposableOn(s))}this._createCameraModel(n)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new ct(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(a.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],n=>n*.1)),this.dispose(a.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(a.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const n=()=>{const o=Re({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=h.Matrix4.toArray(o))};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};n(),this.dispose(this.enabledChanged.disposableOn(n)),this.dispose(this.showHelperChanged.disposableOn(n))}}_createRotatorCircle(e,n){const o=this.ad(new ir(e));this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([o,"debug"],[this,"debug"])),this.dispose(a.track([o,"rotation"],[this,"rotation"]));{const s=()=>{o.selfRotation=ko.rotationFuncs[n](this.selfRotation),o.circleRotation=this.selfRotation[ko.rotationNum[n]]};s(),this.dispose(this.selfRotationChanged.disposableOn(s))}{const s=()=>{const r=this.movingPlaneType===n,l=this.hoveredPlaneType===n,u=[0,0,0,r||l?1:.8];u[ko.rotationNum[n]]=1,o.color=u};s(),this.dispose(this.movingPlaneTypeChanged.disposableOn(s)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(s))}return o}};m(ko,"rotationNum",{heading:0,pitch:1,roll:2}),m(ko,"rotationFuncs",{heading:([e,n,o])=>[0,0,0],pitch:([e,n,o])=>[e,0,-90],roll:([e,n,o])=>[e,n+90,0]});let wi=ko;(t=>{t.createDefaultProps=()=>({...Qt.createDefaultProps(),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(wi||(wi={})),a.extendClassProps(wi.prototype,wi.createDefaultProps);const Ko=class Ko extends a.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(i){this.positions=[i??Ko.defaults.positions[0],this.stopPosition??Ko.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(i){this.positions=[this.startPosition??Ko.defaults.positions[0],i??Ko.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(i,e){if(super(),!i.viewer)return;const o=this.ad(new xe(i,e));o.arcType="RHUMB";const s=this.ad(new ti(i,e));this.ad(a.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(a.track([s,"allowPicking"],[this,"allowPicking"]));{const r=()=>{o.show=s.show=this.show};r(),this.ad(this.showChanged.don(r))}{const r=()=>{o.width=this.width/2,s.pixelSize=this.width};r(),this.ad(this.widthChanged.don(r))}{const r=()=>{o.color=s.color=this.color};r(),this.ad(this.colorChanged.don(r))}{const r=()=>{o.positions=this.positions,s.position=this.stopPosition};r(),this.dispose(this.startPositionChanged.disposableOn(r)),this.dispose(this.stopPositionChanged.disposableOn(r))}}};m(Ko,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Wo=Ko;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(t.defaults.positions),width:10,color:a.reactArray([1,0,0,1])})})(Wo||(Wo={})),a.extendClassProps(Wo.prototype,Wo.createDefaultProps);class rn extends Qt{constructor(e){super();m(this,"_lastPosition");m(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.disposeVar(a.react("none")),originPosition:this.disposeVar(a.reactArray([0,0,0])),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});m(this,"_scaleAxis");m(this,"_pickingXYProcessing",e=>this.disposeVar(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.disposableOn(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!es(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;io(l,r),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d;let p=this.scale[0],f=this.scale[1];const g=a.geoDistance(d,this._opInfo.originPosition.value)-a.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...d];const v=this._opInfo.originDimensions.value[0]/100;g!=0&&this._opInfo.constraintMode.value==="y"&&(g>0?p+=v:p-=v),g!=0&&this._opInfo.constraintMode.value==="x"&&(g>0?f+=v:f-=v),p<=0&&(p+=v),f<=0&&(f+=v),this.scale=[p??1,f??1,this.scale[2]??1]})})));m(this,"_pickingZProcessing",e=>this.disposeVar(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!yc(e.viewer.scene,Se(this._opInfo.originPosition.value),r,n))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(se(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l];let u=this.scale[2];const d=o[2]-this._lastPosition[2];this._lastPosition=[...o];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&(d>0?u+=p:u-=p),u<=0&&(u+=p),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const n=e.viewer;if(!n)return;const{scene:o}=n;this.ad(new wu(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const s=()=>{if(!this._scaleAxis)return;const{zAxis:r,yAxis:l,xAxis:c}=this._scaleAxis,u=this._opInfo.constraintMode.value,d=this._opInfo.step;r.color=[0,0,1,.99],l.color=[0,1,0,.99],c.color=[1,0,0,.99],u==="x"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="y"?l.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(r.color=d?[1,1,0,.8]:[1,1,0,.99])};s(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(s)),this.dispose(this._opInfo.step.changed.disposableOn(s))}{const s=()=>{if(!this._scaleAxis)return;const{position:l=rn.defaults.position}=this,{zAxis:c,yAxis:u,xAxis:d}=this._scaleAxis;c.startPosition=u.startPosition=d.startPosition=l;const[p,f,g]=l;c.stopPosition=[p,f,g+this._opInfo.originDimensions.value[2]];const v=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[0],90);v&&(d.stopPosition=v);const y=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[1],0);y&&(u.stopPosition=y)};s();const r=this.ad(a.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(r.don(s))}{const s=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,l)=>r===this._opInfo.targetPosition.value[l])){this._opInfo.moved.value=!0;return}};s(),this.dispose(this._opInfo.originHeading.changed.disposableOn(s)),this.dispose(this._opInfo.originPosition.changed.disposableOn(s)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(s)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(s))}{const s=this._pickingXYProcessing(e),r=this._pickingZProcessing(e),l=()=>{const f=[...this.position??rn.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},c={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};au(f,o,g,this.axisSnapPixelSize,c),this._opInfo.constraintMode.value=c.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=c.startDragPos},d=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(f,async g=>{g.disposer.dispose((l(),this.positionChanged.disposableOn(l))),g.disposer.dispose(e.pointerMoveEvent.disposableOn(v=>{v.pointerEvent&&u(v.pointerEvent)})),await a.step(g,v=>new Promise((y,w)=>{v.disposer.dispose(w),v.disposer.dispose(e.pointerDownEvent.don(P=>{P.pointerEvent&&u(P.pointerEvent),P.pointerEvent&&P.pointerEvent.button===0&&c.constraintMode!=="none"&&y()}))}))}),this._opInfo.step.value=!1,await a.step(f,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const v=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);s.restart(void 0,v,y),g.disposer.dispose(()=>s.cancel())}else this._opInfo.constraintMode.value==="z"&&(r.restart(),g.disposer.dispose(()=>r.cancel()));await a.step(g,v=>new Promise((y,w)=>{v.disposer.dispose(w),v.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),v.disposer.dispose(e.pointerOutEvent.don(()=>{y()}))})),this._lastPosition=void 0}),d.restart()})),p=()=>{this.enabled?d.restart():d.isRunning&&d.cancel()};p(),this.dispose(this.enabledChanged.disposableOn(p))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,n){const o=this.ad(new Wo(e));return o.width=10,this.ad(a.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Qt.createDefaultProps(),scale:a.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(rn||(rn={})),a.extendClassProps(rn.prototype,rn.createDefaultProps);const to=class to extends Ut{constructor(e){super();m(this,"_editingPoints",this.disposeVar(new a.ObservableArray));m(this,"_cancelEvent",this.disposeVar(new a.Event));m(this,"_currentProcess");m(this,"_menuPoiEnabled",this.disposeVar(a.react(!1)));m(this,"_status",this.disposeVar(a.react("None")));m(this,"_positionsChanged",this.ad(new a.Event));m(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(n=>{for(let{start:o,deleteCount:s,items:r}of n){for(const l of r)l.menuPoi.enabled=this.menuPoiEnabled??!1;for(let l=o;l<o+s;++l)this.editingPoints.get(l).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let n of this.editingPoints)n.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(n=>{this.ad(()=>{var o;((o=n.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(n=>{this._currentProcess&&(n?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const n=()=>{this.polylineShow=this.czmViewer.editingLineShow};n(),this.ad(this.czmViewer.editingLineShowChanged.don(n))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let n of this._editingPoints)n.position&&e.push([...n.position]);return e}resetPositions(e){if(this.enabled??to.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const n=e||[];return!(n.length===this.editingPoints.length&&n.every((o,s)=>o.every((r,l)=>{const c=this.editingPoints.get(s);return c.position&&c.position[l]===r})))}forceResetPositions(e){(this.enabled??to.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const n=this.ad(new xe(e));this.ad(a.track([n,"color"],[this,"polylineColor"])),this.ad(a.track([n,"width"],[this,"polylineWidth"])),this.ad(a.track([n,"show"],[this,"polylineShow"])),this.ad(a.track([n,"arcType"],[this,"polylineArcType"])),this.ad(a.track([n,"loop"],[this,"loop"]));{const o=()=>{const s=[];for(const r of this.getPositions())r[2]-=e.editingHeightOffset??0,s.push(r);n.positions=s};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const n=this._cursorInfo=this.ad(new a.CursorInfo(e.container,a.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(n){if(!this.hideCursorInfo){n.show=!1;return}o==="Adding"?(n.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",n.show=!0):o==="Modifying"||o==="Modifying_Point"?(n.text="Esc键或左键双击:退出编辑状态",n.show=!0):o==="None"&&(n.text="",n.show=!1)}}))}};m(to,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),m(to,"defaults",{...Ut.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:to.baseImageUrl+"point-green.png",otherControlPointImageUrl:to.baseImageUrl+"point-yellow.png"});let ri=to;(t=>{t.createDefaultProps=()=>({...Ut.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:a.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ri||(ri={})),a.extendClassProps(ri.prototype,ri.createDefaultProps);let yF=0;class mC extends a.Destroyable{constructor(e,n){super();m(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_id",yF++);m(this,"_menuPoi");n&&(this.position=n),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new ls(e.czmViewer));o.enabled=!1,this.ad(a.track([o,"show"],[e,"enabled"]));{const s=()=>{if(this.position===void 0){o.position=void 0;return}const r=[...this.position];r[2]-=e.czmViewer.editingHeightOffset??0,o.position=r,e.positionsChanged.emit()};s(),this.d(this.positionChanged.don(s))}{const s=()=>{const r=e.editingPoints.indexOf(this)+1;r!==0&&(o.title=`控制点${r}`,r===1?o.imageUri=e.firstControlPointImageUrl??ri.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ri.defaults.otherControlPointImageUrl)};s(),this.dispose(e.editingPoints.changedEvent.disposableOn(s))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class vC extends mC{constructor(i,e){super(i,e)}}class Ye extends ri{constructor(e){super(e);m(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new a.Event));m(this,"placeEditing");if(!e.viewer)return;const n=this.placeEditing=this.ad(new Oi(e));n.enabled=!1,this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Ye.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Ye.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(a.step(o,async s=>{const r=s.disposer,l=r.ad(this._addingEditingProcessing());r.dispose(()=>"adding canceled!"),r.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),await s.promise(new Promise(c=>{r.dispose(l.completeEvent.disposableOnce(c))}))}))})),this.dispose(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new vC(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Ye.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},n=a.createProcessingFromAsyncFunc(async o=>{let s=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(a.step(o,async l=>{let c;!e()&&(c=l.disposer.disposeVar(new wF(this,s)));const d=l.disposer.disposeVar(new _F(this,s));return l.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>d.do())),await l.promise(new Promise(p=>{c&&l.disposer.dispose(c.overEvent.disposableOnce(f=>{f?(s++,p(!0)):p(!1)})),l.disposer.dispose(d.overEvent.disposableOnce(f=>{f?(s--,p(!0)):p(!1)})),l.disposer.dispose(this.cancelEvent.disposableOn(()=>p(!1)))}))}))&&n.restart()});return n.start(),n}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps()})})(Ye||(Ye={})),a.extendClassProps(Ye.prototype,Ye.createDefaultProps);class wF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));const{placeEditing:o}=e;let s=new vC(e,void 0);e.editingPoints.splice(n,0,s);const r=()=>{(e.debug??Ye.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(s);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(a.track([s,"position"],[o,"position"])),o.enabled=!0;let l=!1;const c=()=>{r(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!l&&c()}),this.dispose(o.overEvent.disposableOnce(()=>{l=!0,s.position===void 0?c():this._overEvent.emit(!0)})),(e.debug??Ye.defaults.debug)&&console.log(`PointAdding creating! index(${n})`),this.dispose(()=>{(e.debug??Ye.defaults.debug)&&console.log(`PointAdding destroying! index(${n})`)})}get overEvent(){return this._overEvent}}function CF(t,i){const e=t.editingPoints,n=i-1;return n<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(n,1),!0)}class _F extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_doEvent",this.disposeVar(new a.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(CF(e,n)))),(e.debug??Ye.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${n})`),this.dispose(()=>{(e.debug??Ye.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${n})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class yC extends Ye{constructor(i){super(i),this.loop=!1}}class wC extends Ye{constructor(i){super(i),this.loop=!0}}class Uh extends mC{constructor(i,e){super(i,e);{const{menuPoi:n}=this;n.commands=[["add","增加控制点","",Ee.baseImageUrl+"add.png"],["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]],n.clickCommandName="modify",n.rightClickCommandName="delete",this.dispose(n.commandEvent.disposableOn(o=>{i.menuPoiCommand(this,o)})),this.dispose(n.dbclickEvent.disposableOn(()=>{i.menuPoiCommand(this,"dbClick")}))}if(i.middlePointShow){const n=this.ad(new _i(i.czmViewer));{n.imageUri=i.firstControlPointImageUrl??Ee.defaults.firstControlPointImageUrl,n.tooltip="点击增加一个控制点",n.bgColor=[0,0,0,.6],n.fgColor=[1,1,1,1],n.size=[8,8],n.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{n.enabled=n.show=!1},s=()=>{var g;if(!(i.enabled??Ee.defaults.enabled))return o();const r=i.editingPoints.indexOf(this),l=i.editingPoints,c=l.length;if(r===-1||c===0||!(i.loop??Ee.defaults.loop)&&r+1>=c)return o();const u=this.position;if(!u)return o();const d=(g=l.get((r+1)%c))==null?void 0:g.position;if(!d)return o();const p=uu(u,d);if(!p)return o();p[2]-=i.czmViewer.editingHeightOffset??0,n.position=p;const f=c<(i.maxPointsNum??Ee.defaults.maxPointsNum);n.enabled=n.show=f};s(),this.dispose(i.positionsChanged.disposableOn(s)),this.dispose(i.loopChanged.disposableOn(s)),this.dispose(i.enabledChanged.disposableOn(s))}this.dispose(n.clickEvent.disposableOn(o=>{if(o.button!==0||i.editingPoints.length>=(i.maxPointsNum??Ee.defaults.maxPointsNum))return;const s=i.editingPoints.indexOf(this);if(s===-1)return;const r=n.position?[...n.position]:void 0;r&&(r[2]+=i.czmViewer.editingHeightOffset??0);let l=new Uh(i,r);i.editingPoints.splice(s+1,0,l),i.modify(l)}))}}}}class Ee extends ri{constructor(e){super(e);m(this,"_menuPoiCommand",this.disposeVar(new a.Event));m(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"translationEditing");{const s=this.ad(a.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new a.ObjResettingWithEvent(s,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new PF(this.editingPoints.get(0),this)}))}const n=this.translationEditing=this.disposeVar(new sn(e));n.enabled=!1;const o=async(s,r)=>{if((this.debug??Ee.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await s.promise(a.step(s,async l=>{const c=l.disposer,u=c.ad(new bF(this));return c.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),c.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),c.dispose(this._forceModifyPosEditorEvent.disposableOn(p=>u.modify(p))),await l.promise(new Promise(p=>{c.dispose(u.overEvent.disposableOnce(f=>{p(f)}))}))})),r===-1)(this.debug??Ee.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??Ee.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??Ee.defaults.loop;const c=this.editingPoints.get(r-1).position;if(!c)return;let u=r%this.editingPoints.length;const p=this.editingPoints.get(u).position;if(!p)return;const f=uu(c,p);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let g=new Uh(this,f);this.editingPoints.splice(r,0,g),await o(s,r)}};this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async s=>{s.disposer.dispose(()=>{(this.debug??Ee.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(s,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,n){this._menuPoiCommand.emit(e,n)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new Uh(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps(),moveWithFirstPosition:!1})})(Ee||(Ee={})),a.extendClassProps(Ee.prototype,Ee.createDefaultProps);class PF extends a.Destroyable{constructor(i,e){super(),this._firstPositionEditor=i,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((n,o)=>{if(n===void 0||o===void 0)return;var s=[n[0]-o[0],n[1]-o[1],n[2]-o[2]];const r=this.multiPointsModifyEditing.editingPoints.length;for(let l=1;l<r;l++){const c=this.multiPointsModifyEditing.editingPoints.get(l),u=c.position;u!==void 0&&(c.position=[u[0]+s[0],u[1]+s[1],u[2]+s[2]])}})}}class bF extends a.Destroyable{constructor(e){super();m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_cancelEvent",this.disposeVar(new a.Event));m(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let n;const o=()=>{n==null||n.destroy(),n=void 0,e.status="Modifying"};this.dispose(o);const s=r=>{o(),e.status="Modifying_Point",n=new SF(e,r),n.dispose(n.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(s)),this.dispose(e._menuPoiCommand.disposableOn((r,l)=>{if(l==="delete"){if(e.editingPoints.length<=2)return;const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(c,1)}else if(l==="modify")s(r);else if(l==="add"){const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(c+1)}else l==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${l})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class SF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));this._modifying=e,this._posEditor=n,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(a.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(s=>{s||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class CC extends Ee{constructor(i){super(i),this.loop=!1}}class _C extends Ee{constructor(i){super(i),this.loop=!0}}class nr extends Ye{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const n=a.geoHeading(this.startPosition,this.endPosition),o=a.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/o)*180/Math.PI,l=Math.sqrt(o*o+s*s);this.rotation=[n,r,0],this.distance=l};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ye.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([90,0,0]),distance:a.react(1)})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);class Go extends Ee{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var l;if(!((l=this.positions)!=null&&l.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",Ee.baseImageUrl+"add.png"],["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let c of this.editingPoints)c.menuPoi.commands=[["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]];const n=a.geoDistance(this.startPosition,this.endPosition);if(Math.abs(n)<=0)return this.rotation=[90,0,0],this.distance=1;const o=a.geoHeading(this.startPosition,this.endPosition),s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/n)*180/Math.PI;this.rotation=[o,r,0],this.distance=Math.hypot(n,s)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ee.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),distance:a.react(0)})})(Go||(Go={})),a.extendClassProps(Go.prototype,Go.createDefaultProps);class PC extends Ye{constructor(i){super(i),this.loop=!1,this.polylineShow=!1}}class bC extends Ee{constructor(i){super(i),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class or extends Ye{constructor(i){super(i),i.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(i){const e=this.ad(new fi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ye.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(or||(or={})),a.extendClassProps(or.prototype,or.createDefaultProps);class sr extends Ee{constructor(i){if(super(i),!!i.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(i){const e=this.ad(new fi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ee.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(sr||(sr={})),a.extendClassProps(sr.prototype,sr.createDefaultProps);class SC extends Go{constructor(i){super(i),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class Pt extends a.EngineObject{constructor(e,n,o){super(e,n,o??!0);m(this,"_currentEditing",this.disposeVar(a.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var s;if(this.currentEditing)if(this.currentEditing instanceof Ye&&((s=this.currentEditing.currentProcess)!=null&&s.isRunning)){if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}}else this.currentEditing instanceof Oi&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Jl=class Jl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new Oi(e));if(this.ad(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)==2&&(n.enabled=!0)})),Reflect.has(i,"position")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),n.enabled=!n.position||a.equalsN3(n.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${i.typeName} 坐标属性无法绑定位置编辑`)}};m(Jl,"type",Jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Place,Jl));let cg=Jl;const jl=class jl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wi(e));if(n.rotation=[90,0,0],this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);o&&(this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"])),this.ad(a.bind([n,"selfRotation"],[i,"rotation"])))});else if(Reflect.has(i,"position")&&Reflect.has(i,"rotation")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${i.typeName} 旋转属性无法绑定旋转编辑`)}};m(jl,"type",jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Rotation,jl));let hg=jl;const ec=class ec extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new rn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")&&Reflect.has(i,"scale")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${i.typeName} 缩放属性无法绑定缩放编辑`)}};m(ec,"type",ec.registerEditing("ESCesiumViewer",a.ESJEditingMode.Scale,ec));let ug=ec;const tc=class tc extends Pt{constructor(i,e){super(Array.isArray(i)?i[0]:i,e,!0);const n=this.currentEditing=this.ad(new sn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++){const r=i[s];Reflect.has(r,"position")?o.push(r.position):r.points&&o.push(...r.points)}n.position=a.getMinMaxCorner(o).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(!(!s||!r)){var l=Dt({originPosition:r},[s])[0][0];i.forEach(c=>{const u=c;if(Reflect.has(c,"position")){const d=Dt({originPosition:r},[u.position])[0][0];u.position=Cn({originPosition:r},[[d[0]+l[0],d[1]+l[1],d[2]+l[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const d=Dt({originPosition:r},u.points)[0];u.points=Cn({originPosition:r},d.map(p=>[p[0]+l[0],p[1]+l[1],p[2]+l[2]]))[0]}})}}))}else if(Reflect.has(i,"position"))this.ad(a.bind([n,"position"],[i,"position"]));else if(i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(i,"points")){const o=i;if(o.points===void 0||o.points.length===0){this.destroy();return}n.position=a.getMinMaxCorner(o.points).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(s===void 0||r===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var l=Dt({originPosition:r},[s])[0][0];const c=Dt({originPosition:r},o.points)[0];o.points=Cn({originPosition:r},c.map(u=>[u[0]+l[0],u[1]+l[1],u[2]+l[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${i.typeName} 坐标属性无法绑定平移编辑`)}};m(tc,"type",tc.registerEditing("ESCesiumViewer",a.ESJEditingMode.Translation,tc));let Hh=tc;const ic=class ic extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new nr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")){const o=i;if(this.ad(a.bind([n,"startPosition"],[o,"position"])),this.ad(je([n,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(a.bind([n,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(a.bind([n,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(a.bind([n,"distance"],[o,"distance"]));else{const s=Se(o.position);if(h.Cartesian3.ZERO.equals(s)||!e.viewer)return;n.distance=Ui(e.viewer.scene,s,100)??1}}else if(Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${i.typeName} 坐标属性无法绑定双点追加编辑`);n.startPosition&&!a.equalsN3(n.startPosition,[0,0,0])&&n.init(),n.enabled=!0}};m(ic,"type",ic.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsAppend,ic));let dg=ic;const nc=class nc extends Pt{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new Go(e));if(Reflect.has(i,"position")){const s=i;if(this.ad(a.bind([n,"startPosition"],[s,"position"])),this.ad(je([n,"rotation"],[s,"rotation"])),Reflect.has(s,"far"))this.ad(a.bind([n,"distance"],[s,"far"]));else if(Reflect.has(s,"radius"))this.ad(a.bind([n,"distance"],[s,"radius"]));else if(Reflect.has(s,"distance"))this.ad(a.bind([n,"distance"],[s,"distance"]));else{const r=Se(s.position);if(h.Cartesian3.ZERO.equals(r)||!e.viewer)return;n.distance=Ui(e.viewer.scene,r,100)??1}}else if(Reflect.has(i,"points")){const s=i;if(s.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.moveWithFirstPosition=!1;const r=()=>n.positions=s.points??[];r(),this.ad(s.pointsChanged.don(()=>!n.enabled&&r())),this.ad(a.track([s,"points"],[n,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};m(nc,"type",nc.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsModify,nc));let pg=nc;const oc=class oc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wC(e));this.ad(n.enabledChanged.don(s=>{!s&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))}));const o=i;if(Reflect.has(o,"points")){const s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};m(oc,"type",oc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularAppend,oc));let fg=oc;const sc=class sc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new _C(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${i.typeName} 坐标属性无法绑定环形插值编辑`)}};m(sc,"type",sc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularInsert,sc));let gg=sc;const rc=class rc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${i.typeName} 坐标属性无法绑定线段追加编辑`)}};m(rc,"type",rc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringAppend,rc));let mg=rc;const ac=class ac extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new CC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${i.typeName} 坐标属性无法绑定线段插入编辑`)}};m(ac,"type",ac.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringInsert,ac));let vg=ac;const lc=class lc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new PC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${i.typeName} 坐标属性无法绑定散点追加编辑`)}};m(lc,"type",lc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterAppend,lc));let yg=lc;const cc=class cc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new bC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${i.typeName} 坐标属性无法绑定散点修改编辑`)}};m(cc,"type",cc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterModify,cc));let wg=cc;const hc=class hc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new or(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${i.typeName} 坐标属性无法绑定可见性追加编辑`)}};m(hc,"type",hc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityAppend,hc));let Cg=hc;const uc=class uc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new sr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${i.typeName} 坐标属性无法绑定可见性修改编辑`)}};m(uc,"type",uc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityModify,uc));let _g=uc;const dc=class dc extends Pt{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new SC(e));if(Reflect.has(i,"points")){const s=i,r=Reflect.has(s,"extrudedHeight"),l=Reflect.has(s,"height"),c=Reflect.has(s,"perPositionHeight")?s.perPositionHeight:!r,u=[a.ESClassification,a.ESPolygonFence,a.ESSunshineAnalysis].some(v=>s instanceof v);let d=a.getMinMaxCorner(s.points).center;d[2]=s.points[0][2];let p=[...d],f=u?s.points[0][2]:0;c?r?p[2]=s.extrudedHeight:p[2]=s.height+f:(l&&(d[2]=s.height),r&&(p[2]=s.extrudedHeight)),n.startPosition=d,n.distance=p[2]-d[2],n.moveWithFirstPosition=!1;let g=[...d];this.ad(n.positionsChanged.don(()=>{n.positions.length===2&&(c?(s.points=s.points.map(v=>[v[0],v[1],v[2]+n.positions[0][2]-g[2]]),r?s.extrudedHeight=n.positions[1][2]:l&&(s.height=n.positions[1][2]-(u?n.positions[0][2]:0))):(l&&(s.height=n.positions[0][2]),r&&(s.extrudedHeight=n.positions[1][2])),g=[...n.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${i.typeName} 坐标属性无法绑定高度修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};m(dc,"type",dc.registerEditing("ESCesiumViewer",a.ESJEditingMode.HeightModify,dc));let Pg=dc;const at=class at extends a.Destroyable{constructor(e,n,o,s=!0){super();m(this,"editingModes",[]);m(this,"editingID");m(this,"useKeyToSwitch");m(this,"currentIndex",0);m(this,"currentEditingMode");m(this,"currentEditingWrapper");m(this,"_notSupportedEditCount",this.disposeVar(a.react(0)));m(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&a.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=n;const r=(Array.isArray(o)?o:[o]).filter(l=>n.supportEditingModes().includes(l));if(this.editingModes=r,this.editingID=n.editingID,this.useKeyToSwitch=s,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",r);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,n){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:n})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(at.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===at.KEY_ESCAPE&&at.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var n;return((n=e.pointerEvent)==null?void 0:n.button)===at.MOUSE_LEFT&&a.nextAnimateFrame(()=>{at.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===at.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&at.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const n=a.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!n){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new n(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(n){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,n),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,n,o,s=!0){at.stop(),at.esEditModeInstance=new at(e,n,o,s)}static stop(){const e=at.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:n,sceneObject:o,editingID:s,editingModes:r}=e;e.destroy(),n.editingEvent.emit({objectIDs:[o.parentID],editingID:s,type:"end",add:{modes:r}})}at.esEditModeInstance=void 0}};m(at,"KEY_ESCAPE","Escape"),m(at,"KEY_SPACE","Space"),m(at,"MOUSE_LEFT",0),m(at,"esEditModeInstance");let $h=at;function xC(){const t=a.createProcessingFromAsyncFunc(async(i,e,n,o)=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"start"});const s=()=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};i.disposer.ad(s);const r=c=>{c.code=="Escape"&&s()};i.disposer.ad(e.keyDownEvent.don(r));const l=new Hh(n,e);i.disposer.ad(()=>{!l.isDestroyed()&&l.destroy()}),await i.promise(new Promise(c=>{l.isDestroyed()&&c(),i.disposer.ad(l.toDestroyEvent.don(()=>{console.log("移动结束"),c()})),i.disposer.ad(e.dblclickEvent.don(()=>c()))}))});return t}class xF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,a.registerCreatedEventUpdate(this,e,()=>{let n;const o=i.getEngineObject(e);e instanceof a.ESBoxClipping&&(n=o.czmBoxClippingPlanes),!(!n||!("computedClippingPlanes"in n)||!("computedClippingPlanesChanged"in n))&&(this.dispose(a.track([this._czmViewer,"sceneGlobeClippingPlanes"],[n,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class AF extends a.Destroyable{constructor(e){super();m(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new a.ESSceneObjectWithId));this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new a.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:n}=this._clippingPlanesSceneObjectWithId;if(n)return new xF(e,n)}))}}class EF extends a.Destroyable{constructor(i){super(),this.dv(new a.ObjResettingWithEvent(i.sceneGlobeClippingPolygonsIdChanged,(e,n)=>{if(!(!e||e===n||e&&e.length===0))return new TF(i)}))}}class TF extends a.Destroyable{constructor(i){super(),this._czmViewer=i,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,n=o=>{if(!o)return;const s=this.dv(a.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{if(o)return new IF(i,o)}))};for(let o=0;o<e.length;o++){const s=e[o],r=a.ESSceneObject.getSceneObjById(s);if(!r)return;let l;r instanceof a.ESExcavate?a.registerCreatedEventUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,n(l)}):r instanceof a.ESHole&&a.registerCreatedEventUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,n(l)})}}}class IF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(n&&n.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);if(!c)return;let u;if(c instanceof a.ESExcavate?u=i.getEngineObject(c).czmPolygonClipping:c instanceof a.ESHole&&(u=i.getEngineObject(c.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[r]={positions:u.positions},s.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=s}}}class MF extends a.Destroyable{constructor(i,e){var r;super(),this._viewer=i;const n=(r=this._viewer.extensions)==null?void 0:r.pickingManager;if(!n)return;const{objectsToExclude:o}=n,s=Array.isArray(e)?[...e]:[e];for(const l of s){if(o.includes(l))throw new Error("objectsToExclude.includes(p)");o.push(l)}this.dispose(()=>{for(let l of s){const c=o.indexOf(l);if(c===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(c,1)}})}}class DF extends a.Destroyable{constructor(e){var r;super();m(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new xo(e)),this._czmGlobeMaterial.show=!0;let n=Object.assign({},Me.defaults.terrainShader,this._czmViewer.terrainShader),o=(r=this._czmViewer.viewer)==null?void 0:r.scene.preUpdate.addEventListener(()=>{var c;const l=n.elevationContour.show&&(((c=this._czmViewer.getCameraInfo())==null?void 0:c.position[2])??0)<=n.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==l&&(this._czmGlobeMaterial.enableContour=l)});this.d(()=>{o&&o()});const s=()=>{n=Object.assign({},Me.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",n.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),n.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),n.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=n.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=n.elevationContour.width,this._czmGlobeMaterial.contourColor=n.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:n.elevationRamp.minHeight,maxHeight:n.elevationRamp.maxHeight,color:n.elevationRamp.color}};s(),this.d(this._czmViewer.terrainShaderChanged.don(s))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function RF(t,i){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...i??{}},n=new h.Viewer(t,e);return n.imageryLayers.removeAll(),n.extend(h.viewerCesiumInspectorMixin),n.cesiumInspector.container.style.display="none",n.extend(h.viewerCesium3DTilesInspectorMixin),n.cesium3DTilesInspector.container.style.display="none",n.cesium3DTilesInspector.viewModel.picking=!1,n.clock.currentTime=h.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),n.scene.screenSpaceCameraController.lookEventTypes=[{eventType:h.CameraEventType.RIGHT_DRAG}],n.scene.screenSpaceCameraController.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}],n.scene.screenSpaceCameraController.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_CLICK),n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n._cesiumWidget._creditContainer.style.display="none",n}function FF(){h.Cesium3DTile.prototype.updateTransform=function(t,i){t=t??h.Matrix4.IDENTITY;const e=h.Matrix4.multiplyTransformation(t,this.transform,new h.Matrix4),n=!h.Matrix4.equals(e,this.computedTransform),o=h.defined(i)&&(this._verticalExaggeration!==i.verticalExaggeration||this._verticalExaggerationRelativeHeight!==i.verticalExaggerationRelativeHeight);if(!n&&!o)return;n&&h.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=i.verticalExaggeration,this._verticalExaggerationRelativeHeight=i.verticalExaggerationRelativeHeight);const s=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform),h.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform)),h.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(s.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function zF(){Reflect.getOwnPropertyDescriptor(h.Camera.prototype,"_currentFlight")||Object.defineProperties(h.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var i=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,i)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new h.Event),this._vtxf_currentFlightEvent}}})}function LF(){const t=new h.Matrix4;function i(n,o){const s=n.positionWC;h.Matrix4.clone(n.transform,t),n.lookAtTransform(h.Matrix4.IDENTITY),n.look(s,o),n.lookAtTransform(t)}const e=Math.PI/60;h.Camera.prototype.lookLeft=function(n){n=n??e,this._mode!==h.SceneMode.SCENE2D&&i(this,-n)},h.Camera.prototype.lookRight=function(n){this.lookLeft(-n)}}function NF(){if(!h.DepthPlane.xbsjFixed){h.DepthPlane.xbsjFixed=!0;var t=h.DepthPlane.prototype.update;h.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var i=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=i.context,n=new h.Geometry({attributes:{position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:h.PrimitiveType.TRIANGLES});this._va=h.VertexArray.fromGeometry({context:e,geometry:n,attributeLocations:{position:0},bufferUsage:h.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function OF(t){const i=t.BoundingSphere,e=t.Cartesian3,n=t.defined,o=t.OrientedBoundingBox,s=t.Rectangle,r=t.TaskProcessor,l=t.TerrainData,c=t.TerrainEncoding,u=t.TerrainMesh,d=t.GoogleEarthEnterpriseTerrainData,p="createVerticesFromGoogleEarthEnterpriseBuffer",f=new r(p),g=new r(p,l.maximumAsynchronousTasks),v=new s,y=new s;d.prototype.createMesh=function(w){w=w??we.Frozen.EMPTY_OBJECT;const P=w.tilingScheme,C=w.x,S=w.y,A=w.level,E=w.exaggeration??1,R=w.exaggerationRelativeHeight??0,N=w.throttle??!0,B=P.ellipsoid;P.tileXYToNativeRectangle(C,S,A,v),P.tileXYToRectangle(C,S,A,y);const V=B.cartographicToCartesian(s.center(y));this._skirtHeight=6378137*.3;const z=(N?g:f).scheduleTask({buffer:this._buffer,nativeRectangle:v,rectangle:s.clone(y),relativeToCenter:V,ellipsoid:B,skirtHeight:this._skirtHeight,exaggeration:E,exaggerationRelativeHeight:R,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!n(z))return;const O=this;return z.then(function(_){return O._mesh=new u(V,new Float32Array(_.vertices),new Uint16Array(_.indices),_.indexCountWithoutSkirts,_.vertexCountWithoutSkirts,_.minimumHeight,_.maximumHeight,i.clone(_.boundingSphere3D),e.clone(_.occludeePointInScaledSpace),_.numberOfAttributes,o.clone(_.orientedBoundingBox),c.clone(_.encoding),_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),O._minimumHeight=_.minimumHeight,O._maximumHeight=_.maximumHeight,O._buffer=void 0,O._mesh})}}function BF(){return h.VERSION.split(".").map(i=>parseInt(i))}let bg;function VF(){return bg||(bg=BF()),bg}function WF(){const t=VF();t[0]===1&&t[1]>=92?OF(h):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function GF(){const t=h.Resource.prototype.fetchJson,i=h.Resource.prototype.fetchArrayBuffer;h.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getJson(n)}else return t.call(this,...e)},h.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getArrayBuffer(n).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return i.call(this,...e)}}function UF(){const t=h.ModelSceneGraph.prototype.buildDrawCommands;h.ModelSceneGraph.prototype.buildDrawCommands=function(...i){const e=this._model,n=e.modelMatrix;e.modelMatrix=h.Matrix4.IDENTITY;const o=t.call(this,...i);return e.modelMatrix=n,o}}function HF(){const t=h.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const $F=`#ifdef GL_OES_standard_derivatives
|
|
1925
|
+
`,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},Fe,t)}class vF extends a.HasOwner{constructor(i){super(i);const{czmViewer:e}=this.owner;let n;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(s=>{const r=n=this._getStartInfo(s.pointerEvent);r&&(this.owner.hoveredPlaneType=r.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(s=>{n&&n.currentPlaneType!=="none"&&(o.restart(void 0,e,n),n=void 0)})),this.dispose(e.dblclickEvent.disposableOn(s=>{const r=this._getStartInfo(s.pointerEvent);if(r&&r.currentPlaneType!=="none"){const{currentPlaneType:l}=r,c=[...this.owner.selfRotation];c[wi.rotationNum[l]]=0,this.owner.selfRotation=c;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(a.createProcessingFromAsyncFunc(async(i,e,n)=>{const o=this.owner.circles[n.currentPlaneType];e.incrementDisabledInputStack(),i.disposer.dispose(()=>e.decrementDisabledInputStack()),i.disposer.dispose(e.pointerMoveEvent.don(s=>{if(n&&s.pointerEvent){const{offsetX:r,offsetY:l}=s.pointerEvent,c=[r,l],{currentPlaneType:u}=n;if(u==="none")return;const d=this.owner.getPlane(u);if(!n.currentV)return;const p=d.pick(c);if(!p||!this.owner.cartesian)return;const f=h.Cartesian3.subtract(n.currentV,this.owner.cartesian,new h.Cartesian3);h.Cartesian3.normalize(f,f);const g=h.Cartesian3.subtract(p,this.owner.cartesian,new h.Cartesian3);if(h.Cartesian3.normalize(g,g),!d.normal||!d.origin)return;const v=lg(f,g,d.normal),y=lg(d.origin,f,d.normal),w=lg(d.origin,g,d.normal);{const P=[...this.owner.selfRotation];P[wi.rotationNum[u]]=n.startRotation+v,this.owner.selfRotation=P,o.circleStartRotation=y,o.circleEndRotation=w}}})),this.owner.movingPlaneType=n.currentPlaneType,i.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),i.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await a.step(i,s=>new Promise((r,l)=>{s.disposer.dispose(l),s.disposer.dispose(e.pointerUpEvent.don(()=>{r()})),s.disposer.dispose(e.pointerOutEvent.don(()=>{r()}))}))}))}_pickPlane(i,e,n,o,s){const r=this.owner.cartesian;if(!r)return;const{selfRotation:l}=this.owner,c=this.owner.getPlane(n).pick(o);if(!c)return;const u=h.Cartesian3.distance(r,c),d=s/4,p=d*3/128;if(!(u>=d-p&&u<=d+p))return;const g=h.Cartesian3.distance(e.camera.positionWC,c);i.currentD2c<=g||(i.currentPlaneType=n,i.currentD2c=g,i.currentV=c,i.startRotation=l[wi.rotationNum[n]])}_getStartInfo(i){var d;const{czmViewer:e}=this.owner,n=(d=e.viewer)==null?void 0:d.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Ui(n,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:s,offsetY:r}=i,l=[s,r],c=i.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:c};return this._pickPlane(u,n,"heading",l,o),this._pickPlane(u,n,"pitch",l,o),this._pickPlane(u,n,"roll",l,o),u}}function lg(t,i,e){const n=h.Cartesian3.cross(i,t,new h.Cartesian3);if(n.equals(h.Cartesian3.ZERO))return 0;h.Cartesian3.normalize(n,n);const o=h.Cartesian3.dot(n,e);let s=Math.acos(h.Cartesian3.dot(t,i))*180/Math.PI;return s=o>0?s:-s,s}const ko=class ko extends Qt{constructor(e){super();m(this,"_hoveredPlaneType",this.disposeVar(a.react("none")));m(this,"_movingPlaneType",this.disposeVar(a.react("none")));m(this,"_circles");m(this,"_czmCameraModel");m(this,"_cartesian");m(this,"_planes",{heading:this.disposeVar(new dF(this)),pitch:this.disposeVar(new pF(this)),roll:this.disposeVar(new fF(this))});m(this,"_rotatorRunningResetting");this._czmViewer=e;const n=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new vF(this)})),this._circles={heading:this._createRotatorCircle(n,"heading"),pitch:this._createRotatorCircle(n,"pitch"),roll:this._createRotatorCircle(n,"roll")},!!n.viewer){{const s=()=>{this._cartesian=this.position&&Se(this.position)||void 0};s(),this.dispose(this.positionChanged.disposableOn(s))}this._createCameraModel(n)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new ct(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(a.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],n=>n*.1)),this.dispose(a.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(a.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const n=()=>{const o=Re({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=h.Matrix4.toArray(o))};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};n(),this.dispose(this.enabledChanged.disposableOn(n)),this.dispose(this.showHelperChanged.disposableOn(n))}}_createRotatorCircle(e,n){const o=this.ad(new ir(e));this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([o,"debug"],[this,"debug"])),this.dispose(a.track([o,"rotation"],[this,"rotation"]));{const s=()=>{o.selfRotation=ko.rotationFuncs[n](this.selfRotation),o.circleRotation=this.selfRotation[ko.rotationNum[n]]};s(),this.dispose(this.selfRotationChanged.disposableOn(s))}{const s=()=>{const r=this.movingPlaneType===n,l=this.hoveredPlaneType===n,u=[0,0,0,r||l?1:.8];u[ko.rotationNum[n]]=1,o.color=u};s(),this.dispose(this.movingPlaneTypeChanged.disposableOn(s)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(s))}return o}};m(ko,"rotationNum",{heading:0,pitch:1,roll:2}),m(ko,"rotationFuncs",{heading:([e,n,o])=>[0,0,0],pitch:([e,n,o])=>[e,0,-90],roll:([e,n,o])=>[e,n+90,0]});let wi=ko;(t=>{t.createDefaultProps=()=>({...Qt.createDefaultProps(),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(wi||(wi={})),a.extendClassProps(wi.prototype,wi.createDefaultProps);const Ko=class Ko extends a.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(i){this.positions=[i??Ko.defaults.positions[0],this.stopPosition??Ko.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(i){this.positions=[this.startPosition??Ko.defaults.positions[0],i??Ko.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(i,e){if(super(),!i.viewer)return;const o=this.ad(new xe(i,e));o.arcType="RHUMB";const s=this.ad(new ti(i,e));this.ad(a.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(a.track([s,"allowPicking"],[this,"allowPicking"]));{const r=()=>{o.show=s.show=this.show};r(),this.ad(this.showChanged.don(r))}{const r=()=>{o.width=this.width/2,s.pixelSize=this.width};r(),this.ad(this.widthChanged.don(r))}{const r=()=>{o.color=s.color=this.color};r(),this.ad(this.colorChanged.don(r))}{const r=()=>{o.positions=this.positions,s.position=this.stopPosition};r(),this.dispose(this.startPositionChanged.disposableOn(r)),this.dispose(this.stopPositionChanged.disposableOn(r))}}};m(Ko,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Wo=Ko;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(t.defaults.positions),width:10,color:a.reactArray([1,0,0,1])})})(Wo||(Wo={})),a.extendClassProps(Wo.prototype,Wo.createDefaultProps);class rn extends Qt{constructor(e){super();m(this,"_lastPosition");m(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.disposeVar(a.react("none")),originPosition:this.disposeVar(a.reactArray([0,0,0])),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});m(this,"_scaleAxis");m(this,"_pickingXYProcessing",e=>this.disposeVar(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.disposableOn(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!es(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;io(l,r),this._opInfo.constraintMode.value==="x"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="y"?oo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d;let p=this.scale[0],f=this.scale[1];const g=a.geoDistance(d,this._opInfo.originPosition.value)-a.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...d];const v=this._opInfo.originDimensions.value[0]/100;g!=0&&this._opInfo.constraintMode.value==="y"&&(g>0?p+=v:p-=v),g!=0&&this._opInfo.constraintMode.value==="x"&&(g>0?f+=v:f-=v),p<=0&&(p+=v),f<=0&&(f+=v),this.scale=[p??1,f??1,this.scale[2]??1]})})));m(this,"_pickingZProcessing",e=>this.disposeVar(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!yc(e.viewer.scene,Se(this._opInfo.originPosition.value),r,n))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(se(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l];let u=this.scale[2];const d=o[2]-this._lastPosition[2];this._lastPosition=[...o];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&(d>0?u+=p:u-=p),u<=0&&(u+=p),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const n=e.viewer;if(!n)return;const{scene:o}=n;this.ad(new wu(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const s=()=>{if(!this._scaleAxis)return;const{zAxis:r,yAxis:l,xAxis:c}=this._scaleAxis,u=this._opInfo.constraintMode.value,d=this._opInfo.step;r.color=[0,0,1,.99],l.color=[0,1,0,.99],c.color=[1,0,0,.99],u==="x"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="y"?l.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(r.color=d?[1,1,0,.8]:[1,1,0,.99])};s(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(s)),this.dispose(this._opInfo.step.changed.disposableOn(s))}{const s=()=>{if(!this._scaleAxis)return;const{position:l=rn.defaults.position}=this,{zAxis:c,yAxis:u,xAxis:d}=this._scaleAxis;c.startPosition=u.startPosition=d.startPosition=l;const[p,f,g]=l;c.stopPosition=[p,f,g+this._opInfo.originDimensions.value[2]];const v=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[0],90);v&&(d.stopPosition=v);const y=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[1],0);y&&(u.stopPosition=y)};s();const r=this.ad(a.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(r.don(s))}{const s=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((r,l)=>r===this._opInfo.targetPosition.value[l])){this._opInfo.moved.value=!0;return}};s(),this.dispose(this._opInfo.originHeading.changed.disposableOn(s)),this.dispose(this._opInfo.originPosition.changed.disposableOn(s)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(s)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(s))}{const s=this._pickingXYProcessing(e),r=this._pickingZProcessing(e),l=()=>{const f=[...this.position??rn.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},c={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};au(f,o,g,this.axisSnapPixelSize,c),this._opInfo.constraintMode.value=c.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=c.startDragPos},d=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(f,async g=>{g.disposer.dispose((l(),this.positionChanged.disposableOn(l))),g.disposer.dispose(e.pointerMoveEvent.disposableOn(v=>{v.pointerEvent&&u(v.pointerEvent)})),await a.step(g,v=>new Promise((y,w)=>{v.disposer.dispose(w),v.disposer.dispose(e.pointerDownEvent.don(P=>{P.pointerEvent&&u(P.pointerEvent),P.pointerEvent&&P.pointerEvent.button===0&&c.constraintMode!=="none"&&y()}))}))}),this._opInfo.step.value=!1,await a.step(f,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const v=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);s.restart(void 0,v,y),g.disposer.dispose(()=>s.cancel())}else this._opInfo.constraintMode.value==="z"&&(r.restart(),g.disposer.dispose(()=>r.cancel()));await a.step(g,v=>new Promise((y,w)=>{v.disposer.dispose(w),v.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),v.disposer.dispose(e.pointerOutEvent.don(()=>{y()}))})),this._lastPosition=void 0}),d.restart()})),p=()=>{this.enabled?d.restart():d.isRunning&&d.cancel()};p(),this.dispose(this.enabledChanged.disposableOn(p))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,n){const o=this.ad(new Wo(e));return o.width=10,this.ad(a.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Qt.createDefaultProps(),scale:a.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(rn||(rn={})),a.extendClassProps(rn.prototype,rn.createDefaultProps);const to=class to extends Ut{constructor(e){super();m(this,"_editingPoints",this.disposeVar(new a.ObservableArray));m(this,"_cancelEvent",this.disposeVar(new a.Event));m(this,"_currentProcess");m(this,"_menuPoiEnabled",this.disposeVar(a.react(!1)));m(this,"_status",this.disposeVar(a.react("None")));m(this,"_positionsChanged",this.ad(new a.Event));m(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(n=>{for(let{start:o,deleteCount:s,items:r}of n){for(const l of r)l.menuPoi.enabled=this.menuPoiEnabled??!1;for(let l=o;l<o+s;++l)this.editingPoints.get(l).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let n of this.editingPoints)n.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(n=>{this.ad(()=>{var o;((o=n.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(n=>{this._currentProcess&&(n?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const n=()=>{this.polylineShow=this.czmViewer.editingLineShow};n(),this.ad(this.czmViewer.editingLineShowChanged.don(n))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let n of this._editingPoints)n.position&&e.push([...n.position]);return e}resetPositions(e){if(this.enabled??to.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const n=e||[];return!(n.length===this.editingPoints.length&&n.every((o,s)=>o.every((r,l)=>{const c=this.editingPoints.get(s);return c.position&&c.position[l]===r})))}forceResetPositions(e){(this.enabled??to.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const n=this.ad(new xe(e));this.ad(a.track([n,"color"],[this,"polylineColor"])),this.ad(a.track([n,"width"],[this,"polylineWidth"])),this.ad(a.track([n,"show"],[this,"polylineShow"])),this.ad(a.track([n,"arcType"],[this,"polylineArcType"])),this.ad(a.track([n,"loop"],[this,"loop"]));{const o=()=>{const s=[];for(const r of this.getPositions())r[2]-=e.editingHeightOffset??0,s.push(r);n.positions=s};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const n=this._cursorInfo=this.ad(new a.CursorInfo(e.container,a.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(n){if(!this.hideCursorInfo){n.show=!1;return}o==="Adding"?(n.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",n.show=!0):o==="Modifying"||o==="Modifying_Point"?(n.text="Esc键或左键双击:退出编辑状态",n.show=!0):o==="None"&&(n.text="",n.show=!1)}}))}};m(to,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),m(to,"defaults",{...Ut.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:to.baseImageUrl+"point-green.png",otherControlPointImageUrl:to.baseImageUrl+"point-yellow.png"});let ri=to;(t=>{t.createDefaultProps=()=>({...Ut.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:a.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ri||(ri={})),a.extendClassProps(ri.prototype,ri.createDefaultProps);let yF=0;class mC extends a.Destroyable{constructor(e,n){super();m(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));m(this,"_id",yF++);m(this,"_menuPoi");n&&(this.position=n),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new ls(e.czmViewer));o.enabled=!1,this.ad(a.track([o,"show"],[e,"enabled"]));{const s=()=>{if(this.position===void 0){o.position=void 0;return}const r=[...this.position];r[2]-=e.czmViewer.editingHeightOffset??0,o.position=r,e.positionsChanged.emit()};s(),this.d(this.positionChanged.don(s))}{const s=()=>{const r=e.editingPoints.indexOf(this)+1;r!==0&&(o.title=`控制点${r}`,r===1?o.imageUri=e.firstControlPointImageUrl??ri.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ri.defaults.otherControlPointImageUrl)};s(),this.dispose(e.editingPoints.changedEvent.disposableOn(s))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class vC extends mC{constructor(i,e){super(i,e)}}class Ye extends ri{constructor(e){super(e);m(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new a.Event));m(this,"placeEditing");if(!e.viewer)return;const n=this.placeEditing=this.ad(new Oi(e));n.enabled=!1,this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Ye.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Ye.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(a.step(o,async s=>{const r=s.disposer,l=r.ad(this._addingEditingProcessing());r.dispose(()=>"adding canceled!"),r.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),await s.promise(new Promise(c=>{r.dispose(l.completeEvent.disposableOnce(c))}))}))})),this.dispose(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new vC(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Ye.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},n=a.createProcessingFromAsyncFunc(async o=>{let s=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(a.step(o,async l=>{let c;!e()&&(c=l.disposer.disposeVar(new wF(this,s)));const d=l.disposer.disposeVar(new _F(this,s));return l.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>d.do())),await l.promise(new Promise(p=>{c&&l.disposer.dispose(c.overEvent.disposableOnce(f=>{f?(s++,p(!0)):p(!1)})),l.disposer.dispose(d.overEvent.disposableOnce(f=>{f?(s--,p(!0)):p(!1)})),l.disposer.dispose(this.cancelEvent.disposableOn(()=>p(!1)))}))}))&&n.restart()});return n.start(),n}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps()})})(Ye||(Ye={})),a.extendClassProps(Ye.prototype,Ye.createDefaultProps);class wF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));const{placeEditing:o}=e;let s=new vC(e,void 0);e.editingPoints.splice(n,0,s);const r=()=>{(e.debug??Ye.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(s);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(a.track([s,"position"],[o,"position"])),o.enabled=!0;let l=!1;const c=()=>{r(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!l&&c()}),this.dispose(o.overEvent.disposableOnce(()=>{l=!0,s.position===void 0?c():this._overEvent.emit(!0)})),(e.debug??Ye.defaults.debug)&&console.log(`PointAdding creating! index(${n})`),this.dispose(()=>{(e.debug??Ye.defaults.debug)&&console.log(`PointAdding destroying! index(${n})`)})}get overEvent(){return this._overEvent}}function CF(t,i){const e=t.editingPoints,n=i-1;return n<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(n,1),!0)}class _F extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_doEvent",this.disposeVar(new a.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(CF(e,n)))),(e.debug??Ye.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${n})`),this.dispose(()=>{(e.debug??Ye.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${n})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class yC extends Ye{constructor(i){super(i),this.loop=!1}}class wC extends Ye{constructor(i){super(i),this.loop=!0}}class Uh extends mC{constructor(i,e){super(i,e);{const{menuPoi:n}=this;n.commands=[["add","增加控制点","",Ee.baseImageUrl+"add.png"],["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]],n.clickCommandName="modify",n.rightClickCommandName="delete",this.dispose(n.commandEvent.disposableOn(o=>{i.menuPoiCommand(this,o)})),this.dispose(n.dbclickEvent.disposableOn(()=>{i.menuPoiCommand(this,"dbClick")}))}if(i.middlePointShow){const n=this.ad(new _i(i.czmViewer));{n.imageUri=i.firstControlPointImageUrl??Ee.defaults.firstControlPointImageUrl,n.tooltip="点击增加一个控制点",n.bgColor=[0,0,0,.6],n.fgColor=[1,1,1,1],n.size=[8,8],n.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{n.enabled=n.show=!1},s=()=>{var g;if(!(i.enabled??Ee.defaults.enabled))return o();const r=i.editingPoints.indexOf(this),l=i.editingPoints,c=l.length;if(r===-1||c===0||!(i.loop??Ee.defaults.loop)&&r+1>=c)return o();const u=this.position;if(!u)return o();const d=(g=l.get((r+1)%c))==null?void 0:g.position;if(!d)return o();const p=uu(u,d);if(!p)return o();p[2]-=i.czmViewer.editingHeightOffset??0,n.position=p;const f=c<(i.maxPointsNum??Ee.defaults.maxPointsNum);n.enabled=n.show=f};s(),this.dispose(i.positionsChanged.disposableOn(s)),this.dispose(i.loopChanged.disposableOn(s)),this.dispose(i.enabledChanged.disposableOn(s))}this.dispose(n.clickEvent.disposableOn(o=>{if(o.button!==0||i.editingPoints.length>=(i.maxPointsNum??Ee.defaults.maxPointsNum))return;const s=i.editingPoints.indexOf(this);if(s===-1)return;const r=n.position?[...n.position]:void 0;r&&(r[2]+=i.czmViewer.editingHeightOffset??0);let l=new Uh(i,r);i.editingPoints.splice(s+1,0,l),i.modify(l)}))}}}}class Ee extends ri{constructor(e){super(e);m(this,"_menuPoiCommand",this.disposeVar(new a.Event));m(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"translationEditing");{const s=this.ad(a.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new a.ObjResettingWithEvent(s,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new PF(this.editingPoints.get(0),this)}))}const n=this.translationEditing=this.disposeVar(new sn(e));n.enabled=!1;const o=async(s,r)=>{if((this.debug??Ee.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await s.promise(a.step(s,async l=>{const c=l.disposer,u=c.ad(new bF(this));return c.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),c.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),c.dispose(this._forceModifyPosEditorEvent.disposableOn(p=>u.modify(p))),await l.promise(new Promise(p=>{c.dispose(u.overEvent.disposableOnce(f=>{p(f)}))}))})),r===-1)(this.debug??Ee.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??Ee.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??Ee.defaults.loop;const c=this.editingPoints.get(r-1).position;if(!c)return;let u=r%this.editingPoints.length;const p=this.editingPoints.get(u).position;if(!p)return;const f=uu(c,p);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let g=new Uh(this,f);this.editingPoints.splice(r,0,g),await o(s,r)}};this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async s=>{s.disposer.dispose(()=>{(this.debug??Ee.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(s,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,n){this._menuPoiCommand.emit(e,n)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new Uh(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps(),moveWithFirstPosition:!1})})(Ee||(Ee={})),a.extendClassProps(Ee.prototype,Ee.createDefaultProps);class PF extends a.Destroyable{constructor(i,e){super(),this._firstPositionEditor=i,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((n,o)=>{if(n===void 0||o===void 0)return;var s=[n[0]-o[0],n[1]-o[1],n[2]-o[2]];const r=this.multiPointsModifyEditing.editingPoints.length;for(let l=1;l<r;l++){const c=this.multiPointsModifyEditing.editingPoints.get(l),u=c.position;u!==void 0&&(c.position=[u[0]+s[0],u[1]+s[1],u[2]+s[2]])}})}}class bF extends a.Destroyable{constructor(e){super();m(this,"_overEvent",this.disposeVar(new a.Event));m(this,"_cancelEvent",this.disposeVar(new a.Event));m(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let n;const o=()=>{n==null||n.destroy(),n=void 0,e.status="Modifying"};this.dispose(o);const s=r=>{o(),e.status="Modifying_Point",n=new SF(e,r),n.dispose(n.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(s)),this.dispose(e._menuPoiCommand.disposableOn((r,l)=>{if(l==="delete"){if(e.editingPoints.length<=2)return;const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(c,1)}else if(l==="modify")s(r);else if(l==="add"){const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(c+1)}else l==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${l})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class SF extends a.Destroyable{constructor(e,n){super();m(this,"_overEvent",this.disposeVar(new a.Event));this._modifying=e,this._posEditor=n,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(a.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(s=>{s||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class CC extends Ee{constructor(i){super(i),this.loop=!1}}class _C extends Ee{constructor(i){super(i),this.loop=!0}}class nr extends Ye{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const n=a.geoHeading(this.startPosition,this.endPosition),o=a.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/o)*180/Math.PI,l=Math.sqrt(o*o+s*s);this.rotation=[n,r,0],this.distance=l};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ye.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([90,0,0]),distance:a.react(1)})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);class Go extends Ee{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var l;if(!((l=this.positions)!=null&&l.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",Ee.baseImageUrl+"add.png"],["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let c of this.editingPoints)c.menuPoi.commands=[["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]];const n=a.geoDistance(this.startPosition,this.endPosition);if(Math.abs(n)<=0)return this.rotation=[90,0,0],this.distance=1;const o=a.geoHeading(this.startPosition,this.endPosition),s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/n)*180/Math.PI;this.rotation=[o,r,0],this.distance=Math.hypot(n,s)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ee.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),distance:a.react(0)})})(Go||(Go={})),a.extendClassProps(Go.prototype,Go.createDefaultProps);class PC extends Ye{constructor(i){super(i),this.loop=!1,this.polylineShow=!1}}class bC extends Ee{constructor(i){super(i),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class or extends Ye{constructor(i){super(i),i.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(i){const e=this.ad(new fi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ye.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(or||(or={})),a.extendClassProps(or.prototype,or.createDefaultProps);class sr extends Ee{constructor(i){if(super(i),!!i.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(i){const e=this.ad(new fi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ee.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(sr||(sr={})),a.extendClassProps(sr.prototype,sr.createDefaultProps);class SC extends Go{constructor(i){super(i),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class Pt extends a.EngineObject{constructor(e,n,o){super(e,n,o??!0);m(this,"_currentEditing",this.disposeVar(a.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var s;if(this.currentEditing)if(this.currentEditing instanceof Ye&&((s=this.currentEditing.currentProcess)!=null&&s.isRunning)){if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}}else this.currentEditing instanceof Oi&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Jl=class Jl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new Oi(e));if(this.ad(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)==2&&(n.enabled=!0)})),Reflect.has(i,"position")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),n.enabled=!n.position||a.equalsN3(n.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${i.typeName} 坐标属性无法绑定位置编辑`)}};m(Jl,"type",Jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Place,Jl));let cg=Jl;const jl=class jl extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wi(e));if(n.rotation=[90,0,0],this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),i instanceof a.ES3DTileset)a.engineObjectCreatedUpdate(this,i,()=>{const o=e.getEngineObject(i);o&&(this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"])),this.ad(a.bind([n,"selfRotation"],[i,"rotation"])))});else if(Reflect.has(i,"position")&&Reflect.has(i,"rotation")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${i.typeName} 旋转属性无法绑定旋转编辑`)}};m(jl,"type",jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Rotation,jl));let hg=jl;const ec=class ec extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new rn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")&&Reflect.has(i,"scale")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${i.typeName} 缩放属性无法绑定缩放编辑`)}};m(ec,"type",ec.registerEditing("ESCesiumViewer",a.ESJEditingMode.Scale,ec));let ug=ec;const tc=class tc extends Pt{constructor(i,e){super(Array.isArray(i)?i[0]:i,e,!0);const n=this.currentEditing=this.ad(new sn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++){const r=i[s];Reflect.has(r,"position")?o.push(r.position):r.points&&o.push(...r.points)}n.position=a.getMinMaxCorner(o).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(!(!s||!r)){var l=Dt({originPosition:r},[s])[0][0];i.forEach(c=>{const u=c;if(Reflect.has(c,"position")){const d=Dt({originPosition:r},[u.position])[0][0];u.position=Cn({originPosition:r},[[d[0]+l[0],d[1]+l[1],d[2]+l[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const d=Dt({originPosition:r},u.points)[0];u.points=Cn({originPosition:r},d.map(p=>[p[0]+l[0],p[1]+l[1],p[2]+l[2]]))[0]}})}}))}else if(Reflect.has(i,"position"))this.ad(a.bind([n,"position"],[i,"position"]));else if(i instanceof a.ES3DTileset)a.engineObjectCreatedUpdate(this,i,()=>{const o=e.getEngineObject(i);this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(i,"points")){const o=i;if(o.points===void 0||o.points.length===0){this.destroy();return}n.position=a.getMinMaxCorner(o.points).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(s===void 0||r===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var l=Dt({originPosition:r},[s])[0][0];const c=Dt({originPosition:r},o.points)[0];o.points=Cn({originPosition:r},c.map(u=>[u[0]+l[0],u[1]+l[1],u[2]+l[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${i.typeName} 坐标属性无法绑定平移编辑`)}};m(tc,"type",tc.registerEditing("ESCesiumViewer",a.ESJEditingMode.Translation,tc));let Hh=tc;const ic=class ic extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new nr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")){const o=i;if(this.ad(a.bind([n,"startPosition"],[o,"position"])),this.ad(je([n,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(a.bind([n,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(a.bind([n,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(a.bind([n,"distance"],[o,"distance"]));else{const s=Se(o.position);if(h.Cartesian3.ZERO.equals(s)||!e.viewer)return;n.distance=Ui(e.viewer.scene,s,100)??1}}else if(Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${i.typeName} 坐标属性无法绑定双点追加编辑`);n.startPosition&&!a.equalsN3(n.startPosition,[0,0,0])&&n.init(),n.enabled=!0}};m(ic,"type",ic.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsAppend,ic));let dg=ic;const nc=class nc extends Pt{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new Go(e));if(Reflect.has(i,"position")){const s=i;if(this.ad(a.bind([n,"startPosition"],[s,"position"])),this.ad(je([n,"rotation"],[s,"rotation"])),Reflect.has(s,"far"))this.ad(a.bind([n,"distance"],[s,"far"]));else if(Reflect.has(s,"radius"))this.ad(a.bind([n,"distance"],[s,"radius"]));else if(Reflect.has(s,"distance"))this.ad(a.bind([n,"distance"],[s,"distance"]));else{const r=Se(s.position);if(h.Cartesian3.ZERO.equals(r)||!e.viewer)return;n.distance=Ui(e.viewer.scene,r,100)??1}}else if(Reflect.has(i,"points")){const s=i;if(s.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.moveWithFirstPosition=!1;const r=()=>n.positions=s.points??[];r(),this.ad(s.pointsChanged.don(()=>!n.enabled&&r())),this.ad(a.track([s,"points"],[n,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};m(nc,"type",nc.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsModify,nc));let pg=nc;const oc=class oc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wC(e));this.ad(n.enabledChanged.don(s=>{!s&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))}));const o=i;if(Reflect.has(o,"points")){const s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};m(oc,"type",oc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularAppend,oc));let fg=oc;const sc=class sc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new _C(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${i.typeName} 坐标属性无法绑定环形插值编辑`)}};m(sc,"type",sc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularInsert,sc));let gg=sc;const rc=class rc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${i.typeName} 坐标属性无法绑定线段追加编辑`)}};m(rc,"type",rc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringAppend,rc));let mg=rc;const ac=class ac extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new CC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${i.typeName} 坐标属性无法绑定线段插入编辑`)}};m(ac,"type",ac.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringInsert,ac));let vg=ac;const lc=class lc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new PC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${i.typeName} 坐标属性无法绑定散点追加编辑`)}};m(lc,"type",lc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterAppend,lc));let yg=lc;const cc=class cc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new bC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${i.typeName} 坐标属性无法绑定散点修改编辑`)}};m(cc,"type",cc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterModify,cc));let wg=cc;const hc=class hc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new or(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${i.typeName} 坐标属性无法绑定可见性追加编辑`)}};m(hc,"type",hc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityAppend,hc));let Cg=hc;const uc=class uc extends Pt{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new sr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${i.typeName} 坐标属性无法绑定可见性修改编辑`)}};m(uc,"type",uc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityModify,uc));let _g=uc;const dc=class dc extends Pt{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new SC(e));if(Reflect.has(i,"points")){const s=i,r=Reflect.has(s,"extrudedHeight"),l=Reflect.has(s,"height"),c=Reflect.has(s,"perPositionHeight")?s.perPositionHeight:!r,u=[a.ESClassification,a.ESPolygonFence,a.ESSunshineAnalysis].some(v=>s instanceof v);let d=a.getMinMaxCorner(s.points).center;d[2]=s.points[0][2];let p=[...d],f=u?s.points[0][2]:0;c?r?p[2]=s.extrudedHeight:p[2]=s.height+f:(l&&(d[2]=s.height),r&&(p[2]=s.extrudedHeight)),n.startPosition=d,n.distance=p[2]-d[2],n.moveWithFirstPosition=!1;let g=[...d];this.ad(n.positionsChanged.don(()=>{n.positions.length===2&&(c?(s.points=s.points.map(v=>[v[0],v[1],v[2]+n.positions[0][2]-g[2]]),r?s.extrudedHeight=n.positions[1][2]:l&&(s.height=n.positions[1][2]-(u?n.positions[0][2]:0))):(l&&(s.height=n.positions[0][2]),r&&(s.extrudedHeight=n.positions[1][2])),g=[...n.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${i.typeName} 坐标属性无法绑定高度修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};m(dc,"type",dc.registerEditing("ESCesiumViewer",a.ESJEditingMode.HeightModify,dc));let Pg=dc;const at=class at extends a.Destroyable{constructor(e,n,o,s=!0){super();m(this,"editingModes",[]);m(this,"editingID");m(this,"useKeyToSwitch");m(this,"currentIndex",0);m(this,"currentEditingMode");m(this,"currentEditingWrapper");m(this,"_notSupportedEditCount",this.disposeVar(a.react(0)));m(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&a.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=n;const r=(Array.isArray(o)?o:[o]).filter(l=>n.supportEditingModes().includes(l));if(this.editingModes=r,this.editingID=n.editingID,this.useKeyToSwitch=s,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",r);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,n){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:n})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(at.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===at.KEY_ESCAPE&&at.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var n;return((n=e.pointerEvent)==null?void 0:n.button)===at.MOUSE_LEFT&&a.nextAnimateFrame(()=>{at.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===at.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&at.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const n=a.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!n){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new n(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(n){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,n),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,n,o,s=!0){at.stop(),at.esEditModeInstance=new at(e,n,o,s)}static stop(){const e=at.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:n,sceneObject:o,editingID:s,editingModes:r}=e;e.destroy(),n.editingEvent.emit({objectIDs:[o.parentID],editingID:s,type:"end",add:{modes:r}})}at.esEditModeInstance=void 0}};m(at,"KEY_ESCAPE","Escape"),m(at,"KEY_SPACE","Space"),m(at,"MOUSE_LEFT",0),m(at,"esEditModeInstance");let $h=at;function xC(){const t=a.createProcessingFromAsyncFunc(async(i,e,n,o)=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"start"});const s=()=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};i.disposer.ad(s);const r=c=>{c.code=="Escape"&&s()};i.disposer.ad(e.keyDownEvent.don(r));const l=new Hh(n,e);i.disposer.ad(()=>{!l.isDestroyed()&&l.destroy()}),await i.promise(new Promise(c=>{l.isDestroyed()&&c(),i.disposer.ad(l.toDestroyEvent.don(()=>{console.log("移动结束"),c()})),i.disposer.ad(e.dblclickEvent.don(()=>c()))}))});return t}class xF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,a.engineObjectCreatedUpdate(this,e,()=>{let n;const o=i.getEngineObject(e);e instanceof a.ESBoxClipping&&(n=o.czmBoxClippingPlanes),!(!n||!("computedClippingPlanes"in n)||!("computedClippingPlanesChanged"in n))&&(this.dispose(a.track([this._czmViewer,"sceneGlobeClippingPlanes"],[n,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class AF extends a.Destroyable{constructor(e){super();m(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new a.ESSceneObjectWithId));this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new a.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:n}=this._clippingPlanesSceneObjectWithId;if(n)return new xF(e,n)}))}}class EF extends a.Destroyable{constructor(i){super(),this.dv(new a.ObjResettingWithEvent(i.sceneGlobeClippingPolygonsIdChanged,(e,n)=>{if(!(!e||e===n||e&&e.length===0))return new TF(i)}))}}class TF extends a.Destroyable{constructor(i){super(),this._czmViewer=i,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,n=o=>{if(!o)return;const s=this.dv(a.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{if(o)return new IF(i,o)}))};for(let o=0;o<e.length;o++){const s=e[o],r=a.ESSceneObject.getSceneObjById(s);if(!r)return;let l;r instanceof a.ESExcavate?a.engineObjectCreatedUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,n(l)}):r instanceof a.ESHole&&a.engineObjectCreatedUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,n(l)})}}}class IF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(n&&n.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);if(!c)return;let u;if(c instanceof a.ESExcavate?u=i.getEngineObject(c).czmPolygonClipping:c instanceof a.ESHole&&(u=i.getEngineObject(c.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[r]={positions:u.positions},s.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=s}}}class MF extends a.Destroyable{constructor(i,e){var r;super(),this._viewer=i;const n=(r=this._viewer.extensions)==null?void 0:r.pickingManager;if(!n)return;const{objectsToExclude:o}=n,s=Array.isArray(e)?[...e]:[e];for(const l of s){if(o.includes(l))throw new Error("objectsToExclude.includes(p)");o.push(l)}this.dispose(()=>{for(let l of s){const c=o.indexOf(l);if(c===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(c,1)}})}}class DF extends a.Destroyable{constructor(e){var r;super();m(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new xo(e)),this._czmGlobeMaterial.show=!0;let n=Object.assign({},Me.defaults.terrainShader,this._czmViewer.terrainShader),o=(r=this._czmViewer.viewer)==null?void 0:r.scene.preUpdate.addEventListener(()=>{var c;const l=n.elevationContour.show&&(((c=this._czmViewer.getCameraInfo())==null?void 0:c.position[2])??0)<=n.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==l&&(this._czmGlobeMaterial.enableContour=l)});this.d(()=>{o&&o()});const s=()=>{n=Object.assign({},Me.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",n.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),n.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),n.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=n.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=n.elevationContour.width,this._czmGlobeMaterial.contourColor=n.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:n.elevationRamp.minHeight,maxHeight:n.elevationRamp.maxHeight,color:n.elevationRamp.color}};s(),this.d(this._czmViewer.terrainShaderChanged.don(s))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function RF(t,i){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...i??{}},n=new h.Viewer(t,e);return n.imageryLayers.removeAll(),n.extend(h.viewerCesiumInspectorMixin),n.cesiumInspector.container.style.display="none",n.extend(h.viewerCesium3DTilesInspectorMixin),n.cesium3DTilesInspector.container.style.display="none",n.cesium3DTilesInspector.viewModel.picking=!1,n.clock.currentTime=h.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),n.scene.screenSpaceCameraController.lookEventTypes=[{eventType:h.CameraEventType.RIGHT_DRAG}],n.scene.screenSpaceCameraController.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}],n.scene.screenSpaceCameraController.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_CLICK),n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n._cesiumWidget._creditContainer.style.display="none",n}function FF(){h.Cesium3DTile.prototype.updateTransform=function(t,i){t=t??h.Matrix4.IDENTITY;const e=h.Matrix4.multiplyTransformation(t,this.transform,new h.Matrix4),n=!h.Matrix4.equals(e,this.computedTransform),o=h.defined(i)&&(this._verticalExaggeration!==i.verticalExaggeration||this._verticalExaggerationRelativeHeight!==i.verticalExaggerationRelativeHeight);if(!n&&!o)return;n&&h.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=i.verticalExaggeration,this._verticalExaggerationRelativeHeight=i.verticalExaggerationRelativeHeight);const s=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform),h.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform)),h.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(s.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function zF(){Reflect.getOwnPropertyDescriptor(h.Camera.prototype,"_currentFlight")||Object.defineProperties(h.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var i=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,i)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new h.Event),this._vtxf_currentFlightEvent}}})}function LF(){const t=new h.Matrix4;function i(n,o){const s=n.positionWC;h.Matrix4.clone(n.transform,t),n.lookAtTransform(h.Matrix4.IDENTITY),n.look(s,o),n.lookAtTransform(t)}const e=Math.PI/60;h.Camera.prototype.lookLeft=function(n){n=n??e,this._mode!==h.SceneMode.SCENE2D&&i(this,-n)},h.Camera.prototype.lookRight=function(n){this.lookLeft(-n)}}function NF(){if(!h.DepthPlane.xbsjFixed){h.DepthPlane.xbsjFixed=!0;var t=h.DepthPlane.prototype.update;h.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var i=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=i.context,n=new h.Geometry({attributes:{position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:h.PrimitiveType.TRIANGLES});this._va=h.VertexArray.fromGeometry({context:e,geometry:n,attributeLocations:{position:0},bufferUsage:h.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function OF(t){const i=t.BoundingSphere,e=t.Cartesian3,n=t.defined,o=t.OrientedBoundingBox,s=t.Rectangle,r=t.TaskProcessor,l=t.TerrainData,c=t.TerrainEncoding,u=t.TerrainMesh,d=t.GoogleEarthEnterpriseTerrainData,p="createVerticesFromGoogleEarthEnterpriseBuffer",f=new r(p),g=new r(p,l.maximumAsynchronousTasks),v=new s,y=new s;d.prototype.createMesh=function(w){w=w??we.Frozen.EMPTY_OBJECT;const P=w.tilingScheme,C=w.x,S=w.y,A=w.level,E=w.exaggeration??1,R=w.exaggerationRelativeHeight??0,N=w.throttle??!0,B=P.ellipsoid;P.tileXYToNativeRectangle(C,S,A,v),P.tileXYToRectangle(C,S,A,y);const V=B.cartographicToCartesian(s.center(y));this._skirtHeight=6378137*.3;const z=(N?g:f).scheduleTask({buffer:this._buffer,nativeRectangle:v,rectangle:s.clone(y),relativeToCenter:V,ellipsoid:B,skirtHeight:this._skirtHeight,exaggeration:E,exaggerationRelativeHeight:R,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!n(z))return;const O=this;return z.then(function(_){return O._mesh=new u(V,new Float32Array(_.vertices),new Uint16Array(_.indices),_.indexCountWithoutSkirts,_.vertexCountWithoutSkirts,_.minimumHeight,_.maximumHeight,i.clone(_.boundingSphere3D),e.clone(_.occludeePointInScaledSpace),_.numberOfAttributes,o.clone(_.orientedBoundingBox),c.clone(_.encoding),_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),O._minimumHeight=_.minimumHeight,O._maximumHeight=_.maximumHeight,O._buffer=void 0,O._mesh})}}function BF(){return h.VERSION.split(".").map(i=>parseInt(i))}let bg;function VF(){return bg||(bg=BF()),bg}function WF(){const t=VF();t[0]===1&&t[1]>=92?OF(h):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function GF(){const t=h.Resource.prototype.fetchJson,i=h.Resource.prototype.fetchArrayBuffer;h.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getJson(n)}else return t.call(this,...e)},h.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getArrayBuffer(n).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return i.call(this,...e)}}function UF(){const t=h.ModelSceneGraph.prototype.buildDrawCommands;h.ModelSceneGraph.prototype.buildDrawCommands=function(...i){const e=this._model,n=e.modelMatrix;e.modelMatrix=h.Matrix4.IDENTITY;const o=t.call(this,...i);return e.modelMatrix=n,o}}function HF(){const t=h.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const $F=`#ifdef GL_OES_standard_derivatives
|
|
1926
1926
|
#extension GL_OES_standard_derivatives : enable
|
|
1927
1927
|
#endif
|
|
1928
1928
|
|
|
@@ -2292,10 +2292,10 @@ async function initCesiumViewer(container, czmViewer) {
|
|
|
2292
2292
|
`;function lO(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
|
|
2293
2293
|
github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
|
|
2294
2294
|
gitee地址:${t}
|
|
2295
|
-
`;console.log(e);const n=globalThis.prompt(e,t);n&&globalThis.open(n,"_blank")}const lt=class lt extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",$h);m(this,"_moveObjectsProcess",this.ad(xC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new AF(this)),this.ad(new EF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new DF(this)})),this._viewerLegend=this.dv(new iO(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new zg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new ML(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ke(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],lt.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:jo(e)}}transformFlyParam(e,n){if("position"in n){const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,Se(n.position),new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=n.rotation[0]-d,f=n.rotation[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:f}}else{const o=Se(e);let s={heading:h.Math.toRadians(n.heading),pitch:h.Math.toRadians(n.pitch),roll:0};const r=new h.HeadingPitchRoll;if(n.distance){r.heading=s.heading,r.pitch=s.pitch,r.roll=0,r.heading-=h.Math.PI_OVER_TWO;const c=h.Transforms.headingPitchRollToFixedFrame(o,r,void 0,void 0),u=h.Matrix4.multiplyByPointAsVector(c,h.Cartesian3.UNIT_X,new h.Cartesian3);h.Cartesian3.multiplyByScalar(u,n.distance,u),h.Cartesian3.subtract(o,u,o)}n.hDelta&&(s.heading+=h.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=h.Math.toRadians(n.pDelta));const l=se(o);return l?{position:l,rotation:[h.Math.toDegrees(s.heading),h.Math.toDegrees(s.pitch),h.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=globalThis.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,lt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await xm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Se(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=lt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!lt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=lt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return Cn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Se(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=lt.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",aO,rO,!0),new a.FunctionProperty([],()=>lt.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","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.GroupProperty([],"比例尺","比例尺(Legend)"),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.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","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.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","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.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","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.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","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.GroupProperty([],"Sscc","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.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),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.GroupProperty([],"Bloom","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.GroupProperty([],"调试","调试"),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.GroupProperty([],"Inspector","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)]}}};m(lt,"type",lt.register("ESCesiumViewer",lt)),m(lt,"getCesiumIonToken",lO),m(lt,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(lt,"latestDefaultAccessToken"),m(lt,"ObjectsToExcludeWrapper",MF),m(lt,"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:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(lt,"getHeightsScartchCarto",new h.Cartographic);let Me=lt;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...sO()})})(Me||(Me={})),a.extendClassProps(Me.prototype,Me.createDefaultProps),I.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.0",e="2025-12-02T07:57:08.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="04ee2f70959c3a59f42078725bbaf6060780e4f4",l=((Date.now()-1764662228e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2295
|
+
`;console.log(e);const n=globalThis.prompt(e,t);n&&globalThis.open(n,"_blank")}const lt=class lt extends a.ESViewer{constructor(e){super(e);m(this,"_disabledInputStack",this.disposeVar(a.react(0)));m(this,"_viewer",this.dv(a.react(void 0)));m(this,"_viewerInstance");m(this,"_viewerLegend");m(this,"pickCustomAttachedInfo");m(this,"_fps",this.dv(a.react(0)));m(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));m(this,"_editingSystem",$h);m(this,"_moveObjectsProcess",this.ad(xC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new AF(this)),this.ad(new EF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new DF(this)})),this._viewerLegend=this.dv(new iO(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new zg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new ML(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&Ke(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],lt.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Er(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Er(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Er(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Ht(e),rotation:jo(e)}}transformFlyParam(e,n){if("position"in n){const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,Se(n.position),new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=n.rotation[0]-d,f=n.rotation[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:n.flyDuration??1,hDelta:p,pDelta:f}}else{const o=Se(e);let s={heading:h.Math.toRadians(n.heading),pitch:h.Math.toRadians(n.pitch),roll:0};const r=new h.HeadingPitchRoll;if(n.distance){r.heading=s.heading,r.pitch=s.pitch,r.roll=0,r.heading-=h.Math.PI_OVER_TWO;const c=h.Transforms.headingPitchRollToFixedFrame(o,r,void 0,void 0),u=h.Matrix4.multiplyByPointAsVector(c,h.Cartesian3.UNIT_X,new h.Cartesian3);h.Cartesian3.multiplyByScalar(u,n.distance,u),h.Cartesian3.subtract(o,u,o)}n.hDelta&&(s.heading+=h.Math.toRadians(n.hDelta)),n.pDelta&&(s.pitch+=h.Math.toRadians(n.pDelta));const l=se(o);return l?{position:l,rotation:[h.Math.toDegrees(s.heading),h.Math.toDegrees(s.pitch),h.Math.toDegrees(s.roll)],flyDuration:n.flyDuration??1}:void 0}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=globalThis.g_XE3CopyRights??{};return e.cesium={version:h.VERSION},e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,lt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await xm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Se(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=lt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!lt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=lt.latestDefaultAccessToken}positionsToLocalPositions(e,n){return Dt(e,n)}localPositionsToPositions(e,n){return Cn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=e instanceof h.Cartesian3?e:Se(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=lt.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",aO,rO,!0),new a.FunctionProperty([],()=>lt.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","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.GroupProperty([],"比例尺","比例尺(Legend)"),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.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","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.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","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.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","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.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","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.GroupProperty([],"Sscc","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.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),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.GroupProperty([],"Bloom","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.GroupProperty([],"调试","调试"),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.GroupProperty([],"Inspector","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)]}}};m(lt,"type",lt.register("ESCesiumViewer",lt)),m(lt,"getCesiumIonToken",lO),m(lt,"currentDefaultAccessToken",h.Ion.defaultAccessToken),m(lt,"latestDefaultAccessToken"),m(lt,"ObjectsToExcludeWrapper",MF),m(lt,"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:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),m(lt,"getHeightsScartchCarto",new h.Cartographic);let Me=lt;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...sO()})})(Me||(Me={})),a.extendClassProps(Me.prototype,Me.createDefaultProps),I.copyright=void 0;try{const t="earthsdk3-cesium",i="3.6.1",e="2025-12-04T02:08:23.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="b951704c9cc2a53b6d53468e08f41aec0794d4c0",l=((Date.now()-1764814103e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
|
|
2296
2296
|
%c${o?o+`
|
|
2297
2297
|
`:""}当前网站正在使用${t},此软件版权归${n}所有
|
|
2298
|
-
`;I.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
2298
|
+
`;I.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","b951704c9cc2a53b6d53468e08f41aec0794d4c0")},get info(){return c},get date(){return"2025-12-04T02:08:23.000Z"},get author(){return"suplyang"},get version(){return"3.6.1"},get name(){return"earthsdk3-cesium"},get commitId(){return"b951704c9cc2a53b6d53468e08f41aec0794d4c0"},print(){console.info(this.info,`
|
|
2299
2299
|
font-size: 18px;
|
|
2300
2300
|
font-weight: 1000;
|
|
2301
2301
|
line-height: 1;
|