earthsdk3 3.3.0 → 3.3.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.iife.js +2 -2
- package/dist/earthsdk3.js +2 -2
- package/dist/earthsdk3.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/earthsdk3.iife.js
CHANGED
|
@@ -534,10 +534,10 @@ ${K0}
|
|
|
534
534
|
`,Q0=Date.now();new Date(Q0).toISOString(),new Date(Q0+864e5).toISOString();const Ge=class Ge extends ft{constructor(e){super(e);p(this,"_flyToEvent",this.disposeVar(new d.Event));p(this,"_resetClockEvent",this.disposeVar(new d.Event))}get typeName(){return"ESCzml"}get defaultProps(){return Ge.createDefaultProps()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new Y("数据","数据",!0,!1,[this,"data"],Ge.defaults.data,Ge.defaults.dataMd),new Y("路径","路径",!1,!1,[this,"uri"],""),new U("启用","启用",!1,!1,[this,"clockEnabled"],!1),new C("倍速","倍速.",!1,!1,[this,"multiplier"],Ge.defaults.multiplier),new U("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"],!0),new Gi("开始时间","开始时间",!0,!1,[this,"startTime"],Ge.defaults.startTime),new Gi("结束时间","结束时间",!0,!1,[this,"stopTime"],Ge.defaults.stopTime),new Gi("当前时间","当前时间",!0,!1,[this,"currentTime"],Ge.defaults.currentTime),new tt("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"SYSTEM_CLOCK_MULTIPLIER"),new tt("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"UNBOUNDED"),new U("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"],!1)],general:[...e.general,new nt("唯一标识","id",!1,!0,[this,"id"]),new nt("名称","name",!0,!1,[this,"name"]),new U("是否显示","show",!1,!1,[this,"show"],!0),new U("开启碰撞","collision",!1,!1,[this,"collision"],!1),new U("允许拾取","allowPicking",!1,!1,[this,"allowPicking"],!1)]}}getProperties(e){return[...super.getProperties(e),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new U("允许拾取","是否允许拾取",!1,!1,[this,"allowPicking"]),new mt("飞入","飞入",["number"],n=>this.flyTo(n),[1e3]),new Y("数据","数据",!0,!1,[this,"data"],Ge.defaults.data,Ge.defaults.dataMd),new Y("路径","路径",!1,!1,[this,"uri"]),new U("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"]),new mt("重设时钟","根据当前加载的数据重设始终",[],()=>this.resetClock(),[]),new Fi("loadFnStr","loadFnStr",!0,!1,[this,"loadFuncStr"],Ge.defaults.defaultLoadFuncStr,Ge.defaults.defaultLoadFuncDocStr)]),new H("时钟","时钟",[new U("启用","启用",!1,!1,[this,"clockEnabled"]),new Gi("开始时间","开始时间",!0,!1,[this,"startTime"],Ge.defaults.startTime),new Gi("结束时间","结束时间",!0,!1,[this,"stopTime"],Ge.defaults.stopTime),new Gi("当前时间","当前时间",!0,!1,[this,"currentTime"],Ge.defaults.currentTime),new C("倍速","倍速.",!1,!1,[this,"multiplier"],Ge.defaults.multiplier),new tt("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]]),new tt("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]]),new U("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"])])]}};p(Ge,"type",Ge.register("ESCzml",Ge,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"})),p(Ge,"defaults",{...ft.defaults,show:!0,allowPicking:!0,data:pI,dataMd:gI,autoResetClock:!0,clockEnabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+864e5,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:K0,defaultLoadFuncDocStr:mI});let ul=Ge;(r=>{r.createDefaultProps=()=>({show:!0,uri:"",allowPicking:!1,data:d.reactJsonWithUndefined(void 0),autoResetClock:!0,clockEnabled:!1,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...ft.createDefaultProps()})})(ul||(ul={})),d.extendClassProps(ul.prototype,ul.createDefaultProps);const Gl=class Gl extends ft{get typeName(){return"ESNavigator"}get defaultProps(){return Gl.createDefaultProps()}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new C("尺寸","尺寸",!1,!1,[this,"cssSize"]),new se("位置","位置(top,right)",!1,!1,[this,"cssPosition"]),new ku("图片地址","图片地址",!1,!1,[this,"imgUrl"])])]}};p(Gl,"type",Gl.register("ESNavigator",Gl,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"})),p(Gl,"defaults",{...ft.defaults,show:!0,cssPosition:[170,30],cssSize:100,imgUrl:ft.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")});let hl=Gl;(r=>{r.createDefaultProps=()=>({...ft.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:r.defaults.imgUrl})})(hl||(hl={})),d.extendClassProps(hl.prototype,hl.createDefaultProps);const Li=class Li extends ft{get typeName(){return"ESViewerStatusBar"}get defaultProps(){return Li.createDefaultProps()}constructor(t){super(t)}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],Li.defaults.show),new C("高度","height",!0,!1,[this,"height"],Li.defaults.height),new C("文字大小","fontSize",!0,!1,[this,"fontSize"],Li.defaults.fontSize),new it("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],Li.defaults.bgColor)])]}};p(Li,"type",Li.register("ESViewerStatusBar",Li,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),p(Li,"defaults",{...ft.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let cl=Li;(r=>{r.createDefaultProps=()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:d.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})})(cl||(cl={})),d.extendClassProps(cl.prototype,cl.createDefaultProps);const Ri=class Ri extends ft{get typeName(){return"ESViewerStatusBarScale"}get defaultProps(){return Ri.createDefaultProps()}constructor(t){super(t)}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new U("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],Ri.defaults.show),new C("高度","height",!0,!1,[this,"height"],Ri.defaults.height),new C("文字大小","fontSize",!0,!1,[this,"fontSize"],Ri.defaults.fontSize),new it("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],Ri.defaults.bgColor)])]}};p(Ri,"type",Ri.register("ESViewerStatusBarScale",Ri,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),p(Ri,"defaults",{...ft.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let fl=Ri;(r=>{r.createDefaultProps=()=>({...ft.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:d.reactArray([.2784313725490196,.2784313725490196,.2784313725490196,.8])})})(fl||(fl={})),d.extendClassProps(fl.prototype,fl.createDefaultProps);const kl=class kl extends ${get typeName(){return"ESGaussianSplatting"}get defaultProps(){return kl.createDefaultProps()}constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new nt("路径","url",!0,!1,[this,"url"]),new C("进度","progress",!1,!0,[this,"progress"],0)]}}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new nt("路径","url",!0,!1,[this,"url"]),new C("进度","progress",!1,!0,[this,"progress"],0)])]}};p(kl,"type",kl.register("ESGaussianSplatting",kl,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"})),p(kl,"defaults",{...$.defaults});let dl=kl;(r=>{r.createDefaultProps=()=>({...$.createDefaultProps(),url:"",progress:0})})(dl||(dl={})),d.extendClassProps(dl.prototype,dl.createDefaultProps);const Xs=class Xs extends ${get typeName(){return"ESStaticMesh"}get defaultProps(){return Xs.createDefaultProps()}constructor(t){super(t)}getESProperties(){const t={...super.getESProperties()},e=[new nt("mesh地址","mesh地址",!1,!1,[this,"mesh"],Xs.defaults.mesh)];return t.basic.push(...e),t}getProperties(t){return[...super.getProperties(t),new H("ESStaticMesh","ESStaticMesh",[new nt("mesh地址","mesh地址",!1,!1,[this,"mesh"],Xs.defaults.mesh)])]}};p(Xs,"type",Xs.register("ESStaticMesh",Xs,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"})),p(Xs,"defaults",{...$.defaults,mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"});let pl=Xs;(r=>{r.createDefaultProps=()=>({...$.createDefaultProps(),mesh:""})})(pl||(pl={})),d.extendClassProps(pl.prototype,pl.createDefaultProps);const zl=class zl extends Et{constructor(e){super(e);p(this,"_startEvent",this.dv(new d.Event));p(this,"_clearEvent",this.dv(new d.Event));p(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new Os),this._eSGeoExtrudedPolygon.parentID=this.id,this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(d.track([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(d.track([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get typeName(){return"ESSkylineAnalysis"}get defaultProps(){return zl.createDefaultProps()}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new mt("开始分析","开始分析",[],()=>this.start(),[]),new mt("清除分析","清除分析",[],()=>this.clear(),[]),new Y("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new Y("深度值","depths",!1,!0,[this,"depths"]),new C("半径","半径",!0,!1,[this,"radius"],1e4)]}}getProperties(e){return[...super.getProperties(e),new H("通用","通用",[new mt("开始分析","开始分析",[],()=>this.start(),[]),new mt("清除分析","清除分析",[],()=>this.clear(),[]),new Y("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new Y("深度值","depths",!1,!0,[this,"depths"]),new C("半径","半径",!0,!1,[this,"radius"],1e4)])]}};p(zl,"type",zl.register("ESSkylineAnalysis",zl,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"})),p(zl,"defaults",{...Et.defaults,windowPositions:[],depths:[],radius:1e4});let gl=zl;(r=>{r.createDefaultProps=()=>({...Et.createDefaultProps(),windowPositions:gf(void 0),depths:d.reactArrayWithUndefined(void 0),radius:d.react(void 0)})})(gl||(gl={})),d.extendClassProps(gl.prototype,gl.createDefaultProps);const Rn=class Rn extends Ot{get typeName(){return"ESHeatMap"}get defaultProps(){return Rn.createDefaultProps()}constructor(t){super(t)}getESProperties(){const t=super.getESProperties();return{...t,basic:[...t.basic,new Y("data","数据",!0,!1,[this,"data"]),new Y("gradient","渐变",!0,!1,[this,"gradient"],Rn.defaults.gradient),new C("radius","半径",!0,!1,[this,"radius"],Rn.defaults.radius),new C("blur","模糊",!0,!1,[this,"blur"],Rn.defaults.blur),new U("is3D","3D",!0,!1,[this,"is3D"])]}}getProperties(t){return[...super.getProperties(t),new H("通用","通用",[new Y("data","数据",!0,!1,[this,"data"]),new Y("gradient","渐变",!0,!1,[this,"gradient"],Rn.defaults.gradient),new C("radius","半径",!0,!1,[this,"radius"],Rn.defaults.radius),new C("blur","模糊",!0,!1,[this,"blur"],Rn.defaults.blur),new U("is3D","3D",!0,!1,[this,"is3D"])])]}};p(Rn,"type",Rn.register("ESHeatMap",Rn,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"})),p(Rn,"defaults",{...Ot.defaults,is3D:!1,data:[],radius:10,gradient:{".5":"green",".7":"yellow",".95":"red"},blur:.85});let ml=Rn;(r=>{r.createDefaultProps=()=>({...Ot.createDefaultProps(),is3D:d.react(void 0),data:d.reactPositions(void 0),gradient:d.reactJsonWithUndefined(void 0),radius:d.react(void 0),blur:d.react(void 0)})})(ml||(ml={})),d.extendClassProps(ml.prototype,ml.createDefaultProps);function B0(r){return typeof r=="string"?document.getElementById(r):r}function Ud(r){if(!r)throw new Error("container is not defined");r.innerHTML="";const t=document.createElement("div");return t.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",r.appendChild(t),t}class Z0 extends d.Destroyable{constructor(e,n){super();p(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=e,this._createSceneObjectListeningFunc=n;const i=this._listeningSceneObjects,s=(a,o)=>{if(a)for(let l of a){const u=i.get(l);u&&(u.destroy(),i.delete(l))}if(o)for(let l of o){if(i.get(l)){console.warn(`listeningSceneObjects已存在某对象:${l.name}`,l);debugger}const c=this.createSceneObjectListeningFunc(l);c&&i.set(l,c)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let a of this._listeningSceneObjects.values())a.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class vI extends d.Destroyable{constructor(t){super(),this._esObjectsManager=t;{const e=this._esObjectsManager;class n extends d.Destroyable{constructor(s){super(),this._esPath=s,this.dv(new d.ObjResettingWithEvent(e.activeViewerChanged,()=>{const a=e.activeViewer;if(!a)return;class o extends d.Destroyable{constructor(u){if(super(),this._esPath=u,!a)throw new Error("!viewer");const c=()=>{const h=e.activeViewer;h&&(this._esPath.path.currentTime=h.simulationTime)};c(),this.d(a.simulationTimeChanged.don(c))}}return new o(this._esPath)}))}}this.dv(new Z0(e.sceneObjectsManager,i=>{if(i instanceof Ls)return new n(i)}))}{const e=this._esObjectsManager;class n extends d.Destroyable{constructor(s){super();const a=()=>{const o=e.activeViewer;o&&(o.simulationTime=s.currentTime??0)};a(),this.d(s.currentTimeChanged.don(a))}}this.dv(new Z0(e.sceneObjectsManager,i=>{if(i instanceof As)return new n(i)}))}}}class yI extends d.Destroyable{constructor(t){super(),t.forEach(e=>{this.d(e.path.currentPositionChanged.don(n=>{n&&e.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...n])})})),this.d(e.path.currentRotationChanged.don(n=>{n&&e.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...n])})}))})}}class _I extends d.Destroyable{constructor(e){super();p(this,"_player");p(this,"_channels",this.dv(d.reactArray([])));this._objectManager=e,this._player=this._objectManager.player,this.dv(new d.ObjResettingWithEvent(this.channelsChanged,()=>{if(this.channels.length===0)return;const n=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],a=ft.getSceneObjById(s.pathId);if(!a||!(a instanceof Ls))continue;const l=s.sceneObjectIds.map(u=>ft.getSceneObjById(u)).filter(u=>u!==void 0);l.length!==0&&n.push({path:a,sceneObjects:l})}if(n.length!==0)return new yI(n)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(e){this._channels.value=e}}function $c(r){if(r.data){const{type:t,value:e}=r.data;if(t==="UITreeA"&&e instanceof Or){const{sceneObject:n}=e;if(n)return n.id}}}function wI(r,t){const{property:e,customEventName:n,otherParams:i}=t,{dragstartDataMananger:s}=r;if(!(e instanceof li)){if(!(e instanceof sp)){if(e instanceof nt){const[a,o]=d.getReactFuncs(e.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const l=i[0];if(l.preventDefault(),!l.dataTransfer)return;$c(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const u=$c(s);u!==void 0&&o(u)}}else if(e instanceof tp){const[a,o]=d.getReactFuncs(e.reactVar);if(n==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const l=i[0];if(l.preventDefault(),!l.dataTransfer)return;$c(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(n==="ondrop"){if(!i)throw new Error("!otherParams");const l=i[0].$event,u=i[0].strinsPropDom,c=i[0].index;l.preventDefault();const h=$c(s);if(h!==void 0){u[c].firstChild.value=h;const f=new Event("input",{bubbles:!0,cancelable:!0});u[c].firstChild.dispatchEvent(f)}}}else if(e instanceof ep){const[a,o]=d.getReactFuncs(e.reactVar)}}}}function $0(r,t,e,n){if(e)n.currentActiveEditing=[r,t];else if(n.currentActiveEditing){const[i,s]=n.currentActiveEditing;i===r&&s===t&&(e||(n.currentActiveEditing=void 0))}}const EI=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class SI extends d.Destroyable{constructor(t,e){super(),this._sceneObject=t;const n=this._sceneObject;for(let i of EI){const s=i+"Changed",a=n[s];if(a){{const o=n[i];$0(n,i,o,e)}this.dispose(a.disposableOn(o=>$0(n,i,o,e)))}}}get sceneObject(){return this._sceneObject}}class PI extends d.Destroyable{constructor(){super();p(this,"_currentActiveEditing",this.disposeVar(d.reactArrayWithUndefined(void 0)));p(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((e,n)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),n){const[i,s]=n;i[s]===!0&&(i[s]=!1)}if(e){const[i,s]=e;i[s]=!0}})),ft.context.sceneObjCreatedEvent.don(e=>{e.dv(new SI(e,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(e){this._currentActiveEditing.value=e}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class CI extends d.Destroyable{constructor(){super();p(this,"_sceneObjects",new Set);p(this,"_sceneObjectsToChange",this.dv(new d.Event));this.d(()=>{const e=d.length(this._sceneObjects);e!==0&&console.warn(`场景对象管理器销毁时仍然管理着${e}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(e){if(this._sceneObjects.has(e))return console.warn(`创建失败:对象${e.typeName+":"+e.id}已经存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([],[e]),this._sceneObjects.add(e);while(!1);return!0}deleteSceneObject(e){if(!this._sceneObjects.has(e))return console.warn(`删除失败:对象${e.typeName+":"+e.id}不存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([e],[]),this._sceneObjects.delete(e);while(!1);return!0}createSceneObject(e,n){const i=ft.context.createSceneObject(e,n);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(e,n){const i=ft.context.createSceneObjectFromClass(e,n);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(e){const n=ft.context.createSceneObjectFromJson(e);return n&&this.addSceneObject(n),n}}function j0(r,t){return r.length===t.length&&r.every((e,n)=>e===t[n])}class II extends d.Destroyable{constructor(t){super(),this._viewer=t,this.d(d.track([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class MI extends d.Destroyable{constructor(t,e){super(),this._viewer=t,this._activeViewer=e;const n=Di.createCommonProps(),i=[];Object.keys(n).forEach(l=>{const u=this._activeViewer[l+"Changed"];i.push(u)});const s=this.dv(d.createNextAnimateFrameEvent(...i)),a=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(n).forEach(l=>{this._viewer[l]=this._activeViewer[l]})};this.d(s.don(a));const o=this.dv(d.createAnimateFrame());o.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const l=this._activeViewer.getCurrentCameraInfo(),u=this._viewer.getCurrentCameraInfo();if(!l)return;const{position:c,rotation:h}=l;u&&j0(c,u.position)&&j0(h,u.rotation)||this._viewer.flyIn(c,h,0)}),this.d(()=>o.cancel())}}const NI=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
|
|
535
535
|
<animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
|
|
536
536
|
</circle><g></g></g></svg>
|
|
537
|
-
`,bI='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',TI='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Vl=class Vl extends d.Destroyable{constructor(t){super();const e=()=>{const n=this.dv(new wa);this.d(d.track([n,"show"],[t,"useDefaultStatusDiv"]));{const i=()=>{n.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};i(),this.d(t.useDefaultStatusDivChanged.don(i)),this.d(t.statusChanged.don(i)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(n),this.d(()=>t.delete(n)),n.instanceClass=class extends d.Destroyable{constructor(a,o,l){super();p(this,"_div",document.createElement("div"));if(this._subContainer=a,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const m=()=>{o.show?this._div.style.opacity="1":this._div.style.opacity="0"};m(),this.d(o.showChanged.don(m))}let u,c,h,f,g;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",c=document.createElement("div"),u.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Vl.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.marginLeft="10px",h.style.display="flex",h.style.flexFlow="column",h.style.maxWidth="300px",f=document.createElement("div"),h.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",g=document.createElement("div"),h.appendChild(g),g.style.fontWeight="400",g.style.textShadow="0 0 2px black";{const m=()=>{let E="Raw";l.status==="Raw"?E="初始状态":l.status==="Creating"?E="正在创建":l.status==="Created"?E="创建完成":l.status==="Error"?E="创建失败":l.status==="Reconnecting"&&(E="重新连接"),f.innerText=`${E}(${l.status})`,g.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(c.innerHTML=Vl.defaultsSvg.loadingSvg),l.status==="Created"&&(c.innerHTML=Vl.defaultsSvg.successSvg),l.status==="Error"&&(c.innerHTML=Vl.defaultsSvg.warnSvg)};m();const _=this.dv(d.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(_.don(m))}}update(){const a=255*Math.random()|0,o=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${a}, ${o}, ${l}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};p(Vl,"defaultsSvg",{loadingSvg:NI,successSvg:bI,warnSvg:TI});let qd=Vl;class DI extends d.Destroyable{constructor(t,e,n){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=n;const i=this._subContainer,s=this._overlayContainer,a=this._viewer,o=()=>{const c=a.zIndex??"";i.style.zIndex=c,s.style.zIndex=c};o(),this.d(a.zIndexChanged.don(o));const l=()=>{i.style.display=a.show??!0?"block":"none"};l(),this.d(a.showChanged.don(l));const u=()=>{i.style.opacity=`${a.opacity??1}`};u(),this.d(a.opacityChanged.don(u))}}function jc(r){let t=d.getExtProp(r,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",r.appendChild(t),d.setExtProp(r,"_relativeContainer",t)),t}class xI extends d.Destroyable{constructor(e,n){super();p(this,"_subContainer",document.createElement("div"));p(this,"_overlayContainer",document.createElement("div"));p(this,"_containerStyleController");this._container=e,this._viewer=n,this._containerStyleController=this.dv(new DI(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),jc(this._container).appendChild(i),this.d(()=>jc(this._container).removeChild(i)),jc(this._container).appendChild(s),this.d(()=>jc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class OI extends d.Destroyable{constructor(){super(...arguments);p(this,"registerObjsMap",new Map)}register(e,n){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,n),e}getViewerConstructor(e){const n=this.registerObjsMap.get(e);if(!n){console.warn(`未找到${e}类!`);return}return n}createViewer(e){const n=e.type;console.log(e);const i=this.getViewerConstructor(n);if(!i)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new i(e)}}class tv extends d.Destroyable{constructor(t,e,n=!1,i=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(d.DomElementEvent.create(e,"pointerdown")),a=this.dv(d.DomElementEvent.create(e,"pointermove")),o=this.dv(d.DomElementEvent.create(e,"pointerup")),l=this.dv(d.DomElementEvent.create(e,"pointerout")),u=this.dv(d.DomElementEvent.create(e,"pointerover")),c=this.dv(new d.PointerClick),h=this.dv(new d.PointerHover),f=()=>{const v=this._viewer.hoverTime*1e3;h.delayTime=v};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(v=>c.pointerDown(v))),this.d(a.don(v=>c.pointerMove(v))),this.d(o.don(v=>c.pointerUp(v))),this.d(l.don(v=>c.pointerOut(v))),this.d(s.don(v=>h.pointerDown(v))),this.d(a.don(v=>h.pointerMove(v))),this.d(o.don(v=>h.pointerUp(v))),this.d(l.don(v=>h.pointerOut(v)));const{x:g,y:m}=e.getBoundingClientRect(),_=i?g:0,E=i?m:0;this.d(h.hoverEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.hoverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.clickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.clickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.dbclickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(s.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(o.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(a.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerMoveEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(u.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerOverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(l.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerOutEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})}));const M=this.dv(d.DomElementEvent.create(e,"keydown"));this.d(M.don(v=>this._viewer.keyDownEvent.emit(v)));const y=this.dv(d.DomElementEvent.create(e,"keyup"));this.d(y.don(v=>this._viewer.keyUpEvent.emit(v)));const w=this.dv(d.DomElementEvent.create(e,"wheel"));this.d(w.don(v=>this._viewer.wheelEvent.emit(v)))}}class AI extends d.Destroyable{constructor(e){super();p(this,"viewer");const n=this.viewer=e;this.ad(new d.ObjResettingWithEvent(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new d.Destroyable;this.viewer.splitPosition=.5;let a=this.getRollerShutterDIV();return i.appendChild(a),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(a)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const n=i=>{if(!e.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const a=i.x/e.parentElement.offsetWidth;e.style.left=`${100*a}%`,this.viewer.splitPosition=a};return e.addEventListener("mouseenter",i=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",i=>{e.style.cursor="default"}),e.addEventListener("mousedown",i=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{e.style.cursor="default",document.removeEventListener("mousemove",n)}),e}}class LI extends d.Destroyable{constructor(e){super();p(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new AI(e))}}const fs=class fs extends d.Destroyable{constructor(e){super();p(this,"_forceRecreateEvent",this.dv(new d.Event));p(this,"_container",this.dv(d.react(void 0)));p(this,"_containerSize",this.dv(d.react(void 0)));p(this,"_editingEvent",this.disposeVar(new d.Event));p(this,"_status",this.dv(d.react("Raw")));p(this,"_statusLog",this.dv(d.react("")));p(this,"_statusContainer",this.dv(new qd(this)));p(this,"_useCustomInteraction",this.dv(d.react(!0)));p(this,"_resetInteractionEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));p(this,"_interactionResetting",this.dv(new d.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new tv(this,this.container)})));p(this,"_viewerChanged",this.dv(new d.Event));p(this,"_containerResetEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));p(this,"_containerResetting",this.dv(new d.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new xI(this.container,this)})));p(this,"_sceneObjectsMap",new Map);p(this,"_id");p(this,"_typeName");p(this,"_updateFuncReact",this.dv(d.react(void 0)));p(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));p(this,"_statusInfo",fs.defaults.statusInfo);p(this,"_navigationMode",this.dv(d.react("Map")));p(this,"_syncViewer",this.dv(d.react(void 0)));p(this,"_syncEventDon",this.dv(new d.ObjResettingWithEvent(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new MI(this,e)})));p(this,"_timeSyncdon",this.dv(new d.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new II(this)})));p(this,"_hoverEvent",this.dv(new d.Event));p(this,"_pointerOverEvent",this.dv(new d.Event));p(this,"_pointerMoveEvent",this.dv(new d.Event));p(this,"_pointerDownEvent",this.dv(new d.Event));p(this,"_pointerUpEvent",this.dv(new d.Event));p(this,"_pointerOutEvent",this.dv(new d.Event));p(this,"_clickEvent",this.dv(new d.Event));p(this,"_dblclickEvent",this.dv(new d.Event));p(this,"_keyDownEvent",this.dv(new d.Event));p(this,"_keyUpEvent",this.dv(new d.Event));p(this,"_wheelEvent",this.dv(new d.Event));p(this,"_actived",this.dv(d.react(!1)));this._id=e.id??d.createGuid();const n=B0(e.container);if(n)this._container.value=Ud(n),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const i=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[o,l]of i.entries())if(!l&&o){const u=Oa.context.createEngineObject(o,this);u&&i.set(o,u)}},a=()=>{for(let[o,l]of i.entries())l&&!l.isDestroyed()&&l.destroy(),i.set(o,void 0)};this.d(a),this.d(this.viewerChanged.don(o=>{a(),o&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(a){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${a}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||d.createAnimateFrame(),s.restart(void 0,a=>{this.updateFunc&&this.updateFunc(this,a)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new LI(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const n=document.getElementById(e);n&&n instanceof HTMLDivElement?this._container.value=Ud(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=Ud(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let n of e)if(!this.has(n)){ft.context.addSceneObject(n);const i=Oa.context.createEngineObject(n,this);i&&this._sceneObjectsMap.set(n,i),n.viewerAttached.emit(this)}}delete(...e){for(let n of e)if(this.has(n)){const i=this._sceneObjectsMap.get(n);i&&i.destroy(),ft.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return fs.createDefaultProps()}_getJson(e=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let s,a=this.defaultProps[i];a instanceof d.ReactiveVariable?s=a.equals(this[i]):s=a===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_setJson(e,n,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const a=Object.keys(this.defaultProps).filter(o=>!s.includes(o));for(let o of a)if(o in e)this[o]=e[o]===null?void 0:e[o];else if(!(i??!1)){let l=this.defaultProps[o];l instanceof d.ReactiveVariable&&(l=l.value),this[o]=l}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(n){console.warn(`时间格式不正确! value: ${e} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(e){return[new H("ESViewer","ESViewer",[new mt("强制刷新","重载",[],()=>this.forceRecreate(),[]),new U("debug","debug",!0,!1,[this,"debug"],fs.defaults.debug),new U("是否可见","是否可见",!0,!1,[this,"show"]),new tt("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new U("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new nt("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new C("时钟","时钟",!1,!1,[this,"currentTime"]),new U("globeShow","globeShow",!0,!1,[this,"globeShow"]),new U("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new C("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new C("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new H("Globe","Globe",[new Y("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}};p(fs,"context",new OI),p(fs,"register",fs.context.register.bind(fs.context)),p(fs,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Di=fs;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:d.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:d.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:d.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:d.react(void 0),rollerShutter:!1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(Di||(Di={})),d.extendClassProps(Di.prototype,Di.createDefaultProps);function ev(r,t){const e=r._lastCameraInfo;if(e){const n=t.viewerChanged.don(i=>{if(!i||!e)return;const{position:s,rotation:a}=e;t.flyIn(s,a,0),r._lastCameraInfo=void 0,n()})}}const RI=r=>{const t=Di.createCommonProps(),e={};try{Object.keys(t).forEach(n=>{e[n]=r[n]})}catch(n){console.warn(n)}return e},rv=(r,t)=>{const e=Di.createCommonProps();try{Object.keys(e).forEach(n=>{r[n]=t[n]})}catch(n){console.warn(n)}};class FI extends d.Destroyable{constructor(e){super();p(this,"_viewersChanged",this.disposeVar(new d.Event));p(this,"_viewers",new Set);p(this,"_viewersToChange",this.dv(new d.Event));this._sceneObjectsManager=e,this.d(()=>{for(const n of this._viewers)this.destroyViewer(n);this._viewers.clear()}),this.viewers.forEach(n=>{const i=this._sceneObjectsManager.sceneObjects;n.add(...i)}),this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...n)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((n,i)=>{this.viewers.forEach(s=>{i.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?console.warn(`${s.typeName}中已存${a.typeName},检查逻辑是否有问题!`):s.add(a))}),n.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?s.delete(a):console.warn(`${s.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(a=>{a.has(s)&&a.delete(s),console.log("sceneObjectsToChange",a.devTags,s.devTags,Ds(a.devTags,s.devTags)),Ds(a.devTags,s.devTags)&&(a.has(s)?console.warn(`${a.typeName}中已存${s.typeName},检查逻辑是否有问题!`):a.add(s))})}))})})),this.d(this.viewersChanged.don((n,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?console.warn(`${a.typeName}中已存${o.typeName},检查逻辑是否有问题!`):a.add(o))}),n.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?a.delete(o):console.warn(`${a.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(a=>{a.d(a.devTagsChanged.don(()=>{a.clearAllSceneObjects();const o=this._sceneObjectsManager.sceneObjects;for(let l of o)console.log("viewersChanged",a.devTags,l.devTags,Ds(a.devTags,l.devTags)),Ds(a.devTags,l.devTags)&&(a.has(l)?console.warn(`${a.typeName}中已存${l.typeName},检查逻辑是否有问题!`):a.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const n=Di.context.createViewer(e);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(e){return e.isDestroyed()?!0:(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed())}}class Sa extends d.Destroyable{constructor(...e){super();p(this,"_drgm",this.dv(new d0));p(this,"_sobjm",this.dv(new CI));p(this,"_vrm",this.dv(new FI(this._sobjm)));p(this,"_sceneObjectEditingManager",this.disposeVar(new PI));p(this,"_activeViewer",this.dv(d.react(void 0)));p(this,"_syncOtherViewersToActived",this.dv(d.react(!1)));p(this,"_cmrvm",this.createSceneObjectFromClass(ya));p(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));p(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});p(this,"_sceneTree",this.dv(new Ah("default",this.dragstartDataMananger,24,this)));p(this,"_propUiTreeManager",this.dv(new Du(24)));p(this,"_sceneTreeMap",new Map);p(this,"_viewerCreatedEvent",this.dv(new d.Event));p(this,"_lastCameraInfo");p(this,"_lastActiveViewerJson");p(this,"syncEvent",this.dv(d.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));p(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(n=>{e?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));p(this,"_player",this.createSceneObjectFromClass(As));p(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));p(this,"_esPlyarAndPathTime",this.dv(new vI(this)));p(this,"_pathAnimationManager",this.dv(new _I(this)))}static get envs(){return ft.context.environmentVariables}getSceneObjectById(e){return ft.getSceneObjectById(e)}getSceneObject(e){return ft.getSceneObject(e)}get $refs(){return ft.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var h;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",a={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:i},o=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(f=>f.json),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:a,viewers:u,sceneTree:o,viewCollection:l,lastView:c}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||e.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(n=>{const i=e.viewers.find(s=>s.id===n.id);i&&(n.json=i)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(e){return wI(this,e)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,n=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const i=this.dv(new Ah(e,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(e,i)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const n=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=n);const i=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),i())}));return n}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,n=!0,i=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?RI(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const a=e.id,o=a?[...this.getViewers()].find(c=>c.id===a):[...this.getViewers()].find(c=>c.typeName===e.type);if(o)if(a&&o.typeName!==e.type)console.warn(`id为${a}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(o);else return console.log("ESViewer exists, will be used"),n&&ev(this,o),i&&this._lastActiveViewerJson&&(rv(o,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),o.container===B0(e.container)?(o.containerOrId=e.container,o.forceRecreate()):o.containerOrId=e.container,this.activeViewer=o,o;console.log("No ESViewer exists, will be created");const l=this.createViewer(e);return console.log(e),console.log(this),n&&ev(this,l),i&&this._lastActiveViewerJson&&(rv(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:n,viewSync:i,attributeSync:s,destroy:a,id:o}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:o},i??!0,s??!0,a??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const n={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:s,attributeSync:a,destroy:o,id:l}=n;return this.switchViewer({type:"ESCesiumViewer",container:i,id:l},s,a,o)}}switchToUEViewer(...e){let n,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:l,uri:u,app:c,token:h,viewSync:f,attributeSync:g,destroy:m,id:_}=e[0];n={type:"ESUeViewer",container:l,id:_,options:{uri:u,app:c,token:h}},i={viewSync:f??!0,attributeSync:g??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{ws:u,esmsg:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{project:u,baseUrl:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(n={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(n={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0}},i={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(n={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:a,destroy:o}=i;return this.switchViewer(n,s,a,o)}createCesiumViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?n={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0}}:n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(e,n){return this._sobjm.createSceneObject(e,n)}createSceneObjectFromClass(e,n){return this._sobjm.createSceneObjectFromClass(e,n)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const n=this._sobjm.deleteSceneObject(e);return e.destroy(),n}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let n of e)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}p(Sa,"getSceneObjById",ft.context.getSceneObjectById.bind(ft.context)),p(Sa,"getEnv",ft.context.getEnv.bind(ft.context)),p(Sa,"setEnv",ft.context.setEnv.bind(ft.context)),(r=>{r.createDefaultProps=()=>({})})(Sa||(Sa={})),d.extendClassProps(Sa.prototype,Sa.createDefaultProps);function GI(){const r=navigator.userAgent;let t="Unknown";/Windows/.test(r)?t="Windows":/Macintosh/.test(r)?t="MacOS":/Linux/.test(r)?t="Linux":/Android/.test(r)?t="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?e="x64":/x86|i686|Win32/.test(r)?e="x86":/arm64|aarch64/.test(r)?e="arm64":/arm/.test(r)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const kI=Date.now();function nv(r){const{os:t,arch:e}=GI(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-kI)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},a=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${a}`,s).then(o=>o.text()).then(o=>console.log(o)).catch(o=>console.log("error",o))}N.copyright=void 0;try{const r="earthsdk3",t="3.3.0",e="2025-08-14T09:06:32.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="60921cbcff46cfbed33163bca9f10cb47aa8cd65",o=((Date.now()-1755162392e3)/36e5).toFixed(1),l=`%c🌏 ${r}%c ${t}.${s.slice(0,8)}.${e} (距今${o}个小时)
|
|
537
|
+
`,bI='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',TI='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Vl=class Vl extends d.Destroyable{constructor(t){super();const e=()=>{const n=this.dv(new wa);this.d(d.track([n,"show"],[t,"useDefaultStatusDiv"]));{const i=()=>{n.show=(t.useDefaultStatusDiv??!0)&&t.status!=="Created"};i(),this.d(t.useDefaultStatusDivChanged.don(i)),this.d(t.statusChanged.don(i)),n.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}t.add(n),this.d(()=>t.delete(n)),n.instanceClass=class extends d.Destroyable{constructor(a,o,l){super();p(this,"_div",document.createElement("div"));if(this._subContainer=a,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const m=()=>{o.show?this._div.style.opacity="1":this._div.style.opacity="0"};m(),this.d(o.showChanged.don(m))}let u,c,h,f,g;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",c=document.createElement("div"),u.appendChild(c),c.style.pointerEvents="none",c.style.display="block",c.style.width="40px",c.innerHTML=Vl.defaultsSvg.loadingSvg,c.style.filter="drop-shadow(0px 0px 1px black)",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.marginLeft="10px",h.style.display="flex",h.style.flexFlow="column",h.style.maxWidth="300px",f=document.createElement("div"),h.appendChild(f),f.style.fontSize="14px",f.style.fontWeight="800",f.style.marginBottom="5px",f.style.textShadow="0 0 2px black",g=document.createElement("div"),h.appendChild(g),g.style.fontWeight="400",g.style.textShadow="0 0 2px black";{const m=()=>{let E="Raw";l.status==="Raw"?E="初始状态":l.status==="Creating"?E="正在创建":l.status==="Created"?E="创建完成":l.status==="Error"?E="创建失败":l.status==="Reconnecting"&&(E="重新连接"),f.innerText=`${E}(${l.status})`,g.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(c.innerHTML=Vl.defaultsSvg.loadingSvg),l.status==="Created"&&(c.innerHTML=Vl.defaultsSvg.successSvg),l.status==="Error"&&(c.innerHTML=Vl.defaultsSvg.warnSvg)};m();const _=this.dv(d.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(_.don(m))}}update(){const a=255*Math.random()|0,o=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${a}, ${o}, ${l}, 0.8)`}}};this.d(t.containerChanged.don(()=>{e()}))}};p(Vl,"defaultsSvg",{loadingSvg:NI,successSvg:bI,warnSvg:TI});let qd=Vl;class DI extends d.Destroyable{constructor(t,e,n){super(),this._subContainer=t,this._overlayContainer=e,this._viewer=n;const i=this._subContainer,s=this._overlayContainer,a=this._viewer,o=()=>{const c=a.zIndex??"";i.style.zIndex=c,s.style.zIndex=c};o(),this.d(a.zIndexChanged.don(o));const l=()=>{i.style.display=a.show??!0?"block":"none"};l(),this.d(a.showChanged.don(l));const u=()=>{i.style.opacity=`${a.opacity??1}`};u(),this.d(a.opacityChanged.don(u))}}function jc(r){let t=d.getExtProp(r,"_relativeContainer");return t||(t=document.createElement("div"),t.style.position="relative",t.style.width="100%",t.style.height="100%",t.style.padding="0",t.style.margin="0",r.appendChild(t),d.setExtProp(r,"_relativeContainer",t)),t}class xI extends d.Destroyable{constructor(e,n){super();p(this,"_subContainer",document.createElement("div"));p(this,"_overlayContainer",document.createElement("div"));p(this,"_containerStyleController");this._container=e,this._viewer=n,this._containerStyleController=this.dv(new DI(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),jc(this._container).appendChild(i),this.d(()=>jc(this._container).removeChild(i)),jc(this._container).appendChild(s),this.d(()=>jc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class OI extends d.Destroyable{constructor(){super(...arguments);p(this,"registerObjsMap",new Map)}register(e,n){return this.registerObjsMap.has(e)&&console.warn(`register warn:${e}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(e,n),e}getViewerConstructor(e){const n=this.registerObjsMap.get(e);if(!n){console.warn(`未找到${e}类!`);return}return n}createViewer(e){const n=e.type;console.log(e);const i=this.getViewerConstructor(n);if(!i)throw new Error(`没有找到类型为${n}的Viewer构造器!`);return new i(e)}}class tv extends d.Destroyable{constructor(t,e,n=!1,i=!1){if(super(),this._viewer=t,!e)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(d.DomElementEvent.create(e,"pointerdown")),a=this.dv(d.DomElementEvent.create(e,"pointermove")),o=this.dv(d.DomElementEvent.create(e,"pointerup")),l=this.dv(d.DomElementEvent.create(e,"pointerout")),u=this.dv(d.DomElementEvent.create(e,"pointerover")),c=this.dv(new d.PointerClick),h=this.dv(new d.PointerHover),f=()=>{const v=this._viewer.hoverTime*1e3;h.delayTime=v};this.d(this._viewer.hoverTimeChanged.don(()=>{f()})),this.d(s.don(v=>c.pointerDown(v))),this.d(a.don(v=>c.pointerMove(v))),this.d(o.don(v=>c.pointerUp(v))),this.d(l.don(v=>c.pointerOut(v))),this.d(s.don(v=>h.pointerDown(v))),this.d(a.don(v=>h.pointerMove(v))),this.d(o.don(v=>h.pointerUp(v))),this.d(l.don(v=>h.pointerOut(v)));const{x:g,y:m}=e.getBoundingClientRect(),_=i?g:0,E=i?m:0;this.d(h.hoverEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.hoverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.clickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.clickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(c.dbclickEvent.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(s.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(o.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);v.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(a.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerMoveEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(u.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerOverEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})})),this.d(l.don(v=>{const[S,P]=d.getDomEventCurrentTargetPos(v,n);this._viewer.pointerOutEvent.emit({screenPosition:[S+_,P+E],pointerEvent:v})}));const M=this.dv(d.DomElementEvent.create(e,"keydown"));this.d(M.don(v=>this._viewer.keyDownEvent.emit(v)));const y=this.dv(d.DomElementEvent.create(e,"keyup"));this.d(y.don(v=>this._viewer.keyUpEvent.emit(v)));const w=this.dv(d.DomElementEvent.create(e,"wheel"));this.d(w.don(v=>this._viewer.wheelEvent.emit(v)))}}class AI extends d.Destroyable{constructor(e){super();p(this,"viewer");const n=this.viewer=e;this.ad(new d.ObjResettingWithEvent(n.rollerShutterChanged,()=>{const i=n.container;if(!i||!n.rollerShutter)return;const s=new d.Destroyable;this.viewer.splitPosition=.5;let a=this.getRollerShutterDIV();return i.appendChild(a),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(a)}),s}))}getRollerShutterDIV(){let e=document.createElement("div");e.style.position="absolute",e.style.left="50%",e.style.top="0",e.style.backgroundColor="#d3d3d3",e.style.width="5px",e.style.height="100%",e.style.zIndex="9999";const n=i=>{if(!e.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const a=i.x/e.parentElement.offsetWidth;e.style.left=`${100*a}%`,this.viewer.splitPosition=a};return e.addEventListener("mouseenter",i=>{e.style.cursor="ew-resize"}),e.addEventListener("mouseleave",i=>{e.style.cursor="default"}),e.addEventListener("mousedown",i=>{e.style.cursor="ew-resize",document.addEventListener("mousemove",n)}),document.addEventListener("mouseup",i=>{e.style.cursor="default",document.removeEventListener("mousemove",n)}),e}}class LI extends d.Destroyable{constructor(e){super();p(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new AI(e))}}const fs=class fs extends d.Destroyable{constructor(e){super();p(this,"_forceRecreateEvent",this.dv(new d.Event));p(this,"_container",this.dv(d.react(void 0)));p(this,"_containerSize",this.dv(d.react(void 0)));p(this,"_editingEvent",this.disposeVar(new d.Event));p(this,"_status",this.dv(d.react("Raw")));p(this,"_statusLog",this.dv(d.react("")));p(this,"_statusContainer",this.dv(new qd(this)));p(this,"_useCustomInteraction",this.dv(d.react(!0)));p(this,"_resetInteractionEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));p(this,"_interactionResetting",this.dv(new d.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new tv(this,this.container)})));p(this,"_viewerChanged",this.dv(new d.Event));p(this,"_containerResetEvent",this.dv(d.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));p(this,"_containerResetting",this.dv(new d.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new xI(this.container,this)})));p(this,"_sceneObjectsMap",new Map);p(this,"_id");p(this,"_typeName");p(this,"_updateFuncReact",this.dv(d.react(void 0)));p(this,"_toDestroyFuncReact",this.dv(d.react(void 0)));p(this,"_statusInfo",fs.defaults.statusInfo);p(this,"_navigationMode",this.dv(d.react("Map")));p(this,"_syncViewer",this.dv(d.react(void 0)));p(this,"_syncEventDon",this.dv(new d.ObjResettingWithEvent(this.syncViewerChanged,()=>{const e=this.syncViewer;if(e)return new MI(this,e)})));p(this,"_timeSyncdon",this.dv(new d.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new II(this)})));p(this,"_hoverEvent",this.dv(new d.Event));p(this,"_pointerOverEvent",this.dv(new d.Event));p(this,"_pointerMoveEvent",this.dv(new d.Event));p(this,"_pointerDownEvent",this.dv(new d.Event));p(this,"_pointerUpEvent",this.dv(new d.Event));p(this,"_pointerOutEvent",this.dv(new d.Event));p(this,"_clickEvent",this.dv(new d.Event));p(this,"_dblclickEvent",this.dv(new d.Event));p(this,"_keyDownEvent",this.dv(new d.Event));p(this,"_keyUpEvent",this.dv(new d.Event));p(this,"_wheelEvent",this.dv(new d.Event));p(this,"_actived",this.dv(d.react(!1)));this._id=e.id??d.createGuid();const n=B0(e.container);if(n)this._container.value=Ud(n),this._typeName=e.type,this._initName();else throw new Error("container is not defined");{const i=()=>{n&&(this.show??!0?n.style.display="block":n.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[o,l]of i.entries())if(!l&&o){const u=Oa.context.createEngineObject(o,this);u&&i.set(o,u)}},a=()=>{for(let[o,l]of i.entries())l&&!l.isDestroyed()&&l.destroy(),i.set(o,void 0)};this.d(a),this.d(this.viewerChanged.don(o=>{a(),o&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(a){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${a}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||d.createAnimateFrame(),s.restart(void 0,a=>{this.updateFunc&&this.updateFunc(this,a)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new LI(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(e){this._container.value=e}set containerOrId(e){if(typeof e=="string"){const n=document.getElementById(e);n&&n instanceof HTMLDivElement?this._container.value=Ud(n):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else e instanceof HTMLDivElement?this._container.value=Ud(e):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(e){this._containerSize.value=e}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(e){this._status.value=e}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(e){this._statusLog.value=e}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(e){this._useCustomInteraction.value=e}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var e;return(e=this._containerResetting.obj)==null?void 0:e.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(e){return this.sceneObjectsMap.get(e)}add(...e){for(let n of e)if(!this.has(n)){ft.context.addSceneObject(n);const i=Oa.context.createEngineObject(n,this);i&&this._sceneObjectsMap.set(n,i),n.viewerAttached.emit(this)}}delete(...e){for(let n of e)if(this.has(n)){const i=this._sceneObjectsMap.get(n);i&&i.destroy(),ft.context.deleteSceneObject(n),this._sceneObjectsMap.delete(n),n.viewerDetached.emit(this)}}disposableAdd(...e){return this.add(...e),()=>this.delete(...e)}disAdd(...e){return this.disposableAdd(...e)}has(e){return this._sceneObjectsMap.has(e)}clearAllSceneObjects(){for(let e of this.sceneObjects)this.delete(e)}get id(){return this._id}set id(e){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return fs.createDefaultProps()}_getJson(e=!0){const n={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(e){let s,a=this.defaultProps[i];a instanceof d.ReactiveVariable?s=a.equals(this[i]):s=a===this[i],s||(n[i]=this[i])}else n[i]=this[i];return n}_setJson(e,n,i){if(!(e instanceof Object)||e.type&&e.type!==this.typeName){console.error(`value.type && value.type${e.type} !== this.typeName${this.typeName}`);return}e.id&&e.id!==this.id&&console.warn(`value.id === undefined || value.id${e.id} !== this.id(${this.id})`);const s=n||[];s.push("id","type");const a=Object.keys(this.defaultProps).filter(o=>!s.includes(o));for(let o of a)if(o in e)this[o]=e[o]===null?void 0:e[o];else if(!(i??!1)){let l=this.defaultProps[o];l instanceof d.ReactiveVariable&&(l=l.value),this[o]=l}}get json(){return this._getJson()}set json(e){this._setJson(e,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(e){this._updateFuncReact.value=e}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(e){this._toDestroyFuncReact.value=e}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(e){this._syncViewer.value=e}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(e){e&&e.syncViewer&&(e.syncViewer=void 0),e===this?this._syncViewer.value=void 0:this._syncViewer.value=e}setCurrentTime(e){try{this.currentTime=typeof e=="string"?Date.parse(e):e}catch(n){console.warn(`时间格式不正确! value: ${e} error: ${n}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(e){return[new H("ESViewer","ESViewer",[new mt("强制刷新","重载",[],()=>this.forceRecreate(),[]),new U("debug","debug",!0,!1,[this,"debug"],fs.defaults.debug),new U("是否可见","是否可见",!0,!1,[this,"show"]),new tt("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new U("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new nt("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new C("时钟","时钟",!1,!1,[this,"currentTime"]),new U("globeShow","globeShow",!0,!1,[this,"globeShow"]),new U("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new C("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new C("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new H("Globe","Globe",[new Y("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(e){this._actived.value=e}get activedChanged(){return this._actived.changed}};p(fs,"context",new OI),p(fs,"register",fs.context.register.bind(fs.context)),p(fs,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Di=fs;(r=>{r.createBaseProps=()=>({name:"未命名场景对象",extras:d.reactJson(void 0),devTags:d.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),r.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:d.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:d.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:d.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:r.defaults.terrainShader,splitPosition:d.react(void 0),rollerShutter:!1}),r.createDefaultProps=()=>({...(0,r.createBaseProps)(),...(0,r.createCommonProps)()})})(Di||(Di={})),d.extendClassProps(Di.prototype,Di.createDefaultProps);function ev(r,t){const e=r._lastCameraInfo;if(e){const n=t.viewerChanged.don(i=>{if(!i||!e)return;const{position:s,rotation:a}=e;t.flyIn(s,a,0),r._lastCameraInfo=void 0,n()})}}const RI=r=>{const t=Di.createCommonProps(),e={};try{Object.keys(t).forEach(n=>{e[n]=r[n]})}catch(n){console.warn(n)}return e},rv=(r,t)=>{const e=Di.createCommonProps();try{Object.keys(e).forEach(n=>{r[n]=t[n]})}catch(n){console.warn(n)}};class FI extends d.Destroyable{constructor(e){super();p(this,"_viewersChanged",this.disposeVar(new d.Event));p(this,"_viewers",new Set);p(this,"_viewersToChange",this.dv(new d.Event));this._sceneObjectsManager=e,this.d(()=>{for(const n of this._viewers)this.destroyViewer(n);this._viewers.clear()}),this.viewers.forEach(n=>{const i=this._sceneObjectsManager.sceneObjects;n.add(...i)}),this.d(()=>{const n=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...n)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((n,i)=>{this.viewers.forEach(s=>{i.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?console.warn(`${s.typeName}中已存${a.typeName},检查逻辑是否有问题!`):s.add(a))}),n.forEach(a=>{Ds(s.devTags,a.devTags)&&(s.has(a)?s.delete(a):console.warn(`${s.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(a=>{a.has(s)&&a.delete(s),console.log("sceneObjectsToChange",a.devTags,s.devTags,Ds(a.devTags,s.devTags)),Ds(a.devTags,s.devTags)&&(a.has(s)?console.warn(`${a.typeName}中已存${s.typeName},检查逻辑是否有问题!`):a.add(s))})}))})})),this.d(this.viewersChanged.don((n,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?console.warn(`${a.typeName}中已存${o.typeName},检查逻辑是否有问题!`):a.add(o))}),n.forEach(a=>{for(let o of s)Ds(a.devTags,o.devTags)&&(a.has(o)?a.delete(o):console.warn(`${a.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(a=>{a.d(a.devTagsChanged.don(()=>{a.clearAllSceneObjects();const o=this._sceneObjectsManager.sceneObjects;for(let l of o)console.log("viewersChanged",a.devTags,l.devTags,Ds(a.devTags,l.devTags)),Ds(a.devTags,l.devTags)&&(a.has(l)?console.warn(`${a.typeName}中已存${l.typeName},检查逻辑是否有问题!`):a.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(e){const n=Di.context.createViewer(e);return this._viewers.add(n),this._viewersChanged.emit([],[n]),n}destroyViewer(e){return e.isDestroyed()?!0:(this._viewers.delete(e),this._viewersChanged.emit([e],[]),e.destroy(),e.isDestroyed())}}class Sa extends d.Destroyable{constructor(...e){super();p(this,"_drgm",this.dv(new d0));p(this,"_sobjm",this.dv(new CI));p(this,"_vrm",this.dv(new FI(this._sobjm)));p(this,"_sceneObjectEditingManager",this.disposeVar(new PI));p(this,"_activeViewer",this.dv(d.react(void 0)));p(this,"_syncOtherViewersToActived",this.dv(d.react(!1)));p(this,"_cmrvm",this.createSceneObjectFromClass(ya));p(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));p(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});p(this,"_sceneTree",this.dv(new Ah("default",this.dragstartDataMananger,24,this)));p(this,"_propUiTreeManager",this.dv(new Du(24)));p(this,"_sceneTreeMap",new Map);p(this,"_viewerCreatedEvent",this.dv(new d.Event));p(this,"_lastCameraInfo");p(this,"_lastActiveViewerJson");p(this,"syncEvent",this.dv(d.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));p(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const e=this.syncOtherViewersToActived;this.viewers.forEach(n=>{e?n.syncOtherViewer(this.activeViewer):n.syncOtherViewer(void 0)})})));p(this,"_player",this.createSceneObjectFromClass(As));p(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));p(this,"_esPlyarAndPathTime",this.dv(new vI(this)));p(this,"_pathAnimationManager",this.dv(new _I(this)))}static get envs(){return ft.context.environmentVariables}getSceneObjectById(e){return ft.getSceneObjectById(e)}getSceneObject(e){return ft.getSceneObject(e)}get $refs(){return ft.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(e){this._activeViewer.value=e}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(e){this._syncOtherViewersToActived.value=e}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var h;const e=this._asset.createdTime||new Date().toISOString(),n=new Date().toISOString(),i=this._asset.name||"未命名项目",a={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:e,modifiedTime:n,name:i},o=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(f=>f.json),c=(h=this.activeViewer)==null?void 0:h.getCurrentCameraInfo();return{asset:a,viewers:u,sceneTree:o,viewCollection:l,lastView:c}}set json(e){try{if(!e.asset)return;if(!e.asset.type||e.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=e.asset&&e.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=e.asset&&e.asset.modifiedTime||"",this._asset.name=e.asset&&e.asset.name||"未命名项目",this._asset.version=e.asset&&e.asset.version||"0.1.0",e.sceneTree&&(this.sceneTree.json=e.sceneTree),e.viewCollection&&(this._cmrvm.views=e.viewCollection),!e.viewers||!Array.isArray(e.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||e.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(n=>{const i=e.viewers.find(s=>s.id===n.id);i&&(n.json=i)})}catch(n){console.error(`ESObjectsManager解析json数据时发生错误! error: ${n}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(e){return wI(this,e)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(e="default"){if(e==="default")return this._sceneTree;if(!this._sceneTreeMap.has(e)){console.warn(`id为${e}的SceneTree不存在!`);return}return this._sceneTreeMap.get(e)}createSceneTree(e,n=24){if(this._sceneTreeMap.has(e)||e==="default")console.warn(`id为${e}的SceneTree已存在!`);else{const i=this.dv(new Ah(e,this.dragstartDataMananger,n,this));this._sceneTreeMap.set(e,i)}return this.getSceneTree(e)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(e){const n=this._vrm.createViewer(e);this.activeViewer||(this.activeViewer=n);const i=this.d(n.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(n),i())}));return n}destroyViewer(e){return this._activeViewer.value===e&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(e)}switchViewer(e,n=!0,i=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&n&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?RI(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const a=e.id,o=a?[...this.getViewers()].find(c=>c.id===a):[...this.getViewers()].find(c=>c.typeName===e.type);if(o)if(a&&o.typeName!==e.type)console.warn(`id为${a}的viewer的typeName和option.type${e.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(o);else return console.log("ESViewer exists, will be used"),n&&ev(this,o),i&&this._lastActiveViewerJson&&(rv(o,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),o.container===B0(e.container)?(o.containerOrId=e.container,o.forceRecreate()):o.containerOrId=e.container,this.activeViewer=o,o;console.log("No ESViewer exists, will be created");const l=this.createViewer(e);return console.log(e),console.log(this),n&&ev(this,l),i&&this._lastActiveViewerJson&&(rv(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...e){if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)){const{container:n,viewSync:i,attributeSync:s,destroy:a,id:o}=e[0];return this.switchViewer({type:"ESCesiumViewer",container:n,id:o},i??!0,s??!0,a??!0)}else if(typeof e[0]=="string"||e[0]instanceof HTMLDivElement){const n={container:e[0],viewSync:e[1]??!0,attributeSync:e[2]??!0,destroy:e[3]??!0,id:e[4]},{container:i,viewSync:s,attributeSync:a,destroy:o,id:l}=n;return this.switchViewer({type:"ESCesiumViewer",container:i,id:l},s,a,o)}}switchToUEViewer(...e){let n,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("uri")){const{container:l,uri:u,app:c,token:h,viewSync:f,attributeSync:g,destroy:m,id:_}=e[0];n={type:"ESUeViewer",container:l,id:_,options:{uri:u,app:c,token:h}},i={viewSync:f??!0,attributeSync:g??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{ws:u,esmsg:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)&&e[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:c,viewSync:h,attributeSync:f,id:g,destroy:m}=e[0];n={type:"ESUeViewer",container:l,id:g,options:{project:u,baseUrl:c}},i={viewSync:h??!0,attributeSync:f??!0,destroy:m??!0}}else(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?(n={type:"ESUeViewer",container:e[0],id:e[6],options:{ws:e[1],esmsg:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}):typeof e[1]=="string"&&e[1].startsWith("http")?(n={type:"ESUeViewer",container:e[0],id:e[7],options:{uri:e[1],app:e[2],token:e[3]??void 0}},i={viewSync:e[4]??!0,attributeSync:e[5]??!0,destroy:e[6]??!0}):(n={type:"ESUeViewer",container:e[0],id:e[6],options:{project:e[1],baseUrl:e[2]??void 0}},i={viewSync:e[3]??!0,attributeSync:e[4]??!0,destroy:e[5]??!0}));if(!n)throw new Error("参数错误");const{viewSync:s,attributeSync:a,destroy:o}=i;return this.switchViewer(n,s,a,o)}createCesiumViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESCesiumViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESCesiumViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createOpenLayersViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESOlViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(n={container:e[0],options:e[1]??void 0,id:e[2]??void 0,type:"ESOlViewer"}),!n)throw new Error("参数错误");return this.createViewer(n)}createUeViewer(...e){let n;if(typeof e[0]=="object"&&!(e[0]instanceof HTMLDivElement)?n={...e[0],type:"ESUeViewer"}:(typeof e[0]=="string"||e[0]instanceof HTMLDivElement)&&(typeof e[1]=="string"&&e[1].startsWith("ws")?n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{ws:e[1],esmsg:e[2]??void 0}}:typeof e[1]=="string"&&e[1].startsWith("http")?n={type:"ESUeViewer",container:e[0],id:e[4]??void 0,options:{uri:e[1],app:e[2],token:e[3]??void 0}}:n={type:"ESUeViewer",container:e[0],id:e[3]??void 0,options:{project:e[1],baseUrl:e[2]??void 0}}),!n)throw new Error("参数错误");return this.createViewer(n)}createSceneObject(e,n){return this._sobjm.createSceneObject(e,n)}createSceneObjectFromClass(e,n){return this._sobjm.createSceneObjectFromClass(e,n)}createSceneObjectFromJson(e){return this._sobjm.createSceneObjectFromJson(e)}destroySceneObject(e){const n=this._sobjm.deleteSceneObject(e);return e.destroy(),n}destroyAllSceneObjects(){const e=[...this._sobjm.sceneObjects];for(let n of e)n!=this._player&&n!=this._cmrvm&&this.destroySceneObject(n)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}p(Sa,"getSceneObjById",ft.context.getSceneObjectById.bind(ft.context)),p(Sa,"getEnv",ft.context.getEnv.bind(ft.context)),p(Sa,"setEnv",ft.context.setEnv.bind(ft.context)),(r=>{r.createDefaultProps=()=>({})})(Sa||(Sa={})),d.extendClassProps(Sa.prototype,Sa.createDefaultProps);function GI(){const r=navigator.userAgent;let t="Unknown";/Windows/.test(r)?t="Windows":/Macintosh/.test(r)?t="MacOS":/Linux/.test(r)?t="Linux":/Android/.test(r)?t="Android":/iOS|iPhone|iPad|iPod/.test(r)&&(t="iOS");let e="Unknown";return/x64|x86_64|Win64|WOW64/.test(r)?e="x64":/x86|i686|Win32/.test(r)?e="x86":/arm64|aarch64/.test(r)?e="arm64":/arm/.test(r)&&(e="arm"),{os:t.toLocaleLowerCase(),arch:e.toLocaleLowerCase()}}const kI=Date.now();function nv(r){const{os:t,arch:e}=GI(),n={version:r.version,commitdate:r.date,commitId:r.commitId,runningTime:(Date.now()-kI)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:t,arch:e},s={method:"GET",headers:new Headers,redirect:"follow"},a=window.encodeURIComponent(JSON.stringify(n));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${a}`,s).then(o=>o.text()).then(o=>console.log(o)).catch(o=>console.log("error",o))}N.copyright=void 0;try{const r="earthsdk3",t="3.3.1",e="2025-08-14T09:06:32.000Z",n="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="60921cbcff46cfbed33163bca9f10cb47aa8cd65",o=((Date.now()-1755162392e3)/36e5).toFixed(1),l=`%c🌏 ${r}%c ${t}.${s.slice(0,8)}.${e} (距今${o}个小时)
|
|
538
538
|
%c${i?i+`
|
|
539
539
|
`:""}当前网站正在使用${r},此软件版权归${n}所有
|
|
540
|
-
`;N.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","60921cbcff46cfbed33163bca9f10cb47aa8cd65")},get info(){return l},get date(){return"2025-08-14T09:06:32.000Z"},get author(){return"suplyang"},get version(){return"3.3.
|
|
540
|
+
`;N.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","60921cbcff46cfbed33163bca9f10cb47aa8cd65")},get info(){return l},get date(){return"2025-08-14T09:06:32.000Z"},get author(){return"suplyang"},get version(){return"3.3.1"},get name(){return"earthsdk3"},get commitId(){return"60921cbcff46cfbed33163bca9f10cb47aa8cd65"},print(){console.info(this.info,`
|
|
541
541
|
font-size: 18px;
|
|
542
542
|
font-weight: 1000;
|
|
543
543
|
line-height: 1;
|
package/dist/earthsdk3.js
CHANGED
|
@@ -39590,7 +39590,7 @@ function hp(n) {
|
|
|
39590
39590
|
}
|
|
39591
39591
|
let Ql;
|
|
39592
39592
|
try {
|
|
39593
|
-
const n = "earthsdk3", e = "3.3.
|
|
39593
|
+
const n = "earthsdk3", e = "3.3.1", t = "2025-08-14T09:06:32.000Z", r = "北京西部世界科技有限公司", i = "地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn", s = "60921cbcff46cfbed33163bca9f10cb47aa8cd65", a = ((Date.now() - 1755162392e3) / 36e5).toFixed(1), l = `%c🌏 ${n}%c ${e}.${s.slice(0, 8)}.${t} (距今${a}个小时)
|
|
39594
39594
|
%c${i ? i + `
|
|
39595
39595
|
` : ""}当前网站正在使用${n},此软件版权归${r}所有
|
|
39596
39596
|
`;
|
|
@@ -39620,7 +39620,7 @@ try {
|
|
|
39620
39620
|
},
|
|
39621
39621
|
// @ts-ignore
|
|
39622
39622
|
get version() {
|
|
39623
|
-
return "3.3.
|
|
39623
|
+
return "3.3.1";
|
|
39624
39624
|
},
|
|
39625
39625
|
// @ts-ignore
|
|
39626
39626
|
get name() {
|
package/dist/earthsdk3.umd.cjs
CHANGED
|
@@ -531,10 +531,10 @@ ${Ap}
|
|
|
531
531
|
`,Rp=Date.now();new Date(Rp).toISOString(),new Date(Rp+24*60*60*1e3).toISOString();const pt=class pt extends j{constructor(t){super(t);d(this,"_flyToEvent",this.disposeVar(new c.Event));d(this,"_resetClockEvent",this.disposeVar(new c.Event))}get typeName(){return"ESCzml"}get defaultProps(){return pt.createDefaultProps()}get flyToEvent(){return this._flyToEvent}flyTo(t){this._flyToEvent.emit(t)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const t={...super.getESProperties()};return{...t,defaultMenu:"basic",basic:[...t.basic,new U("数据","数据",!0,!1,[this,"data"],pt.defaults.data,pt.defaults.dataMd),new U("路径","路径",!1,!1,[this,"uri"],""),new F("启用","启用",!1,!1,[this,"clockEnabled"],!1),new S("倍速","倍速.",!1,!1,[this,"multiplier"],pt.defaults.multiplier),new F("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"],!0),new ii("开始时间","开始时间",!0,!1,[this,"startTime"],pt.defaults.startTime),new ii("结束时间","结束时间",!0,!1,[this,"stopTime"],pt.defaults.stopTime),new ii("当前时间","当前时间",!0,!1,[this,"currentTime"],pt.defaults.currentTime),new Y("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"SYSTEM_CLOCK_MULTIPLIER"),new Y("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"UNBOUNDED"),new F("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"],!1)],general:[...t.general,new J("唯一标识","id",!1,!0,[this,"id"]),new J("名称","name",!0,!1,[this,"name"]),new F("是否显示","show",!1,!1,[this,"show"],!0),new F("开启碰撞","collision",!1,!1,[this,"collision"],!1),new F("允许拾取","allowPicking",!1,!1,[this,"allowPicking"],!1)]}}getProperties(t){return[...super.getProperties(t),new z("通用","通用",[new F("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new F("允许拾取","是否允许拾取",!1,!1,[this,"allowPicking"]),new ie("飞入","飞入",["number"],r=>this.flyTo(r),[1e3]),new U("数据","数据",!0,!1,[this,"data"],pt.defaults.data,pt.defaults.dataMd),new U("路径","路径",!1,!1,[this,"uri"]),new F("自动设置时钟","自动设置时钟",!1,!1,[this,"autoResetClock"]),new ie("重设时钟","根据当前加载的数据重设始终",[],()=>this.resetClock(),[]),new ni("loadFnStr","loadFnStr",!0,!1,[this,"loadFuncStr"],pt.defaults.defaultLoadFuncStr,pt.defaults.defaultLoadFuncDocStr)]),new z("时钟","时钟",[new F("启用","启用",!1,!1,[this,"clockEnabled"]),new ii("开始时间","开始时间",!0,!1,[this,"startTime"],pt.defaults.startTime),new ii("结束时间","结束时间",!0,!1,[this,"stopTime"],pt.defaults.stopTime),new ii("当前时间","当前时间",!0,!1,[this,"currentTime"],pt.defaults.currentTime),new S("倍速","倍速.",!1,!1,[this,"multiplier"],pt.defaults.multiplier),new Y("clockStep","clockStep",!1,!1,[this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]]),new Y("clockRange","clockRange",!1,!1,[this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]]),new F("是否启用动画","是否启用动画",!1,!1,[this,"shouldAnimate"])])]}};d(pt,"type",pt.register("ESCzml",pt,{chsName:"ESCzml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Czml数据加载"})),d(pt,"defaults",{...j.defaults,show:!0,allowPicking:!0,data:r0,dataMd:n0,autoResetClock:!0,clockEnabled:!1,startTime:()=>Date.now(),stopTime:()=>Date.now()+24*60*60*1e3,currentTime:()=>Date.now(),multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:Ap,defaultLoadFuncDocStr:i0});let ya=pt;(n=>{n.createDefaultProps=()=>({show:!0,uri:"",allowPicking:!1,data:c.reactJsonWithUndefined(void 0),autoResetClock:!0,clockEnabled:!1,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,loadFuncStr:void 0,...j.createDefaultProps()})})(ya||(ya={})),c.extendClassProps(ya.prototype,ya.createDefaultProps);const Ha=class Ha extends j{get typeName(){return"ESNavigator"}get defaultProps(){return Ha.createDefaultProps()}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new F("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"]),new S("尺寸","尺寸",!1,!1,[this,"cssSize"]),new ze("位置","位置(top,right)",!1,!1,[this,"cssPosition"]),new Rl("图片地址","图片地址",!1,!1,[this,"imgUrl"])])]}};d(Ha,"type",Ha.register("ESNavigator",Ha,{chsName:"导航控件",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"导航控件"})),d(Ha,"defaults",{...j.defaults,show:!0,cssPosition:[170,30],cssSize:100,imgUrl:j.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/zhinanzhen.png")});let _a=Ha;(n=>{n.createDefaultProps=()=>({...j.createDefaultProps(),show:!0,cssSize:100,cssPosition:[170,30],imgUrl:n.defaults.imgUrl})})(_a||(_a={})),c.extendClassProps(_a.prototype,_a.createDefaultProps);const jn=class jn extends j{get typeName(){return"ESViewerStatusBar"}get defaultProps(){return jn.createDefaultProps()}constructor(e){super(e)}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new F("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],jn.defaults.show),new S("高度","height",!0,!1,[this,"height"],jn.defaults.height),new S("文字大小","fontSize",!0,!1,[this,"fontSize"],jn.defaults.fontSize),new Z("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],jn.defaults.bgColor)])]}};d(jn,"type",jn.register("ESViewerStatusBar",jn,{chsName:"状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),d(jn,"defaults",{...j.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let wa=jn;(n=>{n.createDefaultProps=()=>({...j.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:c.reactArray([71/255,71/255,71/255,.8])})})(wa||(wa={})),c.extendClassProps(wa.prototype,wa.createDefaultProps);const ei=class ei extends j{get typeName(){return"ESViewerStatusBarScale"}get defaultProps(){return ei.createDefaultProps()}constructor(e){super(e)}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new F("是否显示","A boolean Property specifying the visibility .",!1,!1,[this,"show"],ei.defaults.show),new S("高度","height",!0,!1,[this,"height"],ei.defaults.height),new S("文字大小","fontSize",!0,!1,[this,"fontSize"],ei.defaults.fontSize),new Z("背景颜色"," 背景颜色",!0,!1,[this,"bgColor"],ei.defaults.bgColor)])]}};d(ei,"type",ei.register("ESViewerStatusBarScale",ei,{chsName:"比例尺状态栏",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"状态栏"})),d(ei,"defaults",{...j.defaults,show:!0,height:30,fontSize:14,bgColor:[71,71,71,.8]});let Ea=ei;(n=>{n.createDefaultProps=()=>({...j.createDefaultProps(),show:!0,height:30,fontSize:14,bgColor:c.reactArray([71/255,71/255,71/255,.8])})})(Ea||(Ea={})),c.extendClassProps(Ea.prototype,Ea.createDefaultProps);const Ja=class Ja extends q{get typeName(){return"ESGaussianSplatting"}get defaultProps(){return Ja.createDefaultProps()}constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new J("路径","url",!0,!1,[this,"url"]),new S("进度","progress",!1,!0,[this,"progress"],0)]}}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new J("路径","url",!0,!1,[this,"url"]),new S("进度","progress",!1,!0,[this,"progress"],0)])]}};d(Ja,"type",Ja.register("ESGaussianSplatting",Ja,{chsName:"高斯溅射模型",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载高斯溅射模型的 ES 对象"})),d(Ja,"defaults",{...q.defaults});let Sa=Ja;(n=>{n.createDefaultProps=()=>({...q.createDefaultProps(),url:"",progress:0})})(Sa||(Sa={})),c.extendClassProps(Sa.prototype,Sa.createDefaultProps);const ls=class ls extends q{get typeName(){return"ESStaticMesh"}get defaultProps(){return ls.createDefaultProps()}constructor(e){super(e)}getESProperties(){const e={...super.getESProperties()},t=[new J("mesh地址","mesh地址",!1,!1,[this,"mesh"],ls.defaults.mesh)];return e.basic.push(...t),e}getProperties(e){return[...super.getProperties(e),new z("ESStaticMesh","ESStaticMesh",[new J("mesh地址","mesh地址",!1,!1,[this,"mesh"],ls.defaults.mesh)])]}};d(ls,"type",ls.register("ESStaticMesh",ls,{chsName:"静态网格",tags:["ESObjects","_ES_Impl_UE"],description:"Unreal的Mesh对象"})),d(ls,"defaults",{...q.defaults,mesh:"StaticMesh'/Engine/BasicShapes/Sphere.Sphere'"});let Ca=ls;(n=>{n.createDefaultProps=()=>({...q.createDefaultProps(),mesh:""})})(Ca||(Ca={})),c.extendClassProps(Ca.prototype,Ca.createDefaultProps);const Za=class Za extends ue{constructor(t){super(t);d(this,"_startEvent",this.dv(new c.Event));d(this,"_clearEvent",this.dv(new c.Event));d(this,"_eSGeoExtrudedPolygon");this._eSGeoExtrudedPolygon=this.disposeVar(new Ki),this._eSGeoExtrudedPolygon.parentID=this.id,this.ad(this.components.disposableAdd(this._eSGeoExtrudedPolygon)),this.eSGeoExtrudedPolygon.perPositionHeight=!0,this.eSGeoExtrudedPolygon.extrudedHeight=0,this.stroked=!0,this.strokeWidth=2,this.strokeColor=[1,0,0,1],this.ad(c.track([this.eSGeoExtrudedPolygon,"show"],[this,"show"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"stroked"],[this,"stroked"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"strokeWidth"],[this,"strokeWidth"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"strokeColor"],[this,"strokeColor"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"filled"],[this,"filled"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"fillColor"],[this,"fillColor"])),this.ad(c.track([this.eSGeoExtrudedPolygon,"points"],[this,"points"])),this.ad(this.clearEvent.don(()=>{this.points=void 0,this.depths=void 0,this.windowPositions=void 0}))}get typeName(){return"ESSkylineAnalysis"}get defaultProps(){return Za.createDefaultProps()}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get clearEvent(){return this._clearEvent}clear(){this._clearEvent.emit()}get eSGeoExtrudedPolygon(){return this._eSGeoExtrudedPolygon}getESProperties(){const t={...super.getESProperties()};return{...t,basic:[...t.basic,new ie("开始分析","开始分析",[],()=>this.start(),[]),new ie("清除分析","清除分析",[],()=>this.clear(),[]),new U("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new U("深度值","depths",!1,!0,[this,"depths"]),new S("半径","半径",!0,!1,[this,"radius"],1e4)]}}getProperties(t){return[...super.getProperties(t),new z("通用","通用",[new ie("开始分析","开始分析",[],()=>this.start(),[]),new ie("清除分析","清除分析",[],()=>this.clear(),[]),new U("屏幕坐标","windowPositions",!1,!0,[this,"windowPositions"]),new U("深度值","depths",!1,!0,[this,"depths"]),new S("半径","半径",!0,!1,[this,"radius"],1e4)])]}};d(Za,"type",Za.register("ESSkylineAnalysis",Za,{chsName:"天际线分析",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"分析类"})),d(Za,"defaults",{...ue.defaults,windowPositions:[],depths:[],radius:1e4});let Pa=Za;(n=>{n.createDefaultProps=()=>({...ue.createDefaultProps(),windowPositions:wc(void 0),depths:c.reactArrayWithUndefined(void 0),radius:c.react(void 0)})})(Pa||(Pa={})),c.extendClassProps(Pa.prototype,Pa.createDefaultProps);const sn=class sn extends ve{get typeName(){return"ESHeatMap"}get defaultProps(){return sn.createDefaultProps()}constructor(e){super(e)}getESProperties(){const e=super.getESProperties();return{...e,basic:[...e.basic,new U("data","数据",!0,!1,[this,"data"]),new U("gradient","渐变",!0,!1,[this,"gradient"],sn.defaults.gradient),new S("radius","半径",!0,!1,[this,"radius"],sn.defaults.radius),new S("blur","模糊",!0,!1,[this,"blur"],sn.defaults.blur),new F("is3D","3D",!0,!1,[this,"is3D"])]}}getProperties(e){return[...super.getProperties(e),new z("通用","通用",[new U("data","数据",!0,!1,[this,"data"]),new U("gradient","渐变",!0,!1,[this,"gradient"],sn.defaults.gradient),new S("radius","半径",!0,!1,[this,"radius"],sn.defaults.radius),new S("blur","模糊",!0,!1,[this,"blur"],sn.defaults.blur),new F("is3D","3D",!0,!1,[this,"is3D"])])]}};d(sn,"type",sn.register("ESHeatMap",sn,{chsName:"热力图",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于热力图的显示"})),d(sn,"defaults",{...ve.defaults,is3D:!1,data:[],radius:10,gradient:{".5":"green",".7":"yellow",".95":"red"},blur:.85});let Ia=sn;(n=>{n.createDefaultProps=()=>({...ve.createDefaultProps(),is3D:c.react(void 0),data:c.reactPositions(void 0),gradient:c.reactJsonWithUndefined(void 0),radius:c.react(void 0),blur:c.react(void 0)})})(Ia||(Ia={})),c.extendClassProps(Ia.prototype,Ia.createDefaultProps);function Fp(n){return typeof n=="string"?document.getElementById(n):n}function Nh(n){if(!n)throw new Error("container is not defined");n.innerHTML="";const e=document.createElement("div");return e.style.cssText="width: 100%; height: 100%; margin: 0px; padding: 0px; border: none; overflow: hidden; position: relative; z-index: 0; background: rgba(0,0,0,0);",n.appendChild(e),e}class kp extends c.Destroyable{constructor(t,r){super();d(this,"_listeningSceneObjects",new Map);this._sceneObjectsMananger=t,this._createSceneObjectListeningFunc=r;const i=this._listeningSceneObjects,s=(o,a)=>{if(o)for(let l of o){const u=i.get(l);u&&(u.destroy(),i.delete(l))}if(a)for(let l of a){if(i.get(l)){console.warn(`listeningSceneObjects已存在某对象:${l.name}`,l);debugger}const h=this.createSceneObjectListeningFunc(l);h&&i.set(l,h)}};s(void 0,this._sceneObjectsMananger.sceneObjects),this.dispose(this._sceneObjectsMananger.sceneObjectsToChange.disposableOn(s)),this.dispose(()=>{for(let o of this._listeningSceneObjects.values())o.destroy();this._listeningSceneObjects.clear()})}get listeningSceneObjects(){return this._listeningSceneObjects}get createSceneObjectListeningFunc(){return this._createSceneObjectListeningFunc}}class s0 extends c.Destroyable{constructor(e){super(),this._esObjectsManager=e;{const t=this._esObjectsManager;class r extends c.Destroyable{constructor(s){super(),this._esPath=s,this.dv(new c.ObjResettingWithEvent(t.activeViewerChanged,()=>{const o=t.activeViewer;if(!o)return;class a extends c.Destroyable{constructor(u){if(super(),this._esPath=u,!o)throw new Error("!viewer");const h=()=>{const f=t.activeViewer;f&&(this._esPath.path.currentTime=f.simulationTime)};h(),this.d(o.simulationTimeChanged.don(h))}}return new a(this._esPath)}))}}this.dv(new kp(t.sceneObjectsManager,i=>{if(i instanceof Bi)return new r(i)}))}{const t=this._esObjectsManager;class r extends c.Destroyable{constructor(s){super();const o=()=>{const a=t.activeViewer;a&&(a.simulationTime=s.currentTime??0)};o(),this.d(s.currentTimeChanged.don(o))}}this.dv(new kp(t.sceneObjectsManager,i=>{if(i instanceof Qi)return new r(i)}))}}}class o0 extends c.Destroyable{constructor(e){super(),e.forEach(t=>{this.d(t.path.currentPositionChanged.don(r=>{r&&t.sceneObjects.forEach(i=>{Reflect.has(i,"position")&&(i.position=[...r])})})),this.d(t.path.currentRotationChanged.don(r=>{r&&t.sceneObjects.forEach(i=>{Reflect.has(i,"rotation")&&(i.rotation=[...r])})}))})}}class a0 extends c.Destroyable{constructor(t){super();d(this,"_player");d(this,"_channels",this.dv(c.reactArray([])));this._objectManager=t,this._player=this._objectManager.player,this.dv(new c.ObjResettingWithEvent(this.channelsChanged,()=>{if(this.channels.length===0)return;const r=[];for(let i=0;i<this.channels.length;i++){const s=this.channels[i],o=j.getSceneObjById(s.pathId);if(!o||!(o instanceof Bi))continue;const l=s.sceneObjectIds.map(u=>j.getSceneObjById(u)).filter(u=>u!==void 0);l.length!==0&&r.push({path:o,sceneObjects:l})}if(r.length!==0)return new o0(r)}))}get player(){return this._player}get channels(){return this._channels.value}get channelsChanged(){return this._channels.changed}set channels(t){this._channels.value=t}}function dc(n){if(n.data){const{type:e,value:t}=n.data;if(e==="UITreeA"&&t instanceof sr){const{sceneObject:r}=t;if(r)return r.id}}}function l0(n,e){const{property:t,customEventName:r,otherParams:i}=e,{dragstartDataMananger:s}=n;if(!(t instanceof Dn)){if(!(t instanceof Fh)){if(t instanceof J){const[o,a]=c.getReactFuncs(t.reactVar);if(r==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const l=i[0];if(l.preventDefault(),!l.dataTransfer)return;dc(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(r==="ondrop"){if(!i)throw new Error("!otherParams");i[0].preventDefault();const u=dc(s);u!==void 0&&a(u)}}else if(t instanceof Mh){const[o,a]=c.getReactFuncs(t.reactVar);if(r==="ondragover"){if(console.log("ondragover"),!i)throw new Error("!otherParams");const l=i[0];if(l.preventDefault(),!l.dataTransfer)return;dc(s)?l.dataTransfer.dropEffect="move":l.dataTransfer.dropEffect="none"}else if(r==="ondrop"){if(!i)throw new Error("!otherParams");const l=i[0].$event,u=i[0].strinsPropDom,h=i[0].index;l.preventDefault();const f=dc(s);if(f!==void 0){u[h].firstChild.value=f;const p=new Event("input",{bubbles:!0,cancelable:!0});u[h].firstChild.dispatchEvent(p)}}}else if(t instanceof xh){const[o,a]=c.getReactFuncs(t.reactVar)}}}}function Vp(n,e,t,r){if(t)r.currentActiveEditing=[n,e];else if(r.currentActiveEditing){const[i,s]=r.currentActiveEditing;i===n&&s===e&&(t||(r.currentActiveEditing=void 0))}}const u0=["editing","positionEditing","locationEditing","pointEditing","rotationEditing"];class c0 extends c.Destroyable{constructor(e,t){super(),this._sceneObject=e;const r=this._sceneObject;for(let i of u0){const s=i+"Changed",o=r[s];if(o){{const a=r[i];Vp(r,i,a,t)}this.dispose(o.disposableOn(a=>Vp(r,i,a,t)))}}}get sceneObject(){return this._sceneObject}}class h0 extends c.Destroyable{constructor(){super();d(this,"_currentActiveEditing",this.disposeVar(c.reactArrayWithUndefined(void 0)));d(this,"_currentActiveEditingLastChangedTime",0);this.dispose(this._currentActiveEditing.changed.disposableOn((t,r)=>{if(this._currentActiveEditingLastChangedTime=Date.now(),r){const[i,s]=r;i[s]===!0&&(i[s]=!1)}if(t){const[i,s]=t;i[s]=!0}})),j.context.sceneObjCreatedEvent.don(t=>{t.dv(new c0(t,this))})}get currentActiveEditing(){return this._currentActiveEditing.value}set currentActiveEditing(t){this._currentActiveEditing.value=t}get currentActiveEditingChanged(){return this._currentActiveEditing.changed}get currentActiveEditingLastChangedTime(){return this._currentActiveEditingLastChangedTime}}class f0 extends c.Destroyable{constructor(){super();d(this,"_sceneObjects",new Set);d(this,"_sceneObjectsToChange",this.dv(new c.Event));this.d(()=>{const t=c.length(this._sceneObjects);t!==0&&console.warn(`场景对象管理器销毁时仍然管理着${t}个场景对象!`)})}get sceneObjects(){return this._sceneObjects}get sceneObjectsToChange(){return this._sceneObjectsToChange}addSceneObject(t){if(this._sceneObjects.has(t))return console.warn(`创建失败:对象${t.typeName+":"+t.id}已经存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([],[t]),this._sceneObjects.add(t);while(!1);return!0}deleteSceneObject(t){if(!this._sceneObjects.has(t))return console.warn(`删除失败:对象${t.typeName+":"+t.id}不存在于场景对象管理器中!}`),!1;do this._sceneObjectsToChange.emit([t],[]),this._sceneObjects.delete(t);while(!1);return!0}createSceneObject(t,r){const i=j.context.createSceneObject(t,r);return i&&this.addSceneObject(i),i}createSceneObjectFromClass(t,r){const i=j.context.createSceneObjectFromClass(t,r);return i&&this.addSceneObject(i),i}createSceneObjectFromJson(t){const r=j.context.createSceneObjectFromJson(t);return r&&this.addSceneObject(r),r}}function zp(n,e){return n.length===e.length&&n.every((t,r)=>t===e[r])}class d0 extends c.Destroyable{constructor(e){super(),this._viewer=e,this.d(c.track([this._viewer,"currentTime"],[this._viewer,"simulationTime"]))}}class p0 extends c.Destroyable{constructor(e,t){super(),this._viewer=e,this._activeViewer=t;const r=Kn.createCommonProps(),i=[];Object.keys(r).forEach(l=>{const u=this._activeViewer[l+"Changed"];i.push(u)});const s=this.dv(c.createNextAnimateFrameEvent(...i)),o=()=>{this._viewer.status!=="Created"||this._activeViewer.status!=="Created"||Object.keys(r).forEach(l=>{this._viewer[l]=this._activeViewer[l]})};this.d(s.don(o));const a=this.dv(c.createAnimateFrame());a.restart(void 0,async()=>{if(this._viewer.status!=="Created"||this._activeViewer.status!=="Created")return;const l=this._activeViewer.getCurrentCameraInfo(),u=this._viewer.getCurrentCameraInfo();if(!l)return;const{position:h,rotation:f}=l;u&&zp(h,u.position)&&zp(f,u.rotation)||this._viewer.flyIn(h,f,0)}),this.d(()=>a.cancel())}}const g0=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" width="40" height="40" style="shape-rendering: auto; display: block; background: rgba(255, 255, 255, 0);" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-linecap="round" fill="none" stroke-dasharray="50.26548245743669 50.26548245743669" stroke="#ffffff" stroke-width="8" r="32" cy="50" cx="50">
|
|
532
532
|
<animateTransform values="0 50 50;360 50 50" keyTimes="0;1" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
|
|
533
533
|
</circle><g></g></g></svg>
|
|
534
|
-
`,m0='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',v0='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Ka=class Ka extends c.Destroyable{constructor(e){super();const t=()=>{const r=this.dv(new xs);this.d(c.track([r,"show"],[e,"useDefaultStatusDiv"]));{const i=()=>{r.show=(e.useDefaultStatusDiv??!0)&&e.status!=="Created"};i(),this.d(e.useDefaultStatusDivChanged.don(i)),this.d(e.statusChanged.don(i)),r.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}e.add(r),this.d(()=>e.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(o,a,l){super();d(this,"_div",document.createElement("div"));if(this._subContainer=o,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const w=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};w(),this.d(a.showChanged.don(w))}let u,h,f,p,v;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.display="block",h.style.width="40px",h.innerHTML=Ka.defaultsSvg.loadingSvg,h.style.filter="drop-shadow(0px 0px 1px black)",f=document.createElement("div"),u.appendChild(f),f.style.pointerEvents="none",f.style.marginLeft="10px",f.style.display="flex",f.style.flexFlow="column",f.style.maxWidth="300px",p=document.createElement("div"),f.appendChild(p),p.style.fontSize="14px",p.style.fontWeight="800",p.style.marginBottom="5px",p.style.textShadow="0 0 2px black",v=document.createElement("div"),f.appendChild(v),v.style.fontWeight="400",v.style.textShadow="0 0 2px black";{const w=()=>{let T="Raw";l.status==="Raw"?T="初始状态":l.status==="Creating"?T="正在创建":l.status==="Created"?T="创建完成":l.status==="Error"?T="创建失败":l.status==="Reconnecting"&&(T="重新连接"),p.innerText=`${T}(${l.status})`,v.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(h.innerHTML=Ka.defaultsSvg.loadingSvg),l.status==="Created"&&(h.innerHTML=Ka.defaultsSvg.successSvg),l.status==="Error"&&(h.innerHTML=Ka.defaultsSvg.warnSvg)};w();const I=this.dv(c.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(I.don(w))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${l}, 0.8)`}}};this.d(e.containerChanged.don(()=>{t()}))}};d(Ka,"defaultsSvg",{loadingSvg:g0,successSvg:m0,warnSvg:v0});let Dh=Ka;class y0 extends c.Destroyable{constructor(e,t,r){super(),this._subContainer=e,this._overlayContainer=t,this._viewer=r;const i=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const h=o.zIndex??"";i.style.zIndex=h,s.style.zIndex=h};a(),this.d(o.zIndexChanged.don(a));const l=()=>{i.style.display=o.show??!0?"block":"none"};l(),this.d(o.showChanged.don(l));const u=()=>{i.style.opacity=`${o.opacity??1}`};u(),this.d(o.opacityChanged.don(u))}}function pc(n){let e=c.getExtProp(n,"_relativeContainer");return e||(e=document.createElement("div"),e.style.position="relative",e.style.width="100%",e.style.height="100%",e.style.padding="0",e.style.margin="0",n.appendChild(e),c.setExtProp(n,"_relativeContainer",e)),e}class _0 extends c.Destroyable{constructor(t,r){super();d(this,"_subContainer",document.createElement("div"));d(this,"_overlayContainer",document.createElement("div"));d(this,"_containerStyleController");this._container=t,this._viewer=r,this._containerStyleController=this.dv(new y0(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),pc(this._container).appendChild(i),this.d(()=>pc(this._container).removeChild(i)),pc(this._container).appendChild(s),this.d(()=>pc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class w0 extends c.Destroyable{constructor(){super(...arguments);d(this,"registerObjsMap",new Map)}register(t,r){return this.registerObjsMap.has(t)&&console.warn(`register warn:${t}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(t,r),t}getViewerConstructor(t){const r=this.registerObjsMap.get(t);if(!r){console.warn(`未找到${t}类!`);return}return r}createViewer(t){const r=t.type;console.log(t);const i=this.getViewerConstructor(r);if(!i)throw new Error(`没有找到类型为${r}的Viewer构造器!`);return new i(t)}}class Up extends c.Destroyable{constructor(e,t,r=!1,i=!1){if(super(),this._viewer=e,!t)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(c.DomElementEvent.create(t,"pointerdown")),o=this.dv(c.DomElementEvent.create(t,"pointermove")),a=this.dv(c.DomElementEvent.create(t,"pointerup")),l=this.dv(c.DomElementEvent.create(t,"pointerout")),u=this.dv(c.DomElementEvent.create(t,"pointerover")),h=this.dv(new c.PointerClick),f=this.dv(new c.PointerHover),p=()=>{const g=this._viewer.hoverTime*1e3;f.delayTime=g};this.d(this._viewer.hoverTimeChanged.don(()=>{p()})),this.d(s.don(g=>h.pointerDown(g))),this.d(o.don(g=>h.pointerMove(g))),this.d(a.don(g=>h.pointerUp(g))),this.d(l.don(g=>h.pointerOut(g))),this.d(s.don(g=>f.pointerDown(g))),this.d(o.don(g=>f.pointerMove(g))),this.d(a.don(g=>f.pointerUp(g))),this.d(l.don(g=>f.pointerOut(g)));const{x:v,y:w}=t.getBoundingClientRect(),I=i?v:0,T=i?w:0;this.d(f.hoverEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.hoverEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(h.clickEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.clickEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(h.dbclickEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(s.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(a.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(o.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerMoveEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(u.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerOverEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(l.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerOutEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})}));const L=this.dv(c.DomElementEvent.create(t,"keydown"));this.d(L.don(g=>this._viewer.keyDownEvent.emit(g)));const m=this.dv(c.DomElementEvent.create(t,"keyup"));this.d(m.don(g=>this._viewer.keyUpEvent.emit(g)));const _=this.dv(c.DomElementEvent.create(t,"wheel"));this.d(_.don(g=>this._viewer.wheelEvent.emit(g)))}}class E0 extends c.Destroyable{constructor(t){super();d(this,"viewer");const r=this.viewer=t;this.ad(new c.ObjResettingWithEvent(r.rollerShutterChanged,()=>{const i=r.container;if(!i||!r.rollerShutter)return;const s=new c.Destroyable;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let t=document.createElement("div");t.style.position="absolute",t.style.left="50%",t.style.top="0",t.style.backgroundColor="#d3d3d3",t.style.width="5px",t.style.height="100%",t.style.zIndex="9999";const r=i=>{if(!t.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/t.parentElement.offsetWidth;t.style.left=`${100*o}%`,this.viewer.splitPosition=o};return t.addEventListener("mouseenter",i=>{t.style.cursor="ew-resize"}),t.addEventListener("mouseleave",i=>{t.style.cursor="default"}),t.addEventListener("mousedown",i=>{t.style.cursor="ew-resize",document.addEventListener("mousemove",r)}),document.addEventListener("mouseup",i=>{t.style.cursor="default",document.removeEventListener("mousemove",r)}),t}}class S0 extends c.Destroyable{constructor(t){super();d(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new E0(t))}}const Oi=class Oi extends c.Destroyable{constructor(t){super();d(this,"_forceRecreateEvent",this.dv(new c.Event));d(this,"_container",this.dv(c.react(void 0)));d(this,"_containerSize",this.dv(c.react(void 0)));d(this,"_editingEvent",this.disposeVar(new c.Event));d(this,"_status",this.dv(c.react("Raw")));d(this,"_statusLog",this.dv(c.react("")));d(this,"_statusContainer",this.dv(new Dh(this)));d(this,"_useCustomInteraction",this.dv(c.react(!0)));d(this,"_resetInteractionEvent",this.dv(c.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));d(this,"_interactionResetting",this.dv(new c.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new Up(this,this.container)})));d(this,"_viewerChanged",this.dv(new c.Event));d(this,"_containerResetEvent",this.dv(c.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));d(this,"_containerResetting",this.dv(new c.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new _0(this.container,this)})));d(this,"_sceneObjectsMap",new Map);d(this,"_id");d(this,"_typeName");d(this,"_updateFuncReact",this.dv(c.react(void 0)));d(this,"_toDestroyFuncReact",this.dv(c.react(void 0)));d(this,"_statusInfo",Oi.defaults.statusInfo);d(this,"_navigationMode",this.dv(c.react("Map")));d(this,"_syncViewer",this.dv(c.react(void 0)));d(this,"_syncEventDon",this.dv(new c.ObjResettingWithEvent(this.syncViewerChanged,()=>{const t=this.syncViewer;if(t)return new p0(this,t)})));d(this,"_timeSyncdon",this.dv(new c.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new d0(this)})));d(this,"_hoverEvent",this.dv(new c.Event));d(this,"_pointerOverEvent",this.dv(new c.Event));d(this,"_pointerMoveEvent",this.dv(new c.Event));d(this,"_pointerDownEvent",this.dv(new c.Event));d(this,"_pointerUpEvent",this.dv(new c.Event));d(this,"_pointerOutEvent",this.dv(new c.Event));d(this,"_clickEvent",this.dv(new c.Event));d(this,"_dblclickEvent",this.dv(new c.Event));d(this,"_keyDownEvent",this.dv(new c.Event));d(this,"_keyUpEvent",this.dv(new c.Event));d(this,"_wheelEvent",this.dv(new c.Event));d(this,"_actived",this.dv(c.react(!1)));this._id=t.id??c.createGuid();const r=Fp(t.container);if(r)this._container.value=Nh(r),this._typeName=t.type,this._initName();else throw new Error("container is not defined");{const i=()=>{r&&(this.show??!0?r.style.display="block":r.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[a,l]of i.entries())if(!l&&a){const u=Xs.context.createEngineObject(a,this);u&&i.set(a,u)}},o=()=>{for(let[a,l]of i.entries())l&&!l.isDestroyed()&&l.destroy(),i.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||c.createAnimateFrame(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new S0(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(t){this._container.value=t}set containerOrId(t){if(typeof t=="string"){const r=document.getElementById(t);r&&r instanceof HTMLDivElement?this._container.value=Nh(r):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else t instanceof HTMLDivElement?this._container.value=Nh(t):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(t){this._containerSize.value=t}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(t){this._status.value=t}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(t){this._statusLog.value=t}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(t){this._useCustomInteraction.value=t}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(t){return this.sceneObjectsMap.get(t)}add(...t){for(let r of t)if(!this.has(r)){j.context.addSceneObject(r);const i=Xs.context.createEngineObject(r,this);i&&this._sceneObjectsMap.set(r,i),r.viewerAttached.emit(this)}}delete(...t){for(let r of t)if(this.has(r)){const i=this._sceneObjectsMap.get(r);i&&i.destroy(),j.context.deleteSceneObject(r),this._sceneObjectsMap.delete(r),r.viewerDetached.emit(this)}}disposableAdd(...t){return this.add(...t),()=>this.delete(...t)}disAdd(...t){return this.disposableAdd(...t)}has(t){return this._sceneObjectsMap.has(t)}clearAllSceneObjects(){for(let t of this.sceneObjects)this.delete(t)}get id(){return this._id}set id(t){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Oi.createDefaultProps()}_getJson(t=!0){const r={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof c.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(r[i]=this[i])}else r[i]=this[i];return r}_setJson(t,r,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=r||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let l=this.defaultProps[a];l instanceof c.ReactiveVariable&&(l=l.value),this[a]=l}}get json(){return this._getJson()}set json(t){this._setJson(t,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(t){this._syncViewer.value=t}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(t){t&&t.syncViewer&&(t.syncViewer=void 0),t===this?this._syncViewer.value=void 0:this._syncViewer.value=t}setCurrentTime(t){try{this.currentTime=typeof t=="string"?Date.parse(t):t}catch(r){console.warn(`时间格式不正确! value: ${t} error: ${r}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(t){return[new z("ESViewer","ESViewer",[new ie("强制刷新","重载",[],()=>this.forceRecreate(),[]),new F("debug","debug",!0,!1,[this,"debug"],Oi.defaults.debug),new F("是否可见","是否可见",!0,!1,[this,"show"]),new Y("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new F("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new J("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new S("时钟","时钟",!1,!1,[this,"currentTime"]),new F("globeShow","globeShow",!0,!1,[this,"globeShow"]),new F("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new S("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new S("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new z("Globe","Globe",[new U("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(t){this._actived.value=t}get activedChanged(){return this._actived.changed}};d(Oi,"context",new w0),d(Oi,"register",Oi.context.register.bind(Oi.context)),d(Oi,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Kn=Oi;(n=>{n.createBaseProps=()=>({name:"未命名场景对象",extras:c.reactJson(void 0),devTags:c.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),n.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:c.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:c.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:c.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:n.defaults.terrainShader,splitPosition:c.react(void 0),rollerShutter:!1}),n.createDefaultProps=()=>({...(0,n.createBaseProps)(),...(0,n.createCommonProps)()})})(Kn||(Kn={})),c.extendClassProps(Kn.prototype,Kn.createDefaultProps);function Gp(n,e){const t=n._lastCameraInfo;if(t){const r=e.viewerChanged.don(i=>{if(!i||!t)return;const{position:s,rotation:o}=t;e.flyIn(s,o,0),n._lastCameraInfo=void 0,r()})}}const C0=n=>{const e=Kn.createCommonProps(),t={};try{Object.keys(e).forEach(r=>{t[r]=n[r]})}catch(r){console.warn(r)}return t},Wp=(n,e)=>{const t=Kn.createCommonProps();try{Object.keys(t).forEach(r=>{n[r]=e[r]})}catch(r){console.warn(r)}};class P0 extends c.Destroyable{constructor(t){super();d(this,"_viewersChanged",this.disposeVar(new c.Event));d(this,"_viewers",new Set);d(this,"_viewersToChange",this.dv(new c.Event));this._sceneObjectsManager=t,this.d(()=>{for(const r of this._viewers)this.destroyViewer(r);this._viewers.clear()}),this.viewers.forEach(r=>{const i=this._sceneObjectsManager.sceneObjects;r.add(...i)}),this.d(()=>{const r=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...r)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((r,i)=>{this.viewers.forEach(s=>{i.forEach(o=>{Ji(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),r.forEach(o=>{Ji(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,Ji(o.devTags,s.devTags)),Ji(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((r,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(o=>{for(let a of s)Ji(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),r.forEach(o=>{for(let a of s)Ji(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let l of a)console.log("viewersChanged",o.devTags,l.devTags,Ji(o.devTags,l.devTags)),Ji(o.devTags,l.devTags)&&(o.has(l)?console.warn(`${o.typeName}中已存${l.typeName},检查逻辑是否有问题!`):o.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(t){const r=Kn.context.createViewer(t);return this._viewers.add(r),this._viewersChanged.emit([],[r]),r}destroyViewer(t){return t.isDestroyed()?!0:(this._viewers.delete(t),this._viewersChanged.emit([t],[]),t.destroy(),t.isDestroyed())}}class As extends c.Destroyable{constructor(...t){super();d(this,"_drgm",this.dv(new jd));d(this,"_sobjm",this.dv(new f0));d(this,"_vrm",this.dv(new P0(this._sobjm)));d(this,"_sceneObjectEditingManager",this.disposeVar(new h0));d(this,"_activeViewer",this.dv(c.react(void 0)));d(this,"_syncOtherViewersToActived",this.dv(c.react(!1)));d(this,"_cmrvm",this.createSceneObjectFromClass(Os));d(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));d(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});d(this,"_sceneTree",this.dv(new fu("default",this.dragstartDataMananger,24,this)));d(this,"_propUiTreeManager",this.dv(new bl(24)));d(this,"_sceneTreeMap",new Map);d(this,"_viewerCreatedEvent",this.dv(new c.Event));d(this,"_lastCameraInfo");d(this,"_lastActiveViewerJson");d(this,"syncEvent",this.dv(c.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));d(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const t=this.syncOtherViewersToActived;this.viewers.forEach(r=>{t?r.syncOtherViewer(this.activeViewer):r.syncOtherViewer(void 0)})})));d(this,"_player",this.createSceneObjectFromClass(Qi));d(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));d(this,"_esPlyarAndPathTime",this.dv(new s0(this)));d(this,"_pathAnimationManager",this.dv(new a0(this)))}static get envs(){return j.context.environmentVariables}getSceneObjectById(t){return j.getSceneObjectById(t)}getSceneObject(t){return j.getSceneObject(t)}get $refs(){return j.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(t){this._syncOtherViewersToActived.value=t}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var f;const t=this._asset.createdTime||new Date().toISOString(),r=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:r,name:i},a=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(p=>p.json),h=(f=this.activeViewer)==null?void 0:f.getCurrentCameraInfo();return{asset:o,viewers:u,sceneTree:a,viewCollection:l,lastView:h}}set json(t){try{if(!t.asset)return;if(!t.asset.type||t.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=t.asset&&t.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=t.asset&&t.asset.modifiedTime||"",this._asset.name=t.asset&&t.asset.name||"未命名项目",this._asset.version=t.asset&&t.asset.version||"0.1.0",t.sceneTree&&(this.sceneTree.json=t.sceneTree),t.viewCollection&&(this._cmrvm.views=t.viewCollection),!t.viewers||!Array.isArray(t.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||t.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(r=>{const i=t.viewers.find(s=>s.id===r.id);i&&(r.json=i)})}catch(r){console.error(`ESObjectsManager解析json数据时发生错误! error: ${r}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(t){return l0(this,t)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(t="default"){if(t==="default")return this._sceneTree;if(!this._sceneTreeMap.has(t)){console.warn(`id为${t}的SceneTree不存在!`);return}return this._sceneTreeMap.get(t)}createSceneTree(t,r=24){if(this._sceneTreeMap.has(t)||t==="default")console.warn(`id为${t}的SceneTree已存在!`);else{const i=this.dv(new fu(t,this.dragstartDataMananger,r,this));this._sceneTreeMap.set(t,i)}return this.getSceneTree(t)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(t){const r=this._vrm.createViewer(t);this.activeViewer||(this.activeViewer=r);const i=this.d(r.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(r),i())}));return r}destroyViewer(t){return this._activeViewer.value===t&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(t)}switchViewer(t,r=!0,i=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&r&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?C0(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=t.id,a=o?[...this.getViewers()].find(h=>h.id===o):[...this.getViewers()].find(h=>h.typeName===t.type);if(a)if(o&&a.typeName!==t.type)console.warn(`id为${o}的viewer的typeName和option.type${t.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),r&&Gp(this,a),i&&this._lastActiveViewerJson&&(Wp(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===Fp(t.container)?(a.containerOrId=t.container,a.forceRecreate()):a.containerOrId=t.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const l=this.createViewer(t);return console.log(t),console.log(this),r&&Gp(this,l),i&&this._lastActiveViewerJson&&(Wp(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:r,viewSync:i,attributeSync:s,destroy:o,id:a}=t[0];return this.switchViewer({type:"ESCesiumViewer",container:r,id:a},i??!0,s??!0,o??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const r={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:i,viewSync:s,attributeSync:o,destroy:a,id:l}=r;return this.switchViewer({type:"ESCesiumViewer",container:i,id:l},s,o,a)}}switchToUEViewer(...t){let r,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("uri")){const{container:l,uri:u,app:h,token:f,viewSync:p,attributeSync:v,destroy:w,id:I}=t[0];r={type:"ESUeViewer",container:l,id:I,options:{uri:u,app:h,token:f}},i={viewSync:p??!0,attributeSync:v??!0,destroy:w??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:h,viewSync:f,attributeSync:p,id:v,destroy:w}=t[0];r={type:"ESUeViewer",container:l,id:v,options:{ws:u,esmsg:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:w??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:h,viewSync:f,attributeSync:p,id:v,destroy:w}=t[0];r={type:"ESUeViewer",container:l,id:v,options:{project:u,baseUrl:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:w??!0}}else(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?(r={type:"ESUeViewer",container:t[0],id:t[6],options:{ws:t[1],esmsg:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}):typeof t[1]=="string"&&t[1].startsWith("http")?(r={type:"ESUeViewer",container:t[0],id:t[7],options:{uri:t[1],app:t[2],token:t[3]??void 0}},i={viewSync:t[4]??!0,attributeSync:t[5]??!0,destroy:t[6]??!0}):(r={type:"ESUeViewer",container:t[0],id:t[6],options:{project:t[1],baseUrl:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}));if(!r)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=i;return this.switchViewer(r,s,o,a)}createCesiumViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESCesiumViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(r={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESCesiumViewer"}),!r)throw new Error("参数错误");return this.createViewer(r)}createOpenLayersViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESOlViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(r={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESOlViewer"}),!r)throw new Error("参数错误");return this.createViewer(r)}createUeViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESUeViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?r={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{ws:t[1],esmsg:t[2]??void 0}}:typeof t[1]=="string"&&t[1].startsWith("http")?r={type:"ESUeViewer",container:t[0],id:t[4]??void 0,options:{uri:t[1],app:t[2],token:t[3]??void 0}}:r={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{project:t[1],baseUrl:t[2]??void 0}}),!r)throw new Error("参数错误");return this.createViewer(r)}createSceneObject(t,r){return this._sobjm.createSceneObject(t,r)}createSceneObjectFromClass(t,r){return this._sobjm.createSceneObjectFromClass(t,r)}createSceneObjectFromJson(t){return this._sobjm.createSceneObjectFromJson(t)}destroySceneObject(t){const r=this._sobjm.deleteSceneObject(t);return t.destroy(),r}destroyAllSceneObjects(){const t=[...this._sobjm.sceneObjects];for(let r of t)r!=this._player&&r!=this._cmrvm&&this.destroySceneObject(r)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}d(As,"getSceneObjById",j.context.getSceneObjectById.bind(j.context)),d(As,"getEnv",j.context.getEnv.bind(j.context)),d(As,"setEnv",j.context.setEnv.bind(j.context)),(n=>{n.createDefaultProps=()=>({})})(As||(As={})),c.extendClassProps(As.prototype,As.createDefaultProps);function I0(){const n=navigator.userAgent;let e="Unknown";/Windows/.test(n)?e="Windows":/Macintosh/.test(n)?e="MacOS":/Linux/.test(n)?e="Linux":/Android/.test(n)?e="Android":/iOS|iPhone|iPad|iPod/.test(n)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(n)?t="x64":/x86|i686|Win32/.test(n)?t="x86":/arm64|aarch64/.test(n)?t="arm64":/arm/.test(n)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const T0=Date.now();function qp(n){const{os:e,arch:t}=I0(),r={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-T0)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(r));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}P.copyright=void 0;try{const n="earthsdk3",e="3.3.0",t="2025-08-14T09:06:32.000Z",r="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="60921cbcff46cfbed33163bca9f10cb47aa8cd65",a=((Date.now()-1755162392e3)/36e5).toFixed(1),l=`%c🌏 ${n}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
|
|
534
|
+
`,m0='<svg t="1747028305766" class="icon" viewBox="0 0 1032 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3881" width="40" height="40"><path d="M0.1536 547.700736c-0.205824-0.187392-0.205824-0.49152 0.008192-0.68608l80.672768-73.590784a0.63488 0.63488 0 0 1 0.7936-0.029696l263.043072 203.0336c0.667648 0.515072 1.738752 0.498688 2.393088-0.038912l609.191936-500.133888a0.605184 0.605184 0 0 1 0.768 0.022528l74.84928 67.229696a0.454656 0.454656 0 0 1-0.002048 0.685056l-685.234176 618.19904a1.14688 1.14688 0 0 1-1.518592-0.012288L0.1536 547.700736z" fill="#ffffff" p-id="3882"></path></svg>',v0='<svg t="1747028398107" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1146" width="40" height="40"><path d="M415.744006 1.033277A0.992256 0.992256 0 0 1 416.747526 0.000061h189.5045c0.569344 0 1.017856 0.45056 1.001472 1.033216l-21.227518 754.803667a1.062912 1.062912 0 0 1-1.05984 1.032192h-146.933752c-0.569344 0-1.04448-0.45056-1.059839-1.032192L415.744006 1.033277zM511.510528 1024c-52.595709 0-95.231994-39.866366-95.231994-89.043963 0-49.176573 42.636285-89.042939 95.231994-89.042938 52.594685 0 95.231994 39.866366 95.231994 89.042938 0 49.177597-42.637309 89.043963-95.231994 89.043963z" fill="#ffffff" p-id="1147"></path></svg>',Ka=class Ka extends c.Destroyable{constructor(e){super();const t=()=>{const r=this.dv(new xs);this.d(c.track([r,"show"],[e,"useDefaultStatusDiv"]));{const i=()=>{r.show=(e.useDefaultStatusDiv??!0)&&e.status!=="Created"};i(),this.d(e.useDefaultStatusDivChanged.don(i)),this.d(e.statusChanged.don(i)),r.cssText="width:100%;height:100%;position:absolute;left:0px;top:0px;"}e.add(r),this.d(()=>e.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(o,a,l){super();d(this,"_div",document.createElement("div"));if(this._subContainer=o,!l)return;this._subContainer.appendChild(this._div),this.d(()=>this._subContainer.removeChild(this._div));{const w=()=>{a.show?this._div.style.opacity="1":this._div.style.opacity="0"};w(),this.d(a.showChanged.don(w))}let u,h,f,p,v;this._div.style.pointerEvents="none",this._div.style.position="absolute",this._div.style.width="100%",this._div.style.height="100%",this._div.style.backgroundColor="rgba(0, 0, 0, 0.4)",this._div.style.zIndex="100",this._div.style.transition="opacity 2s",u=document.createElement("div"),this._div.appendChild(u),u.style.width="auto",u.style.position="absolute",u.style.left="50%",u.style.top="50%",u.style.transform="translate(-50%,-50%)",u.style.background="rgba(120, 120, 0, 0.7)",u.style.color="white",u.style.fontSize="10px",u.style.background="none",u.style.display="flex",u.style.justifyContent="center",u.style.alignItems="center",h=document.createElement("div"),u.appendChild(h),h.style.pointerEvents="none",h.style.display="block",h.style.width="40px",h.innerHTML=Ka.defaultsSvg.loadingSvg,h.style.filter="drop-shadow(0px 0px 1px black)",f=document.createElement("div"),u.appendChild(f),f.style.pointerEvents="none",f.style.marginLeft="10px",f.style.display="flex",f.style.flexFlow="column",f.style.maxWidth="300px",p=document.createElement("div"),f.appendChild(p),p.style.fontSize="14px",p.style.fontWeight="800",p.style.marginBottom="5px",p.style.textShadow="0 0 2px black",v=document.createElement("div"),f.appendChild(v),v.style.fontWeight="400",v.style.textShadow="0 0 2px black";{const w=()=>{let T="Raw";l.status==="Raw"?T="初始状态":l.status==="Creating"?T="正在创建":l.status==="Created"?T="创建完成":l.status==="Error"?T="创建失败":l.status==="Reconnecting"&&(T="重新连接"),p.innerText=`${T}(${l.status})`,v.innerText=`${l.statusLog}`,(l.status==="Creating"||l.status==="Reconnecting")&&(h.innerHTML=Ka.defaultsSvg.loadingSvg),l.status==="Created"&&(h.innerHTML=Ka.defaultsSvg.successSvg),l.status==="Error"&&(h.innerHTML=Ka.defaultsSvg.warnSvg)};w();const I=this.dv(c.createNextAnimateFrameEvent(l.statusLogChanged,l.statusChanged));this.d(I.don(w))}}update(){const o=255*Math.random()|0,a=255*Math.random()|0,l=255*Math.random()|0;this._div.style.background=`rgba(${o}, ${a}, ${l}, 0.8)`}}};this.d(e.containerChanged.don(()=>{t()}))}};d(Ka,"defaultsSvg",{loadingSvg:g0,successSvg:m0,warnSvg:v0});let Dh=Ka;class y0 extends c.Destroyable{constructor(e,t,r){super(),this._subContainer=e,this._overlayContainer=t,this._viewer=r;const i=this._subContainer,s=this._overlayContainer,o=this._viewer,a=()=>{const h=o.zIndex??"";i.style.zIndex=h,s.style.zIndex=h};a(),this.d(o.zIndexChanged.don(a));const l=()=>{i.style.display=o.show??!0?"block":"none"};l(),this.d(o.showChanged.don(l));const u=()=>{i.style.opacity=`${o.opacity??1}`};u(),this.d(o.opacityChanged.don(u))}}function pc(n){let e=c.getExtProp(n,"_relativeContainer");return e||(e=document.createElement("div"),e.style.position="relative",e.style.width="100%",e.style.height="100%",e.style.padding="0",e.style.margin="0",n.appendChild(e),c.setExtProp(n,"_relativeContainer",e)),e}class _0 extends c.Destroyable{constructor(t,r){super();d(this,"_subContainer",document.createElement("div"));d(this,"_overlayContainer",document.createElement("div"));d(this,"_containerStyleController");this._container=t,this._viewer=r,this._containerStyleController=this.dv(new y0(this._subContainer,this._overlayContainer,this._viewer));const{subContainer:i,overlayContainer:s}=this;i.tabIndex=-1,i.style.outline="none",i.style.width="100%",i.style.height="100%",i.onpointerdown=()=>i.focus(),s.style.position="relative",s.setAttribute("earthsdk3","earthsdk3-overlayContainer"),i.setAttribute("earthsdk3","earthsdk3-subContainer"),pc(this._container).appendChild(i),this.d(()=>pc(this._container).removeChild(i)),pc(this._container).appendChild(s),this.d(()=>pc(this._container).removeChild(s))}get subContainer(){return this._subContainer}get overlayContainer(){return this._overlayContainer}get containerStyleController(){return this._containerStyleController}get container(){return this._container}}class w0 extends c.Destroyable{constructor(){super(...arguments);d(this,"registerObjsMap",new Map)}register(t,r){return this.registerObjsMap.has(t)&&console.warn(`register warn:${t}已经被注册,再次注册会覆盖。`),this.registerObjsMap.set(t,r),t}getViewerConstructor(t){const r=this.registerObjsMap.get(t);if(!r){console.warn(`未找到${t}类!`);return}return r}createViewer(t){const r=t.type;console.log(t);const i=this.getViewerConstructor(r);if(!i)throw new Error(`没有找到类型为${r}的Viewer构造器!`);return new i(t)}}class Up extends c.Destroyable{constructor(e,t,r=!1,i=!1){if(super(),this._viewer=e,!t)throw new Error("ViewerCustomInteraction: container is null");const s=this.dv(c.DomElementEvent.create(t,"pointerdown")),o=this.dv(c.DomElementEvent.create(t,"pointermove")),a=this.dv(c.DomElementEvent.create(t,"pointerup")),l=this.dv(c.DomElementEvent.create(t,"pointerout")),u=this.dv(c.DomElementEvent.create(t,"pointerover")),h=this.dv(new c.PointerClick),f=this.dv(new c.PointerHover),p=()=>{const g=this._viewer.hoverTime*1e3;f.delayTime=g};this.d(this._viewer.hoverTimeChanged.don(()=>{p()})),this.d(s.don(g=>h.pointerDown(g))),this.d(o.don(g=>h.pointerMove(g))),this.d(a.don(g=>h.pointerUp(g))),this.d(l.don(g=>h.pointerOut(g))),this.d(s.don(g=>f.pointerDown(g))),this.d(o.don(g=>f.pointerMove(g))),this.d(a.don(g=>f.pointerUp(g))),this.d(l.don(g=>f.pointerOut(g)));const{x:v,y:w}=t.getBoundingClientRect(),I=i?v:0,T=i?w:0;this.d(f.hoverEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.hoverEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(h.clickEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.clickEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(h.dbclickEvent.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.dblclickEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(s.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.pointerDownEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(a.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);g.button===0&&this._viewer.pointerUpEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(o.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerMoveEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(u.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerOverEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})})),this.d(l.don(g=>{const[y,E]=c.getDomEventCurrentTargetPos(g,r);this._viewer.pointerOutEvent.emit({screenPosition:[y+I,E+T],pointerEvent:g})}));const L=this.dv(c.DomElementEvent.create(t,"keydown"));this.d(L.don(g=>this._viewer.keyDownEvent.emit(g)));const m=this.dv(c.DomElementEvent.create(t,"keyup"));this.d(m.don(g=>this._viewer.keyUpEvent.emit(g)));const _=this.dv(c.DomElementEvent.create(t,"wheel"));this.d(_.don(g=>this._viewer.wheelEvent.emit(g)))}}class E0 extends c.Destroyable{constructor(t){super();d(this,"viewer");const r=this.viewer=t;this.ad(new c.ObjResettingWithEvent(r.rollerShutterChanged,()=>{const i=r.container;if(!i||!r.rollerShutter)return;const s=new c.Destroyable;this.viewer.splitPosition=.5;let o=this.getRollerShutterDIV();return i.appendChild(o),s.d(()=>{this.viewer.splitPosition=0,i.removeChild(o)}),s}))}getRollerShutterDIV(){let t=document.createElement("div");t.style.position="absolute",t.style.left="50%",t.style.top="0",t.style.backgroundColor="#d3d3d3",t.style.width="5px",t.style.height="100%",t.style.zIndex="9999";const r=i=>{if(!t.parentElement)return;i.preventDefault?i.preventDefault():i.returnValue=!1;const o=i.x/t.parentElement.offsetWidth;t.style.left=`${100*o}%`,this.viewer.splitPosition=o};return t.addEventListener("mouseenter",i=>{t.style.cursor="ew-resize"}),t.addEventListener("mouseleave",i=>{t.style.cursor="default"}),t.addEventListener("mousedown",i=>{t.style.cursor="ew-resize",document.addEventListener("mousemove",r)}),document.addEventListener("mouseup",i=>{t.style.cursor="default",document.removeEventListener("mousemove",r)}),t}}class S0 extends c.Destroyable{constructor(t){super();d(this,"rollerShutterAnalysis");this.rollerShutterAnalysis=this.ad(new E0(t))}}const Oi=class Oi extends c.Destroyable{constructor(t){super();d(this,"_forceRecreateEvent",this.dv(new c.Event));d(this,"_container",this.dv(c.react(void 0)));d(this,"_containerSize",this.dv(c.react(void 0)));d(this,"_editingEvent",this.disposeVar(new c.Event));d(this,"_status",this.dv(c.react("Raw")));d(this,"_statusLog",this.dv(c.react("")));d(this,"_statusContainer",this.dv(new Dh(this)));d(this,"_useCustomInteraction",this.dv(c.react(!0)));d(this,"_resetInteractionEvent",this.dv(c.createNextAnimateFrameEvent(this.containerChanged,this._useCustomInteraction.changed,this._forceRecreateEvent)));d(this,"_interactionResetting",this.dv(new c.ObjResettingWithEvent(this._resetInteractionEvent,()=>{if(!(!this.container||!this._useCustomInteraction.value))return new Up(this,this.container)})));d(this,"_viewerChanged",this.dv(new c.Event));d(this,"_containerResetEvent",this.dv(c.createNextAnimateFrameEvent(this.containerChanged,this._forceRecreateEvent)));d(this,"_containerResetting",this.dv(new c.ObjResettingWithEvent(this._containerResetEvent,()=>{if(this.container)return new _0(this.container,this)})));d(this,"_sceneObjectsMap",new Map);d(this,"_id");d(this,"_typeName");d(this,"_updateFuncReact",this.dv(c.react(void 0)));d(this,"_toDestroyFuncReact",this.dv(c.react(void 0)));d(this,"_statusInfo",Oi.defaults.statusInfo);d(this,"_navigationMode",this.dv(c.react("Map")));d(this,"_syncViewer",this.dv(c.react(void 0)));d(this,"_syncEventDon",this.dv(new c.ObjResettingWithEvent(this.syncViewerChanged,()=>{const t=this.syncViewer;if(t)return new p0(this,t)})));d(this,"_timeSyncdon",this.dv(new c.ObjResettingWithEvent(this.timeSyncChanged,()=>{if(this.timeSync)return new d0(this)})));d(this,"_hoverEvent",this.dv(new c.Event));d(this,"_pointerOverEvent",this.dv(new c.Event));d(this,"_pointerMoveEvent",this.dv(new c.Event));d(this,"_pointerDownEvent",this.dv(new c.Event));d(this,"_pointerUpEvent",this.dv(new c.Event));d(this,"_pointerOutEvent",this.dv(new c.Event));d(this,"_clickEvent",this.dv(new c.Event));d(this,"_dblclickEvent",this.dv(new c.Event));d(this,"_keyDownEvent",this.dv(new c.Event));d(this,"_keyUpEvent",this.dv(new c.Event));d(this,"_wheelEvent",this.dv(new c.Event));d(this,"_actived",this.dv(c.react(!1)));this._id=t.id??c.createGuid();const r=Fp(t.container);if(r)this._container.value=Nh(r),this._typeName=t.type,this._initName();else throw new Error("container is not defined");{const i=()=>{r&&(this.show??!0?r.style.display="block":r.style.display="none")};i(),this.d(this.showChanged.don(i))}{const i=this._sceneObjectsMap,s=()=>{for(let[a,l]of i.entries())if(!l&&a){const u=Xs.context.createEngineObject(a,this);u&&i.set(a,u)}},o=()=>{for(let[a,l]of i.entries())l&&!l.isDestroyed()&&l.destroy(),i.set(a,void 0)};this.d(o),this.d(this.viewerChanged.don(a=>{o(),a&&s()}))}{const i=()=>{if(this.execOnceFuncStr)try{Function(`"use strict";return (${this.execOnceFuncStr})`)()(this)}catch(s){console.warn(`execOnceFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`)}};i(),this.d(this.execOnceFuncStrChanged.don(i))}{const i=()=>{if(this.updateFuncStr)try{this.updateFunc=Function(`"use strict";return (${this.updateFuncStr})`)()}catch(o){console.warn(`updateFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${o}`)}};i(),this.d(this.updateFuncStrChanged.don(i));let s;this.d(()=>s&&s.destroy()),this.d(this.updateFuncChanged.don(()=>{s&&s.cancel(),this.updateFunc&&(s=s||c.createAnimateFrame(),s.restart(void 0,o=>{this.updateFunc&&this.updateFunc(this,o)}))}))}{const i=()=>{try{this.toDestroyFunc=this.toDestroyFuncStr&&Function(`"use strict";return (${this.toDestroyFuncStr})`)()||void 0}catch(s){console.warn(`toDestroyFuncStr不能转成函数!或者函数执行时错误!id: ${this.id} ${this.typeName} error: ${s}`),this.toDestroyFunc=void 0}};i(),this.d(this.toDestroyFuncStrChanged.don(i)),this.d(this.toDestroyEvent.don(()=>{this.toDestroyFunc&&this.toDestroyFunc(this)}))}this.ad(new S0(this))}forceRecreate(){this._forceRecreateEvent.emit()}get container(){return this._container.value}set container(t){this._container.value=t}set containerOrId(t){if(typeof t=="string"){const r=document.getElementById(t);r&&r instanceof HTMLDivElement?this._container.value=Nh(r):console.warn("containerOrId warn: !(container instanceof HTMLDivElement)")}else t instanceof HTMLDivElement?this._container.value=Nh(t):console.warn("containerOrId warn: setting container failed!")}get containerChanged(){return this._container.changed}get containerSize(){return this._containerSize.value}set containerSize(t){this._containerSize.value=t}get containerSizeChanged(){return this._containerSize.changed}get editingEvent(){return this._editingEvent}get status(){return this._status.value}get statusChanged(){return this._status.changed}setStatus(t){this._status.value=t}get statusLog(){return this._statusLog.value}get statusLogChanged(){return this._statusLog.changed}setStatusLog(t){this._statusLog.value=t}get useCustomInteraction(){return this._useCustomInteraction.value}set useCustomInteraction(t){this._useCustomInteraction.value=t}get viewerChanged(){return this._viewerChanged}get containerResetEvent(){return this._containerResetEvent}get subContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.subContainer}get subContainerChanged(){return this._containerResetting.objChanged}get overlayContainer(){var t;return(t=this._containerResetting.obj)==null?void 0:t.overlayContainer}get overlayContainerChanged(){return this._containerResetting.objChanged}get sceneObjectsMap(){return this._sceneObjectsMap}get sceneObjects(){return this._sceneObjectsMap.keys()}getEngineObject(t){return this.sceneObjectsMap.get(t)}add(...t){for(let r of t)if(!this.has(r)){j.context.addSceneObject(r);const i=Xs.context.createEngineObject(r,this);i&&this._sceneObjectsMap.set(r,i),r.viewerAttached.emit(this)}}delete(...t){for(let r of t)if(this.has(r)){const i=this._sceneObjectsMap.get(r);i&&i.destroy(),j.context.deleteSceneObject(r),this._sceneObjectsMap.delete(r),r.viewerDetached.emit(this)}}disposableAdd(...t){return this.add(...t),()=>this.delete(...t)}disAdd(...t){return this.disposableAdd(...t)}has(t){return this._sceneObjectsMap.has(t)}clearAllSceneObjects(){for(let t of this.sceneObjects)this.delete(t)}get id(){return this._id}set id(t){console.warn("ESViewer id is readonly")}get typeName(){return this._typeName}_initName(){this.name=`${this.typeName}_${(""+this.id).slice(-4)}`}get defaultProps(){return Oi.createDefaultProps()}_getJson(t=!0){const r={id:this.id,type:this.typeName};for(let i of Object.keys(this.defaultProps))if(t){let s,o=this.defaultProps[i];o instanceof c.ReactiveVariable?s=o.equals(this[i]):s=o===this[i],s||(r[i]=this[i])}else r[i]=this[i];return r}_setJson(t,r,i){if(!(t instanceof Object)||t.type&&t.type!==this.typeName){console.error(`value.type && value.type${t.type} !== this.typeName${this.typeName}`);return}t.id&&t.id!==this.id&&console.warn(`value.id === undefined || value.id${t.id} !== this.id(${this.id})`);const s=r||[];s.push("id","type");const o=Object.keys(this.defaultProps).filter(a=>!s.includes(a));for(let a of o)if(a in t)this[a]=t[a]===null?void 0:t[a];else if(!(i??!1)){let l=this.defaultProps[a];l instanceof c.ReactiveVariable&&(l=l.value),this[a]=l}}get json(){return this._getJson()}set json(t){this._setJson(t,["devTags"])}get updateFunc(){return this._updateFuncReact.value}set updateFunc(t){this._updateFuncReact.value=t}get updateFuncChanged(){return this._updateFuncReact.changed}get toDestroyFunc(){return this._toDestroyFuncReact.value}set toDestroyFunc(t){this._toDestroyFuncReact.value=t}get toDestroyFuncChanged(){return this._toDestroyFuncReact.changed}get navigationMode(){return this._navigationMode.value}get navigationModeChanged(){return this._navigationMode.changed}getNavigationMode(){return this._navigationMode.value}getEngineType(){return this._typeName}get syncViewer(){return this._syncViewer.value}set syncViewer(t){this._syncViewer.value=t}get syncViewerChanged(){return this._syncViewer.changed}syncOtherViewer(t){t&&t.syncViewer&&(t.syncViewer=void 0),t===this?this._syncViewer.value=void 0:this._syncViewer.value=t}setCurrentTime(t){try{this.currentTime=typeof t=="string"?Date.parse(t):t}catch(r){console.warn(`时间格式不正确! value: ${t} error: ${r}`)}}async getVersion(){return window.g_XE3CopyRights??{}}get hoverEvent(){return this._hoverEvent}get pointerOverEvent(){return this._pointerOverEvent}get pointerMoveEvent(){return this._pointerMoveEvent}get pointerDownEvent(){return this._pointerDownEvent}get pointerUpEvent(){return this._pointerUpEvent}get pointerOutEvent(){return this._pointerOutEvent}get clickEvent(){return this._clickEvent}get dblclickEvent(){return this._dblclickEvent}get keyDownEvent(){return this._keyDownEvent}get keyUpEvent(){return this._keyUpEvent}get wheelEvent(){return this._wheelEvent}getProperties(t){return[new z("ESViewer","ESViewer",[new ie("强制刷新","重载",[],()=>this.forceRecreate(),[]),new F("debug","debug",!0,!1,[this,"debug"],Oi.defaults.debug),new F("是否可见","是否可见",!0,!1,[this,"show"]),new Y("位置点单位","lonLatFormat",!0,!1,[this,"lonLatFormat"],[["度","DECIMAL_DEGREE"],["度分","DEGREES_DECIMAL_MINUTES"],["度分秒","SEXAGESIMAL_DEGREE"]]),new F("是否开启文字避让","textAvoidance",!0,!1,[this,"textAvoidance"],!1),new J("ionAccessToken","ionAccessToken",!1,!1,[this,"ionAccessToken"]),new S("时钟","时钟",!1,!1,[this,"currentTime"]),new F("globeShow","globeShow",!0,!1,[this,"globeShow"]),new F("atmosphere","atmosphere",!1,!1,[this,"atmosphere"])]),new S("飞行像素范围","默认飞行定位时对象包围球所占的屏幕像素大小",!1,!1,[this,"flyToBoundingSize"]),new S("编辑高度偏移","编辑时默认的高度偏移",!1,!1,[this,"editingHeightOffset"]),new z("Globe","Globe",[new U("地形着色器","可以设置地形全局坡度,坡向,高程带,等高线等",!1,!1,[this,"terrainShader"])])]}get actived(){return this._actived.value}set actived(t){this._actived.value=t}get activedChanged(){return this._actived.changed}};d(Oi,"context",new w0),d(Oi,"register",Oi.context.register.bind(Oi.context)),d(Oi,"defaults",{show:!0,debug:!1,statusInfo:{fps:0,position:[0,0,0],rotation:[0,0,0],length:0},terrainShader:{slope:{show:!1},aspect:{show:!1},elevationRamp:{show:!1,minHeight:-414,maxHeight:8777,color:[]},elevationContour:{show:!1,color:[1,0,0,1],spacing:150,width:2}},globeShow:!0,splitPosition:0});let Kn=Oi;(n=>{n.createBaseProps=()=>({name:"未命名场景对象",extras:c.reactJson(void 0),devTags:c.reactArrayWithUndefined(void 0),debug:void 0,show:void 0,opacity:void 0,zIndex:void 0,useDefaultStatusDiv:!0,execOnceFuncStr:void 0,updateFuncStr:void 0,toDestroyFuncStr:void 0}),n.createCommonProps=()=>({globeShow:!0,ionAccessToken:"",lonLatFormat:"DECIMAL_DEGREE",fov:60,textAvoidance:!1,flyToBoundingSize:256,hoverTime:2,currentTime:Date.now(),simulationTime:Date.now(),timeSync:!1,rain:0,snow:0,cloud:0,fog:0,depthOfField:0,atmosphere:!0,editingPointSize:void 0,editingPointColor:c.reactArrayWithUndefined(void 0),editingAuxiliaryPointColor:c.reactArrayWithUndefined(void 0),editingLineWidth:void 0,editingLineColor:c.reactArrayWithUndefined(void 0),editingAxisSize:void 0,editingAuxiliaryPointSize:void 0,editingHeightOffset:0,editingLineShow:!0,editingEventListening:!0,terrainShader:n.defaults.terrainShader,splitPosition:c.react(void 0),rollerShutter:!1}),n.createDefaultProps=()=>({...(0,n.createBaseProps)(),...(0,n.createCommonProps)()})})(Kn||(Kn={})),c.extendClassProps(Kn.prototype,Kn.createDefaultProps);function Gp(n,e){const t=n._lastCameraInfo;if(t){const r=e.viewerChanged.don(i=>{if(!i||!t)return;const{position:s,rotation:o}=t;e.flyIn(s,o,0),n._lastCameraInfo=void 0,r()})}}const C0=n=>{const e=Kn.createCommonProps(),t={};try{Object.keys(e).forEach(r=>{t[r]=n[r]})}catch(r){console.warn(r)}return t},Wp=(n,e)=>{const t=Kn.createCommonProps();try{Object.keys(t).forEach(r=>{n[r]=e[r]})}catch(r){console.warn(r)}};class P0 extends c.Destroyable{constructor(t){super();d(this,"_viewersChanged",this.disposeVar(new c.Event));d(this,"_viewers",new Set);d(this,"_viewersToChange",this.dv(new c.Event));this._sceneObjectsManager=t,this.d(()=>{for(const r of this._viewers)this.destroyViewer(r);this._viewers.clear()}),this.viewers.forEach(r=>{const i=this._sceneObjectsManager.sceneObjects;r.add(...i)}),this.d(()=>{const r=this._sceneObjectsManager.sceneObjects;this.viewers.forEach(i=>{i.delete(...r)})}),this.d(this._sceneObjectsManager.sceneObjectsToChange.don((r,i)=>{this.viewers.forEach(s=>{i.forEach(o=>{Ji(s.devTags,o.devTags)&&(s.has(o)?console.warn(`${s.typeName}中已存${o.typeName},检查逻辑是否有问题!`):s.add(o))}),r.forEach(o=>{Ji(s.devTags,o.devTags)&&(s.has(o)?s.delete(o):console.warn(`${s.typeName}中不存在${o.typeName},检查逻辑是否有问题!`))})}),i.length>0&&i.forEach(s=>{s.d(s.devTagsChanged.don(()=>{this.viewers.forEach(o=>{o.has(s)&&o.delete(s),console.log("sceneObjectsToChange",o.devTags,s.devTags,Ji(o.devTags,s.devTags)),Ji(o.devTags,s.devTags)&&(o.has(s)?console.warn(`${o.typeName}中已存${s.typeName},检查逻辑是否有问题!`):o.add(s))})}))})})),this.d(this.viewersChanged.don((r,i)=>{const s=this._sceneObjectsManager.sceneObjects;i.forEach(o=>{for(let a of s)Ji(o.devTags,a.devTags)&&(o.has(a)?console.warn(`${o.typeName}中已存${a.typeName},检查逻辑是否有问题!`):o.add(a))}),r.forEach(o=>{for(let a of s)Ji(o.devTags,a.devTags)&&(o.has(a)?o.delete(a):console.warn(`${o.typeName}中不存在${a.typeName},检查逻辑是否有问题!`))}),i.length>0&&i.forEach(o=>{o.d(o.devTagsChanged.don(()=>{o.clearAllSceneObjects();const a=this._sceneObjectsManager.sceneObjects;for(let l of a)console.log("viewersChanged",o.devTags,l.devTags,Ji(o.devTags,l.devTags)),Ji(o.devTags,l.devTags)&&(o.has(l)?console.warn(`${o.typeName}中已存${l.typeName},检查逻辑是否有问题!`):o.add(l))}))})}))}get viewersChanged(){return this._viewersChanged}get viewers(){return this._viewers}getViewers(){return[...this._viewers]}get viewersToChange(){return this._viewersToChange}createViewer(t){const r=Kn.context.createViewer(t);return this._viewers.add(r),this._viewersChanged.emit([],[r]),r}destroyViewer(t){return t.isDestroyed()?!0:(this._viewers.delete(t),this._viewersChanged.emit([t],[]),t.destroy(),t.isDestroyed())}}class As extends c.Destroyable{constructor(...t){super();d(this,"_drgm",this.dv(new jd));d(this,"_sobjm",this.dv(new f0));d(this,"_vrm",this.dv(new P0(this._sobjm)));d(this,"_sceneObjectEditingManager",this.disposeVar(new h0));d(this,"_activeViewer",this.dv(c.react(void 0)));d(this,"_syncOtherViewersToActived",this.dv(c.react(!1)));d(this,"_cmrvm",this.createSceneObjectFromClass(Os));d(this,"_cmrvmdon",this.d(()=>this._cmrvm&&this.destroySceneObject(this._cmrvm)));d(this,"_asset",{type:"ESObjectsManager",version:"0.1.0",createdTime:"",modifiedTime:"",name:"未命名项目"});d(this,"_sceneTree",this.dv(new fu("default",this.dragstartDataMananger,24,this)));d(this,"_propUiTreeManager",this.dv(new bl(24)));d(this,"_sceneTreeMap",new Map);d(this,"_viewerCreatedEvent",this.dv(new c.Event));d(this,"_lastCameraInfo");d(this,"_lastActiveViewerJson");d(this,"syncEvent",this.dv(c.createNextAnimateFrameEvent(this.activeViewerChanged,this.syncOtherViewersToActivedChanged)));d(this,"_syncEventDon",this.d(this.syncEvent.don(()=>{const t=this.syncOtherViewersToActived;this.viewers.forEach(r=>{t?r.syncOtherViewer(this.activeViewer):r.syncOtherViewer(void 0)})})));d(this,"_player",this.createSceneObjectFromClass(Qi));d(this,"_playerdon",this.d(()=>this._player&&this.destroySceneObject(this._player)));d(this,"_esPlyarAndPathTime",this.dv(new s0(this)));d(this,"_pathAnimationManager",this.dv(new a0(this)))}static get envs(){return j.context.environmentVariables}getSceneObjectById(t){return j.getSceneObjectById(t)}getSceneObject(t){return j.getSceneObject(t)}get $refs(){return j.$refs}get dragstartDataMananger(){return this._drgm}get sceneObjectsManager(){return this._sobjm}get viewers(){return this._vrm.viewers}getViewers(){return this._vrm.getViewers()}get sceneObjectEditingManager(){return this._sceneObjectEditingManager}get activeViewer(){return this._activeViewer.value}set activeViewer(t){this._activeViewer.value=t}get activeViewerChanged(){return this._activeViewer.changed}get syncOtherViewersToActived(){return this._syncOtherViewersToActived.value}set syncOtherViewersToActived(t){this._syncOtherViewersToActived.value=t}get syncOtherViewersToActivedChanged(){return this._syncOtherViewersToActived.changed}get cameraViewsManager(){return this._cmrvm}get json(){var f;const t=this._asset.createdTime||new Date().toISOString(),r=new Date().toISOString(),i=this._asset.name||"未命名项目",o={type:"ESObjectsManager",version:this._asset.version||"0.1.0",createdTime:t,modifiedTime:r,name:i},a=this.sceneTree.json,l=this._cmrvm.views,u=[...this._vrm.viewers].map(p=>p.json),h=(f=this.activeViewer)==null?void 0:f.getCurrentCameraInfo();return{asset:o,viewers:u,sceneTree:a,viewCollection:l,lastView:h}}set json(t){try{if(!t.asset)return;if(!t.asset.type||t.asset.type!=="ESObjectsManager"){console.warn("json装配失败! asset.type 不存在或者不是'ESObjectsManager'");return}if(this._asset.createdTime=t.asset&&t.asset.createdTime||new Date().toISOString(),this._asset.modifiedTime=t.asset&&t.asset.modifiedTime||"",this._asset.name=t.asset&&t.asset.name||"未命名项目",this._asset.version=t.asset&&t.asset.version||"0.1.0",t.sceneTree&&(this.sceneTree.json=t.sceneTree),t.viewCollection&&(this._cmrvm.views=t.viewCollection),!t.viewers||!Array.isArray(t.viewers)){console.warn("viewers is not an array or does not exist !");return}if(this._vrm.viewers.size===0||t.viewers.length===0){console.warn("viewers is empty !");return}this._vrm.viewers.forEach(r=>{const i=t.viewers.find(s=>s.id===r.id);i&&(r.json=i)})}catch(r){console.error(`ESObjectsManager解析json数据时发生错误! error: ${r}`)}}get sceneTree(){return this._sceneTree}get jsonLoadingEvent(){return this._sceneTree.jsonLoadingEvent}get propUiTreeManager(){return this._propUiTreeManager}propTreeCallback(t){return l0(this,t)}getSceneTrees(){return[...this._sceneTreeMap.values()]}getSceneTree(t="default"){if(t==="default")return this._sceneTree;if(!this._sceneTreeMap.has(t)){console.warn(`id为${t}的SceneTree不存在!`);return}return this._sceneTreeMap.get(t)}createSceneTree(t,r=24){if(this._sceneTreeMap.has(t)||t==="default")console.warn(`id为${t}的SceneTree已存在!`);else{const i=this.dv(new fu(t,this.dragstartDataMananger,r,this));this._sceneTreeMap.set(t,i)}return this.getSceneTree(t)}get viewerCreatedEvent(){return this._viewerCreatedEvent}createViewer(t){const r=this._vrm.createViewer(t);this.activeViewer||(this.activeViewer=r);const i=this.d(r.viewerChanged.don(s=>{s&&(this._viewerCreatedEvent.emit(r),i())}));return r}destroyViewer(t){return this._activeViewer.value===t&&(this._activeViewer.value=void 0),this._vrm.destroyViewer(t)}switchViewer(t,r=!0,i=!0,s=!0){var u;this.activeViewer&&this.activeViewer.getNavigationMode()!=="Map"&&this.activeViewer.changeToMap(),!this._lastCameraInfo&&r&&(this._lastCameraInfo=(u=this.activeViewer)==null?void 0:u.getCurrentCameraInfo()),!this._lastActiveViewerJson&&i&&(this._lastActiveViewerJson=this.activeViewer?C0(this.activeViewer):void 0),s&&this.activeViewer&&this.destroyViewer(this.activeViewer);const o=t.id,a=o?[...this.getViewers()].find(h=>h.id===o):[...this.getViewers()].find(h=>h.typeName===t.type);if(a)if(o&&a.typeName!==t.type)console.warn(`id为${o}的viewer的typeName和option.type${t.type}不相同!,虽然id一致但是typeName不同,所以会销毁并创建新的viewer`),this.destroyViewer(a);else return console.log("ESViewer exists, will be used"),r&&Gp(this,a),i&&this._lastActiveViewerJson&&(Wp(a,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),a.container===Fp(t.container)?(a.containerOrId=t.container,a.forceRecreate()):a.containerOrId=t.container,this.activeViewer=a,a;console.log("No ESViewer exists, will be created");const l=this.createViewer(t);return console.log(t),console.log(this),r&&Gp(this,l),i&&this._lastActiveViewerJson&&(Wp(l,this._lastActiveViewerJson),this._lastActiveViewerJson=void 0),this.activeViewer=l,l}switchToCesiumViewer(...t){if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)){const{container:r,viewSync:i,attributeSync:s,destroy:o,id:a}=t[0];return this.switchViewer({type:"ESCesiumViewer",container:r,id:a},i??!0,s??!0,o??!0)}else if(typeof t[0]=="string"||t[0]instanceof HTMLDivElement){const r={container:t[0],viewSync:t[1]??!0,attributeSync:t[2]??!0,destroy:t[3]??!0,id:t[4]},{container:i,viewSync:s,attributeSync:o,destroy:a,id:l}=r;return this.switchViewer({type:"ESCesiumViewer",container:i,id:l},s,o,a)}}switchToUEViewer(...t){let r,i={viewSync:!0,attributeSync:!0,destroy:!0};if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("uri")){const{container:l,uri:u,app:h,token:f,viewSync:p,attributeSync:v,destroy:w,id:I}=t[0];r={type:"ESUeViewer",container:l,id:I,options:{uri:u,app:h,token:f}},i={viewSync:p??!0,attributeSync:v??!0,destroy:w??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("ws")){const{container:l,ws:u,esmsg:h,viewSync:f,attributeSync:p,id:v,destroy:w}=t[0];r={type:"ESUeViewer",container:l,id:v,options:{ws:u,esmsg:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:w??!0}}else if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)&&t[0].hasOwnProperty("project")){const{container:l,project:u,baseUrl:h,viewSync:f,attributeSync:p,id:v,destroy:w}=t[0];r={type:"ESUeViewer",container:l,id:v,options:{project:u,baseUrl:h}},i={viewSync:f??!0,attributeSync:p??!0,destroy:w??!0}}else(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?(r={type:"ESUeViewer",container:t[0],id:t[6],options:{ws:t[1],esmsg:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}):typeof t[1]=="string"&&t[1].startsWith("http")?(r={type:"ESUeViewer",container:t[0],id:t[7],options:{uri:t[1],app:t[2],token:t[3]??void 0}},i={viewSync:t[4]??!0,attributeSync:t[5]??!0,destroy:t[6]??!0}):(r={type:"ESUeViewer",container:t[0],id:t[6],options:{project:t[1],baseUrl:t[2]??void 0}},i={viewSync:t[3]??!0,attributeSync:t[4]??!0,destroy:t[5]??!0}));if(!r)throw new Error("参数错误");const{viewSync:s,attributeSync:o,destroy:a}=i;return this.switchViewer(r,s,o,a)}createCesiumViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESCesiumViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(r={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESCesiumViewer"}),!r)throw new Error("参数错误");return this.createViewer(r)}createOpenLayersViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESOlViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(r={container:t[0],options:t[1]??void 0,id:t[2]??void 0,type:"ESOlViewer"}),!r)throw new Error("参数错误");return this.createViewer(r)}createUeViewer(...t){let r;if(typeof t[0]=="object"&&!(t[0]instanceof HTMLDivElement)?r={...t[0],type:"ESUeViewer"}:(typeof t[0]=="string"||t[0]instanceof HTMLDivElement)&&(typeof t[1]=="string"&&t[1].startsWith("ws")?r={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{ws:t[1],esmsg:t[2]??void 0}}:typeof t[1]=="string"&&t[1].startsWith("http")?r={type:"ESUeViewer",container:t[0],id:t[4]??void 0,options:{uri:t[1],app:t[2],token:t[3]??void 0}}:r={type:"ESUeViewer",container:t[0],id:t[3]??void 0,options:{project:t[1],baseUrl:t[2]??void 0}}),!r)throw new Error("参数错误");return this.createViewer(r)}createSceneObject(t,r){return this._sobjm.createSceneObject(t,r)}createSceneObjectFromClass(t,r){return this._sobjm.createSceneObjectFromClass(t,r)}createSceneObjectFromJson(t){return this._sobjm.createSceneObjectFromJson(t)}destroySceneObject(t){const r=this._sobjm.deleteSceneObject(t);return t.destroy(),r}destroyAllSceneObjects(){const t=[...this._sobjm.sceneObjects];for(let r of t)r!=this._player&&r!=this._cmrvm&&this.destroySceneObject(r)}get player(){return this._player}get esPlyarAndPathTime(){return this._esPlyarAndPathTime}get pathAnimationManager(){return this._pathAnimationManager}}d(As,"getSceneObjById",j.context.getSceneObjectById.bind(j.context)),d(As,"getEnv",j.context.getEnv.bind(j.context)),d(As,"setEnv",j.context.setEnv.bind(j.context)),(n=>{n.createDefaultProps=()=>({})})(As||(As={})),c.extendClassProps(As.prototype,As.createDefaultProps);function I0(){const n=navigator.userAgent;let e="Unknown";/Windows/.test(n)?e="Windows":/Macintosh/.test(n)?e="MacOS":/Linux/.test(n)?e="Linux":/Android/.test(n)?e="Android":/iOS|iPhone|iPad|iPod/.test(n)&&(e="iOS");let t="Unknown";return/x64|x86_64|Win64|WOW64/.test(n)?t="x64":/x86|i686|Win32/.test(n)?t="x86":/arm64|aarch64/.test(n)?t="arm64":/arm/.test(n)&&(t="arm"),{os:e.toLocaleLowerCase(),arch:t.toLocaleLowerCase()}}const T0=Date.now();function qp(n){const{os:e,arch:t}=I0(),r={version:n.version,commitdate:n.date,commitId:n.commitId,runningTime:(Date.now()-T0)/1e3/60|0,date:new Date().toLocaleString(),href:window.location.href,os:e,arch:t},s={method:"GET",headers:new Headers,redirect:"follow"},o=window.encodeURIComponent(JSON.stringify(r));fetch(`https://account.bjxbsj.cn/api/product/record?product=EarthSDKJS&content=${o}`,s).then(a=>a.text()).then(a=>console.log(a)).catch(a=>console.log("error",a))}P.copyright=void 0;try{const n="earthsdk3",e="3.3.1",t="2025-08-14T09:06:32.000Z",r="北京西部世界科技有限公司",i="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="60921cbcff46cfbed33163bca9f10cb47aa8cd65",a=((Date.now()-1755162392e3)/36e5).toFixed(1),l=`%c🌏 ${n}%c ${e}.${s.slice(0,8)}.${t} (距今${a}个小时)
|
|
535
535
|
%c${i?i+`
|
|
536
536
|
`:""}当前网站正在使用${n},此软件版权归${r}所有
|
|
537
|
-
`;P.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","60921cbcff46cfbed33163bca9f10cb47aa8cd65")},get info(){return l},get date(){return"2025-08-14T09:06:32.000Z"},get author(){return"suplyang"},get version(){return"3.3.
|
|
537
|
+
`;P.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","60921cbcff46cfbed33163bca9f10cb47aa8cd65")},get info(){return l},get date(){return"2025-08-14T09:06:32.000Z"},get author(){return"suplyang"},get version(){return"3.3.1"},get name(){return"earthsdk3"},get commitId(){return"60921cbcff46cfbed33163bca9f10cb47aa8cd65"},print(){console.info(this.info,`
|
|
538
538
|
font-size: 18px;
|
|
539
539
|
font-weight: 1000;
|
|
540
540
|
line-height: 1;
|