earthsdk3-ue 3.4.0 → 3.5.0-beta.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.
Files changed (39) hide show
  1. package/README.md +0 -1
  2. package/dist/earthsdk3-ue.iife.js +21 -21
  3. package/dist/earthsdk3-ue.js +127 -130
  4. package/dist/earthsdk3-ue.umd.cjs +4 -4
  5. package/dist/types/ESUeViewer/ESUeViewer.d.ts +23 -18
  6. package/dist/types/ESUeViewer/ESUeViewer.d.ts.map +1 -1
  7. package/dist/types/ESUeViewer/Viewers/CSTMPSViewer/ESMsgWebSocketWrapper.d.ts +1 -1
  8. package/dist/types/ESUeViewer/Viewers/CSTMPSViewer/PSUEViewer.d.ts +1 -1
  9. package/dist/types/ESUeViewer/Viewers/CSTMPSViewer/PSUEViewerWrapper.d.ts +1 -1
  10. package/dist/types/ESUeViewer/Viewers/CSTMPSViewer/index.d.ts +4 -4
  11. package/dist/types/ESUeViewer/Viewers/H5Viewer/DLViewer.d.ts +1 -1
  12. package/dist/types/ESUeViewer/Viewers/H5Viewer/DLViewer.d.ts.map +1 -1
  13. package/dist/types/ESUeViewer/Viewers/H5Viewer/ViewerH5Instance.d.ts +1 -1
  14. package/dist/types/ESUeViewer/Viewers/H5Viewer/ViewerH5Instance.d.ts.map +1 -1
  15. package/dist/types/ESUeViewer/Viewers/INNPSViewer/WebRtcManager.d.ts +1 -1
  16. package/dist/types/ESUeViewer/Viewers/INNPSViewer/WebRtcManager.d.ts.map +1 -1
  17. package/dist/types/ESUeViewer/Viewers/INNPSViewer/WebRtcManagerWrapper.d.ts +1 -1
  18. package/dist/types/ESUeViewer/Viewers/INNPSViewer/index.d.ts +1 -1
  19. package/dist/types/ESUeViewer/inner/ReactProps.d.ts +13 -9
  20. package/dist/types/ESUeViewer/inner/ReactProps.d.ts.map +1 -1
  21. package/dist/types/ESUeViewer/inner/UeLocalViewer.d.ts +2 -2
  22. package/dist/types/ESUeViewer/inner/UeLocalViewer.d.ts.map +1 -1
  23. package/dist/types/ESUeViewer/inner/ViewerCreating.d.ts +1 -2
  24. package/dist/types/ESUeViewer/inner/ViewerCreating.d.ts.map +1 -1
  25. package/dist/types/ESUeViewer/inner/ViewerInstance.d.ts +1 -1
  26. package/dist/types/ESUeViewer/inner/ViewerInstance.d.ts.map +1 -1
  27. package/dist/types/ESUeViewer/inner/ViewerLocalInstance.d.ts +1 -1
  28. package/dist/types/ESUeViewer/inner/ViewerLocalInstance.d.ts.map +1 -1
  29. package/dist/types/ESUeViewer/uemsg/UeCloudViewerBase.d.ts +1 -1
  30. package/dist/types/ESUeViewer/uemsg/UeFuncsType.d.ts +1 -2
  31. package/dist/types/ESUeViewer/uemsg/UeFuncsType.d.ts.map +1 -1
  32. package/dist/types/UeObjects/base/UeESGeoVector/index.d.ts +1 -1
  33. package/dist/types/UeObjects/base/UeESGeoVector/index.d.ts.map +1 -1
  34. package/dist/types/UeObjects/general/UeESGeoDiv/index.d.ts +2 -2
  35. package/dist/types/UeObjects/general/UeESUnrealActor/index.d.ts +1 -1
  36. package/dist/types/UeObjects/general/UeESUnrealActor/index.d.ts.map +1 -1
  37. package/dist/types/index.d.ts +3 -0
  38. package/dist/types/index.d.ts.map +1 -1
  39. package/package.json +4 -5
@@ -1,7 +1,7 @@
1
- (function(f,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("earthsdk3"),require("xbsj-base"),require("@epicgames-ps/lib-pixelstreamingfrontend-ue5.2"),require("html2canvas")):typeof define=="function"&&define.amd?define(["exports","earthsdk3","xbsj-base","@epicgames-ps/lib-pixelstreamingfrontend-ue5.2","html2canvas"],d):(f=typeof globalThis<"u"?globalThis:f||self,d(f.EarthSDK3_UE={},f.EarthSDK3,f.xbsj_base,f.libPixelstreamingfrontendUe5_2,f.html2canvas))})(this,function(f,d,l,L,Xn){"use strict";var Fr=Object.defineProperty;var Ir=(f,d,l)=>d in f?Fr(f,d,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[d]=l;var w=(f,d,l)=>Ir(f,typeof d!="symbol"?d+"":d,l);const qn={...d.ESViewer.defaults,geoReferenceOrigin:void 0,keepWorldOriginNearCamera:!1,useCache:!0,widgetInteractionDistance:200,memReportInterval:10,sceneControlled:!0,brightness:0,emissiveIntensity:1,statusUpdateInterval:.5,baseUrl:window.location.href??"",screenPercentage:-1,antiAliasingMethod:"default"},Ni=()=>({...d.ESViewer.createCommonProps(),apiKey:"",apiUrl:"",secretKey:"",speechVoiceMode:"",geoReferenceOrigin:l.reactArrayWithUndefined(void 0),keepWorldOriginNearCamera:void 0,useCache:void 0,widgetInteractionDistance:void 0,memReportInterval:void 0,sceneControlled:void 0,brightness:void 0,emissiveIntensity:void 0,statusUpdateInterval:void 0,baseUrl:void 0,screenPercentage:void 0,antiAliasingMethod:void 0});function ce(){const u=Ni(),e=[];return Object.keys(u).forEach(t=>{e.push(t)}),e}function fe(u){const{defaults:e}=$,t=ce(),i={};return t.forEach(n=>{i[n]=u[n]??e[n]}),i}const K=async(u,e,t,i,n,r="default")=>{const o=await u.callUeFunc({f:"flyTo",p:{id:e,duration:t,flyToParam:i,position:n,flyMode:r}});if(o.error){console.error(o.error);return}return o.re},we=async(u,e)=>{const t=await u.callUeFunc({f:"destroy",p:{id:e}});return t.error&&console.error(t.error),t},_=(u,e)=>{u.callUeFunc({f:"calcFlyToParam",p:{id:e}}).then(t=>{t.error&&console.error("calcFlyToParam:",t.error)}).catch(t=>{console.error("calcFlyToParam:",t)})},zi=(u,e)=>{u.callUeFunc({f:"refreshTileset",p:{id:e}}).then(t=>{t.error&&console.error("refreshTileset:",t.error)}).catch(t=>{console.error("refreshTileset:",t)})},x=async(u,e,t,i,n,r="default")=>{const o=await u.callUeFunc({f:"flyIn",p:{id:e,position:t,rotation:i,duration:n,flyMode:r}});if(o.error){console.error(o.error);return}return o.re},ki=async(u,e)=>{if(!u){console.warn("DefaultCameraFlyIn: viewer is undefined");return}const t=await u.callUeFunc({f:"DefaultCameraFlyIn",p:{Duration:e??1}});if(t.error){console.error("DefaultCameraFlyIn:",t.error);return}return t},Gi=async u=>{if(!u){console.warn("StartVoice:viewer is undefined");return}const e=await u.callUeFunc({f:"StartVoice",p:{}});if(e.error){console.error("StartVoice:",e.error);return}return e},Hi=async u=>{if(!u){console.warn("StopVoice:viewer is undefined");return}const e=await u.callUeFunc({f:"StopVoice",p:{}});if(e.error){console.error("StopVoice:",e.error);return}return e},Ji=async(u,e)=>{if(!u){console.warn("mountPakFiles:viewer is undefined");return}const t=await u.callUeFunc({f:"MountPakFiles",p:{json:e}});if(t.error){console.error("mountPakFiles:",t.error);return}return t},Bi=async u=>{if(!u){console.warn("generateMemReport:viewer is undefined");return}const e=await u.callUeFunc({f:"GenerateMemReport",p:{}});if(e.error){console.error("generateMemReport:",e.error);return}return e},ye=async(u,e)=>{const t=await u.callUeFunc({f:"resetWithCurrentCamera",p:{id:e}});return t.error&&console.error("resetWithCurrentCamera:",t.error),t},O=(u,e,t,i,n)=>{u.callUeFunc({f:"smoothMoveWithRotation",p:{id:e,Destination:t,NewRotation:i,Time:n}}).then(r=>{r.error&&console.error("smoothMoveWithRotation:",r.error)}).catch(r=>{console.error("smoothMoveWithRotation:",r)})},j=(u,e,t,i,n,r)=>{u.callUeFunc({f:"smoothMoveOnGround",p:{id:e,Lon:t,Lat:i,Ground:n,Time:r}}).then(o=>{o.error&&console.error("smoothMoveOnGround:",o.error)}).catch(o=>{console.error("smoothMoveOnGround:",o)})},tt=(u,e,t,i,n,r,o)=>{u.callUeFunc({f:"smoothMoveWithRotationOnGround",p:{id:e,NewRotation:t,Lon:i,Lat:n,Time:r,Ground:o}}).then(s=>{s.error&&console.error("smoothMoveWithRotationOnGround:",s.error)}).catch(s=>{console.error("smoothMoveWithRotationOnGround:",s)})},Ki=(u,e,t)=>{u.callUeFunc({f:"HighlightFeature",p:{id:e,HlId:t}}).then(i=>{i.error&&console.error("HighlightFeature:",i.error)}).catch(i=>{console.error("HighlightFeature:",i)})},Xi=(u,e,t,i)=>{u.callUeFunc({f:"HighlightFeatureAndFlyTo",p:{id:e,HlId:t,Duration:i}}).then(n=>{n.error&&console.error("HighlightFeatureAndFlyTo:",n.error)}).catch(n=>{console.error("HighlightFeatureAndFlyTo:",n)})},qi=(u,e,t)=>{u.callUeFunc({f:"SetLayerVisible",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerVisible:",i.error)}).catch(i=>{console.error("SetLayerVisible:",i)})},Zi=(u,e,t)=>{u.callUeFunc({f:"SetLayerColor",p:{id:e,LayerJson:t}}).then(i=>{i.error&&console.error("SetLayerColor:",i.error)}).catch(i=>{console.error("SetLayerColor:",i)})},et=(u,e,t,i)=>{u.callUeFunc({f:"smoothMove",p:{id:e,Destination:t,Time:i}}).then(n=>{n.error&&console.error("smoothMove:",n.error)}).catch(n=>{console.error("smoothMove:",n)})},me=async(u,e,t,i)=>{const n=await u.callUeFunc({f:"callFunction",p:{id:e,fn:t,p:i}});return n.error&&(console.error("callFunction:",n.error),console.error(`id: ${e} fn: ${t} param: ${i}`)),n.re??void 0},Vi=(u,e,t,i)=>{u.callUeFunc({f:"SetNodePosition",p:{id:e,NodeName:t,NodePosition:i}}).then(n=>{n.error&&console.error("SetNodePosition:",n.error)}).catch(n=>{console.error("SetNodePosition:",n)})},Yi=(u,e,t,i)=>{u.callUeFunc({f:"SetNodeRotation",p:{id:e,NodeName:t,NodeRotation:i}}).then(n=>{n.error&&console.error("SetNodeRotation:",n.error)}).catch(n=>{console.error("SetNodeRotation:",n)})},Qi=(u,e,t,i)=>{u.callUeFunc({f:"SetNodeScale",p:{id:e,NodeName:t,NodeScale:i}}).then(n=>{n.error&&console.error("SetNodeScale:",n.error)}).catch(n=>{console.error("SetNodeScale:",n)})},W=async(u,e)=>{if(e.mode=="Follow"){const i=d.ESSceneObject.getSceneObject(e.objectId);e.objectId=i?(i.components.main??i).id:e.objectId}else if(e.mode=="Line"){const i=d.ESSceneObject.getSceneObject(e.geoLineStringId);e.geoLineStringId=i?(i.components.main??i).id:e.geoLineStringId}const t=await u.callUeFunc({f:"ChangeNavigationMode",p:e});if(t.error){console.error("ChangeNavigationMode:",t.error);return}return t},bi=async(u,e)=>{const t=await u.callUeFunc({f:"setGlobalProperty",p:e});if(t.error){console.error("setGlobalProperty:",t.error);return}return t},xi=async u=>{const e=await u.callUeFunc({f:"Quit",p:void 0});if(e.error){console.error("Quit:",e.error);return}return e},Oi=async(u,e,t,i)=>{console.log("pickCallFunc",e,t,i);const n=await u.callUeFunc({f:"pick",p:{screenPosition:e,parentInfo:i}});if(!n.re&&(n.error||n.error=="")){console.error("pick:",n.error==""?"未获取到结果":n.error);return}let r=n.re.id,o,s=r?d.ESSceneObject.getSceneObject(r):void 0;return s&&s.parentID&&(s=d.ESSceneObject.getSceneObject(s.parentID)),o=new d.ESJPickedResult(n.re,s,n.re.features,n.re.add,t,e),s&&Reflect.has(s,"allowPicking")&&Reflect.has(s,"pickedEvent")&&(s.allowPicking??!1)&&s.pickedEvent.emit(o),s&&Reflect.has(s,"allowPicking")&&!s.allowPicking?new d.ESJPickedResult:o},ji=async(u,e)=>{const t=await u.callUeFunc({f:"pickPosition",p:{screenPosition:e}});if(!t.re&&(t.error||t.error=="")){console.error("pickPosition",t.error==""?"未获取到结果":t.error);return}const{position:i}=t.re;return i},tn=async(u,e,t,i="ECC_Visibility")=>{const n=await u.callUeFunc({f:"GetHeightByLonLat",p:{Lon:e,Lat:t,Channel:i}});if(n.error){console.warn(`GetHeightByLonLat:${n.error}`);return}return n.re},en=async(u,e,t="ECC_Visibility")=>{const i=await u.callUeFunc({f:"GetHeightsByLonLats",p:{LonLats:e,Channel:t}});if(i.error){console.warn(`GetHeightsByLonLats:${i.error}`);return}i.re.heights.includes(null)&&console.warn("注意! GetHeightsByLonLats: 存在高度为null的点. there are points with a height of null");try{return i.re.heights}catch{return}},nn=async(u,e=64,t=64)=>{const i=await u.callUeFunc({f:"capture",p:{resx:e,resy:t}});if(i.error){console.warn(i.error);return}return i.re.image},rn=async(u,e,t=[64,64])=>{const i=await u.callUeFunc({f:"partialCapture",p:{startPos:e,size:t}});if(i.error){console.warn(i.error);return}return i.re.image},on=async(u,e)=>{const t=await u.callUeFunc({f:"LonLatAltToScreenPosition",p:{LonLatAlt:e}});return t.error&&console.warn(t.error),t.re},sn=async(u,e)=>{const t=await u.callUeFunc({f:"UEPositionToLonLatAlt",p:{UEPosition:e}});if(t.error){console.warn(t.error);return}return[...t.re.LonLatAlt]},an=async(u,e)=>{const t=await u.callUeFunc({f:"GetAllSocketNamesByActorTag",p:{ActorTag:e}});if(t.error){console.warn(t.error);return}return[...t.re.socketNames]},ln=async u=>{const e=await u.callUeFunc({f:"GetVersion",p:void 0});if(e.error){console.warn("GetVersion:",e.error);return}return e.re.version},dn=async(u,e)=>{const t=await u.callUeFunc({f:"GetBoundSphere",p:{id:e}});if(t.error){console.warn(t.error);return}return t.re},cn=async(u,e)=>{const t=await u.callUeFunc({f:"GetBoundSphereWithChildren",p:{id:e}});if(t.error){console.warn(`GetBoundSphereWithChildren:${t.error}`);return}return t.re},un=async(u,e)=>{const t=await u.callUeFunc({f:"GetStrokeMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetStrokeMaterialParamInfo:${t.error}`);return}return t.re},hn=async(u,e)=>{const t=await u.callUeFunc({f:"GetFillMaterialParamInfo",p:{id:e}});if(t.error){console.warn(`GetFillMaterialParamInfo:${t.error}`);return}return t.re},vn=async(u,e)=>{const t=await u.callUeFunc({f:"getGlobalProperty",p:{props:e}});if(t.error){console.warn(`getGlobalProperty:${t.error}`);return}return t.re},gn=async(u,e)=>{const t=await u.callUeFunc({f:"GetObjectByInfo",p:{info:e}});if(t.error){console.warn(`GetObjectByInfo:${t.error}`);return}return t.re},pn=async(u,e,t)=>await u.callUeFunc({f:"BindActorByTag",p:{ID:e,ActorTag:t}}),fn=async u=>await u.callUeFunc({f:"RestoreOriginalScene",p:void 0}),wn=async(u,e)=>await u.callUeFunc({f:"UnBindActorByID",p:{ID:e}}),yn=async(u,e)=>await u.callUeFunc({f:"UnBindActorByTag",p:{ActorTag:e}}),mn=async(u,e,t)=>await u.callUeFunc({f:"CreateActorByClass",p:{ID:e,ActorClass:t}}),Cn=async function(u,e,t){return await u.callUeFunc({f:"Bind3DTilesetByTag",p:{ID:e,ActorTag:t}})},En=async function(u,e){return await u.callUeFunc({f:"UnBind3DTilesetByTag",p:{ActorTag:e}})},Sn=async function(u,e){return await u.callUeFunc({f:"UnBind3DTilesetById",p:{ID:e}})},Fn=async function(u,e,t,i){return await u.callUeFunc({f:"BindImageryByTag",p:{ID:e,ActorTag:t,ComponentTag:i}})},In=async function(u,e,t){return await u.callUeFunc({f:"UnBindImageryByTag",p:{ActorTag:e,ComponentTag:t}})},Tn=async function(u,e){return await u.callUeFunc({f:"UnBindImageryById",p:{ID:e}})},Rn=async function(u,e,t,i){return await u.callUeFunc({f:"GetIdByComponentNameAndHitItem",p:{id:e,ComponentName:t,HitItem:i}})},Dn=async function(u,e="ECC_Visibility"){return await u.callUeFunc({f:"GetCameraRelativeHeight",p:{Channel:e}})},Ln=async function(u,e,t,i){const n=await u.callUeFunc({f:"SaveStringToFile",p:{String:e,Path:t??"undefine",File:i??"data.txt"}});return n.error!==""&&console.warn("SaveStringToFile: ",n.error),n},Pn=async function(u,e,t=!0){const i=await u.callUeFunc({f:"HighlightActorByTag",p:{ActorTag:e,Highlight:t}});return i.error!==""&&console.warn("HighlightActorByTag: ",i.error),i},Un=async function(u,e){const t=await u.callUeFunc({f:"SendCustomMessage",p:{Message:e}});return t.error!==""&&console.warn("SendCustomMessage: ",t.error),t},An=async function(u){const e=await u.callUeFunc({f:"GetStatus",p:void 0});if(e.error){console.warn(`GetStatus:${e.error}`);return}return e.re},Mn=async(u,e,t,i,n=!0)=>{const r=await u.callUeFunc({f:"startEditing",p:{sceneObjectID:e,editingID:t,modes:i,useKeyToSwitch:n}});if(r.error){console.error("startEditing:",r.error);return}return r},Wn=async u=>{const e=await u.callUeFunc({f:"stopEditing",p:void 0});if(e.error){console.error("stopEditing:",e.error);return}return e},$n=async(u,e,t)=>{const i=await u.callUeFunc({f:"moveObjects",p:{sceneObjectIDs:e,editingID:t}});if(i.error){console.error("moveObjects:",i.error);return}return i},_n=async u=>{const e=await u.callUeFunc({f:"GetTilesetMaterialIDList",p:void 0});if(e.error){console.error("GetTilesetMaterialIDList:",e.error);return}return e.re.materialIDList};class it extends l.Destroyable{}const Zn={Response:1},ue={UIInteraction:50,MouseWheel:75};class Vn extends l.HasOwner{constructor(t,i){super(t);w(this,"_processResponseFn",t=>this.esUeViewer.processResponse(t));w(this,"_inner");this._uri=i,this._inner=new WebSocket(this._uri),this.d(()=>{this._inner.close()}),this._innerInit()}get esUeViewer(){return this.owner}get uri(){return this._uri}get inner(){return this._inner}_innerInit(){this.inner.onmessage=t=>{if(this.isDestroyed())return;let i=new FileReader;i.onload=n=>{if(this.isDestroyed())return;let r=n.target.result,o=new Uint32Array(r),s=0;if(o[0]===Zn.Response){s+=4;let g=o[s/4];s+=4;for(let a=0;a<g;a++){let m=o[s/4];s+=4;let p=new TextDecoder("utf-8").decode(r.slice(s,s+m));s+=m,this._processResponseFn(p)}}},i.readAsArrayBuffer(t.data)},this.inner.onopen=()=>{this.isDestroyed()||(console.warn("earthsdk message websocket server connected:",this.uri),console.log("%c[EarthSDK websocket open]","background: #a6ec99; color: black","open"),this.owner.dispatchEvent(new CustomEvent("esmsgwsopen",{detail:"websocket open"})))},this._inner.onclose=t=>{this.isDestroyed()||(console.log("%c[EarthSDK websocket close ]","background: red; color: black","error"),this.owner.dispatchEvent(new CustomEvent("error",{detail:"websocket close"})))},this._inner.onerror=t=>{this.isDestroyed()||(console.log("%c[EarthSDK websocket error ]","background: red; color: black","error"),this.owner.dispatchEvent(new CustomEvent("error",{detail:"websocket error"})))}}sendInputData(t){const i=this.inner;if(i.readyState!==WebSocket.OPEN)return;const r=new Uint8Array(t)[0];if(r>=ue.UIInteraction&&r<=ue.MouseWheel){const o=new ArrayBuffer(t.byteLength+4);return new DataView(o).setUint32(0,t.byteLength,!0),new Uint8Array(o,4).set(new Uint8Array(t)),i.send(new DataView(o)),!0}else return!1}emitDescriptorWithString(t,i){let n=new TextEncoder().encode(i),r=new DataView(new ArrayBuffer(3+n.length)),o=0;r.setUint8(o,t),o++,r.setUint16(o,n.length,!0),o+=2;for(let s=0;s<n.length;s++)r.setUint8(o,n[s]),o+=1;try{this.sendInputData(r.buffer)}catch(s){console.error(`data.buffer.size: ${r.buffer.byteLength} 独立通道 sendInputData error: ${s}`,s)}}destroyImpl(){this._inner&&this._inner.close()}}window.g_emitDescriptor_maxBytes=3e4;let Yn=-1;L.Logger.SetLoggerVerbosity(1);class Qn extends l.Destroyable{constructor(t,i){super();w(this,"_eventTarget",new EventTarget);w(this,"debug",!1);w(this,"uiInteractionCallbacks",new Map);w(this,"_pixelStream");w(this,"_esMsgWsWrapper");this._domOrDomId=t,this._options=i;const n=typeof this._domOrDomId=="string"?document.getElementById(this._domOrDomId):this._domOrDomId;if(!n)throw new Error(`ESUEViewer container${this._domOrDomId} error!`);console.log(`PSUEViewer init _options ${this._options}`);const{url:r,esmsgWsUri:o}=this._options;this._pixelStream=this._initPixelStream(n,r),this.d(()=>{this._pixelStream.disconnect()}),this._handerPixelStreamEvent(),this._esMsgWsWrapper=this._initEsMsgWsWrapper(o);const s=this;if(s.esMsgWsWrapper){const g=s.webRtcController.sendMessageController.dataChannelSender.sendData;s.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(a){s.esMsgWsWrapper?s.esMsgWsWrapper.sendInputData(a):g.call(this,a)}}}get eventTarget(){return this._eventTarget}addEventListener(t,i,n){return this.eventTarget.addEventListener(t,i,n)}removeEventListener(t,i,n){return this.eventTarget.removeEventListener(t,i,n)}dispatchEvent(t){return this.eventTarget.dispatchEvent(t)}_initPixelStream(t,i){const n=new L.Config({initialSettings:{AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!1,SuppressBrowserKeys:!1,[L.TextParameters.SignallingServerUrl]:i}});return n.setFlagEnabled(L.Flags.BrowserSendOffer,!1),n.setFlagEnabled(L.Flags.HoveringMouseMode,!0),n.setFlagEnabled(L.Flags.MatchViewportResolution,!0),n.setNumericSetting(L.NumericParameters.MaxReconnectAttempts,0),new L.PixelStreaming(n,{videoElementParent:t})}get pixelStream(){return this._pixelStream}_initEsMsgWsWrapper(t){return t?this.dv(new Vn(this,t)):void 0}get esMsgWsWrapper(){return this._esMsgWsWrapper}get esWebSocketReady(){var t;return((t=this.esMsgWsWrapper)==null?void 0:t.inner.readyState)===1}_handerPixelStreamEvent(){this.pixelStream.addEventListener("videoInitialized",()=>{console.log("%c[EarthSDK webrtc videoInitialized]","background: #a6ec99; color: black","videoInitialized"),this.dispatchEvent(new CustomEvent("videoinited",{detail:"videoinited"}))}),this.pixelStream.addEventListener("webRtcFailed",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webRtc webRtcFailed]","background: red; color: black","webRtcFailed"),this.dispatchEvent(new CustomEvent("error",{detail:"webRtcFailed"})),this.pixelStream.disconnect())}),this.pixelStream.addEventListener("webRtcDisconnected",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webRtc webRtcDisconnected]","background: red; color: black","webRtcDisconnected"),this.dispatchEvent(new CustomEvent("error",{detail:"webRtcDisconnected"})),this.pixelStream.disconnect())}),this.pixelStream.addEventListener("webRtcConnected",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webrtc webRtcConnected]","background: #a6ec99; color: black","webRtcConnected"),this.dispatchEvent(new CustomEvent("webRtcConnected",{detail:"webRtcConnected"})))}),this.pixelStream.addResponseEventListener("esueviewer",t=>{this.processResponse(t)})}resolveCallback(t){let i={};try{i=JSON.parse(t)}catch{return!1}let n=i.callid;if(typeof n!="string"||!this.uiInteractionCallbacks.has(n))return!1;let r=this.uiInteractionCallbacks.get(n);return typeof r!="function"?!1:(r(i),this.uiInteractionCallbacks.delete(n),!0)}processResponse(t){if(this.debug??!1)try{const i=JSON.parse(t);if(i.ers=i.ers&&i.ers.filter(n=>n.et!=="mouseMoveEvent"),!(i.ers&&i.ers.length>0||i.frs&&i.frs.length>0))return;console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}this.resolveCallback(t)||this.dispatchEvent(new CustomEvent("ueevent",{detail:t}))}emitUIInteraction(t,i){typeof i=="function"&&(t.callid=l.createGuid(),this.uiInteractionCallbacks.set(t.callid,i)),this.pixelStream.emitUIInteraction(t)}get webRtcController(){return this.pixelStream._webRtcController}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=l.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes,o=n.length,s=++Yn;if(this.esMsgWsWrapper){if(o<r){this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-0/1-`+n);return}const g=Math.ceil(o/r)|0;[...new Array(g).keys()].map(m=>n.slice(m*r,(m+1)*r)).forEach((m,p)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-${p}/${g}-`+m)})}}emitCommand(t){this.pixelStream.emitCommand(t)}getVideoSize(){const t=this.webRtcController.videoPlayer.getVideoElement();return{width:t.videoWidth,height:t.videoHeight}}resizeUEVideo(t,i){let n={Resolution:{Width:t,Height:i}};console.log(`resizeUEVideo emitCommand ${t} ${i} begin`),this.emitCommand(n)}}class bn extends l.Destroyable{constructor(t,i,n){super();w(this,"_instance");w(this,"_event",this.dv(new l.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new Qn(this._container,{url:this._wsuri,esmsgWsUri:this._esmsgWsUri})),this.instanceInit()}get webSocketReady(){return this._instance.esWebSocketReady}get event(){return this._event}get debug(){return this._instance.debug}set debug(t){this._instance.debug=t}instanceInit(){if("addEventListener"in this._instance){["esmsgwsopen","error","videoinited","ueevent","webRtcConnected"].forEach(i=>{const n=r=>{this._event.emit(i,r.detail)};this._instance.addEventListener(i,n),this.dispose(()=>this._instance.removeEventListener(i,n))});return}this.dispose(this._instance.errorEvent.disposableOn(t=>{this._event.emit("error",t.detail)})),this.dispose(this._instance.webRtcConnectedEvent.disposableOn(t=>{this._event.emit("webRtcConnected",t.detail)})),this.dispose(this._instance.videoinitedEvent.disposableOn(t=>{this._event.emit("videoinited",t.detail)})),this.dispose(this._instance.ueevent.disposableOn(t=>{this._event.emit("ueevent",t.detail)}))}emitUIInteractionForBigData(t,i){return new Promise((n,r)=>{const o=(...s)=>{n(s),i&&i(...s)};try{this._instance.emitUIInteractionForBigData(t,o)}catch(s){console.warn(`emitUIInteraction发生错误:${s}`),r(s)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}class xn extends it{constructor(t,i,n,r){super();w(this,"_esueViewerWrapper");w(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));w(this,"_ueFuncWithIdAndResultCallbacks",[]);w(this,"_waitingUeFuncIdAndResultCallbacks",new Map);w(this,"_waitingUeCalls",new Set);w(this,"_ueEvent",this.dv(new l.Event));w(this,"_errorEvent",this.dv(new l.Event));w(this,"_readyEvent",this.dv(new l.Event));w(this,"_esmsgwsopen",this.dv(l.react(!1)));w(this,"_videoinited",this.dv(l.react(!1)));w(this,"_webRtcConnected",this.dv(l.react(!1)));this._ueViewer=r,console.log("CSTMPSViewer init ! 以官方像素流 + 独立通信的模式启动!");const o=this._ueViewer;this._esueViewerWrapper=this.dv(new bn(t,i,n));const s=this._esueViewerWrapper;{const v=()=>s.debug=o.debug??!1;v(),this.d(o.debugChanged.don(v))}let g=!1;{const v=()=>{if(g)return;const h=s.webSocketReady;if(this.videoinited&&this.webRtcConnected&&h){console.log("%c[EarthSDK: esmsgWebSocket && videoinited && webRtcConnected]","background: #a6ec99; color: black");const y={eventType:"init",params:{}};s.emitUIInteractionForBigData(y),this._readyEvent.emit(),g=!0}};this.d(this.videoinitedChanged.don(()=>{v()})),this.d(this.webRtcConnectedChanged.don(()=>{v()})),this.d(this.esmsgwsopenChanged.don(()=>{v()}))}this.d(s.event.don((v,h)=>{if(v==="error")this._errorEvent.emit(h);else if(v==="ueevent"){const y=JSON.parse(h);if(y.t==="cr"){const C=y;if(C.frs&&this._ueFuncResultWithIdsEvent.emit(C.frs),C.ers)for(let E of C.ers)this._ueEvent.emit(E)}}else v==="webRtcConnected"?this.webRtcConnected=!0:v==="videoinited"?this.videoinited=!0:v==="esmsgwsopen"&&(this.esmsgwsopen=!0)}));{const v=this.dv(l.createAnimateFrame());let h,y;v.start(()=>{if(h!==t.offsetWidth||y!==t.offsetHeight){if(h=t.offsetWidth,y=t.offsetHeight,h===void 0||y===void 0||!Number.isFinite(h)||!Number.isFinite(y)||h<0||y<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${h} ${y}`);return}s.resize(h,y),console.log(`resize: ${h} ${y}`)}})}this.d(this._ueFuncResultWithIdsEvent.don(v=>{for(const h of v){const y=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);y&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),y.resultCallback(h.r))}}));let a=0;const m=v=>{const h={n:a++,tt:Date.now(),t:"c",fs:v};this._waitingUeCalls.add(h),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._esueViewerWrapper.emitUIInteractionForBigData(h,()=>{this._waitingUeCalls.delete(h)})},p=()=>{if(!g||this._ueFuncWithIdAndResultCallbacks.length===0)return;const v=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,y]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,y);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,y=v.map(R=>({f:R,s:JSON.stringify(R).length}));let C=y.length,E=0,T=0,S=[];do{do{const{f:R,s:I}=y[E];if(S.push(R),++E,T+I>h||S.length>=20)break}while(E<C);S.length>0&&(o.debug&&console.log(`传送${S.length}条消息...`),m([...S]),S.length=0,T=0)}while(E<C)}};this.dv(l.createInterval()).start(p,50),this.d(()=>console.log("UeCloudViewer正在销毁..."))}get esueViewerWrapper(){return this._esueViewerWrapper}get errorEvent(){return this._errorEvent}get readyEvent(){return this._readyEvent}get esmsgwsopen(){return this._esmsgwsopen.value}set esmsgwsopen(t){this._esmsgwsopen.value=t}get esmsgwsopenChanged(){return this._esmsgwsopen.changed}get videoinited(){return this._videoinited.value}set videoinited(t){this._videoinited.value=t}get videoinitedChanged(){return this._videoinited.changed}get webRtcConnected(){return this._webRtcConnected.value}set webRtcConnected(t){this._webRtcConnected.value=t}get webRtcConnectedChanged(){return this._webRtcConnected.changed}resize(t,i){this.esueViewerWrapper.resize(t,i)}callUeFunc(t){return new Promise(i=>{const r={fid:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){(this._ueViewer.debug??!1)&&console.log(`disposableOnUeEvent from UeCloudViewer, type:${t}`);const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}function On(u){let e="";const t=new Uint8Array(u),i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n]);return btoa(e)}const jn=u=>{const e={type:"input",inputdata:On(u)};return JSON.stringify(e)};function tr(u){return typeof u=="string"?document.getElementById(u):u}window.g_emitDescriptor_maxBytes=3e4,console.log("全局可设置消息体最大字节, window.g_emitDescriptor_maxBytes 默认 30000 。");let er=-1;L.Logger.SetLoggerVerbosity(1);class ir extends l.Destroyable{constructor(t,i){super();w(this,"debug",!1);w(this,"_error",this.dv(new l.Event));w(this,"_connected",this.dv(new l.Event));w(this,"_ueevent",this.dv(new l.Event));w(this,"_pixelStream");w(this,"uiInteractionCallbacks",new Map);this._container=t,this._option=i;const n=new L.Config({initialSettings:{HoveringMouse:!0,AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!1,SuppressBrowserKeys:!1,ss:this._option.ws},useUrlParams:!0});n.setFlagEnabled(L.Flags.BrowserSendOffer,!1),n.setFlagEnabled(L.Flags.HoveringMouseMode,!0),n.setFlagEnabled(L.Flags.MatchViewportResolution,!0),n.setNumericSetting(L.NumericParameters.MaxReconnectAttempts,0),this._pixelStream=new L.PixelStreaming(n,{videoElementParent:this.container}),this.d(()=>{this._pixelStream.disconnect()});{const r=this.pixelStream.webSocketController.webSocket,o=this._pixelStream._webRtcController.sendMessageController.dataChannelSender.sendData;this._pixelStream._webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(s){r?r.send(jn(s)):o.call(this,s)}}{const r=o=>{const s=this._pixelStream._webRtcController.mouseController;setTimeout(()=>{const g=s.coordinateConverter.normalizeAndQuantizeUnsigned(o.offsetX,o.offsetY),m=s.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");m&&m([o.button,g.x,g.y]),o.preventDefault()})};this.container.addEventListener("dblclick",r),this.d(()=>{this.container.removeEventListener("dblclick",r)})}["error","close","open"].forEach(o=>{const s=()=>{this.isDestroyed()||(o==="open"?this.connected.emit("webSocketOpen"):o==="close"?this.error.emit("webSocketClose"):o==="error"&&this.error.emit("webSocketError"))};this.pixelStream.webSocketController.webSocket.addEventListener(o,s),this.d(()=>{this.pixelStream.webSocketController.webSocket.removeEventListener(o,s)})}),["videoInitialized","webRtcConnected","webRtcDisconnected","webRtcFailed"].forEach(o=>{const s=()=>{this.isDestroyed()||(o==="webRtcConnected"||o==="videoInitialized"?this.connected.emit(o):(o==="webRtcDisconnected"||o==="webRtcFailed")&&(this.error.emit(o),this.pixelStream.disconnect()))};this.pixelStream.addEventListener(o,s),this.d(()=>{this.pixelStream.removeEventListener(o,s)})}),this.pixelStream.addResponseEventListener("handle_responses",r=>{this.processResponse(r)}),this.d(()=>{this.pixelStream.removeResponseEventListener("handle_responses")})}get error(){return this._error}get connected(){return this._connected}get ueevent(){return this._ueevent}get container(){return tr(this._container)}get pixelStream(){return this._pixelStream}get webSocketReady(){return this.pixelStream.webSocketController.webSocket.readyState===1}processResponse(t){if(this.debug??!1)try{const i=JSON.parse(t);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}this.resolveCallback(t)||this.ueevent.emit(t)}emitUIInteractionForBigData(t,i){typeof i=="function"&&(t.callid=l.createGuid(),this.uiInteractionCallbacks.set(t.callid,i));const n=JSON.stringify(t),r=window.g_emitDescriptor_maxBytes??3e4,o=n.length,s=++er;if(o<r){const m={type:"earthsdk",time:new Date().getTime(),params:`${s}-0/1-`+n};this.sendData(JSON.stringify(m));return}const g=Math.ceil(o/r)|0;[...new Array(g).keys()].map(m=>n.slice(m*r,(m+1)*r)).forEach((m,p)=>{const c={type:"earthsdk",time:new Date().getTime(),params:`${s}-${p}/${g}-`+m};this.sendData(JSON.stringify(c))})}sendData(t){this.pixelStream.webSocketController.webSocket.send(t)}resolveCallback(t){let i={};try{i=JSON.parse(t)}catch{return!1}let n=i.callid;if(typeof n!="string"||!this.uiInteractionCallbacks.has(n))return!1;let r=this.uiInteractionCallbacks.get(n);return typeof r!="function"?!1:(r(i),this.uiInteractionCallbacks.delete(n),!0)}getVideoSize(){const t=this._pixelStream._webRtcController.videoPlayer.getVideoElement();return{width:t.videoWidth,height:t.videoHeight}}emitCommand(t){this.pixelStream.emitCommand(t)}emitUIInteraction(){console.log("emitUIInteraction 像素流初始化"),this.pixelStream.emitUIInteraction("像素流初始化")}resizeUEVideo(t,i){const n={Resolution:{Width:t,Height:i}};console.log(`resizeUEVideo emitCommand ${t} ${i} begin`),this.emitCommand(n)}}class nr extends l.Destroyable{constructor(t,i,n){super();w(this,"_instance");w(this,"_event",this.dv(new l.Event));this._container=t,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new ir(this._container,{ws:this._wsuri})),this.d(this._instance.connected.don(r=>{this._event.emit(r,r),console.log(`%c[EarthSDK] ${r}`,"background: #a6ec99; color: black")})),this.d(this._instance.error.don(r=>{this._event.emit("errorEvent",r),console.log(`%c[EarthSDK] ${r}`,"background: red; color: black")})),this.d(this._instance.ueevent.don(r=>{this._event.emit("ueevent",r)}))}get instance(){return this._instance}get event(){return this._event}get debug(){return this._instance.debug}set debug(t){this._instance.debug=t}emitUIInteractionForBigData(t,i){return new Promise((n,r)=>{const o=(...s)=>{n(s),i&&i(...s)};try{this._instance.emitUIInteractionForBigData(t,o)}catch(s){console.warn(`emitUIInteraction发生错误:${s}`),r(s)}})}getVideoSize(){return this._instance.getVideoSize()}resize(t,i){this._instance.resizeUEVideo(t,i)}}class rr extends it{constructor(t,i,n,r){super();w(this,"_videoInitialized",this.dv(l.react(!1)));w(this,"_webRtcConnected",this.dv(l.react(!1)));w(this,"_webSocketOpen",this.dv(l.react(!1)));w(this,"_ue5ViewerWrapper");w(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));w(this,"_ueFuncWithIdAndResultCallbacks",[]);w(this,"_waitingUeFuncIdAndResultCallbacks",new Map);w(this,"_waitingUeCalls",new Set);w(this,"_ueEvent",this.dv(new l.Event));w(this,"_errorEvent",this.dv(new l.Event));w(this,"_readyEvent",this.dv(new l.Event));this._ueViewer=r,console.log("INNPSViewer init ! 以内置信令服务器模式启动!");const o=this._ueViewer,s=this.dv(new nr(t,i,n));this._ue5ViewerWrapper=s;{const c=()=>s.debug=o.debug??!1;c(),this.d(o.debugChanged.don(c))}{let c=!1;const v=this.dv(l.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(v.don(()=>{if(c)return;const h=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&h){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),c=!0,console.log("%c[EarthSDK videoInitialized && webRtcConnected && webSocketReady]","background: #a6ec99; color: black");const y={eventType:"init",params:{}};this._ue5ViewerWrapper.emitUIInteractionForBigData(y)}else console.warn("webSocketReady",h),c=!1}))}this.d(s.event.don((c,v)=>{if(c==="errorEvent")this._errorEvent.emit(v);else if(c==="videoInitialized")this._videoInitialized.value=!0;else if(c==="webRtcConnected")this._webRtcConnected.value=!0;else if(c==="webSocketOpen")this._webSocketOpen.value=!0;else if(c==="ueevent"){const h=JSON.parse(v);if(h.t==="cr"){const y=h;if(y.frs&&this._ueFuncResultWithIdsEvent.emit(y.frs),y.ers)for(let C of y.ers)this._ueEvent.emit(C)}}}));{const c=this.dv(l.createAnimateFrame());let v,h,y;c.start(()=>{if(v!==t.offsetWidth||h!==t.offsetHeight||y!==o.resolutionScale){if(v=t.offsetWidth,h=t.offsetHeight,v===void 0||h===void 0||!Number.isFinite(v)||!Number.isFinite(h)||v<0||h<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${v} ${h}`);return}y=o.resolutionScale,s.resize(v/y,h/y)}})}this.d(this._ueFuncResultWithIdsEvent.don(c=>{for(const v of c){const h=this._waitingUeFuncIdAndResultCallbacks.get(v.fid);h&&(this._waitingUeFuncIdAndResultCallbacks.delete(v.fid),h.resultCallback(v.r))}}));let g=0;const a=c=>{const v={n:g++,tt:Date.now(),t:"c",fs:c};this._waitingUeCalls.add(v),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(v,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._ue5ViewerWrapper.emitUIInteractionForBigData(v,()=>{this._waitingUeCalls.delete(v)})},m=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const v=this._ueFuncWithIdAndResultCallbacks.map(([h])=>h);for(const[h,y]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,y);this._ueFuncWithIdAndResultCallbacks.length=0;{const h=window.g_emitDescriptor_maxBytes,y=v.map(R=>({f:R,s:JSON.stringify(R).length}));let C=y.length,E=0,T=0,S=[];do{do{const{f:R,s:I}=y[E];if(S.push(R),++E,T+I>h||S.length>=20)break}while(E<C);S.length>0&&(o.debug&&console.log(`传送${S.length}条消息...`),a([...S]),S.length=0,T=0)}while(E<C)}};this.dv(l.createInterval()).start(m,50),this.d(()=>console.log("UeCloudViewer正在销毁..."))}get videoInitialized(){return this._videoInitialized.value}get webRtcConnected(){return this._webRtcConnected.value}get webSocketOpen(){return this._webSocketOpen.value}get ue5ViewerWrapper(){return this._ue5ViewerWrapper}get errorEvent(){return this._errorEvent}get readyEvent(){return this._readyEvent}resize(t,i){this.ue5ViewerWrapper.resize(t,i)}callUeFunc(t){return new Promise(i=>{const r={fid:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:t,resultCallback:i}])})}disposableOnUeEvent(t,i){const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.don(s=>{s.et===t&&s.eid===n&&i(s)});return()=>{o(),r()}}}class or extends l.Destroyable{constructor(t,i,n,r){super();w(this,"_onRuntimeInitialized",this.dv(new l.Event));w(this,"_vIframe",null);this._ueViewer=r;const o=this._ueViewer;{const s=document.createElement("iframe");this._vIframe=s,s.style.cssText="width: 100%; height: 100%; margin: 0; padding: 0; border: none; outline: none;",t.appendChild(s),this.d(()=>{s&&t.removeChild(s)});const g=d.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);s.src=g,s.onload=()=>{const a=s.contentWindow;if(!a){console.error("iframeWindow is null");return}console.log("iwindow.Module",a.Module),a.Module.onRuntimeInitialized=()=>{this._onRuntimeInitialized.emit(),o.setStatus("Created"),o.setStatusLog("创建成功"),a.Module.UE4_resizeCanvas(),a.console.log("创建成功__________________________________________")}}}}get onRuntimeInitialized(){return this._onRuntimeInitialized}get vIframe(){return this._vIframe}}const Nn=typeof TextDecoder<"u"?new TextDecoder:void 0,sr=(u,e=0,t=NaN)=>{const i=e+t;let n=e;for(;u[n]&&!(n>=i);)++n;if(n-e>16&&u.buffer&&Nn)return Nn.decode(u.subarray(e,n));let r="";for(;e<n;){var o=u[e++];if(!(o&128)){r+=String.fromCharCode(o);continue}var s=u[e++]&63;if((o&224)==192){r+=String.fromCharCode((o&31)<<6|s);continue}var g=u[e++]&63;if((o&240)==224?o=(o&15)<<12|s<<6|g:((o&248)!=240&&console.warn("Invalid UTF-8 leading byte encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),o=(o&7)<<18|s<<12|g<<6|u[e++]&63),o<65536)r+=String.fromCharCode(o);else{var a=o-65536;r+=String.fromCharCode(55296|a>>10,56320|a&1023)}}return r};class ar extends l.Destroyable{constructor(e,t,i){super();{const n=()=>{const g=fe(t);t.setGlobalProperty(g)};n();const r=ce(),o=[];r.forEach(g=>{const a=t[g+"Changed"];o.push(a)});const s=this.dv(l.createNextAnimateFrameEvent(...o));this.d(s.don(n))}this.d(t.propChanged.don(n=>{if(n.objId==="")try{Object.keys(n.props).forEach(r=>{const o=n.props[r]===null?void 0:n.props[r];t[r]=o})}catch(r){console.error("ueViewer propChanged:"+r)}})),t.useCustomInteraction=!1,this.dv(new d.ViewerCustomInteraction(t,e)),this.dv(new l.ObjResettingWithEvent(t.statusUpdateIntervalChanged,n=>{if((t.statusUpdateInterval??.5)===0)return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("statusUpdate",s=>{t.statusUpdateEvent.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("propChanged",o=>{t.propChanged.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("objectEvent",o=>{t.objectEvent.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("widgetEvent",o=>{t.widgetEvent.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("speechRecognition",o=>{t.speechRecognition.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("customMessage",o=>{t.customMessage.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const r=new l.Destroyable;return r.d(i.disposableOnUeEvent("editingEvent",o=>{o.objectIDs=o.objectIDs.map(s=>{var g;return((g=d.ESSceneObject.getSceneObjById(s))==null?void 0:g.parentID)??s}),t.editingEvent.emit(o)})),r})),this.ad(i.disposableOnUeEvent("cameraChanged",()=>{t.cameraChanged.emit()}))}}let lr=-1;class dr extends it{constructor(t,i,n="${earthsdk3-ue-h5-assets-script-dir}",r){super();w(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));w(this,"_ueFuncWithIdAndResultCallbacks",[]);w(this,"_waitingUeFuncIdAndResultCallbacks",new Map);w(this,"_waitingUeCalls",new Map);w(this,"_ueEvent",this.dv(new l.Event));this._ueViewer=r;const o=this._ueViewer,s=this.dv(new or(t,i,n,o));let g=!1,a=null;this.d(s.onRuntimeInitialized.don(()=>{var v;if(g=!0,(v=s==null?void 0:s.vIframe)!=null&&v.contentWindow){a=s.vIframe.contentWindow;const h=s.vIframe.contentWindow.document.getElementById("mainarea");h?this.dv(new ar(h,o,this)):console.error("h5Container is null")}else{console.error("iframeWindow is null");return}a.UE_JSHTML5Communication?a.UE_JSHTML5Communication.UESendMessageToJS=h=>{try{const y=sr(a.HEAPU8,h),C=JSON.parse(y);if(o.debug&&(console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(C,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()),C.t==="cr"){const E=C;if(E.frs&&this._ueFuncResultWithIdsEvent.emit(E.frs),E.ers)for(let T of E.ers)this._ueEvent.emit(T)}C.callid&&this._waitingUeCalls.has(C.callid)&&(this._waitingUeCalls.delete(C.callid),console.log(`waitingUeCalls.delete:${C.callid} end`))}catch(y){console.error("UE_JSHTML5Communication.UESendMessageToJS error:",y)}}:console.error("UE_JSHTML5Communication UESendMessageToJS not found")})),this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(v=>{for(const h of v){const y=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);y&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),y(h.r))}}));let m=0;const p=()=>{if(!g||!a||!a.UE_JSHTML5Communication||!a.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const v=this._ueFuncWithIdAndResultCallbacks.map(([I])=>I),h={n:m++,tt:Date.now(),t:"c",fs:v,callid:l.createGuid()};for(const[I,A]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(I.fid,A);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.set(h.callid,h),o.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const y=JSON.stringify(h),C=window.g_emitDescriptor_maxBytes??3e4,E=y.length,T=++lr;if(E<C){const I=`${T}-0/1-`+y;a.UE_JSHTML5Communication.JSSendMessageToUE(I);return}const S=Math.ceil(E/C)|0;[...new Array(S).keys()].map(I=>y.slice(I*C,(I+1)*C)).forEach((I,A)=>{const _i=`${T}-${A}/${S}-`+I;a.UE_JSHTML5Communication.JSSendMessageToUE(_i)})};this.dv(l.createInterval()).start(p,50)}processResponse(t){if(this._ueViewer.debug??!1)try{const i=JSON.parse(t);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${t}) error: ${i}`,i)}}callUeFunc(t){return new Promise(i=>{const r={fid:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.disposableOn(s=>{s.et===t&&s.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(s)}`),i(s))});return()=>{o(),r()}}}let cr=-1;class ur extends it{constructor(t,i){super();w(this,"_ueFuncResultWithIdsEvent",this.dv(new l.Event));w(this,"_ueFuncWithIdAndResultCallbacks",[]);w(this,"_waitingUeFuncIdAndResultCallbacks",new Map);w(this,"_waitingUeCalls",new Set);w(this,"_ueEvent",this.dv(new l.Event));this._ueViewer=i;const n=this._ueViewer;let r=!1;const o={eventType:"init",params:{}};window.ue.es.oncommand(JSON.stringify(o)),r=!0,window.calljs=(m,p)=>{if(n.debug&&console.log(`calljs eventName:${m} eventDetailStr:${p}`),m==="ueevent"||m==="commanFinish")try{const c=JSON.parse(p);if(c.t==="cr"){const v=c;if(v.frs&&this._ueFuncResultWithIdsEvent.emit(v.frs),v.ers)for(let h of v.ers)this._ueEvent.emit(h)}}catch(c){console.error(c)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(m=>{for(const p of m){const c=this._waitingUeFuncIdAndResultCallbacks.get(p.fid);c&&(this._waitingUeFuncIdAndResultCallbacks.delete(p.fid),c(p.r))}}));let s=0;const g=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const m=this._ueFuncWithIdAndResultCallbacks.map(([v])=>v),p={n:s++,tt:Date.now(),t:"c",fs:m};for(const[v,h]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(v.fid,h);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.add(p),n.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(p,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const c=++cr;window.ue.es.oncommand(`${c}-0/1-`+JSON.stringify(p)).then(()=>{this._waitingUeCalls.delete(p)})};this.dv(l.createInterval()).start(g,50)}callUeFunc(t){return new Promise(i=>{const r={fid:l.createGuid(),...t};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(t,i){const n=l.createGuid();this.callUeFunc({f:"addEventListener",p:{et:t,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},o=this._ueEvent.disposableOn(s=>{s.et===t&&s.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${t} eid:${n} ueEvent:${JSON.stringify(s)}`),i(s))});return()=>{o(),r()}}}class hr extends l.Destroyable{constructor(e,t){super();{const i=()=>{const s=fe(e);e.setGlobalProperty(s)};i();const n=ce(),r=[];n.forEach(s=>{const g=e[s+"Changed"];r.push(g)});const o=this.dv(l.createNextAnimateFrameEvent(...r));this.d(o.don(i))}this.d(e.propChanged.don(i=>{if(i.objId==="")try{Object.keys(i.props).forEach(n=>{const r=i.props[n]===null?void 0:i.props[n];e[n]=r})}catch(n){console.error("ueViewer propChanged:"+n)}})),this.dv(new l.ObjResettingWithEvent(e.statusUpdateIntervalChanged,i=>{if((e.statusUpdateInterval??.5)===0)return;const r=new l.Destroyable;return r.d(t.disposableOnUeEvent("statusUpdate",o=>{e.statusUpdateEvent.emit(o)})),r})),this.dv(new l.ObjResettingWithEvent(e.propChangedListeningChanged,()=>{if(!(e.propChangedListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("propChanged",r=>{e.propChanged.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.objectEventListeningChanged,()=>{if(!(e.objectEventListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("objectEvent",r=>{e.objectEvent.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.widgetEventListeningChanged,()=>{if(!(e.widgetEventListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("widgetEvent",r=>{e.widgetEvent.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.speechRecognitionListeningChanged,()=>{if(!(e.speechRecognitionListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("speechRecognition",r=>{e.speechRecognition.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.customMessageListeningChanged,()=>{if(!(e.customMessageListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("customMessage",r=>{e.customMessage.emit(r)})),n})),this.dv(new l.ObjResettingWithEvent(e.editingEventListeningChanged,()=>{if(!(e.editingEventListening??!0))return;const n=new l.Destroyable;return n.d(t.disposableOnUeEvent("editingEvent",r=>{r.objectIDs=r.objectIDs.map(o=>{var s;return((s=d.ESSceneObject.getSceneObjById(o))==null?void 0:s.parentID)??o}),e.editingEvent.emit(r)})),n})),this.ad(t.disposableOnUeEvent("cameraChanged",()=>{e.cameraChanged.emit()}))}}class vr extends l.Destroyable{constructor(e,t,i){super();{const r=()=>{const a=fe(t);t.setGlobalProperty(a)};r();const o=ce(),s=[];o.forEach(a=>{const m=t[a+"Changed"];s.push(m)});const g=this.dv(l.createNextAnimateFrameEvent(...s));this.d(g.don(r))}this.d(t.propChanged.don(r=>{if(r.objId==="")try{Object.keys(r.props).forEach(o=>{const s=r.props[o]===null?void 0:r.props[o];t[o]=s})}catch(o){console.error("ueViewer propChanged:"+o)}}));const n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.position="absolute",n.style.overflow="hidden",n.style.top="0",n.style.left="0",n.style.zIndex="0",n.style.backgroundColor="rgba(255,0,0,0)",n.setAttribute("masker","大屏顶层div,用于模拟鼠标事件和控制UE鼠标事件是否生效"),e.appendChild(n),this.d(()=>{n&&e&&e.removeChild(n)});{const r=(a,m)=>{window.ue.esinput.setinterceptevent(m),a.preventDefault()},o=a=>{r(a,!1)},s=a=>{r(a,!0)},g=a=>{r(a,!1)};n.addEventListener("mouseenter",o),n.addEventListener("mouseleave",s),n.addEventListener("mousemove",g),this.d(()=>{n.removeEventListener("mouseenter",o),n.removeEventListener("mouseleave",s),n.removeEventListener("mousemove",g)})}t.useCustomInteraction=!1,this.dv(new d.ViewerCustomInteraction(t,n)),this.dv(new l.ObjResettingWithEvent(t.statusUpdateIntervalChanged,r=>{if((t.statusUpdateInterval??.5)===0)return;const s=new l.Destroyable;return s.d(i.disposableOnUeEvent("statusUpdate",g=>{t.statusUpdateEvent.emit(g)})),s})),this.dv(new l.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("propChanged",s=>{t.propChanged.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("objectEvent",s=>{t.objectEvent.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("widgetEvent",s=>{t.widgetEvent.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("speechRecognition",s=>{t.speechRecognition.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("customMessage",s=>{t.customMessage.emit(s)})),o})),this.dv(new l.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const o=new l.Destroyable;return o.d(i.disposableOnUeEvent("editingEvent",s=>{s.objectIDs=s.objectIDs.map(g=>{var a;return((a=d.ESSceneObject.getSceneObjById(g))==null?void 0:a.parentID)??g}),t.editingEvent.emit(s)})),o})),this.ad(i.disposableOnUeEvent("cameraChanged",()=>{t.cameraChanged.emit()}))}}class gr extends l.Destroyable{constructor(t,i,n){super();w(this,"_reconnectEvent",this.dv(new l.Event));const r=(p,c)=>p.hasOwnProperty(c);let o=0,s;this.d(()=>{s&&clearTimeout(s)});const a=new URLSearchParams(window.location.search).get("eswebview")==="true",m=()=>{if(window.ue.esinput){n.setStatus("Creating"),console.log("存在(window.ue && window.ue.es && window.ue.esinput 需要适配新版ESWebView 鼠标穿透), 开始创建UeFalseCloudViewer..."),n.setStatusLog("开始创建本地视口...");const p=this.dv(new ur(t,n));this.d(()=>n.viewer=void 0),n.viewer=p,n.setStatus("Created"),n.setStatusLog("本地视口创建成功!"),this.dv(new vr(t,n,p))}else n.setStatus("Error"),n.setStatusLog("请升级 ESWebView !"),this.d(()=>n.viewer=void 0),n.viewer=void 0};if(window.ue&&window.ue.es)m();else if(a){const p=setInterval(()=>{window.ue&&window.ue.es&&(clearInterval(p),m())},200)}else if(r(i.options,"ws")||r(i.options,"uri")&&r(i.options,"app")){n.setStatus("Creating"),n.setStatusLog("开始创建云渲染视口...");let p;this.d(()=>{n.setStatus("Raw"),n.setStatusLog(""),t&&p&&t.removeChild(p)&&(p=void 0)});const c=this.dv(l.createProcessingFromAsyncFunc(async v=>{n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,p&&t.removeChild(p)&&(p=void 0),p=document.createElement("div"),p.setAttribute("earthsdk3-ue","earthsdk3-ue-videoContainer"),p.style.cssText="position:relative; height: 100%;width:100%;",t.appendChild(p);let h,y,C;if(r(i.options,"ws")){const{ws:R,esmsg:I,uselnternalSignallingServer:A}=i.options;h=R,y=I,C=A??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:R,offsetHeight:I}=p;let{uri:A,app:_i,token:Bn}=i.options;A.endsWith("/")||(A+="/");const wr=Bn?`?essstoken=${Bn}`:"",Kn=`/${_i}/${R??1920}/${I??1080}`+wr;console.log(`请求信令服务器: ${A}instance${Kn}`);const yr=await v.promise(fetch(`${A}instance${Kn}`,{method:"GET"})),b=await v.promise(yr.json());if(b&&b.status!=="ok"){n.setStatus("Error"),n.setStatusLog(`信令服务器请求失败 ${b.status}`),this._reconnectEvent.emit(void 0);return}else{console.log(`信令服务器请求成功! ${JSON.stringify(b,void 0," ")}`),await l.sleep(2e3);const{server:mr,esmsg:Cr,instanceId:Er,useInternalSignallingServer:Sr}=b;if(!Er){n.setStatus("Error"),n.setStatusLog("检查信令服务器版本,返回数据错误! "),console.log("信令服务器返回数据错误!不包含instanceId!请升级到 ESSS V3.0+ 版本!"),this._reconnectEvent.emit(void 0);return}h=mr,y=Cr,C=Sr??!1,n.esssResponse=b}}const E=this.dv(C?new rr(p,h,y,n):new xn(p,h,y,n));this.d(()=>n.viewer=void 0),this.d(E.errorEvent.don(R=>{const I=`[${R}]:像素流连接错误!`;n.setStatus("Error"),n.setStatusLog(I),this._reconnectEvent.emit(E)})),await v.promise(new Promise(R=>this.d(E.readyEvent.donce(R)))),n.setStatus("Created"),n.setStatusLog("云渲染视口创建成功!"),o=0,s&&clearTimeout(s),s=void 0;const{offsetWidth:T,offsetHeight:S}=p;E.resize(T*window.devicePixelRatio,S*window.devicePixelRatio),n.viewer=E,this.d(()=>n.viewer=void 0),this.dv(new hr(n,E))}));c.start(),this.d(this._reconnectEvent.don(v=>{s===void 0&&(v&&!v.isDestroyed()&&v.destroy(),n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,n.autoReconnect&&(n.setStatus("Reconnecting"),n.setStatusLog("正在尝试重新连接..."),o=o+5e3>3e4?3e4:o+5e3,console.warn(`间隔:${o/1e3}s,正在尝试重新连接...`),s=window.setTimeout(()=>{c.restart()},o)))})),this.d(c.errorEvent.don(v=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",v),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const p=i,c=p.options.project,v=p.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const h=this.dv(new dr(t,c,v,n));n.viewer=h,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const z=class z extends d.ESViewer{constructor(t){super(t);w(this,"_viewer",this.dv(l.react(void 0)));w(this,"_esssResponse");w(this,"_speechRecognition",this.dv(new l.Event));w(this,"_propChanged",this.dv(new l.Event));w(this,"_objectEvent",this.dv(new l.Event));w(this,"_widgetEvent",this.dv(new l.Event));w(this,"_customMessage",this.dv(new l.Event));w(this,"_statusUpdateEvent",this.dv(new l.Event));w(this,"_statusUpdateEventdon",(()=>{this.d(this.statusUpdateEvent.don(t=>{this._statusInfo.fps=t.FPS??0,this._statusInfo.length=t.length??0,this._statusInfo.position=t.position??[0,0,0],this._statusInfo.rotation=t.rotation??[0,0,0]}))})());if(t.type!=="ESUeViewer")throw new Error("option.type must be ESUeViewer");const i=t;this.d(this._viewer.changed.don(()=>{this.viewerChanged.emit(this.viewer)})),this.dv(new l.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new gr(this.subContainer,i,this)}))}get defaultProps(){return z.createDefaultProps()}set viewer(t){this._viewer.value=t}get viewer(){return this._viewer.value}get esssResponse(){return this._esssResponse}set esssResponse(t){this._esssResponse=t}get speechRecognition(){return this._speechRecognition}get propChanged(){return this._propChanged}get objectEvent(){return this._objectEvent}get widgetEvent(){return this._widgetEvent}get customMessage(){return this._customMessage}get statusUpdateEvent(){return this._statusUpdateEvent}async uePositionToLonLatAlt(t){if(!this.viewer){console.warn("UEPositionToLonLatAlt: viewer is undefined");return}return await sn(this.viewer,t)}async changeNavigationMode(t){if(!this.viewer){console.warn("ChangeNavigationMode: viewer is undefined");return}const i=await W(this.viewer,t);return i&&!i.error&&(this._navigationMode.value=t.mode),i}async resetWithCurrentCamera(t){if(!this.viewer){console.warn("resetWithCurrentCamera: viewer is undefined");return}return await ye(this.viewer,t)}async getAllSocketNamesByActorTag(t){if(!this.viewer){console.warn("GetAllSocketNamesByActorTag: viewer is undefined");return}return await an(this.viewer,t)}async getBoundSphere(t){if(!this.viewer){console.warn("getBoundSphere: viewer is undefined");return}return await dn(this.viewer,t)}async getBoundSphereWithChildren(t){if(!this.viewer){console.warn("getBoundSphereWithChildren: viewer is undefined");return}return await cn(this.viewer,t)}async getStrokeMaterialParamInfo(t){if(!this.viewer){console.warn("GetStrokeMaterialParamInfo: viewer is undefined");return}return await un(this.viewer,t)}async getFillMaterialParamInfo(t){if(!this.viewer){console.warn("getFillMaterialParamInfo: viewer is undefined");return}return await hn(this.viewer,t)}async getGlobalProperty(t){if(!this.viewer){console.warn("getGlobalProperty: viewer is undefined");return}return await vn(this.viewer,t)}async getObjectByInfo(t){if(!this.viewer){console.warn("GetObjectByInfo: viewer is undefined");return}return await gn(this.viewer,t)}async defaultCameraFlyIn(t=1){if(!this.viewer){console.warn("DefaultCameraFlyIn: viewer is undefined");return}return await ki(this.viewer,t)}async startVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Gi(this.viewer)}async stopVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Hi(this.viewer)}async mountPakFiles(t){if(!this.viewer){console.warn("mountPakFiles:viewer is undefined");return}return await Ji(this.viewer,t)}async generateMemReport(){if(!this.viewer){console.warn("generateMemReport:viewer is undefined");return}return await Bi(this.viewer)}async quit(){if(!this.viewer){console.warn("Quit: viewer is undefined");return}return await xi(this.viewer)}async bindActorByTag(t,i){if(!this.viewer){console.warn("BindActorByTag: viewer is undefined");return}return await pn(this.viewer,t,i)}async restoreOriginalScene(){if(!this.viewer){console.warn("RestoreOriginalScene: viewer is undefined");return}return await fn(this.viewer)}async unBindActorByID(t){if(!this.viewer){console.warn("UnBindActorByID: viewer is undefined");return}return await wn(this.viewer,t)}async unBindActorByTag(t){if(!this.viewer){console.warn("UnBindActorByTag: viewer is undefined");return}return await yn(this.viewer,t)}async createActorByClass(t,i){if(!this.viewer){console.warn("CreateActorByClass: viewer is undefined");return}return await mn(this.viewer,t,i)}async bind3DTilesetByTag(t,i){if(!this.viewer){console.warn("Bind3DTilesetByTag: viewer is undefined");return}return await Cn(this.viewer,t,i)}async unBind3DTilesetByTag(t){if(!this.viewer){console.warn("UnBind3DTilesetByTag: viewer is undefined");return}return await En(this.viewer,t)}async unBind3DTilesetById(t){if(!this.viewer){console.warn("UnBind3DTilesetById: viewer is undefined");return}return await Sn(this.viewer,t)}async bindImageryByTag(t,i,n){if(!this.viewer){console.warn("BindImageryByTag: viewer is undefined");return}return await Fn(this.viewer,t,i,n)}async unBindImageryByTag(t,i){if(!this.viewer){console.warn("UnBindImageryByTag: viewer is undefined");return}return await In(this.viewer,t,i)}async unBindImageryById(t){if(!this.viewer){console.warn("UnBindImageryById: viewer is undefined");return}return await Tn(this.viewer,t)}async getIdByComponentNameAndHitItem(t,i,n){if(!this.viewer){console.warn("GetIdByComponentNameAndHitItem: viewer is undefined");return}return await Rn(this.viewer,t,i,n)}async getCameraRelativeHeight(t="ECC_Visibility"){if(!this.viewer){console.warn("GetCameraRelativeHeight: viewer is undefined");return}return await Dn(this.viewer,t)}async saveStringToFile(t,i,n){if(!this.viewer){console.warn("SaveStringToFile: viewer is undefined");return}return await Ln(this.viewer,t,i,n)}async highlightActorByTag(t,i=!0){if(!this.viewer){console.warn("HighlightActorByTag: viewer is undefined");return}return await Pn(this.viewer,t,i)}async sendCustomMessage(t){if(!this.viewer){console.warn("SendCustomMessage: viewer is undefined");return}return await Un(this.viewer,t)}async getStatus(){if(!this.viewer){console.warn("GetStatus:viewer is undefined");return}return await An(this.viewer)}async getTilesetMaterialIDList(){if(!this.viewer){console.warn("GetTilesetMaterialIDList:viewer is undefined");return}return await _n(this.viewer)}async pick(t,i,n){if(!this.viewer)return;let r=t;if(t&&window.ue&&this.container){const[o,s]=t,{x:g,y:a}=this.container.getBoundingClientRect();r=[g+o,a+s]}return await Oi(this.viewer,r,i,n)}async pickPosition(t){if(!this.viewer)return;let i=t;if(t&&window.ue&&this.container){const[n,r]=t,{x:o,y:s}=this.container.getBoundingClientRect();i=[o+n,s+r]}return await ji(this.viewer,i)}async quickPickPosition(t){return await this.pickPosition(t)}async getTerrainHeight(t){return await this.getHeightByLonLat(t[0],t[1])??void 0}async flyIn(t,i=[0,0,0],n=1,r="default"){if(!this.viewer)return;const o=await x(this.viewer,void 0,t,i,n,r);if(o)return o.endType===0&&console.warn(`flyTo:flyTo is end! endType:${o.endType}`),o.endType===1&&console.warn(`flyTo:飞行中断! endType:${o.endType}`),o}async flyTo(t,i,n="default"){if(!this.viewer)return;const r=await K(this.viewer,void 0,void 0,t,i,n);if(r)return r.endType===0&&console.warn(`flyTo:flyTo is end! endType:${r.endType}`),r.endType===1&&console.warn(`flyTo:飞行中断! endType:${r.endType}`),r}flyToBoundingSphere(t,i,n=1){const r=[[t[0],t[1],0],[t[0],t[3],0],[t[2],t[3],0],[t[2],t[1],0]],o=d.getGeoBoundingSphereFromPositions(r);if(!o)return;const{center:s,radius:g}=o,a={distance:i??g,heading:0,pitch:-90,flyDuration:n,hDelta:0,pDelta:0};this.flyTo(a,s)}getCurrentCameraInfo(){const{position:t,rotation:i}=this._statusInfo;return{position:t,rotation:i}}getLengthInPixel(){return this._statusInfo.length}async changeToWalk(t,i=4.2,n=1.6){if(!this.viewer)return;const r={mode:"Walk",position:t,jumpZVelocity:i,eyeHeight:n},o=await W(this.viewer,r);return o&&!o.error&&(this._navigationMode.value=r.mode),o}async changeToMap(){if(!this.viewer)return;const t={mode:"Map"},i=await W(this.viewer,t);return i&&!i.error&&(this._navigationMode.value=t.mode),i}async changeToRotateGlobe(t=38,i=1e7,n=60){if(!this.viewer)return;const r={mode:"RotateGlobe",latitude:t,height:i,cycleTime:n},o=await W(this.viewer,r);return o&&!o.error&&(this._navigationMode.value=r.mode),o}async changeToLine(t,i=10,n=10,r=!0,o=10,s="auto"){if(!this.viewer)return;const g={mode:"Line",geoLineStringId:t,speed:i,heightOffset:n,loop:r,turnRateDPS:o,lineMode:s},a=await W(this.viewer,g);return a&&!a.error&&(this._navigationMode.value=g.mode),a}async changeToUserDefined(t){if(!this.viewer)return;const i={mode:"UserDefined",userDefinedPawn:t},n=await W(this.viewer,i);return n&&!n.error&&(this._navigationMode.value=i.mode),n}async changeToRotatePoint(t,i=5e4,n=60,r=0,o=-30){if(!this.viewer)return;const s={mode:"RotatePoint",position:t,distance:i,orbitPeriod:n,heading:r,pitch:o},g=await W(this.viewer,s);return g&&!g.error&&(this._navigationMode.value=s.mode),g}async changeToFollow(t,i=0,n=0,r=-30,o=!0){if(!this.viewer)return;const s={mode:"Follow",objectId:t,distance:i,heading:n,pitch:r,relativeRotation:o},g=await W(this.viewer,s);return g&&!g.error&&(this._navigationMode.value=s.mode),g}getFPS(){return this._statusInfo.fps}async getVersion(){const t=window.g_XE3CopyRights??{};if(!this.viewer)return t;const i=await ln(this.viewer);return t.esforue=i,t}async getHeightByLonLat(t,i,n="ECC_Visibility"){if(!this.viewer)return null;const r=await tn(this.viewer,t,i,n);return r&&r.height!==void 0?r.height:null}async getHeightsByLonLats(t,i="ECC_Visibility"){return this.viewer?await en(this.viewer,t,i):void 0}async capture(t=64,i=64){return this.viewer?await nn(this.viewer,t,i):void 0}async partialCapture(t,i=[64,64]){if(!this.viewer){console.warn("partialCapture:viewer is undefined");return}return await rn(this.viewer,t,i)}async lonLatAltToScreenPosition(t){if(!this.viewer)return;const i=await on(this.viewer,t);return i&&[i.X,i.Y]}async setGlobalProperty(t){if(this.viewer)return await bi(this.viewer,t)}async startEditing(t,i,n){n=Object.assign({useKeyToSwitch:!0,callSource:"outer"},n);const r=t.components.main??t;if(!r||!this.viewer||i==null)return;const o=Array.isArray(i)?[...i]:[i];return r.editingID=`${n.callSource}_${l.createGuid()}`,await Mn(this.viewer,r.id,r.editingID,o,n.useKeyToSwitch)}async stopEditing(){if(this.viewer)return await Wn(this.viewer)}async moveObjects(t){if(!this.viewer)return;const i=[],n=l.createGuid();for(let r=0;r<t.length;r++){const o=t[r],s=o.components.main??o;s.editingID=n,s&&i.push(s.id)}if(i.length!==0)return await $n(this.viewer,i,n)}};w(z,"type",z.register("ESUeViewer",z)),w(z,"defaults",{...qn});let $=z;(u=>{u.createDefaultProps=()=>({...d.ESViewer.createDefaultProps(),...Ni(),resolutionScale:1,autoReconnect:!1,propChangedListening:void 0,objectEventListening:void 0,widgetEventListening:void 0,speechRecognitionListening:void 0,customMessageListening:void 0})})($||($={})),l.extendClassProps($.prototype,$.createDefaultProps);class N extends d.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i)return;const n=this.ad(l.react(!1));e.components.main||this.d(this.createdEvent.don(()=>{const r=this.constructor.propValFuncs,o=e.defaultProps,s=Object.keys(o).filter(v=>r[v]!==null);s.push(...this.constructor.forceUeUpdateProps);const g=e.constructor.defaults,a={val:{}},m=[];for(let v of s){const h=v+"Changed",y=e[h];m.push(y);const C=r[v];if(C===null)throw console.error("vf === null error"),new Error("vf === null error");const E=()=>{const T=e[v]??g[v]??e.constructor[`default${v.charAt(0).toUpperCase()+v.slice(1)}`];let S=C?C(T,this,t,e):T;if(S===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${v} 对象名:${e.name} 对象id: ${e.id}`);return}a.val[v]=S};E(),this.d(y.don(E))}const p=()=>{i.callUeFunc({f:"update",p:{id:e.id,...a.val}}),a.val={}},c=this.dv(l.createNextAnimateFrameEvent(...m));this.d(c.don(p)),this.d(n.changed.don(p)),this.d(e.flushEvent.don(()=>c.flush()))})),e.components.main||(this.d(()=>{n.value&&we(i,e.id)}),i.callUeFunc({f:"create",p:{type:e.typeName,id:e.id}}).then(()=>{n.value=!0}).catch(r=>console.error(r)))}}w(N,"propValFuncs",{ref:null,devTags:null,extras:null,execOnceFuncStr:null,updateFuncStr:null,toDestroyFuncStr:null}),w(N,"forceUeUpdateProps",[]);class P extends N{constructor(e,t){super(e,t);const i=t.viewer;i&&(this.d(e.flyToEvent.don(n=>{K(i,e.id,n)})),this.d(e.flyInEvent.don(n=>{var r,o;x(i,e.id,(r=e.flyInParam)==null?void 0:r.position,(o=e.flyInParam)==null?void 0:o.rotation,n??1)})),this.d(e.calcFlyToParamEvent.don(()=>{_(i,e.id)})),this.d(e.calcFlyInParamEvent.don(()=>{const n=t.getCurrentCameraInfo();if(!n)return;const{position:r,rotation:o}=n;e.flyInParam={position:r,rotation:o,flyDuration:1}})),this.d(t.propChanged.don(n=>{n.objId===e.id&&Object.keys(n.props).forEach(r=>{const o=n.props[r]===null?void 0:n.props[r];e[r]=o})})))}}class F extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i)return;const n=()=>{e.editing||i.callUeFunc({f:"update",p:{id:e.id,position:e.position,rotation:e.rotation}})},r=this.dv(l.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)})),this.d(e.smoothMoveEvent.don((g,a)=>{et(i,e.id,g,a)})),this.d(e.smoothMoveWithRotationEvent.don((g,a,m)=>{O(i,e.id,g,a,m)})),this.d(e.smoothMoveOnGroundEvent.don((g,a,m,p)=>{j(i,e.id,g,a,p,m)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((g,a,m,p,c)=>{tt(i,e.id,g,a,m,p,c)})),this.d(e.smoothMoveKeepPitchEvent.don(async(g,a)=>{const m=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:e.id,Destination:g,Time:a}});m.error&&console.error("SmoothMoveKeepPitch:",m.error)})),this.d(e.automaticLandingEvent.don(g=>{const a=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(m=>{m!==null&&(e.position=[...a,m],e.collision=g)})}));const o=async(g,a,m,p)=>{const{viewer:c}=g;if(!c){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const v=await c.callUeFunc({f:"SmoothMoveRelatively",p:{id:a,RelativePosition:m,Time:p}});return v.error&&console.error("SmoothMoveRelatively:",v.error),v};this.d(e.smoothMoveRelativelyEvent.don((g,a)=>{o(t,e.id,g,a)}));const s=async(g,a,m,p,c)=>{const{viewer:v}=g;if(!v){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const h=await v.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:a,RelativePosition:m,NewRotation:p,Time:c}});return h.error&&console.error("SmoothMoveRelativelyWithRotation:",h.error),h};this.d(e.smoothMoveRelativelyWithRotationEvent.don((g,a,m)=>{s(t,e.id,g,a,m)}))}}class D extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i)return;const n=()=>{e.editing||i.callUeFunc({f:"update",p:{id:e.id,points:e.points}})},r=this.dv(l.createNextAnimateFrameEvent(e.pointsChanged,e.editingChanged));this.d(r.don(()=>{setTimeout(n,0)}))}}w(D,"propValFuncs",{...P.propValFuncs,pointStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),strokeStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),fillStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})})});class M extends F{constructor(e,t){super(e,t),t.viewer&&this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,add:o}=n;e.widgetEvent.emit({type:r,add:o})}))}}class Ce extends F{constructor(e,t){super(e,t),t.viewer}}w(Ce,"propValFuncs",{...F.propValFuncs,pointStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),strokeStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})}),fillStyle:e=>({...e,materialParams:JSON.stringify(e.materialParams??{})})});class he extends Ce{constructor(e,t){super(e,t),t.viewer}}const zn=u=>{switch(u){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是3dTileset,无法绑定";default:return"未知错误"}},nt=class nt extends d.EngineObject{constructor(t,i){super(t,i);w(this,"_styleColor",this.dv(l.react([])));w(this,"_styleVisable",this.dv(l.react([])));const n=i.viewer;if(!n){console.warn("UeES3DTileset: viewer is undefined!");return}let r,o;const s=async()=>{!r&&!o||await n.callUeFunc({f:"update",p:{id:t.id,url:t.url,show:t.show,collision:t.collision,allowPicking:t.allowPicking,flyToParam:t.flyToParam??d.ES3DTileset.defaultFlyToParam,flyInParam:t.flyInParam??d.ES3DTileset.defaultFlyInParam,highlightID:t.highlightID,highlightColor:t.highlightColor,highlight:t.highlight,materialMode:t.materialMode,maximumScreenSpaceError:t.maximumScreenSpaceError,colorMode:Reflect.has(t,"colorMode")?t.colorMode:void 0,offset:t.offset,rotation:t.rotation,cacheBytes:t.cacheBytes,colorBlendMode:t.colorBlendMode,materialOverrideMap:t.materialOverrideMap}})},g=this.dv(l.createNextAnimateFrameEvent(t.urlChanged,t.showChanged,t.flyToParamChanged,t.flyInParamChanged,t.collisionChanged,t.allowPickingChanged,t.highlightIDChanged,t.highlightColorChanged,t.highlightChanged,t.materialModeChanged,t.maximumScreenSpaceErrorChanged,t.offsetChanged,t.rotationChanged,t.cacheBytesChanged,t.colorBlendModeChanged,t.materialOverrideMapChanged));s(),this.d(g.don(s)),Reflect.has(t,"colorMode")&&this.d(t.colorModeChanged.don(()=>s()));const a=this.dv(l.react(void 0));{const p=this.dv(l.createNextAnimateFrameEvent(t.actorTagChanged,t.urlChanged)),c=()=>{t.actorTag?a.value={type:"ActorTag",actorTag:t.actorTag}:t.url?a.value={type:"CreatedUrl",url:t.url}:a.value=void 0,t.editing=!1};c(),this.d(p.don(c))}const m=async()=>{const{id:p}=t;if(r!==void 0){r=void 0;try{const c=await i.unBind3DTilesetById(p);if(!c)return;if(c.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${c.error}`);return}}catch(c){console.warn(`UeES3DTileset UnBind3DTilesetById: ${c}`);return}}if(o!==void 0){o=void 0;try{const c=await n.callUeFunc({f:"destroy",p:{id:p}});if(!c)return;if(c.error!==""){console.warn(`UeES3DTileset Destroy: ${c.error}`);return}}catch(c){console.warn(`UeES3DTileset Destroy: ${c}`);return}}};this.d(()=>{m()});{const p=this.dv(l.createProcessingFromAsyncFunc(async v=>{if(a.value===void 0){await v.promise(m());return}if(a.value.type==="ActorTag"){const{actorTag:h}=a.value;if(r!==h&&await v.promise(m()),r!==void 0||h===void 0)return;try{r=h;const y=await v.promise(i.bind3DTilesetByTag(t.id,h));if(!y)return;if(y.error!==""){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${y.error}`);return}if(y.re.type!==0)if(y.re.type===1)console.warn(`UeES3DTileset Bind3DTilesetByTag: ${zn(y.re.type)}`);else{console.warn(`UeES3DTileset Bind3DTilesetByTag: ${zn(y.re.type)}`);return}}catch(y){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${y}`);return}}else if(a.value.type==="CreatedUrl"){const{url:h}=a.value;if(h!==o&&await m(),o!==void 0||h===void 0)return;try{o=h;const y=await v.promise(n.callUeFunc({f:"create",p:{type:t.typeName,id:t.id}}));if(!y)return;if(y.error!==""){console.warn(`UeES3DTileset create: ${y.error}`);return}}catch(y){console.warn(`UeES3DTileset create: ${y}`);return}}await v.promise(s())})),c=async()=>{p.restart()};c(),this.d(a.changed.don(c))}this.d(t.refreshTilesetEvent.don(()=>{zi(n,t.id)})),this.d(t.flyToEvent.don(async(p,c)=>{if(!r&&!o)return;const v=await K(n,t.id,p);let h="over";v===void 0?h="error":v.endType===0?h="over":v.endType===1&&(h="cancelled"),t.flyOverEvent.emit(c,h,i)})),this.d(t.calcFlyToParamEvent.don(()=>{!r&&!o||_(n,t.id)})),this.d(t.calcFlyInParamEvent.don(async()=>{if(!r&&!o||!i.actived)return;const p=await i.getCurrentCameraInfo();if(!p)return;const{position:c,rotation:v}=p;t.flyInParam={position:c,rotation:v,flyDuration:1}})),this.d(i.propChanged.don(p=>{!r&&!o||p.objId===t.id&&Object.keys(p.props).forEach(c=>{const v=p.props[c]===null?void 0:p.props[c];t[c]=v})})),this.d(i.objectEvent.don(p=>{!r&&!o||p.id!==t.id||p.type!=="3DTilesetReady"||t.tilesetReady.emit(p.p)}));{const p=async(y,C)=>{if(!r&&!o)return;const E=await n.callUeFunc({f:"SetFeatureColor",p:{id:t.id,featureName:y,json:C}});if(E&&E.error!==""){console.warn(`UeES3DTileset SetFeatureColor: ${E.error}`);return}},c=async(y,C)=>{if(!r&&!o)return;const E=await n.callUeFunc({f:"SetFeatureVisable",p:{id:t.id,featureName:y,json:C}});if(E&&E.error!==""){console.warn(`UeES3DTileset SetFeatureVisable: ${E.error}`);return}},v=async()=>{if(!r&&!o)return;const y=await n.callUeFunc({f:"ResetFeatureStyle",p:{id:t.id}});if(y&&y.error!==""){console.warn(`UeES3DTileset ResetFeatureStyle: ${y.error}`);return}},h=async y=>{if(!r&&!o)return;const C=await n.callUeFunc({f:"SetFeatureStyle",p:{id:t.id,json:y}});if(C&&C.error!==""){console.warn(`UeES3DTileset SetFeatureStyle: ${C.error}`);return}};this.d(t.setFeatureColorEvent.don((y,C)=>{const E=[...this.styleColor,...C];this.styleColor=[...E],p(y,E)})),this.d(t.setFeatureVisableEvent.don((y,C)=>{const E=[...this.styleVisable,...C];this.styleVisable=[...E],c(y,E)})),this.d(t.resetFeatureStyleEvent.don(()=>{v(),this.styleColor=[],this.styleVisable=[]})),this.d(t.setFeatureStyleEvent.don(y=>{h(y)}))}{const p=async()=>{if(!r&&!o){t._featureTableResultEvent.emit(void 0);return}try{const c=await n.callUeFunc({f:"GetFeatureTable",p:{id:t.id}});c.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${c.error}`),t._featureTableResultEvent.emit(c.re.table)}catch(c){console.warn(`UeES3DTileset GetFeatureTable: ${c}`),t._featureTableResultEvent.emit(void 0)}};this.d(t.getFeatureTableEvent.don(()=>{p()}))}{const p=async()=>{if(!r&&!o){t.getMaterialNameListEvent.emit(void 0);return}try{const c=await n.callUeFunc({f:"GetMaterialNameList",p:{id:t.id}});c.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${c.error}`),t.getMaterialNameListEvent.emit(c.re.materialNameList)}catch(c){console.warn(`UeES3DTileset GetMaterialNameList: ${c}`),t.getMaterialNameListEvent.emit(void 0)}};this.ad(t.getMaterialNameListEvent.don(c=>{c=="start"&&p()}))}}get styleColor(){return this._styleColor.value}set styleColor(t){this._styleColor.value=t}get styleVisable(){return this._styleVisable.value}set styleVisable(t){this._styleVisable.value=t}};w(nt,"type",nt.register("ESUeViewer",d.ES3DTileset.type,nt));let ve=nt;const kn=u=>{switch(u){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag对应的Actor是地形,无法绑定";case 4:return"没搜索到ComponentTag,无法绑定";default:return"未知错误"}},rt=class rt extends d.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}let n,r;const o=this.dv(l.react(void 0)),s=this.ad(l.reactJson(""));{const p=()=>{if(typeof e.url=="string")s.value=d.ESSceneObject.context.getStrFromEnv(e.url);else{const c=e.url;c.url=d.ESSceneObject.context.getStrFromEnv(c.url),s.value=c}};p(),this.ad(e.urlChanged.don(p))}const g=async()=>{if(!n&&!r)return;let p=e.targetID??d.ESImageryLayer.defaults.targetID;if(p&&p!=""){const c=d.ESSceneObject.getSceneObject(p);p=c?(c.components.main??c).id:p}await i.callUeFunc({f:"update",p:{id:e.id,show:e.show??!0,rectangle:e.rectangle??[-180,-90,180,90],collision:e.collision??!0,allowPicking:e.allowPicking??!1,flyToParam:e.flyToParam??d.ESImageryLayer.defaultFlyToParam,flyInParam:e.flyInParam??d.ESImageryLayer.defaultFlyInParam,url:s.value??"",zIndex:e.zIndex??0,maximumLevel:e.maximumLevel??d.ESImageryLayer.defaults.maximumLevel,minimumLevel:e.minimumLevel??d.ESImageryLayer.defaults.minimumLevel,options:e.options??d.ESImageryLayer.defaults.options,targetID:p,opacity:e.opacity??d.ESImageryLayer.defaults.opacity,splitDirection:e.splitDirection??d.ESImageryLayer.defaults.splitDirection}})},a=this.dv(l.createNextAnimateFrameEvent(e.showChanged,s.changed,e.flyToParamChanged,e.flyInParamChanged,e.zIndexChanged,e.collisionChanged,e.allowPickingChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.rectangleChanged,e.optionsChanged,e.targetIDChanged,e.opacityChanged,e.splitDirectionChanged));this.d(a.don(g));const m=async()=>{const{id:p}=e;if(n!==void 0){n=void 0;try{const c=await t.unBindImageryById(p);if(!c)return;if(c.error!==""){console.warn(`UeESImageryLayer UnImageryByID: ${c.error}`);return}}catch(c){console.warn(`UeESImageryLayer UnImageryByID promise: ${c}`);return}}if(r!==void 0){r=void 0;try{const c=await i.callUeFunc({f:"destroy",p:{id:p,test:"UeESImageryLayer"}});if(!c)return;if(c.error!==""){console.warn(`UeESImageryLayer Destroy: ${c.error}`);return}}catch(c){console.warn(`UeESImageryLayer Destroy promise: ${c}`);return}}};this.d(()=>{m()});{const p=this.dv(l.createProcessingFromAsyncFunc(async v=>{if(o.value===void 0){await v.promise(m());return}if(o.value.type==="ActorTag"){const{actorTag:h,componentTag:y}=o.value;if(n!==h&&await v.promise(m()),n!==void 0||h===void 0)return;try{n=h;const C=await v.promise(t.bindImageryByTag(e.id,h,y));if(!C)return;if(C.error!==""){console.warn(`ESImageryLayer BindImageryByTag: ${C.error}`);return}if(C.re.type!==0)if(C.re.type===1)console.warn(`ESImageryLayer BindImageryByTag: ${kn(C.re.type)}`);else{console.warn(`ESImageryLayer BindImageryByTag: ${kn(C.re.type)}`);return}}catch(C){console.warn(`ESImageryLayer BindImageryByTag promise: ${C}`);return}}else if(o.value.type==="CreatedUrl"){const{url:h}=o.value;if(h!==r&&await v.promise(m()),r!==void 0||h===void 0)return;try{r=h;const y=await v.promise(i.callUeFunc({f:"create",p:{type:"ESImageryLayer",id:e.id}}));if(!y)return;if(y.error!==""){console.warn(`ESImageryLayer create: ${y.error}`);return}}catch{console.warn("ESImageryLayer create: create promise error");return}}await v.promise(g())})),c=async()=>{p.restart()};c(),this.d(o.changed.don(c))}{const p=this.dv(l.createNextAnimateFrameEvent(e.actorTagChanged,s.changed,e.componentTagChanged)),c=()=>{e.actorTag&&e.componentTag?o.value={type:"ActorTag",actorTag:e.actorTag,componentTag:e.componentTag}:s.value?o.value={type:"CreatedUrl",url:s.value}:o.value=void 0};c(),this.d(p.don(c))}this.d(e.flyToEvent.don(async(p,c)=>{if(!n&&!r)return;const v=await K(i,e.id,p);let h="over";v===void 0?h="error":v.endType===0?h="over":v.endType===1&&(h="cancelled"),e.flyOverEvent.emit(c,h,t)})),this.d(e.flyInEvent.don(async(p,c)=>{var y,C;if(!n&&!r)return;const v=await x(i,e.id,(y=e.flyInParam)==null?void 0:y.position,(C=e.flyInParam)==null?void 0:C.rotation,p??1);let h="over";v===void 0?h="error":v.endType===0?h="over":v.endType===1&&(h="cancelled"),e.flyOverEvent.emit(c,h,t)})),this.d(e.calcFlyToParamEvent.don(()=>{!n&&!r||_(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const p=await t.getCurrentCameraInfo();if(!p)return;const{position:c,rotation:v}=p;e.flyInParam={position:c,rotation:v,flyDuration:1}})),this.d(t.propChanged.don(p=>{!n&&!r||p.objId===e.id&&Object.keys(p.props).forEach(c=>{const v=p.props[c]===null?void 0:p.props[c];e[c]=v})}))}};w(rt,"type",rt.register("ESUeViewer",d.ESImageryLayer.type,rt));let Ee=rt;const k=class k extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(k,"type",k.register("ESUeViewer",d.ESTerrainLayer.type,k)),w(k,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),w(k,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(e):(e.url=d.ESSceneObject.context.getStrFromEnv(e.url),e),czmMaxzoom:null,czmMinzoom:null});let Se=k;const ot=class ot extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ot,"type",ot.register("ESUeViewer",d.ESAlarm.type,ot));let Fe=ot;const st=class st extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(st,"type",st.register("ESUeViewer",d.ESApertureEffect.type,st));let Ie=st;const at=class at extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(at,"type",at.register("ESUeViewer",d.ESGeoPolygon.type,at));let U=at;const lt=class lt extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=d.ESAreaMeasurement.defaults.fillStyle;try{o={...e.fillStyle??d.ESAreaMeasurement.defaults.fillStyle}}catch(s){console.error("ESAreaMeasurement fillStyle 属性类型错误!",s),o={...d.ESAreaMeasurement.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,stroked:e.stroked??d.ESAreaMeasurement.defaults.stroked,fillStyle:o,filled:e.filled??d.ESAreaMeasurement.defaults.filled}}),console.log(o)},r=this.dv(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.strokedChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};w(lt,"type",lt.register("ESUeViewer",d.ESAreaMeasurement.type,lt));let Te=lt;const dt=class dt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(dt,"type",dt.register("ESUeViewer",d.ESBlastParticleSystem.type,dt));let Re=dt;const X=class X extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};w(X,"type",X.register("ESUeViewer",d.ESBoxClipping.type,X)),w(X,"propValFuncs",{...F.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?(t.components.main??t).id:e}});let De=X;const ct=class ct extends F{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.dispose(e.flyInEvent.don((n,r,o="default")=>{const{id:s,duration:g,position:a,rotation:m}=e;x(i,s,a,m,g??n,o)})),this.dispose(e.resetWithCurrentCameraEvent.don(()=>{ye(i,e.id)})),this.dispose(e.captureEvent.don((n,r)=>{t.capture(n,r).then(s=>{s&&(e.thumbnail=s)})}))}};w(ct,"type",ct.register("ESUeViewer",d.ESCameraView.type,ct));let Le=ct;const ut=class ut extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ut,"type",ut.register("ESUeViewer",d.ESCameraVisibleRange.type,ut));let Pe=ut;const ht=class ht extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ht,"type",ht.register("ESUeViewer",d.ESCar.type,ht));let Ue=ht;const vt=class vt extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o=d.ESClassification.defaults.fillStyle;try{o={...e.fillStyle??d.ESClassification.defaults.fillStyle}}catch(s){console.error("ESClassification fillStyle 属性类型错误!",s),o={...d.ESClassification.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,filled:e.filled??d.ESClassification.defaults.filled,fillStyle:o}})},r=this.dv(l.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};w(vt,"type",vt.register("ESUeViewer",d.ESClassification.type,vt));let Ae=vt;const q=class q extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};w(q,"type",q.register("ESUeViewer",d.ESClippingPlane.type,q)),w(q,"propValFuncs",{...F.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?(t.components.main??t).id:e}});let Me=q;const gt=class gt extends F{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(l.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=d.ESSceneObject.context.getStrFromEnv(e.url??d.ESDataMesh.defaults.url);else{const g=e.url;g.url=d.ESSceneObject.context.getStrFromEnv(g.url??d.ESDataMesh.defaults.url),n.value=g}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{const s=e.colorStops??d.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:e.id,url:n.value??d.ESDataMesh.defaults.url,currentTime:e.currentTime??d.ESDataMesh.defaults.currentTime,minPropValue:e.minPropValue??d.ESDataMesh.defaults.minPropValue,maxPropValue:e.maxPropValue??d.ESDataMesh.defaults.maxPropValue,colorStops:JSON.stringify(s)}})},o=this.dv(l.createNextAnimateFrameEvent(n.changed,e.currentTimeChanged,e.minPropValueChanged,e.maxPropValueChanged,e.colorStopsChanged));this.d(o.don(r)),this.d(e.createdEvent.don(r))}};w(gt,"type",gt.register("ESUeViewer",d.ESDataMesh.type,gt));let We=gt;const pt=class pt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(pt,"type",pt.register("ESUeViewer",d.ESDatasmithRuntimeModel.type,pt));let $e=pt;const ft=class ft extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ft,"type",ft.register("ESUeViewer",d.ESDirectionMeasurement.type,ft));let _e=ft;const wt=class wt extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let o;try{o={...e.strokeStyle??d.ESDistanceMeasurement.defaults.strokeStyle}}catch(s){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",s),o={...d.ESDistanceMeasurement.defaults.strokeStyle}}i.callUeFunc({f:"update",p:{id:e.id,strokeStyle:o}})},r=this.dv(l.createNextAnimateFrameEvent(e.strokeStyleChanged));this.d(r.don(n)),this.d(e.createdEvent.don(n))}};w(wt,"type",wt.register("ESUeViewer",d.ESDistanceMeasurement.type,wt));let Ne=wt;const yt=class yt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(yt,"type",yt.register("ESUeViewer",d.ESLocalPolygon.type,yt));let ge=yt;const mt=class mt extends ge{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(mt,"type",mt.register("ESUeViewer",d.ESDynamicWater.type,mt));let ze=mt;const Ct=class Ct extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(t.widgetEvent.don(n=>{if(n.objId!==e.id)return;const{type:r,properties:o}=n;e.widgetEvent.emit({type:r,properties:o})}))}};w(Ct,"type",Ct.register("ESUeViewer",d.ESEntityCluster.type,Ct));let ke=Ct;const Z=class Z extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Z,"type",Z.register("ESUeViewer",d.ESExcavate.type,Z)),w(Z,"propValFuncs",{...U.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?(t.components.main??t).id:e}});let Ge=Z;const Et=class Et extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Et,"type",Et.register("ESUeViewer",d.ESFireParticleSystem.type,Et));let He=Et;const St=class St extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(l.reactJson(""));{const s=()=>{if(typeof e.url=="string")n.value=d.ESSceneObject.context.getStrFromEnv(e.url);else{const g=e.url;g.url=d.ESSceneObject.context.getStrFromEnv(g.url),n.value=g}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{i.callUeFunc({f:"update",p:{id:e.id,url:n.value??d.ESForestTileset.defaults.url,treeTypes:e.treeTypes??d.ESForestTileset.defaults.treeTypes,xiaoBanWidget:e.xiaoBanWidget??d.ESForestTileset.defaults.xiaoBanWidget,youShiSZ:e.youShiSZ??d.ESForestTileset.defaults.youShiSZ,diLei:e.diLei??d.ESForestTileset.defaults.diLei,senLinLB:e.senLinLB??d.ESForestTileset.defaults.senLinLB,labelMaterial:e.labelMaterial??d.ESForestTileset.defaults.labelMaterial,heightOffset:e.heightOffset??d.ESForestTileset.defaults.heightOffset}})},o=this.dv(l.createNextAnimateFrameEvent(n.changed,e.treeTypesChanged,e.xiaoBanWidgetChanged,e.youShiSZChanged,e.diLeiChanged,e.senLinLBChanged,e.labelMaterialChanged,e.heightOffsetChanged));this.d(o.don(r)),this.d(e.createdEvent.don(r))}};w(St,"type",St.register("ESUeViewer",d.ESForestTileset.type,St));let Je=St;const Ft=class Ft extends d.EngineObject{constructor(e,t){super(e,t),this.ad(new l.ObjResettingWithEvent(e.renderInUEChanged,()=>e.renderInUE?new Hn(e,t):new Gn(e,t)))}};w(Ft,"type",Ft.register("ESUeViewer",d.ESGeoDiv.type,Ft));let Be=Ft;class Gn extends l.Destroyable{constructor(t,i){super();w(this,"_screenPosition",this.disposeVar(l.reactArrayWithUndefined(void 0)));const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}const r=this.disposeVar(new d.ESTextLabel);r.parentID=t.id,t.components.disposableAdd(r,!0),r.show=!1,this.dispose(l.bind([r,"position"],[t,"position"])),this.dispose(l.bind([r,"rotation"],[t,"rotation"])),this.dispose(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.dispose(l.bind([r,"flyInParam"],[t,"flyInParam"])),this.dispose(t.calcFlyToParamEvent.disposableOn(()=>{_(n,r.id)})),this.dispose(t.calcFlyInParamEvent.disposableOn(async()=>{if(!i.actived)return;const g=await i.getCurrentCameraInfo();if(!g)return;const{position:a,rotation:m}=g;t.flyInParam={position:a,rotation:m,flyDuration:1}})),this.dispose(t.smoothMoveEvent.disposableOn((g,a)=>{et(n,r.id,g,a)})),this.dispose(t.smoothMoveWithRotationEvent.disposableOn((g,a,m)=>{O(n,r.id,g,a,m)})),this.dispose(t.smoothMoveOnGroundEvent.disposableOn((g,a,m,p)=>{j(n,r.id,g,a,p,m)})),this.dispose(t.smoothMoveWithRotationOnGroundEvent.disposableOn((g,a,m,p,c)=>{tt(n,r.id,g,a,m,p,c)})),this.dispose(t.flyToEvent.disposableOn((g,a)=>{r.flyTo(g)})),this.dispose(t.flyInEvent.don(g=>{r.flyIn(g)}));const o=this._screenPosition,s=this.disposeVar(new d.ESCustomDiv);s.parentID=t.id,i.add(s),this.dispose(()=>i.delete(s)),this.dispose(l.bind([s,"allowPicking"],[t,"allowPicking"]));{const g=this.disposeVar(l.createAnimateFrame()),a=()=>{t.show?g.restart(void 0,async()=>{if(!t.position)return;const m=await i.lonLatAltToScreenPosition(t.position);if(!this.isDestroyed())if(!m)this._screenPosition.value=void 0;else{const[p,c]=m;p===-1&&c===-1?this._screenPosition.value=void 0:this._screenPosition.value=[p,c]}}):g.cancel()};a(),this.dispose(t.showChanged.disposableOn(a))}{const g=()=>class extends l.Destroyable{constructor(c,v,h){if(super(),this._subContainer=c,!h)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const y=new l.PosFloatDiv,C=y.element;this._subContainer.appendChild(C),this.dispose(()=>this._subContainer.removeChild(C)),C.onclick=E=>{(t.allowPicking??!1)&&t.pickedEvent.emit(new d.ESJPickedResult({div:C,pointerEvent:E},t,void 0,void 0,void 0,[E.x,E.y]))};{const E=()=>{t.editing?C.children[0].style.pointerEvents="none":C.children[0].style.pointerEvents="all"};E(),this.d(t.editingChanged.don(E))}{const E=()=>{const S=t.show;o.value&&S?(y.show=!0,y.winPos=[...o.value]):(y.show=!1,y.winPos=[0,0])};E();const T=this.disposeVar(l.createNextAnimateFrameEvent(t.showChanged,o.changed));this.dispose(T.disposableOn(E))}{const E=()=>{const[T,S]=t.anchor??d.ESGeoDiv.defaults.anchor;y.originRatioX=T,y.originRatioY=S};E(),this.dispose(t.anchorChanged.disposableOn(E))}{const E=()=>{y.opacity=t.opacity??d.ESGeoDiv.defaults.opacity};E(),this.dispose(t.opacityChanged.disposableOn(E))}this.disposeVar(new t.instanceClass(y.contentDiv,t,h))}},a=()=>{try{t.instanceClass?s.instanceClass=g():s.instanceClass=void 0}catch(p){console.error(p)}};a();const m=this.dv(l.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged,t.anchorChanged,t.editingChanged,t.showChanged,t.allowPickingChanged));this.d(m.don(a))}}get screenPosition(){return this._screenPosition.value}get screenPositionChanged(){return this._screenPosition.changed}set screenPosition(t){this._screenPosition.value=t}}class Hn extends l.Destroyable{constructor(t,i){super();w(this,"_imageLabel");w(this,"_hasClassDivAndPos",{});this._imageLabel=this.dv(new d.ESImageLabel),this._imageLabel.isHoverZoom=!1,this._imageLabel.parentID=t.id;const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}const r=this._imageLabel;t.components.disposableAdd(r,!0);{const o=()=>{if(!n)return;if(!t.instanceClass)throw new Error("!sceneObject.instanceClass");const a=document.createElement("div"),m=this.dv(new t.instanceClass(a,t,i))._container;if(m.style.opacity=t.opacity.toString()??d.ESGeoDiv.defaults.opacity,m.style.position="fixed",m.style.zIndex="-1",m.style.top="0px",!document.body.contains(m)){document.body.appendChild(m);let c=m?m.querySelectorAll("*[class]"):[];for(let v=0;v<c.length;v++){const h=c[v];var p=h.getBoundingClientRect();this._hasClassDivAndPos[h.className]=[h.offsetLeft,h.offsetTop,h.offsetLeft+p.width,h.offsetTop+p.height]}}Xn(m,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:m.offsetWidth,height:m.offsetHeight,scale:1}).then(c=>{document.body.contains(m)&&document.body.removeChild(m),r.url=c.toDataURL(),r.show=t.show}).catch(()=>{document.body.contains(m)&&document.body.removeChild(m)})},s=()=>{try{t.instanceClass?o():(r.url="",r.show=!1)}catch(a){console.error(a)}};s();const g=this.dv(l.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(g.don(s))}{const o=()=>{r.show=t.show};r.show=!1,this.ad(t.showChanged.don(o))}this.d(l.track([r,"anchor"],[t,"anchor"])),this.d(l.bind([r,"position"],[t,"position"])),this.d(l.bind([r,"rotation"],[t,"rotation"])),this.d(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(l.bind([r,"flyInParam"],[t,"flyInParam"])),this.d(l.bind([r,"allowPicking"],[t,"allowPicking"])),this.d(l.bind([r,"scale"],[t,"scale"])),this.d(l.track([r,"minVisibleDistance"],[t,"minVisibleDistance"])),this.d(l.track([r,"maxVisibleDistance"],[t,"maxVisibleDistance"])),this.ad(t.automaticLandingEvent.don(()=>{r.automaticLanding()})),this.d(i.widgetEvent.don(o=>{if(o.objId!==this._imageLabel.id)return;const{type:s,add:g}=o;if(s==="leftClick"&&g){const a=(g==null?void 0:g.classNames)??[],m=Object.keys(this._hasClassDivAndPos);for(let p=0;p<m.length;p++){const c=m[p];let v=this._hasClassDivAndPos[c];g&&g.mouseRelativePos&&g.mouseRelativePos[0]>=v[0]&&g.mouseRelativePos[0]<=v[2]&&g.mouseRelativePos[1]>=v[1]&&g.mouseRelativePos[1]<=v[3]&&a.push(c)}g.classNames=a}t.widgetEvent.emit({type:s,add:g})})),this.d(t.calcFlyToParamEvent.don(()=>{_(n,r.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const o=i.getCurrentCameraInfo();if(!o)return;const{position:s,rotation:g}=o;t.flyInParam={position:s,rotation:g,flyDuration:1}})),this.d(t.smoothMoveEvent.don((o,s)=>{et(n,r.id,o,s)})),this.d(t.smoothMoveWithRotationEvent.don((o,s,g)=>{O(n,r.id,o,s,g)})),this.d(t.smoothMoveOnGroundEvent.don((o,s,g,a)=>{j(n,r.id,o,s,a,g)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((o,s,g,a,m)=>{tt(n,r.id,o,s,g,a,m)})),this.d(t.flyToEvent.don((o,s)=>{r.flyTo(o)})),this.d(t.flyInEvent.don(o=>{r.flyIn(o)}))}}const It=class It extends P{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.flyToFeatureIndexEvent.don((n,r)=>{i.callUeFunc({f:"flyToFeatureIndex",p:{id:e.id,index:n,duration:r}})})),this.d(e.flyToFeatureEvent.don((n,r,o)=>{i.callUeFunc({f:"flyToFeature",p:{id:e.id,key:n,value:r,duration:o}})}))}};w(It,"type",It.register("ESUeViewer",d.ESGeoJson.type,It));let Ke=It;const Tt=class Tt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Tt,"type",Tt.register("ESUeViewer",d.ESGeoLineString.type,Tt));let pe=Tt;const Rt=class Rt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Rt,"type",Rt.register("ESUeViewer",d.ESGeoRectangle.type,Rt));let Xe=Rt;const Dt=class Dt extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Dt,"type",Dt.register("ESUeViewer",d.ESGeoWater.type,Dt));let qe=Dt;const G=class G extends F{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.setNodePositionEvent.don((n,r)=>{Vi(i,e.id,n,r)})),this.d(e.setNodeRotationEvent.don((n,r)=>{Yi(i,e.id,n,r)})),this.d(e.setNodeScaleEvent.don((n,r)=>{Qi(i,e.id,n,r)}))}};w(G,"forceUeUpdateProps",[...F.forceUeUpdateProps,"url"]),w(G,"propValFuncs",{...F.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(d.rpToap(e)):(e.url=d.ESSceneObject.context.getStrFromEnv(d.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),w(G,"type",G.register("ESUeViewer",d.ESGltfModel.type,G));let Ze=G;const Lt=class Lt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Lt,"type",Lt.register("ESUeViewer",d.ESHeightMeasurement.type,Lt));let Ve=Lt;const Pt=class Pt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=async(o,s,g,a)=>{const{viewer:m}=o;if(!m){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const p=await m.callUeFunc({f:"AIMoveTo",p:{id:s,Destination:g,Time:a}});return p.error&&console.error("AIMoveTo:",p.error),p};this.d(e.aiMoveToEvent.don((o,s)=>{n(t,e.id,o,s)}));const r=async(o,s)=>{const{viewer:g}=o;if(!g){console.error("StopAIMove: ueViewer.viewer is undefined");return}const a=await g.callUeFunc({f:"StopAIMove",p:{id:s}});return a.error&&console.error("StopAIMove:",a.error),a};this.d(e.stopAIMoveEvent.don(()=>{r(t,e.id)}))}};w(Pt,"type",Pt.register("ESUeViewer",d.ESHuman.type,Pt));let Ye=Pt;const H=class H extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.anchor=[.5,1]}};w(H,"type",H.register("ESUeViewer",d.ESImageLabel.type,H)),w(H,"forceUeUpdateProps",[...M.forceUeUpdateProps,"url"]),w(H,"propValFuncs",{...M.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(d.rpToap(e)):(e.url=d.ESSceneObject.context.getStrFromEnv(d.rpToap(e.url)),e)});let Qe=H;const Ut=class Ut extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Ut,"type",Ut.register("ESUeViewer",d.ESLevelRuntimeModel.type,Ut));let be=Ut;const At=class At extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(At,"type",At.register("ESUeViewer",d.ESLocalCircle.type,At));let xe=At;const Mt=class Mt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Mt,"type",Mt.register("ESUeViewer",d.ESLocalPolygonZ.type,Mt));let Oe=Mt;const Wt=class Wt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Wt,"type",Wt.register("ESUeViewer",d.ESLocalRectangle.type,Wt));let je=Wt;const $t=class $t extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w($t,"type",$t.register("ESUeViewer",d.ESLocalSkyBox.type,$t));let ti=$t;const _t=class _t extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(_t,"type",_t.register("ESUeViewer",d.ESLocationMeasurement.type,_t));let ei=_t;const Nt=class Nt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Nt,"type",Nt.register("ESUeViewer",d.ESPipeFence.type,Nt));let ii=Nt;const zt=class zt extends pe{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(zt,"type",zt.register("ESUeViewer",d.ESPipeline.type,zt));let ni=zt;const kt=class kt extends ve{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.highlightFeatureEvent.don(n=>{const r=typeof n=="number"?n.toString():n;Ki(i,e.id,r)})),this.d(e.highlightFeatureAndFlyToEvent.don((n,r,o,s)=>{const g=typeof n=="number"?n.toString():n;Xi(i,e.id,g,s??1)})),this.d(e.setLayerVisibleEvent.don((n,r)=>{let o="";typeof r!="string"?o=JSON.stringify(r):o=r,qi(i,e.id,o)})),this.d(e.setLayerColorEvent.don((n,r)=>{let o="";typeof r!="string"?o=JSON.stringify(r):o=r,Zi(i,e.id,o)}))}};w(kt,"type",kt.register("ESUeViewer",d.ESPipeserTileset.type,kt));let ri=kt;const Gt=class Gt extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Gt,"type",Gt.register("ESUeViewer",d.ESPit.type,Gt));let oi=Gt;const Ht=class Ht extends M{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.ad(e.getInitialStyleEvent.don(async()=>{try{const n=await i.callUeFunc({f:"GetInitialStyle",p:{id:e.id}});n.error!=""&&console.error("getInitialStyleEvent:",n.error),e.initialStyle.value=structuredClone(n.re)}catch(n){console.error("getInitialStyleEvent:",n),e.initialStyle.value=void 0}}))}};w(Ht,"type",Ht.register("ESUeViewer",d.ESPoi2D.type,Ht));let si=Ht;const Jt=class Jt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Jt,"type",Jt.register("ESUeViewer",d.ESPoi3D.type,Jt));let ai=Jt;const J=class J extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(J,"type",J.register("ESUeViewer",d.ESPoiTileset.type,J)),w(J,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),w(J,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?d.ESSceneObject.context.getStrFromEnv(e):(e.url=d.ESSceneObject.context.getStrFromEnv(e.url),e)});let li=J;const Bt=class Bt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Bt,"type",Bt.register("ESUeViewer",d.ESPolygonFence.type,Bt));let di=Bt;const V=class V extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(V,"type",V.register("ESUeViewer",d.ESPolygonFlattenedPlane.type,V)),w(V,"propValFuncs",{...U.propValFuncs,targetID:e=>{if(!e)return"";const t=d.ESSceneObject.getSceneObject(e);return t?(t.components.main??t).id:e}});let ci=V;const Kt=class Kt extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Kt,"type",Kt.register("ESUeViewer",d.ESPolygonWithHole.type,Kt));let ui=Kt;const Xt=class Xt extends N{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(()=>{e.ids=[]}),this.d(e.highlightInner3DtilesetEvent.don(n=>{n.highlight=!0})),this.d(e.removeHighlightInner3DtilesetEvent.don(n=>{n.highlight=!1}));{const n=s=>{s=s.toLocaleLowerCase();let g=[255,255,255,1];if(s.startsWith("#")){if(s.length===4){let a=parseInt(s[1]+s[1],16),m=parseInt(s[2]+s[2],16),p=parseInt(s[3]+s[3],16);g=[a,m,p,1]}else if(s.length===7){let a=parseInt(s.substring(1,3),16),m=parseInt(s.substring(3,5),16),p=parseInt(s.substring(5,7),16);g=[a,m,p,1]}}else if(s.startsWith("rgba")){let a=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(a){let m=parseInt(a[1]),p=parseInt(a[2]),c=parseInt(a[3]),v=parseFloat(a[4]);g=[m,p,c,v]}}else if(s.startsWith("rgb")){let a=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(a){let m=parseInt(a[1]),p=parseInt(a[2]),c=parseInt(a[3]);g=[m,p,c,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[g[0]/255,g[1]/255,g[2]/255,g[3]]},r=()=>{const s=e.layerConfig;if(!s)return;const g=[];s.forEach(a=>{s.filter(p=>p.dataset==a.dataset).length==1?g.push({condition:[{field:"dataset",op:"==",value:a.dataset}],color:n(a.value.color??"rgb(255,255,255)"),show:a.value.visible}):g.push({condition:[{field:"layer",op:"==",value:a.layer},{field:"dataset",op:"==",value:a.dataset}],color:n(a.value.color??"rgb(255,255,255)"),show:a.value.visible})}),e.setFeatureStyle(g)};r();const o=this.dv(l.createNextAnimateFrameEvent(e.layerConfigChanged,e.colorBlendModeChanged));this.d(o.don(()=>{r()}))}}};w(Xt,"type",Xt.register("ESUeViewer",d.ESRtsTileset.type,Xt));let hi=Xt;const qt=class qt extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}this.d(e.addTreesEvent.don(n=>{d.addTreesCallFunc(t,e.id,n)})),this.d(e.removeAllTreesEvent.don(()=>{d.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(n=>{d.updateTreeParamsCallFunc(t,e.id,n)})),this.d(e.cutDownTreesEvent.don((n,r)=>{d.cutDownTreesCallFunc(t,e.id,n,r)})),this.d(e.growthSimulationEvent.don((n,r,o)=>{d.growthSimulationCallFunc(t,e.id,n,r,o)}))}};w(qt,"type",qt.register("ESUeViewer",d.ESSeparateFoliage.type,qt));let vi=qt;const Zt=class Zt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Zt,"type",Zt.register("ESUeViewer",d.ESSubmergingAnalysis.type,Zt));let gi=Zt;const Vt=class Vt extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.stopEvent.don(()=>{i.callUeFunc({f:"Stop",p:{id:e.id}})}))}};w(Vt,"type",Vt.register("ESUeViewer",d.ESSunshineAnalysis.type,Vt));let pi=Vt;const Yt=class Yt extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})}))}};w(Yt,"type",Yt.register("ESUeViewer",d.ESSurfaceAreaMeasurement.type,Yt));let fi=Yt;const Qt=class Qt extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Qt,"type",Qt.register("ESUeViewer",d.ESTextLabel.type,Qt));let wi=Qt;const Y=class Y extends M{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.callFunctionEvent.don(async(n,r)=>{const o=await me(i,e.id,n,r);e.__callFunctionResultEvent.emit(o)}))}};w(Y,"type",Y.register("ESUeViewer",d.ESUEWidget.type,Y)),w(Y,"propValFuncs",{...M.propValFuncs,info:e=>JSON.stringify(e??{})});let yi=Y;const Jn=u=>{switch(u){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},pr=u=>{switch(u){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},bt=class bt extends d.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn(`${e.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{we(i,e.id)});const n=async()=>{a()||await i.callUeFunc({f:"update",p:{id:e.id,name:e.name,show:e.show,rotation:e.rotation,flyToParam:e.flyToParam??d.ESUnrealActor.defaultFlyToParam,flyInParam:e.flyInParam??d.ESUnrealActor.defaultFlyInParam,highlight:e.highlight,collision:e.collision,scale:e.scale,minVisibleDistance:e.minVisibleDistance,maxVisibleDistance:e.maxVisibleDistance}})},r=this.dv(l.createNextAnimateFrameEvent(e.showChanged,e.nameChanged,e.rotationChanged,e.flyToParamChanged,e.flyInParamChanged,e.highlightChanged,e.collisionChanged,e.scaleChanged,e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(r.don(n)),this.d(e.flushEvent.don(()=>r.flush()));let o,s;const g=async()=>{a()||(await i.callUeFunc({f:"update",p:{id:e.id,position:e.position}}),(t.debug??!1)&&console.log(`updatePostion:${e.position},actorTag:${e.actorTag},actorClass:${e.actorClass}`))},a=()=>!o&&!s?(console.warn(`${e.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,m=async()=>{const{id:c}=e,v=await t.unBindActorByID(c);v&&v.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${v.error}`),o=void 0;const h=await i.callUeFunc({f:"destroy",p:{id:c}});if(h&&h.error!==""){console.warn(`${e.id} UeESUnrealActor DestroyActorByID: ${h.error}`);return}s=void 0},p=this.dv(l.react({type:"ActorClass",actorClass:"default"}));{const c=this.dv(l.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),v=async()=>{e.actorTag!==""?p.value={type:"ActorTag",actorTag:e.actorTag}:p.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};v(),this.d(c.don(v)),this.d(e.flushEvent.don(()=>c.flush()))}{const c=this.dv(l.createProcessingFromAsyncFunc(async h=>{if(await h.promise(m()),p.value.type==="ActorTag"){const{actorTag:y}=p.value;await h.promise(m());try{e.lastActorStatus="null";const C=await h.promise(t.bindActorByTag(e.id,y));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor BindActorByTag:${y},${C.error}`);return}if(C.re.type===0)e.lastActorStatus="bound",o=y;else if(C.re.type===1)e.lastActorStatus="bound",o=y,console.warn(`${e.id} UeESUnrealActor BindActorByTag:${y},${Jn(C.re.type)}`);else{o=void 0,console.warn(`${e.id} UeESUnrealActor BindActorByTag error:${y}, ${Jn(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor BindActorByTag catch error:${y}, ${C}`);return}}else if(p.value.type==="ActorClass"){const{actorClass:y}=p.value;try{const C=await h.promise(t.createActorByClass(e.id,y));if(!C)return;if(C.error!==""){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error :${y}, ${C.error}`);return}if(C.re.type===0)e.lastActorStatus="created",s=y;else{console.warn(`${e.id} UeESUnrealActor CreateActorByClass error type :${y},${pr(C.re.type)}`);return}}catch(C){console.warn(`${e.id} UeESUnrealActor CreateActorByClass error catch :${y}, ${JSON.stringify(C)}`);return}}await h.promise(n()),await h.promise(g())})),v=async()=>{c.restart()};v(),this.d(p.changed.don(v))}this.d(e.positionChanged.don(g)),this.d(e.callFunctionEvent.don(async(c,v)=>{if(a()){e.__callFunctionResultEvent.emit(void 0);return}const h=await me(i,e.id,c,v);e.__callFunctionResultEvent.emit(h)})),this.d(e.smoothMoveEvent.don((c,v)=>{a()||et(i,e.id,c,v)})),this.d(e.smoothMoveWithRotationEvent.don((c,v,h)=>{a()||O(i,e.id,c,v,h)})),this.d(e.smoothMoveOnGroundEvent.don((c,v,h,y)=>{a()||j(i,e.id,c,v,y,h)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((c,v,h,y,C)=>{a()||tt(i,e.id,c,v,h,y,C)})),this.d(e.automaticLandingEvent.don(c=>{if(a())return;const v=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(h=>{h!==null&&(e.position=[...v,h],e.collision=c)})})),this.d(e.flyToEvent.don(async(c,v)=>{if(a())return;const h=await K(i,e.id,c);let y="over";h===void 0?y="error":h.endType===0?y="over":h.endType===1&&(y="cancelled"),e.flyOverEvent.emit(v,y,t)})),this.d(e.calcFlyToParamEvent.don(()=>{a()||_(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const c=await t.getCurrentCameraInfo();if(!c)return;const{position:v,rotation:h}=c;e.flyInParam={position:v,rotation:h,flyDuration:1}})),this.d(t.propChanged.don(c=>{a()||c.objId===e.id&&Object.keys(c.props).forEach(v=>{const h=c.props[v]===null?void 0:c.props[v];e[v]=h})}))}};w(bt,"type",bt.register("ESUeViewer",d.ESUnrealActor.type,bt));let mi=bt;const xt=class xt extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(xt,"type",xt.register("ESUeViewer",d.ESVideoFusion.type,xt));let Ci=xt;const Ot=class Ot extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Ot,"type",Ot.register("ESUeViewer",d.ESViewShed.type,Ot));let Ei=Ot;const jt=class jt extends D{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};w(jt,"type",jt.register("ESUeViewer",d.ESVisibilityAnalysis.type,jt));let Si=jt;const te=class te extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.ad(l.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.clearEvent.don(()=>{i.callUeFunc({f:"Clear",p:{id:e.id}})}))}};w(te,"type",te.register("ESUeViewer",d.ESVolumeMeasurement.type,te));let Fi=te;const Q=class Q extends M{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Q,"type",Q.register("ESUeViewer",d.ESWidget.type,Q)),w(Q,"propValFuncs",{...M.propValFuncs,info:e=>JSON.stringify(e??{})});let Ii=Q;const ee=class ee extends d.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}e.poi.actorTag=e.human.id,e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8],this.d(e.poiOffsetHeightChanged.don(()=>{e.poi.positionOffset=[0,0,e.poiOffsetHeight-.8]})),this.d(()=>{e.poi.actorTag=""})}};w(ee,"type",ee.register("ESUeViewer",d.ESHumanPoi.type,ee));let Ti=ee;d.ESSceneObject.context.getStrFromEnv(d.ESNavigator.defaults.imgUrl);const ie=class ie extends d.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new d.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),this.dispose(l.track([n,"show"],[e,"show"])),n.instanceClass=class extends l.Destroyable{constructor(o,s,g){super(),this._subContainer=o;const a=document.createElement("div");this._subContainer.appendChild(a),this.dispose(()=>this._subContainer.removeChild(a));{const c=async()=>{const v=await t.getCurrentCameraInfo(),h=v==null?void 0:v.position,C=[...v==null?void 0:v.rotation];C[0]=360,t.flyIn(h,C)};a.addEventListener("click",c),a.style.cursor="pointer",this.dispose(()=>a.removeEventListener("click",c))}{const c=()=>{a.style.width=`${e.cssSize?e.cssSize:d.ESNavigator.defaults.cssSize}px`,a.style.height=`${e.cssSize?e.cssSize:d.ESNavigator.defaults.cssSize}px`};c(),e.dispose(e.cssSizeChanged.disposableOn(c))}a.style.position="fixed";{const c=()=>{a.style.top=`${e.cssPosition?e.cssPosition[0]:d.ESNavigator.defaults.cssPosition[0]}px`,a.style.right=`${e.cssPosition?e.cssPosition[1]:d.ESNavigator.defaults.cssPosition[1]}px`};c(),e.dispose(e.cssPositionChanged.disposableOn(c))}a.style.transition=" right 0.4s linear",a.style.cursor="pointer";const m=document.createElement("div");a.appendChild(m),this.dispose(()=>a.removeChild(m)),m.style.width="100%",m.style.height="100%",m.style.position="relative";const p=document.createElement("img");m.appendChild(p),this.dispose(()=>m.removeChild(p)),p.style.width="100%",p.style.height="100%",p.style.border="none";{const c=()=>p.src=e.imgUrl;c(),e.dispose(e.imgUrlChanged.disposableOn(c))}{const c=()=>{const C=-t.getCurrentCameraInfo().rotation[0];p.style.transform=`rotate(${C}deg)`};let v;const h=async()=>{c(),e.show?(a.style.display="block",v=setInterval(()=>{c()},1e3)):(a.style.display="none",clearInterval(v))};this.dispose(e.showChanged.disposableOn(h)),h(),this.dispose(()=>clearInterval(v))}p.style.transformOrigin="50% 50%"}}}};w(ie,"type",ie.register("ESUeViewer",d.ESNavigator.type,ie));let Ri=ie;const B=class B extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}{const n=()=>{let r=e.materialMode==="blue"?"multipleArrows":e.materialMode==="purple"?"singleArrow":e.materialMode;i.callUeFunc({f:"update",p:{id:e.id,materialMode:r}})};this.dispose(e.materialModeChanged.disposableOn(n))}}};w(B,"type",B.register("ESUeViewer",d.ESPath.type,B)),w(B,"forceUeUpdateProps",[...D.forceUeUpdateProps]),w(B,"propValFuncs",{...D.propValFuncs});let Di=B;async function fr(u){navigator.clipboard.writeText(u).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const ne=class ne extends d.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new d.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),n.instanceClass=class extends l.Destroyable{constructor(o,s,g){if(super(),this._subContainer=o,!g||!(g instanceof $))return;const a=document.createElement("div");this._subContainer.appendChild(a),this.dispose(()=>this._subContainer.removeChild(a)),a.style.width="100%",a.style.position="absolute",a.style.height=`${d.ESViewerStatusBar.defaults.height}px`,a.style.left="0",a.style.bottom="0",a.style.color="#fff",a.style.padding="0 20px 0 0",a.style.boxSizing="border-box",a.style.lineHeight=`${d.ESViewerStatusBar.defaults.height}px`,a.style.zIndex="100",a.style.alignContent="center",a.style.justifyContent="space-between";const m=document.createElement("span");a.appendChild(m),this.dispose(()=>a.removeChild(m));const p=document.createElement("span");m.appendChild(p),this.dispose(()=>m.removeChild(p));const c=document.createElement("span");m.appendChild(c),c.addEventListener("dblclick",function(){let h=c.innerHTML;h.startsWith("鼠标位置")&&(h=h.slice(5)),fr(h)}),c.style.cursor="pointer",this.dispose(()=>m.removeChild(c));const v=document.createElement("span");a.appendChild(v),this.dispose(()=>a.removeChild(v));{const h=()=>{a.style.height=(e.height??d.ESViewerStatusBar.defaults.height)+"px",a.style.lineHeight=(e.height??d.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(h)),h()}{const h=()=>{a.style.fontSize=(e.fontSize??d.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(h)),h()}{const h=()=>{e.bgColor?a.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:a.style.background=`rgba(${d.ESViewerStatusBar.defaults.bgColor[0]},${d.ESViewerStatusBar.defaults.bgColor[1]},${d.ESViewerStatusBar.defaults.bgColor[2]},${d.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(h)),h()}g.getVersion().then(h=>{h&&(v.innerText=`Ue 版本 : ${h[0]} `)}).catch(h=>{console.log(h)});{const h=()=>{let E="",T="";E+=`帧率:${g.getFPS().toFixed(0)}FPS`,p.innerText=E;const S=t.getCurrentCameraInfo();E+=` 经度: ${S.position[0].toFixed(5)}° 纬度: ${S.position[1].toFixed(5)}° 高度: ${S.position[2].toFixed(2)}米 偏航角: ${S.rotation[0].toFixed(2)}° 俯仰角: ${S.rotation[1].toFixed(2)}° 翻滚角:${S.rotation[2].toFixed(2)}° `,p.innerText=E,t.pick().then(R=>{if(R){const{pickResult:I}=R;if(I&&I.position){const{position:A}=I;T+=`鼠标位置:${A[0].toFixed(5)}° ${A[1].toFixed(5)}° ${A[2].toFixed(2)}m`}else T+="暂时无法获取鼠标位置...";c.innerText=T}}).catch(R=>{console.log(R)})};let y;const C=async()=>{h(),e.show?(a.style.display="flex",y=setInterval(()=>{h()},1e3)):(a.style.display="none",clearInterval(y))};this.dispose(e.showChanged.disposableOn(C)),C(),this.dispose(()=>clearInterval(y))}}}}};w(ne,"type",ne.register("ESUeViewer",d.ESViewerStatusBar.type,ne));let Li=ne;const re=class re extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(re,"type",re.register("ESUeViewer",d.ESGaussianSplatting.type,re));let Pi=re;const oe=class oe extends N{constructor(t,i){super(t,i);w(this,"_es3DTileset",this.dv(new d.ES3DTileset));if(!i.viewer){console.warn("viewer is undefined!");return}this.es3DTileset.parentID=t.id;{const r=this._es3DTileset;t.components.disposableAdd(r,!0),this.d(l.track([r,"allowPicking"],[t,"allowPicking"])),this.d(l.track([r,"collision"],[t,"collision"])),this.d(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(l.bind([r,"flyToParam"],[t,"flyToParam"])),this.d(l.track([r,"url"],[t,"url"])),this.d(l.track([r,"actorTag"],[t,"actorTag"])),this.d(l.track([r,"materialMode"],[t,"materialMode"])),this.d(l.track([r,"highlight"],[t,"highlight"])),this.d(l.track([r,"maximumScreenSpaceError"],[t,"maximumScreenSpaceError"])),this.d(l.track([r,"highlightID"],[t,"highlightID"])),this.d(l.track([r,"highlightColor"],[t,"highlightColor"])),this.d(l.bind([r,"offset"],[t,"offset"])),this.d(l.bind([r,"rotation"],[t,"rotation"])),this.d(l.track([r,"czmImageBasedLightingFactor"],[t,"czmImageBasedLightingFactor"])),this.d(l.track([r,"czmLuminanceAtZenith"],[t,"czmLuminanceAtZenith"])),this.d(l.track([r,"czmMaximumMemoryUsage"],[t,"czmMaximumMemoryUsage"])),this.d(l.track([r,"czmClassificationType"],[t,"czmClassificationType"])),this.d(l.track([r,"czmStyleJson"],[t,"czmStyleJson"])),this.d(l.track([r,"czmBackFaceCulling"],[t,"czmBackFaceCulling"])),this.d(l.track([r,"czmDebugShowBoundingVolume"],[t,"czmDebugShowBoundingVolume"])),this.d(l.track([r,"czmDebugShowContentBoundingVolume"],[t,"czmDebugShowContentBoundingVolume"])),this.d(l.track([r,"colorBlendMode"],[t,"colorBlendMode"])),this.d(l.track([r,"cacheBytes"],[t,"cacheBytes"])),this.d(l.track([r,"clippingPlaneEnabled"],[t,"clippingPlaneEnabled"])),this.d(l.track([r,"unionClippingRegions"],[t,"unionClippingRegions"])),this.d(l.track([r,"clippingPlaneEdgeColor"],[t,"clippingPlaneEdgeColor"])),this.d(l.track([r,"clippingPlaneEdgeWidth"],[t,"clippingPlaneEdgeWidth"])),this.d(l.track([r,"materialParams"],[t,"materialParams"])),this.d(l.bind([r,"supportEdit"],[t,"supportEdit"])),this.d(l.bind([r,"clippingPlanesId"],[t,"clippingPlanesId"])),this.d(l.bind([r,"clippingPlaneIds"],[t,"clippingPlaneIds"])),this.d(l.bind([r,"flattenedPlaneId"],[t,"flattenedPlaneId"])),this.d(l.bind([r,"flattenedPlaneEnabled"],[t,"flattenedPlaneEnabled"])),this.d(l.bind([r,"clippingPlaneId"],[t,"clippingPlaneId"])),this.d(l.bind([r,"excavateId"],[t,"excavateId"]))}{const r=this._es3DTileset;this.d(t.refreshTilesetEvent.don(()=>{r.refreshTileset()})),this.d(t.highlightFeatureEvent.don((...o)=>{r.highlightFeature(...o)})),this.d(t.highlightFeatureAndFlyToEvent.don((...o)=>{r.highlightFeatureAndFlyTo(...o)})),this.d(t.setFeatureColorEvent.don((...o)=>{r.setFeatureColor(...o)})),this.d(t.setFeatureVisableEvent.don((...o)=>{r.setFeatureVisable(...o)})),this.d(t.resetFeatureStyleEvent.don((...o)=>{r.resetFeatureStyle(...o)})),this.d(t.flyInEvent.don((...o)=>{r.flyIn(o[0])})),this.d(t.flyToEvent.don((...o)=>{r.flyTo(o[0])})),this.d(t.calcFlyToParamEvent.don((...o)=>{r.calcFlyToParam(...o)})),this.d(t.calcFlyInParamEvent.don((...o)=>{r.calcFlyInParam(...o)}))}{const r=this._es3DTileset;this.d(r.tilesetReady.don(o=>{t.tilesetReady.emit(o)})),this.d(r.pickedEvent.don(o=>{o.assign({sceneObject:t}),t.pickedEvent.emit(o)}))}{const r=()=>{this.es3DTileset.show=t.show};r(),this.d(t.showChanged.don(()=>{r()}))}}get es3DTileset(){return this._es3DTileset}};w(oe,"type",oe.register("ESUeViewer",d.ESRtsFeatureEditing.type,oe));let Ui=oe;const se=class se extends N{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(se,"type",se.register("ESUeViewer",d.ESMsTileset.type,se));let Ai=se;const ae=class ae extends U{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{i.callUeFunc({f:"update",p:{id:e.id,height:e.height??d.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??d.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??d.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},r=this.disposeVar(l.createNextAnimateFrameEvent(e.heightChanged,e.extrudedHeightChanged,e.perPositionHeightChanged));this.dispose(r.disposableOn(n)),this.dispose(e.createdEvent.disposableOn(n))}};w(ae,"type",ae.register("ESUeViewer",d.ESGeoExtrudedPolygon.type,ae));let Mi=ae;const le=class le extends F{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(le,"type",le.register("ESUeViewer",d.ESStaticMesh.type,le));let Wi=le;const de=class de extends D{constructor(e,t){super(e,t);const i=t.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(e.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:e.id}})})),this.d(e.clearEvent.don(()=>{i.callUeFunc({f:"Clear",p:{id:e.id}})}))}};w(de,"type",de.register("ESUeViewer",d.ESSkylineAnalysis.type,de));let $i=de;f.copyright=void 0;try{const u="earthsdk3-ue",e="3.4.0",t="2025-09-12T07:06:00.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="7bb817c2218c8ba03b2c728ade4fc430cfee47dd",s=((Date.now()-175766076e4)/36e5).toFixed(1),g=`%c🌏 ${u}%c ${e}.${r.slice(0,8)}.${t} (距今${s}个小时)
1
+ (function(p,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("earthsdk3"),require("@epicgames-ps/lib-pixelstreamingfrontend-ue5.2"),require("html2canvas")):typeof define=="function"&&define.amd?define(["exports","earthsdk3","@epicgames-ps/lib-pixelstreamingfrontend-ue5.2","html2canvas"],o):(p=typeof globalThis<"u"?globalThis:p||self,o(p.EarthSDK3_UE={},p.EarthSDK3,p.libPixelstreamingfrontendUe5_2,p.html2canvas))})(this,(function(p,o,R,Jn){"use strict";var Sr=Object.defineProperty;var Fr=(p,o,R)=>o in p?Sr(p,o,{enumerable:!0,configurable:!0,writable:!0,value:R}):p[o]=R;var f=(p,o,R)=>Fr(p,typeof o!="symbol"?o+"":o,R);const Kn={...o.ESViewer.defaults,geoReferenceOrigin:void 0,keepWorldOriginNearCamera:!1,useCache:!0,widgetInteractionDistance:200,memReportInterval:10,sceneControlled:!0,brightness:0,emissiveIntensity:1,statusUpdateInterval:.5,baseUrl:window.location.href??"",screenPercentage:-1,antiAliasingMethod:"default"},$i=()=>({...o.ESViewer.createCommonProps(),apiKey:"",apiUrl:"",secretKey:"",speechVoiceMode:"",geoReferenceOrigin:o.reactArrayWithUndefined(void 0),keepWorldOriginNearCamera:void 0,useCache:void 0,widgetInteractionDistance:void 0,memReportInterval:void 0,sceneControlled:void 0,brightness:void 0,emissiveIntensity:void 0,statusUpdateInterval:void 0,baseUrl:void 0,screenPercentage:void 0,antiAliasingMethod:void 0});function dt(){const c=$i(),t=[];return Object.keys(c).forEach(e=>{t.push(e)}),t}function pt(c){const{defaults:t}=M,e=dt(),i={};return e.forEach(n=>{i[n]=c[n]??t[n]}),i}const H=async(c,t,e,i,n,r="default")=>{const s=await c.callUeFunc({f:"flyTo",p:{id:t,duration:e,flyToParam:i,position:n,flyMode:r}});if(s.error){console.error(s.error);return}return s.re},ft=async(c,t)=>{const e=await c.callUeFunc({f:"destroy",p:{id:t}});return e.error&&console.error(e.error),e},W=(c,t)=>{c.callUeFunc({f:"calcFlyToParam",p:{id:t}}).then(e=>{e.error&&console.error("calcFlyToParam:",e.error)}).catch(e=>{console.error("calcFlyToParam:",e)})},_i=(c,t)=>{c.callUeFunc({f:"refreshTileset",p:{id:t}}).then(e=>{e.error&&console.error("refreshTileset:",e.error)}).catch(e=>{console.error("refreshTileset:",e)})},Q=async(c,t,e,i,n,r="default")=>{const s=await c.callUeFunc({f:"flyIn",p:{id:t,position:e,rotation:i,duration:n,flyMode:r}});if(s.error){console.error(s.error);return}return s.re},bi=async(c,t)=>{if(!c){console.warn("DefaultCameraFlyIn: viewer is undefined");return}const e=await c.callUeFunc({f:"DefaultCameraFlyIn",p:{Duration:t??1}});if(e.error){console.error("DefaultCameraFlyIn:",e.error);return}return e},xi=async c=>{if(!c){console.warn("StartVoice:viewer is undefined");return}const t=await c.callUeFunc({f:"StartVoice",p:{}});if(t.error){console.error("StartVoice:",t.error);return}return t},Ni=async c=>{if(!c){console.warn("StopVoice:viewer is undefined");return}const t=await c.callUeFunc({f:"StopVoice",p:{}});if(t.error){console.error("StopVoice:",t.error);return}return t},zi=async(c,t)=>{if(!c){console.warn("mountPakFiles:viewer is undefined");return}const e=await c.callUeFunc({f:"MountPakFiles",p:{json:t}});if(e.error){console.error("mountPakFiles:",e.error);return}return e},Gi=async c=>{if(!c){console.warn("generateMemReport:viewer is undefined");return}const t=await c.callUeFunc({f:"GenerateMemReport",p:{}});if(t.error){console.error("generateMemReport:",t.error);return}return t},wt=async(c,t)=>{const e=await c.callUeFunc({f:"resetWithCurrentCamera",p:{id:t}});return e.error&&console.error("resetWithCurrentCamera:",e.error),e},k=(c,t,e,i,n)=>{c.callUeFunc({f:"smoothMoveWithRotation",p:{id:t,Destination:e,NewRotation:i,Time:n}}).then(r=>{r.error&&console.error("smoothMoveWithRotation:",r.error)}).catch(r=>{console.error("smoothMoveWithRotation:",r)})},O=(c,t,e,i,n,r)=>{c.callUeFunc({f:"smoothMoveOnGround",p:{id:t,Lon:e,Lat:i,Ground:n,Time:r}}).then(s=>{s.error&&console.error("smoothMoveOnGround:",s.error)}).catch(s=>{console.error("smoothMoveOnGround:",s)})},j=(c,t,e,i,n,r,s)=>{c.callUeFunc({f:"smoothMoveWithRotationOnGround",p:{id:t,NewRotation:e,Lon:i,Lat:n,Time:r,Ground:s}}).then(a=>{a.error&&console.error("smoothMoveWithRotationOnGround:",a.error)}).catch(a=>{console.error("smoothMoveWithRotationOnGround:",a)})},Hi=(c,t,e)=>{c.callUeFunc({f:"HighlightFeature",p:{id:t,HlId:e}}).then(i=>{i.error&&console.error("HighlightFeature:",i.error)}).catch(i=>{console.error("HighlightFeature:",i)})},Ji=(c,t,e,i)=>{c.callUeFunc({f:"HighlightFeatureAndFlyTo",p:{id:t,HlId:e,Duration:i}}).then(n=>{n.error&&console.error("HighlightFeatureAndFlyTo:",n.error)}).catch(n=>{console.error("HighlightFeatureAndFlyTo:",n)})},Ki=(c,t,e)=>{c.callUeFunc({f:"SetLayerVisible",p:{id:t,LayerJson:e}}).then(i=>{i.error&&console.error("SetLayerVisible:",i.error)}).catch(i=>{console.error("SetLayerVisible:",i)})},Xi=(c,t,e)=>{c.callUeFunc({f:"SetLayerColor",p:{id:t,LayerJson:e}}).then(i=>{i.error&&console.error("SetLayerColor:",i.error)}).catch(i=>{console.error("SetLayerColor:",i)})},ee=(c,t,e,i)=>{c.callUeFunc({f:"smoothMove",p:{id:t,Destination:e,Time:i}}).then(n=>{n.error&&console.error("smoothMove:",n.error)}).catch(n=>{console.error("smoothMove:",n)})},yt=async(c,t,e,i)=>{const n=await c.callUeFunc({f:"callFunction",p:{id:t,fn:e,p:i}});return n.error&&(console.error("callFunction:",n.error),console.error(`id: ${t} fn: ${e} param: ${i}`)),n.re??void 0},qi=(c,t,e,i)=>{c.callUeFunc({f:"SetNodePosition",p:{id:t,NodeName:e,NodePosition:i}}).then(n=>{n.error&&console.error("SetNodePosition:",n.error)}).catch(n=>{console.error("SetNodePosition:",n)})},Zi=(c,t,e,i)=>{c.callUeFunc({f:"SetNodeRotation",p:{id:t,NodeName:e,NodeRotation:i}}).then(n=>{n.error&&console.error("SetNodeRotation:",n.error)}).catch(n=>{console.error("SetNodeRotation:",n)})},Vi=(c,t,e,i)=>{c.callUeFunc({f:"SetNodeScale",p:{id:t,NodeName:e,NodeScale:i}}).then(n=>{n.error&&console.error("SetNodeScale:",n.error)}).catch(n=>{console.error("SetNodeScale:",n)})},A=async(c,t)=>{if(t.mode=="Follow"){const i=o.ESSceneObject.getSceneObject(t.objectId);t.objectId=i?(i.components.main??i).id:t.objectId}else if(t.mode=="Line"){const i=o.ESSceneObject.getSceneObject(t.geoLineStringId);t.geoLineStringId=i?(i.components.main??i).id:t.geoLineStringId}const e=await c.callUeFunc({f:"ChangeNavigationMode",p:t});if(e.error){console.error("ChangeNavigationMode:",e.error);return}return e},Yi=async(c,t)=>{const e=await c.callUeFunc({f:"setGlobalProperty",p:t});if(e.error){console.error("setGlobalProperty:",e.error);return}return e},Qi=async c=>{const t=await c.callUeFunc({f:"Quit",p:void 0});if(t.error){console.error("Quit:",t.error);return}return t},ki=async(c,t,e,i)=>{console.log("pickCallFunc",t,e,i);const n=await c.callUeFunc({f:"pick",p:{screenPosition:t,parentInfo:i}});if(!n.re&&(n.error||n.error=="")){console.error("pick:",n.error==""?"未获取到结果":n.error);return}let r=n.re.id,s,a=r?o.ESSceneObject.getSceneObject(r):void 0;return a&&a.parentID&&(a=o.ESSceneObject.getSceneObject(a.parentID)),s=new o.ESJPickedResult(n.re,a,n.re.features,n.re.add,e,t),a&&Reflect.has(a,"allowPicking")&&Reflect.has(a,"pickedEvent")&&(a.allowPicking??!1)&&a.pickedEvent.emit(s),a&&Reflect.has(a,"allowPicking")&&!a.allowPicking?new o.ESJPickedResult:s},Oi=async(c,t)=>{const e=await c.callUeFunc({f:"pickPosition",p:{screenPosition:t}});if(!e.re&&(e.error||e.error=="")){console.error("pickPosition",e.error==""?"未获取到结果":e.error);return}const{position:i}=e.re;return i},ji=async(c,t,e,i="ECC_Visibility")=>{const n=await c.callUeFunc({f:"GetHeightByLonLat",p:{Lon:t,Lat:e,Channel:i}});if(n.error){console.warn(`GetHeightByLonLat:${n.error}`);return}return n.re},en=async(c,t,e="ECC_Visibility")=>{const i=await c.callUeFunc({f:"GetHeightsByLonLats",p:{LonLats:t,Channel:e}});if(i.error){console.warn(`GetHeightsByLonLats:${i.error}`);return}i.re.heights.includes(null)&&console.warn("注意! GetHeightsByLonLats: 存在高度为null的点. there are points with a height of null");try{return i.re.heights}catch{return}},tn=async(c,t=64,e=64)=>{const i=await c.callUeFunc({f:"capture",p:{resx:t,resy:e}});if(i.error){console.warn(i.error);return}return i.re.image},nn=async(c,t,e=[64,64])=>{const i=await c.callUeFunc({f:"partialCapture",p:{startPos:t,size:e}});if(i.error){console.warn(i.error);return}return i.re.image},rn=async(c,t)=>{const e=await c.callUeFunc({f:"LonLatAltToScreenPosition",p:{LonLatAlt:t}});return e.error&&console.warn(e.error),e.re},on=async(c,t)=>{const e=await c.callUeFunc({f:"UEPositionToLonLatAlt",p:{UEPosition:t}});if(e.error){console.warn(e.error);return}return[...e.re.LonLatAlt]},sn=async(c,t)=>{const e=await c.callUeFunc({f:"GetAllSocketNamesByActorTag",p:{ActorTag:t}});if(e.error){console.warn(e.error);return}return[...e.re.socketNames]},an=async c=>{const t=await c.callUeFunc({f:"GetVersion",p:void 0});if(t.error){console.warn("GetVersion:",t.error);return}return t.re.version},ln=async(c,t)=>{const e=await c.callUeFunc({f:"GetBoundSphere",p:{id:t}});if(e.error){console.warn(e.error);return}return e.re},dn=async(c,t)=>{const e=await c.callUeFunc({f:"GetBoundSphereWithChildren",p:{id:t}});if(e.error){console.warn(`GetBoundSphereWithChildren:${e.error}`);return}return e.re},cn=async(c,t)=>{const e=await c.callUeFunc({f:"GetStrokeMaterialParamInfo",p:{id:t}});if(e.error){console.warn(`GetStrokeMaterialParamInfo:${e.error}`);return}return e.re},un=async(c,t)=>{const e=await c.callUeFunc({f:"GetFillMaterialParamInfo",p:{id:t}});if(e.error){console.warn(`GetFillMaterialParamInfo:${e.error}`);return}return e.re},hn=async(c,t)=>{const e=await c.callUeFunc({f:"getGlobalProperty",p:{props:t}});if(e.error){console.warn(`getGlobalProperty:${e.error}`);return}return e.re},vn=async(c,t)=>{const e=await c.callUeFunc({f:"GetObjectByInfo",p:{info:t}});if(e.error){console.warn(`GetObjectByInfo:${e.error}`);return}return e.re},gn=async(c,t,e)=>await c.callUeFunc({f:"BindActorByTag",p:{ID:t,ActorTag:e}}),pn=async c=>await c.callUeFunc({f:"RestoreOriginalScene",p:void 0}),fn=async(c,t)=>await c.callUeFunc({f:"UnBindActorByID",p:{ID:t}}),wn=async(c,t)=>await c.callUeFunc({f:"UnBindActorByTag",p:{ActorTag:t}}),yn=async(c,t,e)=>await c.callUeFunc({f:"CreateActorByClass",p:{ID:t,ActorClass:e}}),mn=async function(c,t,e){return await c.callUeFunc({f:"Bind3DTilesetByTag",p:{ID:t,ActorTag:e}})},Cn=async function(c,t){return await c.callUeFunc({f:"UnBind3DTilesetByTag",p:{ActorTag:t}})},En=async function(c,t){return await c.callUeFunc({f:"UnBind3DTilesetById",p:{ID:t}})},Sn=async function(c,t,e,i){return await c.callUeFunc({f:"BindImageryByTag",p:{ID:t,ActorTag:e,ComponentTag:i}})},Fn=async function(c,t,e){return await c.callUeFunc({f:"UnBindImageryByTag",p:{ActorTag:t,ComponentTag:e}})},In=async function(c,t){return await c.callUeFunc({f:"UnBindImageryById",p:{ID:t}})},Tn=async function(c,t,e,i){return await c.callUeFunc({f:"GetIdByComponentNameAndHitItem",p:{id:t,ComponentName:e,HitItem:i}})},Rn=async function(c,t="ECC_Visibility"){return await c.callUeFunc({f:"GetCameraRelativeHeight",p:{Channel:t}})},Dn=async function(c,t,e,i){const n=await c.callUeFunc({f:"SaveStringToFile",p:{String:t,Path:e??"undefine",File:i??"data.txt"}});return n.error!==""&&console.warn("SaveStringToFile: ",n.error),n},Ln=async function(c,t,e=!0){const i=await c.callUeFunc({f:"HighlightActorByTag",p:{ActorTag:t,Highlight:e}});return i.error!==""&&console.warn("HighlightActorByTag: ",i.error),i},Pn=async function(c,t){const e=await c.callUeFunc({f:"SendCustomMessage",p:{Message:t}});return e.error!==""&&console.warn("SendCustomMessage: ",e.error),e},Bn=async function(c){const t=await c.callUeFunc({f:"GetStatus",p:void 0});if(t.error){console.warn(`GetStatus:${t.error}`);return}return t.re},Un=async(c,t,e,i,n=!0)=>{const r=await c.callUeFunc({f:"startEditing",p:{sceneObjectID:t,editingID:e,modes:i,useKeyToSwitch:n}});if(r.error){console.error("startEditing:",r.error);return}return r},An=async c=>{const t=await c.callUeFunc({f:"stopEditing",p:void 0});if(t.error){console.error("stopEditing:",t.error);return}return t},Mn=async(c,t,e)=>{const i=await c.callUeFunc({f:"moveObjects",p:{sceneObjectIDs:t,editingID:e}});if(i.error){console.error("moveObjects:",i.error);return}return i},Wn=async c=>{const t=await c.callUeFunc({f:"GetTilesetMaterialIDList",p:void 0});if(t.error){console.error("GetTilesetMaterialIDList:",t.error);return}return t.re.materialIDList};class te extends o.Destroyable{}const Xn={Response:1},ct={UIInteraction:50,MouseWheel:75};class qn extends o.HasOwner{constructor(e,i){super(e);f(this,"_processResponseFn",e=>this.esUeViewer.processResponse(e));f(this,"_inner");this._uri=i,this._inner=new WebSocket(this._uri),this.d(()=>{this._inner.close()}),this._innerInit()}get esUeViewer(){return this.owner}get uri(){return this._uri}get inner(){return this._inner}_innerInit(){this.inner.onmessage=e=>{if(this.isDestroyed())return;let i=new FileReader;i.onload=n=>{if(this.isDestroyed())return;let r=n.target.result,s=new Uint32Array(r),a=0;if(s[0]===Xn.Response){a+=4;let v=s[a/4];a+=4;for(let l=0;l<v;l++){let y=s[a/4];a+=4;let g=new TextDecoder("utf-8").decode(r.slice(a,a+y));a+=y,this._processResponseFn(g)}}},i.readAsArrayBuffer(e.data)},this.inner.onopen=()=>{this.isDestroyed()||(console.warn("earthsdk message websocket server connected:",this.uri),console.log("%c[EarthSDK websocket open]","background: #a6ec99; color: black","open"),this.owner.dispatchEvent(new CustomEvent("esmsgwsopen",{detail:"websocket open"})))},this._inner.onclose=e=>{this.isDestroyed()||(console.log("%c[EarthSDK websocket close ]","background: red; color: black","error"),this.owner.dispatchEvent(new CustomEvent("error",{detail:"websocket close"})))},this._inner.onerror=e=>{this.isDestroyed()||(console.log("%c[EarthSDK websocket error ]","background: red; color: black","error"),this.owner.dispatchEvent(new CustomEvent("error",{detail:"websocket error"})))}}sendInputData(e){const i=this.inner;if(i.readyState!==WebSocket.OPEN)return;const r=new Uint8Array(e)[0];if(r>=ct.UIInteraction&&r<=ct.MouseWheel){const s=new ArrayBuffer(e.byteLength+4);return new DataView(s).setUint32(0,e.byteLength,!0),new Uint8Array(s,4).set(new Uint8Array(e)),i.send(new DataView(s)),!0}else return!1}emitDescriptorWithString(e,i){let n=new TextEncoder().encode(i),r=new DataView(new ArrayBuffer(3+n.length)),s=0;r.setUint8(s,e),s++,r.setUint16(s,n.length,!0),s+=2;for(let a=0;a<n.length;a++)r.setUint8(s,n[a]),s+=1;try{this.sendInputData(r.buffer)}catch(a){console.error(`data.buffer.size: ${r.buffer.byteLength} 独立通道 sendInputData error: ${a}`,a)}}destroyImpl(){this._inner&&this._inner.close()}}window.g_emitDescriptor_maxBytes=3e4;let Zn=-1;R.Logger.SetLoggerVerbosity(1);class Vn extends o.Destroyable{constructor(e,i){super();f(this,"_eventTarget",new EventTarget);f(this,"debug",!1);f(this,"uiInteractionCallbacks",new Map);f(this,"_pixelStream");f(this,"_esMsgWsWrapper");this._domOrDomId=e,this._options=i;const n=typeof this._domOrDomId=="string"?document.getElementById(this._domOrDomId):this._domOrDomId;if(!n)throw new Error(`ESUEViewer container${this._domOrDomId} error!`);console.log(`PSUEViewer init _options ${this._options}`);const{url:r,esmsgWsUri:s}=this._options;this._pixelStream=this._initPixelStream(n,r),this.d(()=>{this._pixelStream.disconnect()}),this._handerPixelStreamEvent(),this._esMsgWsWrapper=this._initEsMsgWsWrapper(s);const a=this;if(a.esMsgWsWrapper){const v=a.webRtcController.sendMessageController.dataChannelSender.sendData;a.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(l){a.esMsgWsWrapper?a.esMsgWsWrapper.sendInputData(l):v.call(this,l)}}}get eventTarget(){return this._eventTarget}addEventListener(e,i,n){return this.eventTarget.addEventListener(e,i,n)}removeEventListener(e,i,n){return this.eventTarget.removeEventListener(e,i,n)}dispatchEvent(e){return this.eventTarget.dispatchEvent(e)}_initPixelStream(e,i){const n=new R.Config({initialSettings:{AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!1,SuppressBrowserKeys:!1,[R.TextParameters.SignallingServerUrl]:i}});return n.setFlagEnabled(R.Flags.BrowserSendOffer,!1),n.setFlagEnabled(R.Flags.HoveringMouseMode,!0),n.setFlagEnabled(R.Flags.MatchViewportResolution,!0),n.setNumericSetting(R.NumericParameters.MaxReconnectAttempts,0),new R.PixelStreaming(n,{videoElementParent:e})}get pixelStream(){return this._pixelStream}_initEsMsgWsWrapper(e){return e?this.dv(new qn(this,e)):void 0}get esMsgWsWrapper(){return this._esMsgWsWrapper}get esWebSocketReady(){var e;return((e=this.esMsgWsWrapper)==null?void 0:e.inner.readyState)===1}_handerPixelStreamEvent(){this.pixelStream.addEventListener("videoInitialized",()=>{console.log("%c[EarthSDK webrtc videoInitialized]","background: #a6ec99; color: black","videoInitialized"),this.dispatchEvent(new CustomEvent("videoinited",{detail:"videoinited"}))}),this.pixelStream.addEventListener("webRtcFailed",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webRtc webRtcFailed]","background: red; color: black","webRtcFailed"),this.dispatchEvent(new CustomEvent("error",{detail:"webRtcFailed"})),this.pixelStream.disconnect())}),this.pixelStream.addEventListener("webRtcDisconnected",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webRtc webRtcDisconnected]","background: red; color: black","webRtcDisconnected"),this.dispatchEvent(new CustomEvent("error",{detail:"webRtcDisconnected"})),this.pixelStream.disconnect())}),this.pixelStream.addEventListener("webRtcConnected",()=>{this.isDestroyed()||(console.log("%c[EarthSDK webrtc webRtcConnected]","background: #a6ec99; color: black","webRtcConnected"),this.dispatchEvent(new CustomEvent("webRtcConnected",{detail:"webRtcConnected"})))}),this.pixelStream.addResponseEventListener("esueviewer",e=>{this.processResponse(e)})}resolveCallback(e){let i={};try{i=JSON.parse(e)}catch{return!1}let n=i.callid;if(typeof n!="string"||!this.uiInteractionCallbacks.has(n))return!1;let r=this.uiInteractionCallbacks.get(n);return typeof r!="function"?!1:(r(i),this.uiInteractionCallbacks.delete(n),!0)}processResponse(e){if(this.debug??!1)try{const i=JSON.parse(e);if(i.ers=i.ers&&i.ers.filter(n=>n.et!=="mouseMoveEvent"),!(i.ers&&i.ers.length>0||i.frs&&i.frs.length>0))return;console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${e}) error: ${i}`,i)}this.resolveCallback(e)||this.dispatchEvent(new CustomEvent("ueevent",{detail:e}))}emitUIInteraction(e,i){typeof i=="function"&&(e.callid=o.createGuid(),this.uiInteractionCallbacks.set(e.callid,i)),this.pixelStream.emitUIInteraction(e)}get webRtcController(){return this.pixelStream._webRtcController}emitUIInteractionForBigData(e,i){typeof i=="function"&&(e.callid=o.createGuid(),this.uiInteractionCallbacks.set(e.callid,i));const n=JSON.stringify(e),r=window.g_emitDescriptor_maxBytes,s=n.length,a=++Zn;if(this.esMsgWsWrapper){if(s<r){this.esMsgWsWrapper.emitDescriptorWithString(ct.UIInteraction,`${a}-0/1-`+n);return}const v=Math.ceil(s/r)|0;[...new Array(v).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,g)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(ct.UIInteraction,`${a}-${g}/${v}-`+y)})}}emitCommand(e){this.pixelStream.emitCommand(e)}getVideoSize(){const e=this.webRtcController.videoPlayer.getVideoElement();return{width:e.videoWidth,height:e.videoHeight}}resizeUEVideo(e,i){let n={Resolution:{Width:e,Height:i}};console.log(`resizeUEVideo emitCommand ${e} ${i} begin`),this.emitCommand(n)}}class Yn extends o.Destroyable{constructor(e,i,n){super();f(this,"_instance");f(this,"_event",this.dv(new o.Event));this._container=e,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new Vn(this._container,{url:this._wsuri,esmsgWsUri:this._esmsgWsUri})),this.instanceInit()}get webSocketReady(){return this._instance.esWebSocketReady}get event(){return this._event}get debug(){return this._instance.debug}set debug(e){this._instance.debug=e}instanceInit(){if("addEventListener"in this._instance){["esmsgwsopen","error","videoinited","ueevent","webRtcConnected"].forEach(i=>{const n=r=>{this._event.emit(i,r.detail)};this._instance.addEventListener(i,n),this.dispose(()=>this._instance.removeEventListener(i,n))});return}this.dispose(this._instance.errorEvent.disposableOn(e=>{this._event.emit("error",e.detail)})),this.dispose(this._instance.webRtcConnectedEvent.disposableOn(e=>{this._event.emit("webRtcConnected",e.detail)})),this.dispose(this._instance.videoinitedEvent.disposableOn(e=>{this._event.emit("videoinited",e.detail)})),this.dispose(this._instance.ueevent.disposableOn(e=>{this._event.emit("ueevent",e.detail)}))}emitUIInteractionForBigData(e,i){return new Promise((n,r)=>{const s=(...a)=>{n(a),i&&i(...a)};try{this._instance.emitUIInteractionForBigData(e,s)}catch(a){console.warn(`emitUIInteraction发生错误:${a}`),r(a)}})}getVideoSize(){return this._instance.getVideoSize()}resize(e,i){this._instance.resizeUEVideo(e,i)}}class Qn extends te{constructor(e,i,n,r){super();f(this,"_esueViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new o.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new o.Event));f(this,"_errorEvent",this.dv(new o.Event));f(this,"_readyEvent",this.dv(new o.Event));f(this,"_esmsgwsopen",this.dv(o.react(!1)));f(this,"_videoinited",this.dv(o.react(!1)));f(this,"_webRtcConnected",this.dv(o.react(!1)));this._ueViewer=r,console.log("CSTMPSViewer init ! 以官方像素流 + 独立通信的模式启动!");const s=this._ueViewer;this._esueViewerWrapper=this.dv(new Yn(e,i,n));const a=this._esueViewerWrapper;{const h=()=>a.debug=s.debug??!1;h(),this.d(s.debugChanged.don(h))}let v=!1;{const h=()=>{if(v)return;const u=a.webSocketReady;if(this.videoinited&&this.webRtcConnected&&u){console.log("%c[EarthSDK: esmsgWebSocket && videoinited && webRtcConnected]","background: #a6ec99; color: black");const w={eventType:"init",params:{}};a.emitUIInteractionForBigData(w),this._readyEvent.emit(),v=!0}};this.d(this.videoinitedChanged.don(()=>{h()})),this.d(this.webRtcConnectedChanged.don(()=>{h()})),this.d(this.esmsgwsopenChanged.don(()=>{h()}))}this.d(a.event.don((h,u)=>{if(h==="error")this._errorEvent.emit(u);else if(h==="ueevent"){const w=JSON.parse(u);if(w.t==="cr"){const m=w;if(m.frs&&this._ueFuncResultWithIdsEvent.emit(m.frs),m.ers)for(let C of m.ers)this._ueEvent.emit(C)}}else h==="webRtcConnected"?this.webRtcConnected=!0:h==="videoinited"?this.videoinited=!0:h==="esmsgwsopen"&&(this.esmsgwsopen=!0)}));{const h=this.dv(o.createAnimateFrame());let u,w;h.start(()=>{if(u!==e.offsetWidth||w!==e.offsetHeight){if(u=e.offsetWidth,w=e.offsetHeight,u===void 0||w===void 0||!Number.isFinite(u)||!Number.isFinite(w)||u<0||w<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${u} ${w}`);return}a.resize(u,w),console.log(`resize: ${u} ${w}`)}})}this.d(this._ueFuncResultWithIdsEvent.don(h=>{for(const u of h){const w=this._waitingUeFuncIdAndResultCallbacks.get(u.fid);w&&(this._waitingUeFuncIdAndResultCallbacks.delete(u.fid),w.resultCallback(u.r))}}));let l=0;const y=h=>{const u={n:l++,tt:Date.now(),t:"c",fs:h};this._waitingUeCalls.add(u),s.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(u,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._esueViewerWrapper.emitUIInteractionForBigData(u,()=>{this._waitingUeCalls.delete(u)})},g=()=>{if(!v||this._ueFuncWithIdAndResultCallbacks.length===0)return;const h=this._ueFuncWithIdAndResultCallbacks.map((([u])=>u));for(const[u,w]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(u.fid,w);this._ueFuncWithIdAndResultCallbacks.length=0;{const u=window.g_emitDescriptor_maxBytes,w=h.map(T=>({f:T,s:JSON.stringify(T).length}));let m=w.length,C=0,I=0,E=[];do{do{const{f:T,s:F}=w[C];if(E.push(T),++C,I+F>u||E.length>=20)break}while(C<m);E.length>0&&(s.debug&&console.log(`传送${E.length}条消息...`),y([...E]),E.length=0,I=0)}while(C<m)}};this.dv(o.createInterval()).start(g,50),this.d(()=>console.log("UeCloudViewer正在销毁..."))}get esueViewerWrapper(){return this._esueViewerWrapper}get errorEvent(){return this._errorEvent}get readyEvent(){return this._readyEvent}get esmsgwsopen(){return this._esmsgwsopen.value}set esmsgwsopen(e){this._esmsgwsopen.value=e}get esmsgwsopenChanged(){return this._esmsgwsopen.changed}get videoinited(){return this._videoinited.value}set videoinited(e){this._videoinited.value=e}get videoinitedChanged(){return this._videoinited.changed}get webRtcConnected(){return this._webRtcConnected.value}set webRtcConnected(e){this._webRtcConnected.value=e}get webRtcConnectedChanged(){return this._webRtcConnected.changed}resize(e,i){this.esueViewerWrapper.resize(e,i)}callUeFunc(e){return new Promise(i=>{const r={fid:o.createGuid(),...e};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:e,resultCallback:i}])})}disposableOnUeEvent(e,i){(this._ueViewer.debug??!1)&&console.log(`disposableOnUeEvent from UeCloudViewer, type:${e}`);const n=o.createGuid();this.callUeFunc({f:"addEventListener",p:{et:e,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.don(a=>{a.et===e&&a.eid===n&&i(a)});return()=>{s(),r()}}}function kn(c){let t="";const e=new Uint8Array(c),i=e.length;for(let n=0;n<i;n++)t+=String.fromCharCode(e[n]);return btoa(t)}const On=c=>{const t={type:"input",inputdata:kn(c)};return JSON.stringify(t)};function jn(c){return typeof c=="string"?document.getElementById(c):c}window.g_emitDescriptor_maxBytes=3e4,console.log("全局可设置消息体最大字节, window.g_emitDescriptor_maxBytes 默认 30000 。");let er=-1;R.Logger.SetLoggerVerbosity(1);class tr extends o.Destroyable{constructor(e,i){super();f(this,"debug",!1);f(this,"_error",this.dv(new o.Event));f(this,"_connected",this.dv(new o.Event));f(this,"_ueevent",this.dv(new o.Event));f(this,"_pixelStream");f(this,"uiInteractionCallbacks",new Map);this._container=e,this._option=i;const n=new R.Config({initialSettings:{HoveringMouse:!0,AutoPlayVideo:!0,AutoConnect:!0,StartVideoMuted:!1,SuppressBrowserKeys:!1,ss:this._option.ws},useUrlParams:!0});n.setFlagEnabled(R.Flags.BrowserSendOffer,!1),n.setFlagEnabled(R.Flags.HoveringMouseMode,!0),n.setFlagEnabled(R.Flags.MatchViewportResolution,!0),n.setNumericSetting(R.NumericParameters.MaxReconnectAttempts,0),this._pixelStream=new R.PixelStreaming(n,{videoElementParent:this.container}),this.d(()=>{this._pixelStream.disconnect()});{const r=this.pixelStream.webSocketController.webSocket,s=this._pixelStream._webRtcController.sendMessageController.dataChannelSender.sendData;this._pixelStream._webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(a){r?r.send(On(a)):s.call(this,a)}}{const r=s=>{const a=this._pixelStream._webRtcController.mouseController;setTimeout(()=>{const v=a.coordinateConverter.normalizeAndQuantizeUnsigned(s.offsetX,s.offsetY),y=a.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");y&&y([s.button,v.x,v.y]),s.preventDefault()})};this.container.addEventListener("dblclick",r),this.d(()=>{this.container.removeEventListener("dblclick",r)})}["error","close","open"].forEach(s=>{const a=()=>{this.isDestroyed()||(s==="open"?this.connected.emit("webSocketOpen"):s==="close"?this.error.emit("webSocketClose"):s==="error"&&this.error.emit("webSocketError"))};this.pixelStream.webSocketController.webSocket.addEventListener(s,a),this.d(()=>{this.pixelStream.webSocketController.webSocket.removeEventListener(s,a)})}),["videoInitialized","webRtcConnected","webRtcDisconnected","webRtcFailed"].forEach(s=>{const a=()=>{this.isDestroyed()||(s==="webRtcConnected"||s==="videoInitialized"?this.connected.emit(s):(s==="webRtcDisconnected"||s==="webRtcFailed")&&(this.error.emit(s),this.pixelStream.disconnect()))};this.pixelStream.addEventListener(s,a),this.d(()=>{this.pixelStream.removeEventListener(s,a)})}),this.pixelStream.addResponseEventListener("handle_responses",r=>{this.processResponse(r)}),this.d(()=>{this.pixelStream.removeResponseEventListener("handle_responses")})}get error(){return this._error}get connected(){return this._connected}get ueevent(){return this._ueevent}get container(){return jn(this._container)}get pixelStream(){return this._pixelStream}get webSocketReady(){return this.pixelStream.webSocketController.webSocket.readyState===1}processResponse(e){if(this.debug??!1)try{const i=JSON.parse(e);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${e}) error: ${i}`,i)}this.resolveCallback(e)||this.ueevent.emit(e)}emitUIInteractionForBigData(e,i){typeof i=="function"&&(e.callid=o.createGuid(),this.uiInteractionCallbacks.set(e.callid,i));const n=JSON.stringify(e),r=window.g_emitDescriptor_maxBytes??3e4,s=n.length,a=++er;if(s<r){const y={type:"earthsdk",time:new Date().getTime(),params:`${a}-0/1-`+n};this.sendData(JSON.stringify(y));return}const v=Math.ceil(s/r)|0;[...new Array(v).keys()].map(y=>n.slice(y*r,(y+1)*r)).forEach((y,g)=>{const d={type:"earthsdk",time:new Date().getTime(),params:`${a}-${g}/${v}-`+y};this.sendData(JSON.stringify(d))})}sendData(e){this.pixelStream.webSocketController.webSocket.send(e)}resolveCallback(e){let i={};try{i=JSON.parse(e)}catch{return!1}let n=i.callid;if(typeof n!="string"||!this.uiInteractionCallbacks.has(n))return!1;let r=this.uiInteractionCallbacks.get(n);return typeof r!="function"?!1:(r(i),this.uiInteractionCallbacks.delete(n),!0)}getVideoSize(){const e=this._pixelStream._webRtcController.videoPlayer.getVideoElement();return{width:e.videoWidth,height:e.videoHeight}}emitCommand(e){this.pixelStream.emitCommand(e)}emitUIInteraction(){console.log("emitUIInteraction 像素流初始化"),this.pixelStream.emitUIInteraction("像素流初始化")}resizeUEVideo(e,i){const n={Resolution:{Width:e,Height:i}};console.log(`resizeUEVideo emitCommand ${e} ${i} begin`),this.emitCommand(n)}}class ir extends o.Destroyable{constructor(e,i,n){super();f(this,"_instance");f(this,"_event",this.dv(new o.Event));this._container=e,this._wsuri=i,this._esmsgWsUri=n,this._instance=this.dv(new tr(this._container,{ws:this._wsuri})),this.d(this._instance.connected.don(r=>{this._event.emit(r,r),console.log(`%c[EarthSDK] ${r}`,"background: #a6ec99; color: black")})),this.d(this._instance.error.don(r=>{this._event.emit("errorEvent",r),console.log(`%c[EarthSDK] ${r}`,"background: red; color: black")})),this.d(this._instance.ueevent.don(r=>{this._event.emit("ueevent",r)}))}get instance(){return this._instance}get event(){return this._event}get debug(){return this._instance.debug}set debug(e){this._instance.debug=e}emitUIInteractionForBigData(e,i){return new Promise((n,r)=>{const s=(...a)=>{n(a),i&&i(...a)};try{this._instance.emitUIInteractionForBigData(e,s)}catch(a){console.warn(`emitUIInteraction发生错误:${a}`),r(a)}})}getVideoSize(){return this._instance.getVideoSize()}resize(e,i){this._instance.resizeUEVideo(e,i)}}class nr extends te{constructor(e,i,n,r){super();f(this,"_videoInitialized",this.dv(o.react(!1)));f(this,"_webRtcConnected",this.dv(o.react(!1)));f(this,"_webSocketOpen",this.dv(o.react(!1)));f(this,"_ue5ViewerWrapper");f(this,"_ueFuncResultWithIdsEvent",this.dv(new o.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new o.Event));f(this,"_errorEvent",this.dv(new o.Event));f(this,"_readyEvent",this.dv(new o.Event));this._ueViewer=r,console.log("INNPSViewer init ! 以内置信令服务器模式启动!");const s=this._ueViewer,a=this.dv(new ir(e,i,n));this._ue5ViewerWrapper=a;{const d=()=>a.debug=s.debug??!1;d(),this.d(s.debugChanged.don(d))}{let d=!1;const h=this.dv(o.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(h.don(()=>{if(d)return;const u=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&u){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),d=!0,console.log("%c[EarthSDK videoInitialized && webRtcConnected && webSocketReady]","background: #a6ec99; color: black");const w={eventType:"init",params:{}};this._ue5ViewerWrapper.emitUIInteractionForBigData(w)}else console.warn("webSocketReady",u),d=!1}))}this.d(a.event.don((d,h)=>{if(d==="errorEvent")this._errorEvent.emit(h);else if(d==="videoInitialized")this._videoInitialized.value=!0;else if(d==="webRtcConnected")this._webRtcConnected.value=!0;else if(d==="webSocketOpen")this._webSocketOpen.value=!0;else if(d==="ueevent"){const u=JSON.parse(h);if(u.t==="cr"){const w=u;if(w.frs&&this._ueFuncResultWithIdsEvent.emit(w.frs),w.ers)for(let m of w.ers)this._ueEvent.emit(m)}}}));{const d=this.dv(o.createAnimateFrame());let h,u,w;d.start(()=>{if(h!==e.offsetWidth||u!==e.offsetHeight||w!==s.resolutionScale){if(h=e.offsetWidth,u=e.offsetHeight,h===void 0||u===void 0||!Number.isFinite(h)||!Number.isFinite(u)||h<0||u<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${h} ${u}`);return}w=s.resolutionScale,a.resize(h/w,u/w)}})}this.d(this._ueFuncResultWithIdsEvent.don(d=>{for(const h of d){const u=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);u&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),u.resultCallback(h.r))}}));let v=0;const l=d=>{const h={n:v++,tt:Date.now(),t:"c",fs:d};this._waitingUeCalls.add(h),s.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(h,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd()),this._ue5ViewerWrapper.emitUIInteractionForBigData(h,()=>{this._waitingUeCalls.delete(h)})},y=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const h=this._ueFuncWithIdAndResultCallbacks.map((([u])=>u));for(const[u,w]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(u.fid,w);this._ueFuncWithIdAndResultCallbacks.length=0;{const u=window.g_emitDescriptor_maxBytes,w=h.map(T=>({f:T,s:JSON.stringify(T).length}));let m=w.length,C=0,I=0,E=[];do{do{const{f:T,s:F}=w[C];if(E.push(T),++C,I+F>u||E.length>=20)break}while(C<m);E.length>0&&(s.debug&&console.log(`传送${E.length}条消息...`),l([...E]),E.length=0,I=0)}while(C<m)}};this.dv(o.createInterval()).start(y,50),this.d(()=>console.log("UeCloudViewer正在销毁..."))}get videoInitialized(){return this._videoInitialized.value}get webRtcConnected(){return this._webRtcConnected.value}get webSocketOpen(){return this._webSocketOpen.value}get ue5ViewerWrapper(){return this._ue5ViewerWrapper}get errorEvent(){return this._errorEvent}get readyEvent(){return this._readyEvent}resize(e,i){this.ue5ViewerWrapper.resize(e,i)}callUeFunc(e){return new Promise(i=>{const r={fid:o.createGuid(),...e};this._ueFuncWithIdAndResultCallbacks.push([r,{timeStamp:Date.now(),ueFunc:e,resultCallback:i}])})}disposableOnUeEvent(e,i){const n=o.createGuid();this.callUeFunc({f:"addEventListener",p:{et:e,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.don(a=>{a.et===e&&a.eid===n&&i(a)});return()=>{s(),r()}}}class rr extends o.Destroyable{constructor(e,i,n,r){super();f(this,"_onRuntimeInitialized",this.dv(new o.Event));f(this,"_vIframe",null);this._ueViewer=r;const s=this._ueViewer;{const a=document.createElement("iframe");this._vIframe=a,a.style.cssText="width: 100%; height: 100%; margin: 0; padding: 0; border: none; outline: none;",e.appendChild(a),this.d(()=>{a&&e.removeChild(a)});const v=o.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);a.src=v,a.onload=()=>{const l=a.contentWindow;if(!l){console.error("iframeWindow is null");return}console.log("iwindow.Module",l.Module),l.Module.onRuntimeInitialized=()=>{this._onRuntimeInitialized.emit(),s.setStatus("Created"),s.setStatusLog("创建成功"),l.Module.UE4_resizeCanvas(),l.console.log("创建成功__________________________________________")}}}}get onRuntimeInitialized(){return this._onRuntimeInitialized}get vIframe(){return this._vIframe}}const $n=typeof TextDecoder<"u"?new TextDecoder:void 0,or=(c,t=0,e=NaN)=>{const i=t+e;let n=t;for(;c[n]&&!(n>=i);)++n;if(n-t>16&&c.buffer&&$n)return $n.decode(c.subarray(t,n));let r="";for(;t<n;){var s=c[t++];if(!(s&128)){r+=String.fromCharCode(s);continue}var a=c[t++]&63;if((s&224)==192){r+=String.fromCharCode((s&31)<<6|a);continue}var v=c[t++]&63;if((s&240)==224?s=(s&15)<<12|a<<6|v:((s&248)!=240&&console.warn("Invalid UTF-8 leading byte encountered when deserializing a UTF-8 string in wasm memory to a JS string!"),s=(s&7)<<18|a<<12|v<<6|c[t++]&63),s<65536)r+=String.fromCharCode(s);else{var l=s-65536;r+=String.fromCharCode(55296|l>>10,56320|l&1023)}}return r};class sr extends o.Destroyable{constructor(t,e,i){super();{const n=()=>{const v=pt(e);e.setGlobalProperty(v)};n();const r=dt(),s=[];r.forEach(v=>{const l=e[v+"Changed"];s.push(l)});const a=this.dv(o.createNextAnimateFrameEvent(...s));this.d(a.don(n))}this.d(e.propChanged.don(n=>{if(n.objId==="")try{Object.keys(n.props).forEach(r=>{const s=n.props[r]===null?void 0:n.props[r];e[r]=s})}catch(r){console.error("ueViewer propChanged:"+r)}})),e.useCustomInteraction=!1,this.dv(new o.ViewerCustomInteraction(e,t)),this.dv(new o.ObjResettingWithEvent(e.statusUpdateIntervalChanged,(n=>{if((e.statusUpdateInterval??.5)===0)return;const s=new o.Destroyable;return s.d(i.disposableOnUeEvent("statusUpdate",a=>{e.statusUpdateEvent.emit(a)})),s}))),this.dv(new o.ObjResettingWithEvent(e.propChangedListeningChanged,()=>{if(!(e.propChangedListening??!0))return;const r=new o.Destroyable;return r.d(i.disposableOnUeEvent("propChanged",s=>{e.propChanged.emit(s)})),r})),this.dv(new o.ObjResettingWithEvent(e.objectEventListeningChanged,()=>{if(!(e.objectEventListening??!0))return;const r=new o.Destroyable;return r.d(i.disposableOnUeEvent("objectEvent",s=>{e.objectEvent.emit(s)})),r})),this.dv(new o.ObjResettingWithEvent(e.widgetEventListeningChanged,()=>{if(!(e.widgetEventListening??!0))return;const r=new o.Destroyable;return r.d(i.disposableOnUeEvent("widgetEvent",s=>{e.widgetEvent.emit(s)})),r})),this.dv(new o.ObjResettingWithEvent(e.speechRecognitionListeningChanged,()=>{if(!(e.speechRecognitionListening??!0))return;const r=new o.Destroyable;return r.d(i.disposableOnUeEvent("speechRecognition",s=>{e.speechRecognition.emit(s)})),r})),this.dv(new o.ObjResettingWithEvent(e.customMessageListeningChanged,()=>{if(!(e.customMessageListening??!0))return;const r=new o.Destroyable;return r.d(i.disposableOnUeEvent("customMessage",s=>{e.customMessage.emit(s)})),r})),this.dv(new o.ObjResettingWithEvent(e.editingEventListeningChanged,()=>{if(!(e.editingEventListening??!0))return;const r=new o.Destroyable;return r.d(i.disposableOnUeEvent("editingEvent",s=>{s.objectIDs=s.objectIDs.map(a=>{var v;return((v=o.ESSceneObject.getSceneObjById(a))==null?void 0:v.parentID)??a}),e.editingEvent.emit(s)})),r})),this.ad(i.disposableOnUeEvent("cameraChanged",()=>{e.cameraChanged.emit()}))}}let ar=-1;class lr extends te{constructor(e,i,n="${earthsdk3-ue-h5-assets-script-dir}",r){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new o.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Map);f(this,"_ueEvent",this.dv(new o.Event));this._ueViewer=r;const s=this._ueViewer,a=this.dv(new rr(e,i,n,s));let v=!1,l=null;this.d(a.onRuntimeInitialized.don(()=>{var h;if(v=!0,(h=a==null?void 0:a.vIframe)!=null&&h.contentWindow){l=a.vIframe.contentWindow;const u=a.vIframe.contentWindow.document.getElementById("mainarea");u?this.dv(new sr(u,s,this)):console.error("h5Container is null")}else{console.error("iframeWindow is null");return}l.UE_JSHTML5Communication?l.UE_JSHTML5Communication.UESendMessageToJS=u=>{try{const w=or(l.HEAPU8,u),m=JSON.parse(w);if(s.debug&&(console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(m,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()),m.t==="cr"){const C=m;if(C.frs&&this._ueFuncResultWithIdsEvent.emit(C.frs),C.ers)for(let I of C.ers)this._ueEvent.emit(I)}m.callid&&this._waitingUeCalls.has(m.callid)&&(this._waitingUeCalls.delete(m.callid),console.log(`waitingUeCalls.delete:${m.callid} end`))}catch(w){console.error("UE_JSHTML5Communication.UESendMessageToJS error:",w)}}:console.error("UE_JSHTML5Communication UESendMessageToJS not found")})),this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(h=>{for(const u of h){const w=this._waitingUeFuncIdAndResultCallbacks.get(u.fid);w&&(this._waitingUeFuncIdAndResultCallbacks.delete(u.fid),w(u.r))}}));let y=0;const g=()=>{if(!v||!l||!l.UE_JSHTML5Communication||!l.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const h=this._ueFuncWithIdAndResultCallbacks.map((([F])=>F)),u={n:y++,tt:Date.now(),t:"c",fs:h,callid:o.createGuid()};for(const[F,B]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(F.fid,B);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.set(u.callid,u),s.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(u,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const w=JSON.stringify(u),m=window.g_emitDescriptor_maxBytes??3e4,C=w.length,I=++ar;if(C<m){const F=`${I}-0/1-`+w;l.UE_JSHTML5Communication.JSSendMessageToUE(F);return}const E=Math.ceil(C/m)|0;[...new Array(E).keys()].map(F=>w.slice(F*m,(F+1)*m)).forEach((F,B)=>{const Wi=`${I}-${B}/${E}-`+F;l.UE_JSHTML5Communication.JSSendMessageToUE(Wi)})};this.dv(o.createInterval()).start(g,50)}processResponse(e){if(this._ueViewer.debug??!1)try{const i=JSON.parse(e);console.group("%cUE => JS"," background-color:#006EFF;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(i,void 0,"")}`," border:1px dashed #006EFF;border-radius:5px;padding:10px;line-height:25px;color:#006EFF;"),console.groupEnd()}catch(i){console.error(`processResponse(${e}) error: ${i}`,i)}}callUeFunc(e){return new Promise(i=>{const r={fid:o.createGuid(),...e};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(e,i){const n=o.createGuid();this.callUeFunc({f:"addEventListener",p:{et:e,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.disposableOn(a=>{a.et===e&&a.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${e} eid:${n} ueEvent:${JSON.stringify(a)}`),i(a))});return()=>{s(),r()}}}let dr=-1;class cr extends te{constructor(e,i){super();f(this,"_ueFuncResultWithIdsEvent",this.dv(new o.Event));f(this,"_ueFuncWithIdAndResultCallbacks",[]);f(this,"_waitingUeFuncIdAndResultCallbacks",new Map);f(this,"_waitingUeCalls",new Set);f(this,"_ueEvent",this.dv(new o.Event));this._ueViewer=i;const n=this._ueViewer;let r=!1;const s={eventType:"init",params:{}};window.ue.es.oncommand(JSON.stringify(s)),r=!0,window.calljs=(y,g)=>{if(n.debug&&console.log(`calljs eventName:${y} eventDetailStr:${g}`),y==="ueevent"||y==="commanFinish")try{const d=JSON.parse(g);if(d.t==="cr"){const h=d;if(h.frs&&this._ueFuncResultWithIdsEvent.emit(h.frs),h.ers)for(let u of h.ers)this._ueEvent.emit(u)}}catch(d){console.error(d)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(y=>{for(const g of y){const d=this._waitingUeFuncIdAndResultCallbacks.get(g.fid);d&&(this._waitingUeFuncIdAndResultCallbacks.delete(g.fid),d(g.r))}}));let a=0;const v=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const y=this._ueFuncWithIdAndResultCallbacks.map((([h])=>h)),g={n:a++,tt:Date.now(),t:"c",fs:y};for(const[h,u]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(h.fid,u);this._ueFuncWithIdAndResultCallbacks.length=0,this._waitingUeCalls.add(g),n.debug&&(console.group("%cxe2 => ue"," background-color:green;color:#ffffff;font-weight:bold;padding:4px;border-radius:5px;"),console.log(`%c${JSON.stringify(g,void 0,"")}`," border:1px dashed green;border-radius:5px;padding:10px;line-height:25px;color:green;"),console.groupEnd());const d=++dr;window.ue.es.oncommand(`${d}-0/1-`+JSON.stringify(g)).then(()=>{this._waitingUeCalls.delete(g)})};this.dv(o.createInterval()).start(v,50)}callUeFunc(e){return new Promise(i=>{const r={fid:o.createGuid(),...e};this._ueFuncWithIdAndResultCallbacks.push([r,i])})}disposableOnUeEvent(e,i){const n=o.createGuid();this.callUeFunc({f:"addEventListener",p:{et:e,eid:n}});const r=()=>{this.callUeFunc({f:"removeEventListener",p:{eid:n}})},s=this._ueEvent.disposableOn(a=>{a.et===e&&a.eid===n&&((this._ueViewer.debug??!1)&&console.log(`callback, type:${e} eid:${n} ueEvent:${JSON.stringify(a)}`),i(a))});return()=>{s(),r()}}}class ur extends o.Destroyable{constructor(t,e){super();{const i=()=>{const a=pt(t);t.setGlobalProperty(a)};i();const n=dt(),r=[];n.forEach(a=>{const v=t[a+"Changed"];r.push(v)});const s=this.dv(o.createNextAnimateFrameEvent(...r));this.d(s.don(i))}this.d(t.propChanged.don(i=>{if(i.objId==="")try{Object.keys(i.props).forEach(n=>{const r=i.props[n]===null?void 0:i.props[n];t[n]=r})}catch(n){console.error("ueViewer propChanged:"+n)}})),this.dv(new o.ObjResettingWithEvent(t.statusUpdateIntervalChanged,(i=>{if((t.statusUpdateInterval??.5)===0)return;const r=new o.Destroyable;return r.d(e.disposableOnUeEvent("statusUpdate",s=>{t.statusUpdateEvent.emit(s)})),r}))),this.dv(new o.ObjResettingWithEvent(t.propChangedListeningChanged,()=>{if(!(t.propChangedListening??!0))return;const n=new o.Destroyable;return n.d(e.disposableOnUeEvent("propChanged",r=>{t.propChanged.emit(r)})),n})),this.dv(new o.ObjResettingWithEvent(t.objectEventListeningChanged,()=>{if(!(t.objectEventListening??!0))return;const n=new o.Destroyable;return n.d(e.disposableOnUeEvent("objectEvent",r=>{t.objectEvent.emit(r)})),n})),this.dv(new o.ObjResettingWithEvent(t.widgetEventListeningChanged,()=>{if(!(t.widgetEventListening??!0))return;const n=new o.Destroyable;return n.d(e.disposableOnUeEvent("widgetEvent",r=>{t.widgetEvent.emit(r)})),n})),this.dv(new o.ObjResettingWithEvent(t.speechRecognitionListeningChanged,()=>{if(!(t.speechRecognitionListening??!0))return;const n=new o.Destroyable;return n.d(e.disposableOnUeEvent("speechRecognition",r=>{t.speechRecognition.emit(r)})),n})),this.dv(new o.ObjResettingWithEvent(t.customMessageListeningChanged,()=>{if(!(t.customMessageListening??!0))return;const n=new o.Destroyable;return n.d(e.disposableOnUeEvent("customMessage",r=>{t.customMessage.emit(r)})),n})),this.dv(new o.ObjResettingWithEvent(t.editingEventListeningChanged,()=>{if(!(t.editingEventListening??!0))return;const n=new o.Destroyable;return n.d(e.disposableOnUeEvent("editingEvent",r=>{r.objectIDs=r.objectIDs.map(s=>{var a;return((a=o.ESSceneObject.getSceneObjById(s))==null?void 0:a.parentID)??s}),t.editingEvent.emit(r)})),n})),this.ad(e.disposableOnUeEvent("cameraChanged",()=>{t.cameraChanged.emit()}))}}class hr extends o.Destroyable{constructor(t,e,i){super();{const r=()=>{const l=pt(e);e.setGlobalProperty(l)};r();const s=dt(),a=[];s.forEach(l=>{const y=e[l+"Changed"];a.push(y)});const v=this.dv(o.createNextAnimateFrameEvent(...a));this.d(v.don(r))}this.d(e.propChanged.don(r=>{if(r.objId==="")try{Object.keys(r.props).forEach(s=>{const a=r.props[s]===null?void 0:r.props[s];e[s]=a})}catch(s){console.error("ueViewer propChanged:"+s)}}));const n=document.createElement("div");n.style.width="100%",n.style.height="100%",n.style.position="absolute",n.style.overflow="hidden",n.style.top="0",n.style.left="0",n.style.zIndex="0",n.style.backgroundColor="rgba(255,0,0,0)",n.setAttribute("masker","大屏顶层div,用于模拟鼠标事件和控制UE鼠标事件是否生效"),t.appendChild(n),this.d(()=>{n&&t&&t.removeChild(n)});{const r=(l,y)=>{window.ue.esinput.setinterceptevent(y),l.preventDefault()},s=l=>{r(l,!1)},a=l=>{r(l,!0)},v=l=>{r(l,!1)};n.addEventListener("mouseenter",s),n.addEventListener("mouseleave",a),n.addEventListener("mousemove",v),this.d(()=>{n.removeEventListener("mouseenter",s),n.removeEventListener("mouseleave",a),n.removeEventListener("mousemove",v)})}e.useCustomInteraction=!1,this.dv(new o.ViewerCustomInteraction(e,n)),this.dv(new o.ObjResettingWithEvent(e.statusUpdateIntervalChanged,(r=>{if((e.statusUpdateInterval??.5)===0)return;const a=new o.Destroyable;return a.d(i.disposableOnUeEvent("statusUpdate",v=>{e.statusUpdateEvent.emit(v)})),a}))),this.dv(new o.ObjResettingWithEvent(e.propChangedListeningChanged,()=>{if(!(e.propChangedListening??!0))return;const s=new o.Destroyable;return s.d(i.disposableOnUeEvent("propChanged",a=>{e.propChanged.emit(a)})),s})),this.dv(new o.ObjResettingWithEvent(e.objectEventListeningChanged,()=>{if(!(e.objectEventListening??!0))return;const s=new o.Destroyable;return s.d(i.disposableOnUeEvent("objectEvent",a=>{e.objectEvent.emit(a)})),s})),this.dv(new o.ObjResettingWithEvent(e.widgetEventListeningChanged,()=>{if(!(e.widgetEventListening??!0))return;const s=new o.Destroyable;return s.d(i.disposableOnUeEvent("widgetEvent",a=>{e.widgetEvent.emit(a)})),s})),this.dv(new o.ObjResettingWithEvent(e.speechRecognitionListeningChanged,()=>{if(!(e.speechRecognitionListening??!0))return;const s=new o.Destroyable;return s.d(i.disposableOnUeEvent("speechRecognition",a=>{e.speechRecognition.emit(a)})),s})),this.dv(new o.ObjResettingWithEvent(e.customMessageListeningChanged,()=>{if(!(e.customMessageListening??!0))return;const s=new o.Destroyable;return s.d(i.disposableOnUeEvent("customMessage",a=>{e.customMessage.emit(a)})),s})),this.dv(new o.ObjResettingWithEvent(e.editingEventListeningChanged,()=>{if(!(e.editingEventListening??!0))return;const s=new o.Destroyable;return s.d(i.disposableOnUeEvent("editingEvent",a=>{a.objectIDs=a.objectIDs.map(v=>{var l;return((l=o.ESSceneObject.getSceneObjById(v))==null?void 0:l.parentID)??v}),e.editingEvent.emit(a)})),s})),this.ad(i.disposableOnUeEvent("cameraChanged",()=>{e.cameraChanged.emit()}))}}class vr extends o.Destroyable{constructor(e,i,n){super();f(this,"_reconnectEvent",this.dv(new o.Event));const r=(g,d)=>g.hasOwnProperty(d);let s=0,a;this.d(()=>{a&&clearTimeout(a)});const l=new URLSearchParams(window.location.search).get("eswebview")==="true",y=()=>{if(window.ue.esinput){n.setStatus("Creating"),console.log("存在(window.ue && window.ue.es && window.ue.esinput 需要适配新版ESWebView 鼠标穿透), 开始创建UeFalseCloudViewer..."),n.setStatusLog("开始创建本地视口...");const g=this.dv(new cr(e,n));this.d(()=>n.viewer=void 0),n.viewer=g,n.setStatus("Created"),n.setStatusLog("本地视口创建成功!"),this.dv(new hr(e,n,g))}else n.setStatus("Error"),n.setStatusLog("请升级 ESWebView !"),this.d(()=>n.viewer=void 0),n.viewer=void 0};if(window.ue&&window.ue.es)y();else if(l){const g=setInterval(()=>{window.ue&&window.ue.es&&(clearInterval(g),y())},200)}else if(r(i.options,"ws")||r(i.options,"uri")&&r(i.options,"app")){n.setStatus("Creating"),n.setStatusLog("开始创建云渲染视口...");let g;this.d(()=>{n.setStatus("Raw"),n.setStatusLog(""),e&&g&&e.removeChild(g)&&(g=void 0)});const d=this.dv(o.createProcessingFromAsyncFunc(async h=>{n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,g&&e.removeChild(g)&&(g=void 0),g=document.createElement("div"),g.setAttribute("earthsdk3-ue","earthsdk3-ue-videoContainer"),g.style.cssText="position:relative; height: 100%;width:100%;",e.appendChild(g);let u,w,m;if(r(i.options,"ws")){const{ws:T,esmsg:F,uselnternalSignallingServer:B}=i.options;u=T,w=F,m=B??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:T,offsetHeight:F}=g;let{uri:B,app:Wi,token:Gn}=i.options;B.endsWith("/")||(B+="/");const fr=Gn?`?essstoken=${Gn}`:"",Hn=`/${Wi}/${T??1920}/${F??1080}`+fr;console.log(`请求信令服务器: ${B}instance${Hn}`);const wr=await h.promise(fetch(`${B}instance${Hn}`,{method:"GET"})),Y=await h.promise(wr.json());if(Y&&Y.status!=="ok"){n.setStatus("Error"),n.setStatusLog(`信令服务器请求失败 ${Y.status}`),this._reconnectEvent.emit(void 0);return}else{console.log(`信令服务器请求成功! ${JSON.stringify(Y,void 0," ")}`),await o.sleep(2e3);const{server:yr,esmsg:mr,instanceId:Cr,useInternalSignallingServer:Er}=Y;if(!Cr){n.setStatus("Error"),n.setStatusLog("检查信令服务器版本,返回数据错误! "),console.log("信令服务器返回数据错误!不包含instanceId!请升级到 ESSS V3.0+ 版本!"),this._reconnectEvent.emit(void 0);return}u=yr,w=mr,m=Er??!1,n.esssResponse=Y}}const C=this.dv(m?new nr(g,u,w,n):new Qn(g,u,w,n));this.d(()=>n.viewer=void 0),this.d(C.errorEvent.don(T=>{const F=`[${T}]:像素流连接错误!`;n.setStatus("Error"),n.setStatusLog(F),this._reconnectEvent.emit(C)})),await h.promise(new Promise(T=>this.d(C.readyEvent.donce(T)))),n.setStatus("Created"),n.setStatusLog("云渲染视口创建成功!"),s=0,a&&clearTimeout(a),a=void 0;const{offsetWidth:I,offsetHeight:E}=g;C.resize(I*window.devicePixelRatio,E*window.devicePixelRatio),n.viewer=C,this.d(()=>n.viewer=void 0),this.dv(new ur(n,C))}));d.start(),this.d(this._reconnectEvent.don(h=>{a===void 0&&(h&&!h.isDestroyed()&&h.destroy(),n.viewer&&!n.viewer.isDestroyed()&&n.viewer.destroy(),n.viewer=void 0,n.autoReconnect&&(n.setStatus("Reconnecting"),n.setStatusLog("正在尝试重新连接..."),s=s+5e3>3e4?3e4:s+5e3,console.warn(`间隔:${s/1e3}s,正在尝试重新连接...`),a=window.setTimeout(()=>{d.restart()},s)))})),this.d(d.errorEvent.don(h=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",h),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const g=i,d=g.options.project,h=g.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const u=this.dv(new lr(e,d,h,n));n.viewer=u,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const _=class _ extends o.ESViewer{constructor(e){super(e);f(this,"_viewer",this.dv(o.react(void 0)));f(this,"_esssResponse");f(this,"_speechRecognition",this.dv(new o.Event));f(this,"_propChanged",this.dv(new o.Event));f(this,"_objectEvent",this.dv(new o.Event));f(this,"_widgetEvent",this.dv(new o.Event));f(this,"_customMessage",this.dv(new o.Event));f(this,"_statusUpdateEvent",this.dv(new o.Event));f(this,"_statusUpdateEventdon",(()=>{this.d(this.statusUpdateEvent.don(e=>{this._statusInfo.fps=e.FPS??0,this._statusInfo.length=e.length??0,this._statusInfo.position=e.position??[0,0,0],this._statusInfo.rotation=e.rotation??[0,0,0]}))})());if(e.type!=="ESUeViewer")throw new Error("option.type must be ESUeViewer");const i=e;this.d(this._viewer.changed.don(()=>{this.viewerChanged.emit(this.viewer)})),this.dv(new o.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new vr(this.subContainer,i,this)}))}get defaultProps(){return _.createDefaultProps()}set viewer(e){this._viewer.value=e}get viewer(){return this._viewer.value}get esssResponse(){return this._esssResponse}set esssResponse(e){this._esssResponse=e}get speechRecognition(){return this._speechRecognition}get propChanged(){return this._propChanged}get objectEvent(){return this._objectEvent}get widgetEvent(){return this._widgetEvent}get customMessage(){return this._customMessage}get statusUpdateEvent(){return this._statusUpdateEvent}async uePositionToLonLatAlt(e){if(!this.viewer){console.warn("UEPositionToLonLatAlt: viewer is undefined");return}return await on(this.viewer,e)}async changeNavigationMode(e){if(!this.viewer){console.warn("ChangeNavigationMode: viewer is undefined");return}const i=await A(this.viewer,e);return i&&!i.error&&(this._navigationMode.value=e.mode),i}async resetWithCurrentCamera(e){if(!this.viewer){console.warn("resetWithCurrentCamera: viewer is undefined");return}return await wt(this.viewer,e)}async getAllSocketNamesByActorTag(e){if(!this.viewer){console.warn("GetAllSocketNamesByActorTag: viewer is undefined");return}return await sn(this.viewer,e)}async getBoundSphere(e){if(!this.viewer){console.warn("getBoundSphere: viewer is undefined");return}return await ln(this.viewer,e)}async getBoundSphereWithChildren(e){if(!this.viewer){console.warn("getBoundSphereWithChildren: viewer is undefined");return}return await dn(this.viewer,e)}async getStrokeMaterialParamInfo(e){if(!this.viewer){console.warn("GetStrokeMaterialParamInfo: viewer is undefined");return}return await cn(this.viewer,e)}async getFillMaterialParamInfo(e){if(!this.viewer){console.warn("getFillMaterialParamInfo: viewer is undefined");return}return await un(this.viewer,e)}async getGlobalProperty(e){if(!this.viewer){console.warn("getGlobalProperty: viewer is undefined");return}return await hn(this.viewer,e)}async getObjectByInfo(e){if(!this.viewer){console.warn("GetObjectByInfo: viewer is undefined");return}return await vn(this.viewer,e)}async defaultCameraFlyIn(e=1){if(!this.viewer){console.warn("DefaultCameraFlyIn: viewer is undefined");return}return await bi(this.viewer,e)}async startVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await xi(this.viewer)}async stopVoice(){if(!this.viewer){console.warn("startVoice:viewer is undefined");return}return await Ni(this.viewer)}async mountPakFiles(e){if(!this.viewer){console.warn("mountPakFiles:viewer is undefined");return}return await zi(this.viewer,e)}async generateMemReport(){if(!this.viewer){console.warn("generateMemReport:viewer is undefined");return}return await Gi(this.viewer)}async quit(){if(!this.viewer){console.warn("Quit: viewer is undefined");return}return await Qi(this.viewer)}async bindActorByTag(e,i){if(!this.viewer){console.warn("BindActorByTag: viewer is undefined");return}return await gn(this.viewer,e,i)}async restoreOriginalScene(){if(!this.viewer){console.warn("RestoreOriginalScene: viewer is undefined");return}return await pn(this.viewer)}async unBindActorByID(e){if(!this.viewer){console.warn("UnBindActorByID: viewer is undefined");return}return await fn(this.viewer,e)}async unBindActorByTag(e){if(!this.viewer){console.warn("UnBindActorByTag: viewer is undefined");return}return await wn(this.viewer,e)}async createActorByClass(e,i){if(!this.viewer){console.warn("CreateActorByClass: viewer is undefined");return}return await yn(this.viewer,e,i)}async bind3DTilesetByTag(e,i){if(!this.viewer){console.warn("Bind3DTilesetByTag: viewer is undefined");return}return await mn(this.viewer,e,i)}async unBind3DTilesetByTag(e){if(!this.viewer){console.warn("UnBind3DTilesetByTag: viewer is undefined");return}return await Cn(this.viewer,e)}async unBind3DTilesetById(e){if(!this.viewer){console.warn("UnBind3DTilesetById: viewer is undefined");return}return await En(this.viewer,e)}async bindImageryByTag(e,i,n){if(!this.viewer){console.warn("BindImageryByTag: viewer is undefined");return}return await Sn(this.viewer,e,i,n)}async unBindImageryByTag(e,i){if(!this.viewer){console.warn("UnBindImageryByTag: viewer is undefined");return}return await Fn(this.viewer,e,i)}async unBindImageryById(e){if(!this.viewer){console.warn("UnBindImageryById: viewer is undefined");return}return await In(this.viewer,e)}async getIdByComponentNameAndHitItem(e,i,n){if(!this.viewer){console.warn("GetIdByComponentNameAndHitItem: viewer is undefined");return}return await Tn(this.viewer,e,i,n)}async getCameraRelativeHeight(e="ECC_Visibility"){if(!this.viewer){console.warn("GetCameraRelativeHeight: viewer is undefined");return}return await Rn(this.viewer,e)}async saveStringToFile(e,i,n){if(!this.viewer){console.warn("SaveStringToFile: viewer is undefined");return}return await Dn(this.viewer,e,i,n)}async highlightActorByTag(e,i=!0){if(!this.viewer){console.warn("HighlightActorByTag: viewer is undefined");return}return await Ln(this.viewer,e,i)}async sendCustomMessage(e){if(!this.viewer){console.warn("SendCustomMessage: viewer is undefined");return}return await Pn(this.viewer,e)}async getStatus(){if(!this.viewer){console.warn("GetStatus:viewer is undefined");return}return await Bn(this.viewer)}async getTilesetMaterialIDList(){if(!this.viewer){console.warn("GetTilesetMaterialIDList:viewer is undefined");return}return await Wn(this.viewer)}async pick(e,i,n){if(!this.viewer)return;let r=e;if(e&&window.ue&&this.container){const[s,a]=e,{x:v,y:l}=this.container.getBoundingClientRect();r=[v+s,l+a]}return await ki(this.viewer,r,i,n)}async pickPosition(e){if(!this.viewer)return;let i=e;if(e&&window.ue&&this.container){const[n,r]=e,{x:s,y:a}=this.container.getBoundingClientRect();i=[s+n,a+r]}return await Oi(this.viewer,i)}async quickPickPosition(e){return await this.pickPosition(e)}async getTerrainHeight(e){return await this.getHeightByLonLat(e[0],e[1])??void 0}async flyIn(e,i=[0,0,0],n=1,r="default"){if(!this.viewer)return;const s=await Q(this.viewer,void 0,e,i,n,r);if(s)return s.endType===0&&console.warn(`flyTo:flyTo is end! endType:${s.endType}`),s.endType===1&&console.warn(`flyTo:飞行中断! endType:${s.endType}`),s}async flyTo(e,i,n="default"){if(!this.viewer)return;const r=await H(this.viewer,void 0,void 0,e,i,n);if(r)return r.endType===0&&console.warn(`flyTo:flyTo is end! endType:${r.endType}`),r.endType===1&&console.warn(`flyTo:飞行中断! endType:${r.endType}`),r}flyToBoundingSphere(e,i,n=1){const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],s=o.getGeoBoundingSphereFromPositions(r);if(!s)return;const{center:a,radius:v}=s,l={distance:i??v,heading:0,pitch:-90,flyDuration:n,hDelta:0,pDelta:0};this.flyTo(l,a)}getCurrentCameraInfo(){const{position:e,rotation:i}=this._statusInfo;return{position:e,rotation:i}}getLengthInPixel(){return this._statusInfo.length}async changeToWalk(e,i=4.2,n=1.6){if(!this.viewer)return;const r={mode:"Walk",position:e,jumpZVelocity:i,eyeHeight:n},s=await A(this.viewer,r);return s&&!s.error&&(this._navigationMode.value=r.mode),s}async changeToMap(){if(!this.viewer)return;const e={mode:"Map"},i=await A(this.viewer,e);return i&&!i.error&&(this._navigationMode.value=e.mode),i}async changeToRotateGlobe(e=38,i=1e7,n=60){if(!this.viewer)return;const r={mode:"RotateGlobe",latitude:e,height:i,cycleTime:n},s=await A(this.viewer,r);return s&&!s.error&&(this._navigationMode.value=r.mode),s}async changeToLine(e,i=10,n=10,r=!0,s=10,a="auto"){if(!this.viewer)return;const v={mode:"Line",geoLineStringId:e,speed:i,heightOffset:n,loop:r,turnRateDPS:s,lineMode:a},l=await A(this.viewer,v);return l&&!l.error&&(this._navigationMode.value=v.mode),l}async changeToUserDefined(e){if(!this.viewer)return;const i={mode:"UserDefined",userDefinedPawn:e},n=await A(this.viewer,i);return n&&!n.error&&(this._navigationMode.value=i.mode),n}async changeToRotatePoint(e,i=5e4,n=60,r=0,s=-30){if(!this.viewer)return;const a={mode:"RotatePoint",position:e,distance:i,orbitPeriod:n,heading:r,pitch:s},v=await A(this.viewer,a);return v&&!v.error&&(this._navigationMode.value=a.mode),v}async changeToFollow(e,i=0,n=0,r=-30,s=!0){if(!this.viewer)return;const a={mode:"Follow",objectId:e,distance:i,heading:n,pitch:r,relativeRotation:s},v=await A(this.viewer,a);return v&&!v.error&&(this._navigationMode.value=a.mode),v}getFPS(){return this._statusInfo.fps}async getVersion(){const e=window.g_XE3CopyRights??{};if(!this.viewer)return e;const i=await an(this.viewer);return e.esforue=i,e}async getHeightByLonLat(e,i,n="ECC_Visibility"){if(!this.viewer)return null;const r=await ji(this.viewer,e,i,n);return r&&r.height!==void 0?r.height:null}async getHeightsByLonLats(e,i="ECC_Visibility"){return this.viewer?await en(this.viewer,e,i):void 0}async capture(e=64,i=64){return this.viewer?await tn(this.viewer,e,i):void 0}async partialCapture(e,i=[64,64]){if(!this.viewer){console.warn("partialCapture:viewer is undefined");return}return await nn(this.viewer,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer)return;const i=await rn(this.viewer,e);return i&&[i.X,i.Y]}async setGlobalProperty(e){if(this.viewer)return await Yi(this.viewer,e)}async startEditing(e,i,n){n=Object.assign({useKeyToSwitch:!0,callSource:"outer"},n);const r=e.components.main??e;if(!r||!this.viewer||i==null)return;const s=Array.isArray(i)?[...i]:[i];return r.editingID=`${n.callSource}_${o.createGuid()}`,await Un(this.viewer,r.id,r.editingID,s,n.useKeyToSwitch)}async stopEditing(){if(this.viewer)return await An(this.viewer)}async moveObjects(e){if(!this.viewer)return;const i=[],n=o.createGuid();for(let r=0;r<e.length;r++){const s=e[r],a=s.components.main??s;a.editingID=n,a&&i.push(a.id)}if(i.length!==0)return await Mn(this.viewer,i,n)}};f(_,"type",_.register("ESUeViewer",_)),f(_,"defaults",{...Kn});let M=_;(c=>{c.createDefaultProps=()=>({...o.ESViewer.createDefaultProps(),...$i(),resolutionScale:1,autoReconnect:!1,propChangedListening:void 0,objectEventListening:void 0,widgetEventListening:void 0,speechRecognitionListening:void 0,customMessageListening:void 0})})(M||(M={})),o.extendClassProps(M.prototype,M.createDefaultProps);class $ extends o.EngineObject{constructor(t,e){super(t,e);const i=e.viewer;if(!i)return;const n=this.ad(o.react(!1));t.components.main||this.d(this.createdEvent.don(()=>{const r=this.constructor.propValFuncs,s=t.defaultProps,a=Object.keys(s).filter(h=>r[h]!==null);a.push(...this.constructor.forceUeUpdateProps);const v=t.constructor.defaults,l={val:{}},y=[];for(let h of a){const u=h+"Changed",w=t[u];y.push(w);const m=r[h];if(m===null)throw console.error("vf === null error"),new Error("vf === null error");const C=()=>{const I=t[h]??v[h]??t.constructor[`default${h.charAt(0).toUpperCase()+h.slice(1)}`];let E=m?m(I,this,e,t):I;if(E===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${h} 对象名:${t.name} 对象id: ${t.id}`);return}l.val[h]=E};C(),this.d(w.don(C))}const g=()=>{i.callUeFunc({f:"update",p:{id:t.id,...l.val}}),l.val={}},d=this.dv(o.createNextAnimateFrameEvent(...y));this.d(d.don(g)),this.d(n.changed.don(g)),this.d(t.flushEvent.don(()=>d.flush()))})),t.components.main||(this.d(()=>{n.value&&ft(i,t.id)}),i.callUeFunc({f:"create",p:{type:t.typeName,id:t.id}}).then(()=>{n.value=!0}).catch(r=>console.error(r)))}}f($,"propValFuncs",{ref:null,devTags:null,extras:null,execOnceFuncStr:null,updateFuncStr:null,toDestroyFuncStr:null}),f($,"forceUeUpdateProps",[]);class L extends ${constructor(t,e){super(t,e);const i=e.viewer;i&&(this.d(t.flyToEvent.don(n=>{H(i,t.id,n)})),this.d(t.flyInEvent.don(n=>{var r,s;Q(i,t.id,(r=t.flyInParam)==null?void 0:r.position,(s=t.flyInParam)==null?void 0:s.rotation,n??1)})),this.d(t.calcFlyToParamEvent.don(()=>{W(i,t.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const n=e.getCurrentCameraInfo();if(!n)return;const{position:r,rotation:s}=n;t.flyInParam={position:r,rotation:s,flyDuration:1}})),this.d(e.propChanged.don(n=>{n.objId===t.id&&Object.keys(n.props).forEach(r=>{const s=n.props[r]===null?void 0:n.props[r];t[r]=s})})))}}class S extends L{constructor(t,e){super(t,e);const i=e.viewer;if(!i)return;const n=()=>{t.editing||i.callUeFunc({f:"update",p:{id:t.id,position:t.position,rotation:t.rotation}})},r=this.dv(o.createNextAnimateFrameEvent(t.positionChanged,t.rotationChanged,t.editingChanged));this.d(r.don(()=>{setTimeout(n,0)})),this.d(t.smoothMoveEvent.don((v,l)=>{ee(i,t.id,v,l)})),this.d(t.smoothMoveWithRotationEvent.don((v,l,y)=>{k(i,t.id,v,l,y)})),this.d(t.smoothMoveOnGroundEvent.don((v,l,y,g)=>{O(i,t.id,v,l,g,y)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((v,l,y,g,d)=>{j(i,t.id,v,l,y,g,d)})),this.d(t.smoothMoveKeepPitchEvent.don(async(v,l)=>{const y=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:t.id,Destination:v,Time:l}});y.error&&console.error("SmoothMoveKeepPitch:",y.error)})),this.d(t.automaticLandingEvent.don(v=>{const l=[t.position[0],t.position[1]];e.getHeightByLonLat(t.position[0],t.position[1],"Visibility").then(y=>{y!==null&&(t.position=[...l,y],t.collision=v)})}));const s=async(v,l,y,g)=>{const{viewer:d}=v;if(!d){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const h=await d.callUeFunc({f:"SmoothMoveRelatively",p:{id:l,RelativePosition:y,Time:g}});return h.error&&console.error("SmoothMoveRelatively:",h.error),h};this.d(t.smoothMoveRelativelyEvent.don((v,l)=>{s(e,t.id,v,l)}));const a=async(v,l,y,g,d)=>{const{viewer:h}=v;if(!h){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const u=await h.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:l,RelativePosition:y,NewRotation:g,Time:d}});return u.error&&console.error("SmoothMoveRelativelyWithRotation:",u.error),u};this.d(t.smoothMoveRelativelyWithRotationEvent.don((v,l,y)=>{a(e,t.id,v,l,y)}))}}class D extends L{constructor(t,e){super(t,e);const i=e.viewer;if(!i)return;const n=()=>{t.editing||i.callUeFunc({f:"update",p:{id:t.id,points:t.points}})},r=this.dv(o.createNextAnimateFrameEvent(t.pointsChanged,t.editingChanged));this.d(r.don(()=>{setTimeout(n,0)}))}}f(D,"propValFuncs",{...L.propValFuncs,pointStyle:t=>({...t,materialParams:JSON.stringify(t.materialParams??{})}),strokeStyle:t=>({...t,materialParams:JSON.stringify(t.materialParams??{})}),fillStyle:t=>({...t,materialParams:JSON.stringify(t.materialParams??{})})});class U extends S{constructor(t,e){super(t,e),e.viewer&&this.d(e.widgetEvent.don(n=>{if(n.objId!==t.id)return;const{type:r,add:s}=n;t.widgetEvent.emit({type:r,add:s})}))}}class mt extends S{constructor(t,e){super(t,e),e.viewer}}f(mt,"propValFuncs",{...S.propValFuncs,pointStyle:t=>({...t,materialParams:JSON.stringify(t.materialParams??{})}),strokeStyle:t=>({...t,materialParams:JSON.stringify(t.materialParams??{})}),fillStyle:t=>({...t,materialParams:JSON.stringify(t.materialParams??{})})});class ut extends mt{constructor(t,e){super(t,e),e.viewer}}const _n=c=>{switch(c){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是3dTileset,无法绑定";default:return"未知错误"}},ie=class ie extends o.EngineObject{constructor(e,i){super(e,i);f(this,"_styleColor",this.dv(o.react([])));f(this,"_styleVisable",this.dv(o.react([])));const n=i.viewer;if(!n){console.warn("UeES3DTileset: viewer is undefined!");return}let r,s;const a=async()=>{!r&&!s||await n.callUeFunc({f:"update",p:{id:e.id,url:e.url,show:e.show,collision:e.collision,allowPicking:e.allowPicking,flyToParam:e.flyToParam??o.ES3DTileset.defaultFlyToParam,flyInParam:e.flyInParam??o.ES3DTileset.defaultFlyInParam,highlightID:e.highlightID,highlightColor:e.highlightColor,highlight:e.highlight,materialMode:e.materialMode,maximumScreenSpaceError:e.maximumScreenSpaceError,colorMode:Reflect.has(e,"colorMode")?e.colorMode:void 0,offset:e.offset,rotation:e.rotation,cacheBytes:e.cacheBytes,colorBlendMode:e.colorBlendMode,materialOverrideMap:e.materialOverrideMap}})},v=this.dv(o.createNextAnimateFrameEvent(e.urlChanged,e.showChanged,e.flyToParamChanged,e.flyInParamChanged,e.collisionChanged,e.allowPickingChanged,e.highlightIDChanged,e.highlightColorChanged,e.highlightChanged,e.materialModeChanged,e.maximumScreenSpaceErrorChanged,e.offsetChanged,e.rotationChanged,e.cacheBytesChanged,e.colorBlendModeChanged,e.materialOverrideMapChanged));a(),this.d(v.don(a)),Reflect.has(e,"colorMode")&&this.d(e.colorModeChanged.don(()=>a()));const l=this.dv(o.react(void 0));{const g=this.dv(o.createNextAnimateFrameEvent(e.actorTagChanged,e.urlChanged)),d=()=>{e.actorTag?l.value={type:"ActorTag",actorTag:e.actorTag}:e.url?l.value={type:"CreatedUrl",url:e.url}:l.value=void 0,e.editing=!1};d(),this.d(g.don(d))}const y=async()=>{const{id:g}=e;if(r!==void 0){r=void 0;try{const d=await i.unBind3DTilesetById(g);if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d}`);return}}if(s!==void 0){s=void 0;try{const d=await n.callUeFunc({f:"destroy",p:{id:g}});if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset Destroy: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset Destroy: ${d}`);return}}};this.d(()=>{y()});{const g=this.dv(o.createProcessingFromAsyncFunc(async h=>{if(l.value===void 0){await h.promise(y());return}if(l.value.type==="ActorTag"){const{actorTag:u}=l.value;if(r!==u&&await h.promise(y()),r!==void 0||u===void 0)return;try{r=u;const w=await h.promise(i.bind3DTilesetByTag(e.id,u));if(!w)return;if(w.error!==""){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${w.error}`);return}if(w.re.type!==0)if(w.re.type===1)console.warn(`UeES3DTileset Bind3DTilesetByTag: ${_n(w.re.type)}`);else{console.warn(`UeES3DTileset Bind3DTilesetByTag: ${_n(w.re.type)}`);return}}catch(w){console.warn(`UeES3DTileset Bind3DTilesetByTag: ${w}`);return}}else if(l.value.type==="CreatedUrl"){const{url:u}=l.value;if(u!==s&&await y(),s!==void 0||u===void 0)return;try{s=u;const w=await h.promise(n.callUeFunc({f:"create",p:{type:e.typeName,id:e.id}}));if(!w)return;if(w.error!==""){console.warn(`UeES3DTileset create: ${w.error}`);return}}catch(w){console.warn(`UeES3DTileset create: ${w}`);return}}await h.promise(a())})),d=async()=>{g.restart()};d(),this.d(l.changed.don(d))}this.d(e.refreshTilesetEvent.don(()=>{_i(n,e.id)})),this.d(e.flyToEvent.don(async(g,d)=>{if(!r&&!s)return;const h=await H(n,e.id,g);let u="over";h===void 0?u="error":h.endType===0?u="over":h.endType===1&&(u="cancelled"),e.flyOverEvent.emit(d,u,i)})),this.d(e.calcFlyToParamEvent.don(()=>{!r&&!s||W(n,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!r&&!s||!i.actived)return;const g=await i.getCurrentCameraInfo();if(!g)return;const{position:d,rotation:h}=g;e.flyInParam={position:d,rotation:h,flyDuration:1}})),this.d(i.propChanged.don(g=>{!r&&!s||g.objId===e.id&&Object.keys(g.props).forEach(d=>{const h=g.props[d]===null?void 0:g.props[d];e[d]=h})})),this.d(i.objectEvent.don(g=>{!r&&!s||g.id!==e.id||g.type!=="3DTilesetReady"||e.tilesetReady.emit(g.p)}));{const g=async(w,m)=>{if(!r&&!s)return;const C=await n.callUeFunc({f:"SetFeatureColor",p:{id:e.id,featureName:w,json:m}});if(C&&C.error!==""){console.warn(`UeES3DTileset SetFeatureColor: ${C.error}`);return}},d=async(w,m)=>{if(!r&&!s)return;const C=await n.callUeFunc({f:"SetFeatureVisable",p:{id:e.id,featureName:w,json:m}});if(C&&C.error!==""){console.warn(`UeES3DTileset SetFeatureVisable: ${C.error}`);return}},h=async()=>{if(!r&&!s)return;const w=await n.callUeFunc({f:"ResetFeatureStyle",p:{id:e.id}});if(w&&w.error!==""){console.warn(`UeES3DTileset ResetFeatureStyle: ${w.error}`);return}},u=async w=>{if(!r&&!s)return;const m=await n.callUeFunc({f:"SetFeatureStyle",p:{id:e.id,json:w}});if(m&&m.error!==""){console.warn(`UeES3DTileset SetFeatureStyle: ${m.error}`);return}};this.d(e.setFeatureColorEvent.don((w,m)=>{const C=[...this.styleColor,...m];this.styleColor=[...C],g(w,C)})),this.d(e.setFeatureVisableEvent.don((w,m)=>{const C=[...this.styleVisable,...m];this.styleVisable=[...C],d(w,C)})),this.d(e.resetFeatureStyleEvent.don(()=>{h(),this.styleColor=[],this.styleVisable=[]})),this.d(e.setFeatureStyleEvent.don(w=>{u(w)}))}{const g=async()=>{if(!r&&!s){e._featureTableResultEvent.emit(void 0);return}try{const d=await n.callUeFunc({f:"GetFeatureTable",p:{id:e.id}});d.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${d.error}`),e._featureTableResultEvent.emit(d.re.table)}catch(d){console.warn(`UeES3DTileset GetFeatureTable: ${d}`),e._featureTableResultEvent.emit(void 0)}};this.d(e.getFeatureTableEvent.don(()=>{g()}))}{const g=async()=>{if(!r&&!s){e.getMaterialNameListEvent.emit(void 0);return}try{const d=await n.callUeFunc({f:"GetMaterialNameList",p:{id:e.id}});d.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${d.error}`),e.getMaterialNameListEvent.emit(d.re.materialNameList)}catch(d){console.warn(`UeES3DTileset GetMaterialNameList: ${d}`),e.getMaterialNameListEvent.emit(void 0)}};this.ad(e.getMaterialNameListEvent.don(d=>{d=="start"&&g()}))}}get styleColor(){return this._styleColor.value}set styleColor(e){this._styleColor.value=e}get styleVisable(){return this._styleVisable.value}set styleVisable(e){this._styleVisable.value=e}};f(ie,"type",ie.register("ESUeViewer",o.ES3DTileset.type,ie));let ht=ie;const bn=c=>{switch(c){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"没搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag对应的Actor是地形,无法绑定";case 4:return"没搜索到ComponentTag,无法绑定";default:return"未知错误"}},ne=class ne extends o.EngineObject{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}let n,r;const s=this.dv(o.react(void 0)),a=this.ad(o.reactJson(""));{const g=()=>{if(typeof t.url=="string")a.value=o.ESSceneObject.context.getStrFromEnv(t.url);else{const d=t.url;d.url=o.ESSceneObject.context.getStrFromEnv(d.url),a.value=d}};g(),this.ad(t.urlChanged.don(g))}const v=async()=>{if(!n&&!r)return;let g=t.targetID??o.ESImageryLayer.defaults.targetID;if(g&&g!=""){const d=o.ESSceneObject.getSceneObject(g);g=d?(d.components.main??d).id:g}await i.callUeFunc({f:"update",p:{id:t.id,show:t.show??!0,rectangle:t.rectangle??[-180,-90,180,90],collision:t.collision??!0,allowPicking:t.allowPicking??!1,flyToParam:t.flyToParam??o.ESImageryLayer.defaultFlyToParam,flyInParam:t.flyInParam??o.ESImageryLayer.defaultFlyInParam,url:a.value??"",zIndex:t.zIndex??0,maximumLevel:t.maximumLevel??o.ESImageryLayer.defaults.maximumLevel,minimumLevel:t.minimumLevel??o.ESImageryLayer.defaults.minimumLevel,options:t.options??o.ESImageryLayer.defaults.options,targetID:g,opacity:t.opacity??o.ESImageryLayer.defaults.opacity,splitDirection:t.splitDirection??o.ESImageryLayer.defaults.splitDirection}})},l=this.dv(o.createNextAnimateFrameEvent(t.showChanged,a.changed,t.flyToParamChanged,t.flyInParamChanged,t.zIndexChanged,t.collisionChanged,t.allowPickingChanged,t.maximumLevelChanged,t.minimumLevelChanged,t.rectangleChanged,t.optionsChanged,t.targetIDChanged,t.opacityChanged,t.splitDirectionChanged));this.d(l.don(v));const y=async()=>{const{id:g}=t;if(n!==void 0){n=void 0;try{const d=await e.unBindImageryById(g);if(!d)return;if(d.error!==""){console.warn(`UeESImageryLayer UnImageryByID: ${d.error}`);return}}catch(d){console.warn(`UeESImageryLayer UnImageryByID promise: ${d}`);return}}if(r!==void 0){r=void 0;try{const d=await i.callUeFunc({f:"destroy",p:{id:g,test:"UeESImageryLayer"}});if(!d)return;if(d.error!==""){console.warn(`UeESImageryLayer Destroy: ${d.error}`);return}}catch(d){console.warn(`UeESImageryLayer Destroy promise: ${d}`);return}}};this.d(()=>{y()});{const g=this.dv(o.createProcessingFromAsyncFunc(async h=>{if(s.value===void 0){await h.promise(y());return}if(s.value.type==="ActorTag"){const{actorTag:u,componentTag:w}=s.value;if(n!==u&&await h.promise(y()),n!==void 0||u===void 0)return;try{n=u;const m=await h.promise(e.bindImageryByTag(t.id,u,w));if(!m)return;if(m.error!==""){console.warn(`ESImageryLayer BindImageryByTag: ${m.error}`);return}if(m.re.type!==0)if(m.re.type===1)console.warn(`ESImageryLayer BindImageryByTag: ${bn(m.re.type)}`);else{console.warn(`ESImageryLayer BindImageryByTag: ${bn(m.re.type)}`);return}}catch(m){console.warn(`ESImageryLayer BindImageryByTag promise: ${m}`);return}}else if(s.value.type==="CreatedUrl"){const{url:u}=s.value;if(u!==r&&await h.promise(y()),r!==void 0||u===void 0)return;try{r=u;const w=await h.promise(i.callUeFunc({f:"create",p:{type:"ESImageryLayer",id:t.id}}));if(!w)return;if(w.error!==""){console.warn(`ESImageryLayer create: ${w.error}`);return}}catch{console.warn("ESImageryLayer create: create promise error");return}}await h.promise(v())})),d=async()=>{g.restart()};d(),this.d(s.changed.don(d))}{const g=this.dv(o.createNextAnimateFrameEvent(t.actorTagChanged,a.changed,t.componentTagChanged)),d=()=>{t.actorTag&&t.componentTag?s.value={type:"ActorTag",actorTag:t.actorTag,componentTag:t.componentTag}:a.value?s.value={type:"CreatedUrl",url:a.value}:s.value=void 0};d(),this.d(g.don(d))}this.d(t.flyToEvent.don(async(g,d)=>{if(!n&&!r)return;const h=await H(i,t.id,g);let u="over";h===void 0?u="error":h.endType===0?u="over":h.endType===1&&(u="cancelled"),t.flyOverEvent.emit(d,u,e)})),this.d(t.flyInEvent.don(async(g,d)=>{var w,m;if(!n&&!r)return;const h=await Q(i,t.id,(w=t.flyInParam)==null?void 0:w.position,(m=t.flyInParam)==null?void 0:m.rotation,g??1);let u="over";h===void 0?u="error":h.endType===0?u="over":h.endType===1&&(u="cancelled"),t.flyOverEvent.emit(d,u,e)})),this.d(t.calcFlyToParamEvent.don(()=>{!n&&!r||W(i,t.id)})),this.d(t.calcFlyInParamEvent.don(async()=>{if(!e.actived)return;const g=await e.getCurrentCameraInfo();if(!g)return;const{position:d,rotation:h}=g;t.flyInParam={position:d,rotation:h,flyDuration:1}})),this.d(e.propChanged.don(g=>{!n&&!r||g.objId===t.id&&Object.keys(g.props).forEach(d=>{const h=g.props[d]===null?void 0:g.props[d];t[d]=h})}))}};f(ne,"type",ne.register("ESUeViewer",o.ESImageryLayer.type,ne));let Ct=ne;const b=class b extends L{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(b,"type",b.register("ESUeViewer",o.ESTerrainLayer.type,b)),f(b,"forceUeUpdateProps",[...L.forceUeUpdateProps,"url"]),f(b,"propValFuncs",{...L.propValFuncs,url:t=>typeof t=="string"?o.ESSceneObject.context.getStrFromEnv(t):(t.url=o.ESSceneObject.context.getStrFromEnv(t.url),t),czmMaxzoom:null,czmMinzoom:null});let Et=b;const re=class re extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(re,"type",re.register("ESUeViewer",o.ESAlarm.type,re));let St=re;const oe=class oe extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(oe,"type",oe.register("ESUeViewer",o.ESApertureEffect.type,oe));let Ft=oe;const se=class se extends D{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(se,"type",se.register("ESUeViewer",o.ESGeoPolygon.type,se));let P=se;const ae=class ae extends P{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let s=o.ESAreaMeasurement.defaults.fillStyle;try{s={...t.fillStyle??o.ESAreaMeasurement.defaults.fillStyle}}catch(a){console.error("ESAreaMeasurement fillStyle 属性类型错误!",a),s={...o.ESAreaMeasurement.defaults.fillStyle}}s.materialParams=JSON.stringify(s.materialParams),i.callUeFunc({f:"update",p:{id:t.id,stroked:t.stroked??o.ESAreaMeasurement.defaults.stroked,fillStyle:s,filled:t.filled??o.ESAreaMeasurement.defaults.filled}}),console.log(s)},r=this.dv(o.createNextAnimateFrameEvent(t.fillStyleChanged,t.strokedChanged,t.filledChanged));this.d(r.don(n)),this.d(t.createdEvent.don(n))}};f(ae,"type",ae.register("ESUeViewer",o.ESAreaMeasurement.type,ae));let It=ae;const le=class le extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(le,"type",le.register("ESUeViewer",o.ESBlastParticleSystem.type,le));let Tt=le;const J=class J extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is underfined!");return}}};f(J,"type",J.register("ESUeViewer",o.ESBoxClipping.type,J)),f(J,"propValFuncs",{...S.propValFuncs,targetID:t=>{if(!t)return"";const e=o.ESSceneObject.getSceneObject(t);return e?(e.components.main??e).id:t}});let Rt=J;const de=class de extends S{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.dispose(t.flyInEvent.don((n,r,s="default")=>{const{id:a,duration:v,position:l,rotation:y}=t;Q(i,a,l,y,v??n,s)})),this.dispose(t.resetWithCurrentCameraEvent.don(()=>{wt(i,t.id)})),this.dispose(t.captureEvent.don((n,r)=>{e.capture(n,r).then(a=>{a&&(t.thumbnail=a)})}))}};f(de,"type",de.register("ESUeViewer",o.ESCameraView.type,de));let Dt=de;const ce=class ce extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(ce,"type",ce.register("ESUeViewer",o.ESCameraVisibleRange.type,ce));let Lt=ce;const ue=class ue extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(ue,"type",ue.register("ESUeViewer",o.ESCar.type,ue));let Pt=ue;const he=class he extends D{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let s=o.ESClassification.defaults.fillStyle;try{s={...t.fillStyle??o.ESClassification.defaults.fillStyle}}catch(a){console.error("ESClassification fillStyle 属性类型错误!",a),s={...o.ESClassification.defaults.fillStyle}}s.materialParams=JSON.stringify(s.materialParams),i.callUeFunc({f:"update",p:{id:t.id,filled:t.filled??o.ESClassification.defaults.filled,fillStyle:s}})},r=this.dv(o.createNextAnimateFrameEvent(t.fillStyleChanged,t.filledChanged));this.d(r.don(n)),this.d(t.createdEvent.don(n))}};f(he,"type",he.register("ESUeViewer",o.ESClassification.type,he));let Bt=he;const K=class K extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is underfined!");return}}};f(K,"type",K.register("ESUeViewer",o.ESClippingPlane.type,K)),f(K,"propValFuncs",{...S.propValFuncs,targetID:t=>{if(!t)return"";const e=o.ESSceneObject.getSceneObject(t);return e?(e.components.main??e).id:t}});let Ut=K;const ve=class ve extends S{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(o.reactJson(""));{const a=()=>{if(typeof t.url=="string")n.value=o.ESSceneObject.context.getStrFromEnv(t.url??o.ESDataMesh.defaults.url);else{const v=t.url;v.url=o.ESSceneObject.context.getStrFromEnv(v.url??o.ESDataMesh.defaults.url),n.value=v}};a(),this.ad(t.urlChanged.don(a))}const r=()=>{const a=t.colorStops??o.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:t.id,url:n.value??o.ESDataMesh.defaults.url,currentTime:t.currentTime??o.ESDataMesh.defaults.currentTime,minPropValue:t.minPropValue??o.ESDataMesh.defaults.minPropValue,maxPropValue:t.maxPropValue??o.ESDataMesh.defaults.maxPropValue,colorStops:JSON.stringify(a)}})},s=this.dv(o.createNextAnimateFrameEvent(n.changed,t.currentTimeChanged,t.minPropValueChanged,t.maxPropValueChanged,t.colorStopsChanged));this.d(s.don(r)),this.d(t.createdEvent.don(r))}};f(ve,"type",ve.register("ESUeViewer",o.ESDataMesh.type,ve));let At=ve;const ge=class ge extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(ge,"type",ge.register("ESUeViewer",o.ESDatasmithRuntimeModel.type,ge));let Mt=ge;const pe=class pe extends D{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(pe,"type",pe.register("ESUeViewer",o.ESDirectionMeasurement.type,pe));let Wt=pe;const fe=class fe extends D{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{let s;try{s={...t.strokeStyle??o.ESDistanceMeasurement.defaults.strokeStyle}}catch(a){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",a),s={...o.ESDistanceMeasurement.defaults.strokeStyle}}i.callUeFunc({f:"update",p:{id:t.id,strokeStyle:s}})},r=this.dv(o.createNextAnimateFrameEvent(t.strokeStyleChanged));this.d(r.don(n)),this.d(t.createdEvent.don(n))}};f(fe,"type",fe.register("ESUeViewer",o.ESDistanceMeasurement.type,fe));let $t=fe;const we=class we extends ut{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(we,"type",we.register("ESUeViewer",o.ESLocalPolygon.type,we));let vt=we;const ye=class ye extends vt{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(ye,"type",ye.register("ESUeViewer",o.ESDynamicWater.type,ye));let _t=ye;const me=class me extends L{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(e.widgetEvent.don(n=>{if(n.objId!==t.id)return;const{type:r,properties:s}=n;t.widgetEvent.emit({type:r,properties:s})}))}};f(me,"type",me.register("ESUeViewer",o.ESEntityCluster.type,me));let bt=me;const X=class X extends P{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(X,"type",X.register("ESUeViewer",o.ESExcavate.type,X)),f(X,"propValFuncs",{...P.propValFuncs,targetID:t=>{if(!t)return"";const e=o.ESSceneObject.getSceneObject(t);return e?(e.components.main??e).id:t}});let xt=X;const Ce=class Ce extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Ce,"type",Ce.register("ESUeViewer",o.ESFireParticleSystem.type,Ce));let Nt=Ce;const Ee=class Ee extends L{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const n=this.ad(o.reactJson(""));{const a=()=>{if(typeof t.url=="string")n.value=o.ESSceneObject.context.getStrFromEnv(t.url);else{const v=t.url;v.url=o.ESSceneObject.context.getStrFromEnv(v.url),n.value=v}};a(),this.ad(t.urlChanged.don(a))}const r=()=>{i.callUeFunc({f:"update",p:{id:t.id,url:n.value??o.ESForestTileset.defaults.url,treeTypes:t.treeTypes??o.ESForestTileset.defaults.treeTypes,xiaoBanWidget:t.xiaoBanWidget??o.ESForestTileset.defaults.xiaoBanWidget,youShiSZ:t.youShiSZ??o.ESForestTileset.defaults.youShiSZ,diLei:t.diLei??o.ESForestTileset.defaults.diLei,senLinLB:t.senLinLB??o.ESForestTileset.defaults.senLinLB,labelMaterial:t.labelMaterial??o.ESForestTileset.defaults.labelMaterial,heightOffset:t.heightOffset??o.ESForestTileset.defaults.heightOffset}})},s=this.dv(o.createNextAnimateFrameEvent(n.changed,t.treeTypesChanged,t.xiaoBanWidgetChanged,t.youShiSZChanged,t.diLeiChanged,t.senLinLBChanged,t.labelMaterialChanged,t.heightOffsetChanged));this.d(s.don(r)),this.d(t.createdEvent.don(r))}};f(Ee,"type",Ee.register("ESUeViewer",o.ESForestTileset.type,Ee));let zt=Ee;const Se=class Se extends o.EngineObject{constructor(t,e){super(t,e),this.ad(new o.ObjResettingWithEvent(t.renderInUEChanged,()=>t.renderInUE?new Nn(t,e):new xn(t,e)))}};f(Se,"type",Se.register("ESUeViewer",o.ESGeoDiv.type,Se));let Gt=Se;class xn extends o.Destroyable{constructor(e,i){super();f(this,"_screenPosition",this.disposeVar(o.reactArrayWithUndefined(void 0)));const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}const r=this.disposeVar(new o.ESTextLabel);r.parentID=e.id,e.components.disposableAdd(r,!0),r.show=!1,this.dispose(o.bind([r,"position"],[e,"position"])),this.dispose(o.bind([r,"rotation"],[e,"rotation"])),this.dispose(o.bind([r,"flyToParam"],[e,"flyToParam"])),this.dispose(o.bind([r,"flyInParam"],[e,"flyInParam"])),this.dispose(e.calcFlyToParamEvent.disposableOn(()=>{W(n,r.id)})),this.dispose(e.calcFlyInParamEvent.disposableOn(async()=>{if(!i.actived)return;const v=await i.getCurrentCameraInfo();if(!v)return;const{position:l,rotation:y}=v;e.flyInParam={position:l,rotation:y,flyDuration:1}})),this.dispose(e.smoothMoveEvent.disposableOn((v,l)=>{ee(n,r.id,v,l)})),this.dispose(e.smoothMoveWithRotationEvent.disposableOn((v,l,y)=>{k(n,r.id,v,l,y)})),this.dispose(e.smoothMoveOnGroundEvent.disposableOn((v,l,y,g)=>{O(n,r.id,v,l,g,y)})),this.dispose(e.smoothMoveWithRotationOnGroundEvent.disposableOn((v,l,y,g,d)=>{j(n,r.id,v,l,y,g,d)})),this.dispose(e.flyToEvent.disposableOn((v,l)=>{r.flyTo(v)})),this.dispose(e.flyInEvent.don(v=>{r.flyIn(v)}));const s=this._screenPosition,a=this.disposeVar(new o.ESCustomDiv);a.parentID=e.id,i.add(a),this.dispose(()=>i.delete(a)),this.dispose(o.bind([a,"allowPicking"],[e,"allowPicking"]));{const v=this.disposeVar(o.createAnimateFrame()),l=()=>{e.show?v.restart(void 0,async()=>{if(!e.position)return;const y=await i.lonLatAltToScreenPosition(e.position);if(!this.isDestroyed())if(!y)this._screenPosition.value=void 0;else{const[g,d]=y;g===-1&&d===-1?this._screenPosition.value=void 0:this._screenPosition.value=[g,d]}}):v.cancel()};l(),this.dispose(e.showChanged.disposableOn(l))}{const v=()=>class extends o.Destroyable{constructor(d,h,u){if(super(),this._subContainer=d,!u)return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");const w=new o.PosFloatDiv,m=w.element;this._subContainer.appendChild(m),this.dispose(()=>this._subContainer.removeChild(m)),m.onclick=C=>{(e.allowPicking??!1)&&e.pickedEvent.emit(new o.ESJPickedResult({div:m,pointerEvent:C},e,void 0,void 0,void 0,[C.x,C.y]))};{const C=()=>{e.editing?m.children[0].style.pointerEvents="none":m.children[0].style.pointerEvents="all"};C(),this.d(e.editingChanged.don(C))}{const C=()=>{const E=e.show;s.value&&E?(w.show=!0,w.winPos=[...s.value]):(w.show=!1,w.winPos=[0,0])};C();const I=this.disposeVar(o.createNextAnimateFrameEvent(e.showChanged,s.changed));this.dispose(I.disposableOn(C))}{const C=()=>{const[I,E]=e.anchor??o.ESGeoDiv.defaults.anchor;w.originRatioX=I,w.originRatioY=E};C(),this.dispose(e.anchorChanged.disposableOn(C))}{const C=()=>{w.opacity=e.opacity??o.ESGeoDiv.defaults.opacity};C(),this.dispose(e.opacityChanged.disposableOn(C))}this.disposeVar(new e.instanceClass(w.contentDiv,e,u))}},l=()=>{try{e.instanceClass?a.instanceClass=v():a.instanceClass=void 0}catch(g){console.error(g)}};l();const y=this.dv(o.createNextAnimateFrameEvent(e.instanceClassChanged,e.opacityChanged,e.anchorChanged,e.editingChanged,e.showChanged,e.allowPickingChanged));this.d(y.don(l))}}get screenPosition(){return this._screenPosition.value}get screenPositionChanged(){return this._screenPosition.changed}set screenPosition(e){this._screenPosition.value=e}}class Nn extends o.Destroyable{constructor(e,i){super();f(this,"_imageLabel");f(this,"_hasClassDivAndPos",{});this._imageLabel=this.dv(new o.ESImageLabel),this._imageLabel.isHoverZoom=!1,this._imageLabel.parentID=e.id;const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}const r=this._imageLabel;e.components.disposableAdd(r,!0);{const s=()=>{if(!n)return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");const l=document.createElement("div"),y=this.dv(new e.instanceClass(l,e,i))._container;if(y.style.opacity=e.opacity.toString()??o.ESGeoDiv.defaults.opacity,y.style.position="fixed",y.style.zIndex="-1",y.style.top="0px",!document.body.contains(y)){document.body.appendChild(y);let d=y?y.querySelectorAll("*[class]"):[];for(let h=0;h<d.length;h++){const u=d[h];var g=u.getBoundingClientRect();this._hasClassDivAndPos[u.className]=[u.offsetLeft,u.offsetTop,u.offsetLeft+g.width,u.offsetTop+g.height]}}Jn(y,{backgroundColor:null,allowTaint:!0,useCORS:!0,width:y.offsetWidth,height:y.offsetHeight,scale:1}).then(d=>{document.body.contains(y)&&document.body.removeChild(y),r.url=d.toDataURL(),r.show=e.show}).catch(()=>{document.body.contains(y)&&document.body.removeChild(y)})},a=()=>{try{e.instanceClass?s():(r.url="",r.show=!1)}catch(l){console.error(l)}};a();const v=this.dv(o.createNextAnimateFrameEvent(e.instanceClassChanged,e.opacityChanged));this.d(v.don(a))}{const s=()=>{r.show=e.show};r.show=!1,this.ad(e.showChanged.don(s))}this.d(o.track([r,"anchor"],[e,"anchor"])),this.d(o.bind([r,"position"],[e,"position"])),this.d(o.bind([r,"rotation"],[e,"rotation"])),this.d(o.bind([r,"flyToParam"],[e,"flyToParam"])),this.d(o.bind([r,"flyInParam"],[e,"flyInParam"])),this.d(o.bind([r,"allowPicking"],[e,"allowPicking"])),this.d(o.bind([r,"scale"],[e,"scale"])),this.d(o.track([r,"minVisibleDistance"],[e,"minVisibleDistance"])),this.d(o.track([r,"maxVisibleDistance"],[e,"maxVisibleDistance"])),this.ad(e.automaticLandingEvent.don(()=>{r.automaticLanding()})),this.d(i.widgetEvent.don(s=>{if(s.objId!==this._imageLabel.id)return;const{type:a,add:v}=s;if(a==="leftClick"&&v){const l=(v==null?void 0:v.classNames)??[],y=Object.keys(this._hasClassDivAndPos);for(let g=0;g<y.length;g++){const d=y[g];let h=this._hasClassDivAndPos[d];v&&v.mouseRelativePos&&v.mouseRelativePos[0]>=h[0]&&v.mouseRelativePos[0]<=h[2]&&v.mouseRelativePos[1]>=h[1]&&v.mouseRelativePos[1]<=h[3]&&l.push(d)}v.classNames=l}e.widgetEvent.emit({type:a,add:v})})),this.d(e.calcFlyToParamEvent.don(()=>{W(n,r.id)})),this.d(e.calcFlyInParamEvent.don(()=>{const s=i.getCurrentCameraInfo();if(!s)return;const{position:a,rotation:v}=s;e.flyInParam={position:a,rotation:v,flyDuration:1}})),this.d(e.smoothMoveEvent.don((s,a)=>{ee(n,r.id,s,a)})),this.d(e.smoothMoveWithRotationEvent.don((s,a,v)=>{k(n,r.id,s,a,v)})),this.d(e.smoothMoveOnGroundEvent.don((s,a,v,l)=>{O(n,r.id,s,a,l,v)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((s,a,v,l,y)=>{j(n,r.id,s,a,v,l,y)})),this.d(e.flyToEvent.don((s,a)=>{r.flyTo(s)})),this.d(e.flyInEvent.don(s=>{r.flyIn(s)}))}}const Fe=class Fe extends L{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(t.flyToFeatureIndexEvent.don((n,r)=>{i.callUeFunc({f:"flyToFeatureIndex",p:{id:t.id,index:n,duration:r}})})),this.d(t.flyToFeatureEvent.don((n,r,s)=>{i.callUeFunc({f:"flyToFeature",p:{id:t.id,key:n,value:r,duration:s}})}))}};f(Fe,"type",Fe.register("ESUeViewer",o.ESGeoJson.type,Fe));let Ht=Fe;const Ie=class Ie extends D{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Ie,"type",Ie.register("ESUeViewer",o.ESGeoLineString.type,Ie));let gt=Ie;const Te=class Te extends D{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Te,"type",Te.register("ESUeViewer",o.ESGeoRectangle.type,Te));let Jt=Te;const Re=class Re extends P{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Re,"type",Re.register("ESUeViewer",o.ESGeoWater.type,Re));let Kt=Re;const x=class x extends S{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(t.setNodePositionEvent.don((n,r)=>{qi(i,t.id,n,r)})),this.d(t.setNodeRotationEvent.don((n,r)=>{Zi(i,t.id,n,r)})),this.d(t.setNodeScaleEvent.don((n,r)=>{Vi(i,t.id,n,r)}))}};f(x,"forceUeUpdateProps",[...S.forceUeUpdateProps,"url"]),f(x,"propValFuncs",{...S.propValFuncs,url:t=>typeof t=="string"?o.ESSceneObject.context.getStrFromEnv(o.rpToap(t)):(t.url=o.ESSceneObject.context.getStrFromEnv(o.rpToap(t.url)),t),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),f(x,"type",x.register("ESUeViewer",o.ESGltfModel.type,x));let Xt=x;const De=class De extends D{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(De,"type",De.register("ESUeViewer",o.ESHeightMeasurement.type,De));let qt=De;const Le=class Le extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}const n=async(s,a,v,l)=>{const{viewer:y}=s;if(!y){console.error("AIMoveTo: ueViewer.viewer is undefined");return}const g=await y.callUeFunc({f:"AIMoveTo",p:{id:a,Destination:v,Time:l}});return g.error&&console.error("AIMoveTo:",g.error),g};this.d(t.aiMoveToEvent.don((s,a)=>{n(e,t.id,s,a)}));const r=async(s,a)=>{const{viewer:v}=s;if(!v){console.error("StopAIMove: ueViewer.viewer is undefined");return}const l=await v.callUeFunc({f:"StopAIMove",p:{id:a}});return l.error&&console.error("StopAIMove:",l.error),l};this.d(t.stopAIMoveEvent.don(()=>{r(e,t.id)}))}};f(Le,"type",Le.register("ESUeViewer",o.ESHuman.type,Le));let Zt=Le;const N=class N extends U{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}t.anchor=[.5,1]}};f(N,"type",N.register("ESUeViewer",o.ESImageLabel.type,N)),f(N,"forceUeUpdateProps",[...U.forceUeUpdateProps,"url"]),f(N,"propValFuncs",{...U.propValFuncs,url:t=>typeof t=="string"?o.ESSceneObject.context.getStrFromEnv(o.rpToap(t)):(t.url=o.ESSceneObject.context.getStrFromEnv(o.rpToap(t.url)),t)});let Vt=N;const Pe=class Pe extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Pe,"type",Pe.register("ESUeViewer",o.ESLevelRuntimeModel.type,Pe));let Yt=Pe;const Be=class Be extends ut{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Be,"type",Be.register("ESUeViewer",o.ESLocalCircle.type,Be));let Qt=Be;const Ue=class Ue extends L{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Ue,"type",Ue.register("ESUeViewer",o.ESLocalPolygonZ.type,Ue));let kt=Ue;const Ae=class Ae extends ut{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Ae,"type",Ae.register("ESUeViewer",o.ESLocalRectangle.type,Ae));let Ot=Ae;const Me=class Me extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Me,"type",Me.register("ESUeViewer",o.ESLocalSkyBox.type,Me));let jt=Me;const We=class We extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(We,"type",We.register("ESUeViewer",o.ESLocationMeasurement.type,We));let ei=We;const $e=class $e extends D{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f($e,"type",$e.register("ESUeViewer",o.ESPipeFence.type,$e));let ti=$e;const _e=class _e extends gt{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(_e,"type",_e.register("ESUeViewer",o.ESPipeline.type,_e));let ii=_e;const be=class be extends ht{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(t.highlightFeatureEvent.don(n=>{const r=typeof n=="number"?n.toString():n;Hi(i,t.id,r)})),this.d(t.highlightFeatureAndFlyToEvent.don((n,r,s,a)=>{const v=typeof n=="number"?n.toString():n;Ji(i,t.id,v,a??1)})),this.d(t.setLayerVisibleEvent.don((n,r)=>{let s="";typeof r!="string"?s=JSON.stringify(r):s=r,Ki(i,t.id,s)})),this.d(t.setLayerColorEvent.don((n,r)=>{let s="";typeof r!="string"?s=JSON.stringify(r):s=r,Xi(i,t.id,s)}))}};f(be,"type",be.register("ESUeViewer",o.ESPipeserTileset.type,be));let ni=be;const xe=class xe extends P{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(xe,"type",xe.register("ESUeViewer",o.ESPit.type,xe));let ri=xe;const Ne=class Ne extends U{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.ad(t.getInitialStyleEvent.don(async()=>{try{const n=await i.callUeFunc({f:"GetInitialStyle",p:{id:t.id}});n.error!=""&&console.error("getInitialStyleEvent:",n.error),t.initialStyle.value=structuredClone(n.re)}catch(n){console.error("getInitialStyleEvent:",n),t.initialStyle.value=void 0}}))}};f(Ne,"type",Ne.register("ESUeViewer",o.ESPoi2D.type,Ne));let oi=Ne;const ze=class ze extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(ze,"type",ze.register("ESUeViewer",o.ESPoi3D.type,ze));let si=ze;const z=class z extends L{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(z,"type",z.register("ESUeViewer",o.ESPoiTileset.type,z)),f(z,"forceUeUpdateProps",[...L.forceUeUpdateProps,"url"]),f(z,"propValFuncs",{...L.propValFuncs,url:t=>typeof t=="string"?o.ESSceneObject.context.getStrFromEnv(t):(t.url=o.ESSceneObject.context.getStrFromEnv(t.url),t)});let ai=z;const Ge=class Ge extends D{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Ge,"type",Ge.register("ESUeViewer",o.ESPolygonFence.type,Ge));let li=Ge;const q=class q extends P{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(q,"type",q.register("ESUeViewer",o.ESPolygonFlattenedPlane.type,q)),f(q,"propValFuncs",{...P.propValFuncs,targetID:t=>{if(!t)return"";const e=o.ESSceneObject.getSceneObject(t);return e?(e.components.main??e).id:t}});let di=q;const He=class He extends P{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(He,"type",He.register("ESUeViewer",o.ESPolygonWithHole.type,He));let ci=He;const Je=class Je extends ${constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(()=>{t.ids=[]}),this.d(t.highlightInner3DtilesetEvent.don(n=>{n.highlight=!0})),this.d(t.removeHighlightInner3DtilesetEvent.don(n=>{n.highlight=!1}));{const n=a=>{a=a.toLocaleLowerCase();let v=[255,255,255,1];if(a.startsWith("#")){if(a.length===4){let l=parseInt(a[1]+a[1],16),y=parseInt(a[2]+a[2],16),g=parseInt(a[3]+a[3],16);v=[l,y,g,1]}else if(a.length===7){let l=parseInt(a.substring(1,3),16),y=parseInt(a.substring(3,5),16),g=parseInt(a.substring(5,7),16);v=[l,y,g,1]}}else if(a.startsWith("rgba")){let l=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/);if(l){let y=parseInt(l[1]),g=parseInt(l[2]),d=parseInt(l[3]),h=parseFloat(l[4]);v=[y,g,d,h]}}else if(a.startsWith("rgb")){let l=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);if(l){let y=parseInt(l[1]),g=parseInt(l[2]),d=parseInt(l[3]);v=[y,g,d,1]}}else console.error("color类型只能为#rrggbb、#rgb、rgba(r,g,b,a)、rgb(r,g,b)");return[v[0]/255,v[1]/255,v[2]/255,v[3]]},r=()=>{const a=t.layerConfig;if(!a)return;const v=[];a.forEach(l=>{a.filter(g=>g.dataset==l.dataset).length==1?v.push({condition:[{field:"dataset",op:"==",value:l.dataset}],color:n(l.value.color??"rgb(255,255,255)"),show:l.value.visible}):v.push({condition:[{field:"layer",op:"==",value:l.layer},{field:"dataset",op:"==",value:l.dataset}],color:n(l.value.color??"rgb(255,255,255)"),show:l.value.visible})}),t.setFeatureStyle(v)};r();const s=this.dv(o.createNextAnimateFrameEvent(t.layerConfigChanged,t.colorBlendModeChanged));this.d(s.don(()=>{r()}))}}};f(Je,"type",Je.register("ESUeViewer",o.ESRtsTileset.type,Je));let ui=Je;const Ke=class Ke extends L{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(t.addTreesEvent.don(n=>{o.addTreesCallFunc(e,t.id,n)})),this.d(t.removeAllTreesEvent.don(()=>{o.removeAllTreesCallFunc(e,t.id)})),this.d(t.updateTreeParamsEvent.don(n=>{o.updateTreeParamsCallFunc(e,t.id,n)})),this.d(t.cutDownTreesEvent.don((n,r)=>{o.cutDownTreesCallFunc(e,t.id,n,r)})),this.d(t.growthSimulationEvent.don((n,r,s)=>{o.growthSimulationCallFunc(e,t.id,n,r,s)}))}};f(Ke,"type",Ke.register("ESUeViewer",o.ESSeparateFoliage.type,Ke));let hi=Ke;const Xe=class Xe extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Xe,"type",Xe.register("ESUeViewer",o.ESSubmergingAnalysis.type,Xe));let vi=Xe;const qe=class qe extends P{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(t.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:t.id}})})),this.d(t.stopEvent.don(()=>{i.callUeFunc({f:"Stop",p:{id:t.id}})}))}};f(qe,"type",qe.register("ESUeViewer",o.ESSunshineAnalysis.type,qe));let gi=qe;const Ze=class Ze extends P{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(t.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:t.id}})}))}};f(Ze,"type",Ze.register("ESUeViewer",o.ESSurfaceAreaMeasurement.type,Ze));let pi=Ze;const Ve=class Ve extends U{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Ve,"type",Ve.register("ESUeViewer",o.ESTextLabel.type,Ve));let fi=Ve;const Z=class Z extends U{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(t.callFunctionEvent.don(async(n,r)=>{const s=await yt(i,t.id,n,r);t.__callFunctionResultEvent.emit(s)}))}};f(Z,"type",Z.register("ESUeViewer",o.ESUEWidget.type,Z)),f(Z,"propValFuncs",{...U.propValFuncs,info:t=>JSON.stringify(t??{})});let wi=Z;const zn=c=>{switch(c){case 0:return"成功绑定";case 1:return"解绑之前的内容,成功绑定";case 2:return"未搜索到ActorTag,无法绑定";case 3:return"搜索到ActorTag但对应的Actor不是场景原有的,而是新建的,无法绑定";case 4:return"搜索到ActorTag对应的Actor是地形或3DTileset,无法绑定";default:return"未知错误"}},gr=c=>{switch(c){case 0:return"创建成功";case 1:return"未找到对应的资源,无法创建";case 2:return"Id与场景中现有的ActorTag重复,创建后可能出现问题,创建失败";default:return"未知错误"}},Ye=class Ye extends o.EngineObject{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn(`${t.id} UeESUnrealActor viewer is undefined!`);return}this.d(()=>{ft(i,t.id)});const n=async()=>{l()||await i.callUeFunc({f:"update",p:{id:t.id,name:t.name,show:t.show,rotation:t.rotation,flyToParam:t.flyToParam??o.ESUnrealActor.defaultFlyToParam,flyInParam:t.flyInParam??o.ESUnrealActor.defaultFlyInParam,highlight:t.highlight,collision:t.collision,scale:t.scale,minVisibleDistance:t.minVisibleDistance,maxVisibleDistance:t.maxVisibleDistance}})},r=this.dv(o.createNextAnimateFrameEvent(t.showChanged,t.nameChanged,t.rotationChanged,t.flyToParamChanged,t.flyInParamChanged,t.highlightChanged,t.collisionChanged,t.scaleChanged,t.minVisibleDistanceChanged,t.maxVisibleDistanceChanged));this.d(r.don(n)),this.d(t.flushEvent.don(()=>r.flush()));let s,a;const v=async()=>{l()||(await i.callUeFunc({f:"update",p:{id:t.id,position:t.position}}),(e.debug??!1)&&console.log(`updatePostion:${t.position},actorTag:${t.actorTag},actorClass:${t.actorClass}`))},l=()=>!s&&!a?(console.warn(`${t.id} 未绑定ActorTag或未创建ActorClass!`),!0):!1,y=async()=>{const{id:d}=t,h=await e.unBindActorByID(d);h&&h.error!==""&&console.warn(`${t.id} UeESUnrealActor UnBindActorByID: ${h.error}`),s=void 0;const u=await i.callUeFunc({f:"destroy",p:{id:d}});if(u&&u.error!==""){console.warn(`${t.id} UeESUnrealActor DestroyActorByID: ${u.error}`);return}a=void 0},g=this.dv(o.react({type:"ActorClass",actorClass:"default"}));{const d=this.dv(o.createNextAnimateFrameEvent(t.actorClassChanged,t.actorTagChanged)),h=async()=>{t.actorTag!==""?g.value={type:"ActorTag",actorTag:t.actorTag}:g.value={type:"ActorClass",actorClass:t.actorClass===""?"default":t.actorClass}};h(),this.d(d.don(h)),this.d(t.flushEvent.don(()=>d.flush()))}{const d=this.dv(o.createProcessingFromAsyncFunc(async u=>{if(await u.promise(y()),t.lastActorStatus="null",g.value.type==="ActorTag"){const{actorTag:w}=g.value;try{const m=await u.promise(e.bindActorByTag(t.id,w));if(!m)return;if(m.error!==""){console.warn(`${t.id} UeESUnrealActor BindActorByTag:${w},${m.error}`);return}if(m.re.type===0)t.lastActorStatus="bound",s=w;else if(m.re.type===1)t.lastActorStatus="bound",s=w,console.warn(`${t.id} UeESUnrealActor BindActorByTag:${w},${zn(m.re.type)}`);else{s=void 0,console.warn(`${t.id} UeESUnrealActor BindActorByTag error:${w}, ${zn(m.re.type)}`);return}}catch(m){console.warn(`${t.id} UeESUnrealActor BindActorByTag catch error:${w}, ${m}`);return}}else if(g.value.type==="ActorClass"){const{actorClass:w}=g.value;try{const m=await u.promise(e.createActorByClass(t.id,w));if(!m)return;if(m.error!==""){console.warn(`${t.id} UeESUnrealActor CreateActorByClass error :${w}, ${m.error}`);return}if(m.re.type===0)w!=="default"&&(t.lastActorStatus="created"),a=w;else{console.warn(`${t.id} UeESUnrealActor CreateActorByClass error type :${w},${gr(m.re.type)}`);return}}catch(m){console.warn(`${t.id} UeESUnrealActor CreateActorByClass error catch :${w}, ${JSON.stringify(m)}`);return}}await u.promise(n()),await u.promise(v())})),h=async()=>{d.restart()};h(),this.d(g.changed.don(h))}this.d(t.positionChanged.don(v)),this.d(t.callFunctionEvent.don(async(d,h)=>{if(l()){t.__callFunctionResultEvent.emit(void 0);return}const u=await yt(i,t.id,d,h);t.__callFunctionResultEvent.emit(u)})),this.d(t.smoothMoveEvent.don((d,h)=>{l()||ee(i,t.id,d,h)})),this.d(t.smoothMoveWithRotationEvent.don((d,h,u)=>{l()||k(i,t.id,d,h,u)})),this.d(t.smoothMoveOnGroundEvent.don((d,h,u,w)=>{l()||O(i,t.id,d,h,w,u)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((d,h,u,w,m)=>{l()||j(i,t.id,d,h,u,w,m)})),this.d(t.automaticLandingEvent.don(d=>{if(l())return;const h=[t.position[0],t.position[1]];e.getHeightByLonLat(t.position[0],t.position[1],"Visibility").then(u=>{u!==null&&(t.position=[...h,u],t.collision=d)})})),this.d(t.flyToEvent.don(async(d,h)=>{if(l())return;const u=await H(i,t.id,d);let w="over";u===void 0?w="error":u.endType===0?w="over":u.endType===1&&(w="cancelled"),t.flyOverEvent.emit(h,w,e)})),this.d(t.calcFlyToParamEvent.don(()=>{l()||W(i,t.id)})),this.d(t.calcFlyInParamEvent.don(async()=>{if(!e.actived)return;const d=await e.getCurrentCameraInfo();if(!d)return;const{position:h,rotation:u}=d;t.flyInParam={position:h,rotation:u,flyDuration:1}})),this.d(e.propChanged.don(d=>{l()||d.objId===t.id&&Object.keys(d.props).forEach(h=>{const u=d.props[h]===null?void 0:d.props[h];t[h]=u})}))}};f(Ye,"type",Ye.register("ESUeViewer",o.ESUnrealActor.type,Ye));let yi=Ye;const Qe=class Qe extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(Qe,"type",Qe.register("ESUeViewer",o.ESVideoFusion.type,Qe));let mi=Qe;const ke=class ke extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(ke,"type",ke.register("ESUeViewer",o.ESViewShed.type,ke));let Ci=ke;const Oe=class Oe extends D{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is underfined!");return}}};f(Oe,"type",Oe.register("ESUeViewer",o.ESVisibilityAnalysis.type,Oe));let Ei=Oe;const je=class je extends P{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.ad(o.track([t,"volume"],[t,"cutAndFillVolume"])),this.d(t.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:t.id}})})),this.d(t.clearEvent.don(()=>{i.callUeFunc({f:"Clear",p:{id:t.id}})}))}};f(je,"type",je.register("ESUeViewer",o.ESVolumeMeasurement.type,je));let Si=je;const V=class V extends U{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(V,"type",V.register("ESUeViewer",o.ESWidget.type,V)),f(V,"propValFuncs",{...U.propValFuncs,info:t=>JSON.stringify(t??{})});let Fi=V;const et=class et extends o.EngineObject{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}t.poi.actorTag=t.human.id,t.poi.positionOffset=[0,0,t.poiOffsetHeight-.8],this.d(t.poiOffsetHeightChanged.don(()=>{t.poi.positionOffset=[0,0,t.poiOffsetHeight-.8]})),this.d(()=>{t.poi.actorTag=""})}};f(et,"type",et.register("ESUeViewer",o.ESHumanPoi.type,et));let Ii=et;o.ESSceneObject.context.getStrFromEnv(o.ESNavigator.defaults.imgUrl);const tt=class tt extends o.EngineObject{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new o.ESCustomDiv);e.add(n),this.dispose(()=>e.delete(n)),this.dispose(o.track([n,"show"],[t,"show"])),n.instanceClass=class extends o.Destroyable{constructor(s,a,v){super(),this._subContainer=s;const l=document.createElement("div");this._subContainer.appendChild(l),this.dispose(()=>this._subContainer.removeChild(l));{const d=async()=>{const h=await e.getCurrentCameraInfo(),u=h==null?void 0:h.position,m=[...h==null?void 0:h.rotation];m[0]=360,e.flyIn(u,m)};l.addEventListener("click",d),l.style.cursor="pointer",this.dispose(()=>l.removeEventListener("click",d))}{const d=()=>{l.style.width=`${t.cssSize?t.cssSize:o.ESNavigator.defaults.cssSize}px`,l.style.height=`${t.cssSize?t.cssSize:o.ESNavigator.defaults.cssSize}px`};d(),t.dispose(t.cssSizeChanged.disposableOn(d))}l.style.position="fixed";{const d=()=>{l.style.top=`${t.cssPosition?t.cssPosition[0]:o.ESNavigator.defaults.cssPosition[0]}px`,l.style.right=`${t.cssPosition?t.cssPosition[1]:o.ESNavigator.defaults.cssPosition[1]}px`};d(),t.dispose(t.cssPositionChanged.disposableOn(d))}l.style.transition=" right 0.4s linear",l.style.cursor="pointer";const y=document.createElement("div");l.appendChild(y),this.dispose(()=>l.removeChild(y)),y.style.width="100%",y.style.height="100%",y.style.position="relative";const g=document.createElement("img");y.appendChild(g),this.dispose(()=>y.removeChild(g)),g.style.width="100%",g.style.height="100%",g.style.border="none";{const d=()=>g.src=t.imgUrl;d(),t.dispose(t.imgUrlChanged.disposableOn(d))}{const d=()=>{const m=-e.getCurrentCameraInfo().rotation[0];g.style.transform=`rotate(${m}deg)`};let h;const u=async()=>{d(),t.show?(l.style.display="block",h=setInterval(()=>{d()},1e3)):(l.style.display="none",clearInterval(h))};this.dispose(t.showChanged.disposableOn(u)),u(),this.dispose(()=>clearInterval(h))}g.style.transformOrigin="50% 50%"}}}};f(tt,"type",tt.register("ESUeViewer",o.ESNavigator.type,tt));let Ti=tt;const G=class G extends D{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}{const n=()=>{let r=t.materialMode==="blue"?"multipleArrows":t.materialMode==="purple"?"singleArrow":t.materialMode;i.callUeFunc({f:"update",p:{id:t.id,materialMode:r}})};this.dispose(t.materialModeChanged.disposableOn(n))}}};f(G,"type",G.register("ESUeViewer",o.ESPath.type,G)),f(G,"forceUeUpdateProps",[...D.forceUeUpdateProps]),f(G,"propValFuncs",{...D.propValFuncs});let Ri=G;async function pr(c){navigator.clipboard.writeText(c).then(function(){console.log("复制成功")},function(t){console.log("复制失败")})}const it=class it extends o.EngineObject{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new o.ESCustomDiv);e.add(n),this.dispose(()=>e.delete(n)),n.instanceClass=class extends o.Destroyable{constructor(s,a,v){if(super(),this._subContainer=s,!v||!(v instanceof M))return;const l=document.createElement("div");this._subContainer.appendChild(l),this.dispose(()=>this._subContainer.removeChild(l)),l.style.width="100%",l.style.position="absolute",l.style.height=`${o.ESViewerStatusBar.defaults.height}px`,l.style.left="0",l.style.bottom="0",l.style.color="#fff",l.style.padding="0 20px 0 0",l.style.boxSizing="border-box",l.style.lineHeight=`${o.ESViewerStatusBar.defaults.height}px`,l.style.zIndex="100",l.style.alignContent="center",l.style.justifyContent="space-between";const y=document.createElement("span");l.appendChild(y),this.dispose(()=>l.removeChild(y));const g=document.createElement("span");y.appendChild(g),this.dispose(()=>y.removeChild(g));const d=document.createElement("span");y.appendChild(d),d.addEventListener("dblclick",function(){let u=d.innerHTML;u.startsWith("鼠标位置")&&(u=u.slice(5)),pr(u)}),d.style.cursor="pointer",this.dispose(()=>y.removeChild(d));const h=document.createElement("span");l.appendChild(h),this.dispose(()=>l.removeChild(h));{const u=()=>{l.style.height=(t.height??o.ESViewerStatusBar.defaults.height)+"px",l.style.lineHeight=(t.height??o.ESViewerStatusBar.defaults.height)+"px"};this.dispose(t.heightChanged.disposableOn(u)),u()}{const u=()=>{l.style.fontSize=(t.fontSize??o.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(t.fontSizeChanged.disposableOn(u)),u()}{const u=()=>{t.bgColor?l.style.background=`rgba(${t.bgColor[0]*255},${t.bgColor[1]*255},${t.bgColor[2]*255},${t.bgColor[3]})`:l.style.background=`rgba(${o.ESViewerStatusBar.defaults.bgColor[0]},${o.ESViewerStatusBar.defaults.bgColor[1]},${o.ESViewerStatusBar.defaults.bgColor[2]},${o.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(t.bgColorChanged.disposableOn(u)),u()}v.getVersion().then(u=>{u&&(h.innerText=`Ue 版本 : ${u[0]} `)}).catch(u=>{console.log(u)});{const u=()=>{let C="",I="";C+=`帧率:${v.getFPS().toFixed(0)}FPS`,g.innerText=C;const E=e.getCurrentCameraInfo();C+=` 经度: ${E.position[0].toFixed(5)}° 纬度: ${E.position[1].toFixed(5)}° 高度: ${E.position[2].toFixed(2)}米 偏航角: ${E.rotation[0].toFixed(2)}° 俯仰角: ${E.rotation[1].toFixed(2)}° 翻滚角:${E.rotation[2].toFixed(2)}° `,g.innerText=C,e.pick().then(T=>{if(T){const{pickResult:F}=T;if(F&&F.position){const{position:B}=F;I+=`鼠标位置:${B[0].toFixed(5)}° ${B[1].toFixed(5)}° ${B[2].toFixed(2)}m`}else I+="暂时无法获取鼠标位置...";d.innerText=I}}).catch(T=>{console.log(T)})};let w;const m=async()=>{u(),t.show?(l.style.display="flex",w=setInterval(()=>{u()},1e3)):(l.style.display="none",clearInterval(w))};this.dispose(t.showChanged.disposableOn(m)),m(),this.dispose(()=>clearInterval(w))}}}}};f(it,"type",it.register("ESUeViewer",o.ESViewerStatusBar.type,it));let Di=it;const nt=class nt extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(nt,"type",nt.register("ESUeViewer",o.ESGaussianSplatting.type,nt));let Li=nt;const rt=class rt extends ${constructor(e,i){super(e,i);f(this,"_es3DTileset",this.dv(new o.ES3DTileset));if(!i.viewer){console.warn("viewer is undefined!");return}this.es3DTileset.parentID=e.id;{const r=this._es3DTileset;e.components.disposableAdd(r,!0),this.d(o.track([r,"allowPicking"],[e,"allowPicking"])),this.d(o.track([r,"collision"],[e,"collision"])),this.d(o.bind([r,"flyToParam"],[e,"flyToParam"])),this.d(o.bind([r,"flyToParam"],[e,"flyToParam"])),this.d(o.track([r,"url"],[e,"url"])),this.d(o.track([r,"actorTag"],[e,"actorTag"])),this.d(o.track([r,"materialMode"],[e,"materialMode"])),this.d(o.track([r,"highlight"],[e,"highlight"])),this.d(o.track([r,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(o.track([r,"highlightID"],[e,"highlightID"])),this.d(o.track([r,"highlightColor"],[e,"highlightColor"])),this.d(o.bind([r,"offset"],[e,"offset"])),this.d(o.bind([r,"rotation"],[e,"rotation"])),this.d(o.track([r,"czmImageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(o.track([r,"czmLuminanceAtZenith"],[e,"czmLuminanceAtZenith"])),this.d(o.track([r,"czmMaximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(o.track([r,"czmClassificationType"],[e,"czmClassificationType"])),this.d(o.track([r,"czmStyleJson"],[e,"czmStyleJson"])),this.d(o.track([r,"czmBackFaceCulling"],[e,"czmBackFaceCulling"])),this.d(o.track([r,"czmDebugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(o.track([r,"czmDebugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(o.track([r,"colorBlendMode"],[e,"colorBlendMode"])),this.d(o.track([r,"cacheBytes"],[e,"cacheBytes"])),this.d(o.track([r,"clippingPlaneEnabled"],[e,"clippingPlaneEnabled"])),this.d(o.track([r,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(o.track([r,"clippingPlaneEdgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(o.track([r,"clippingPlaneEdgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(o.track([r,"materialParams"],[e,"materialParams"])),this.d(o.bind([r,"supportEdit"],[e,"supportEdit"])),this.d(o.bind([r,"clippingPlanesId"],[e,"clippingPlanesId"])),this.d(o.bind([r,"clippingPlaneIds"],[e,"clippingPlaneIds"])),this.d(o.bind([r,"flattenedPlaneId"],[e,"flattenedPlaneId"])),this.d(o.bind([r,"flattenedPlaneEnabled"],[e,"flattenedPlaneEnabled"])),this.d(o.bind([r,"clippingPlaneId"],[e,"clippingPlaneId"])),this.d(o.bind([r,"excavateId"],[e,"excavateId"]))}{const r=this._es3DTileset;this.d(e.refreshTilesetEvent.don(()=>{r.refreshTileset()})),this.d(e.highlightFeatureEvent.don((...s)=>{r.highlightFeature(...s)})),this.d(e.highlightFeatureAndFlyToEvent.don((...s)=>{r.highlightFeatureAndFlyTo(...s)})),this.d(e.setFeatureColorEvent.don((...s)=>{r.setFeatureColor(...s)})),this.d(e.setFeatureVisableEvent.don((...s)=>{r.setFeatureVisable(...s)})),this.d(e.resetFeatureStyleEvent.don((...s)=>{r.resetFeatureStyle(...s)})),this.d(e.flyInEvent.don((...s)=>{r.flyIn(s[0])})),this.d(e.flyToEvent.don((...s)=>{r.flyTo(s[0])})),this.d(e.calcFlyToParamEvent.don((...s)=>{r.calcFlyToParam(...s)})),this.d(e.calcFlyInParamEvent.don((...s)=>{r.calcFlyInParam(...s)}))}{const r=this._es3DTileset;this.d(r.tilesetReady.don(s=>{e.tilesetReady.emit(s)})),this.d(r.pickedEvent.don(s=>{s.assign({sceneObject:e}),e.pickedEvent.emit(s)}))}{const r=()=>{this.es3DTileset.show=e.show};r(),this.d(e.showChanged.don(()=>{r()}))}}get es3DTileset(){return this._es3DTileset}};f(rt,"type",rt.register("ESUeViewer",o.ESRtsFeatureEditing.type,rt));let Pi=rt;const ot=class ot extends ${constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(ot,"type",ot.register("ESUeViewer",o.ESMsTileset.type,ot));let Bi=ot;const st=class st extends P{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const n=()=>{i.callUeFunc({f:"update",p:{id:t.id,height:t.height??o.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:t.extrudedHeight??o.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:t.perPositionHeight??o.ESGeoExtrudedPolygon.defaults.perPositionHeight}})},r=this.disposeVar(o.createNextAnimateFrameEvent(t.heightChanged,t.extrudedHeightChanged,t.perPositionHeightChanged));this.dispose(r.disposableOn(n)),this.dispose(t.createdEvent.disposableOn(n))}};f(st,"type",st.register("ESUeViewer",o.ESGeoExtrudedPolygon.type,st));let Ui=st;const at=class at extends S{constructor(t,e){if(super(t,e),!e.viewer){console.warn("viewer is undefined!");return}}};f(at,"type",at.register("ESUeViewer",o.ESStaticMesh.type,at));let Ai=at;const lt=class lt extends D{constructor(t,e){super(t,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}this.d(t.startEvent.don(()=>{i.callUeFunc({f:"Start",p:{id:t.id}})})),this.d(t.clearEvent.don(()=>{i.callUeFunc({f:"Clear",p:{id:t.id}})}))}};f(lt,"type",lt.register("ESUeViewer",o.ESSkylineAnalysis.type,lt));let Mi=lt;p.copyright=void 0;try{const c="earthsdk3-ue",t="3.5.0-beta.1",e="2025-09-22T09:21:39.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="d401c49e211d1145dfde463837c9d5d3a95d11cf",a=((Date.now()-1758532899e3)/36e5).toFixed(1),v=`%c🌏 ${c}%c ${t}.${r.slice(0,8)}.${e} (距今${a}个小时)
2
2
  %c${n?n+`
3
- `:""}当前网站正在使用${u},此软件版权归${i}所有
4
- `;f.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","7bb817c2218c8ba03b2c728ade4fc430cfee47dd")},get info(){return g},get date(){return"2025-09-12T07:06:00.000Z"},get author(){return"suplyang"},get version(){return"3.4.0"},get name(){return"earthsdk3-ue"},get commitId(){return"7bb817c2218c8ba03b2c728ade4fc430cfee47dd"},print(a=!1){!a&&window._xe2_no_copy_print||console.info(this.info,`
3
+ `:""}当前网站正在使用${c},此软件版权归${i}所有
4
+ `;p.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","d401c49e211d1145dfde463837c9d5d3a95d11cf")},get info(){return v},get date(){return"2025-09-22T09:21:39.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.1"},get name(){return"earthsdk3-ue"},get commitId(){return"d401c49e211d1145dfde463837c9d5d3a95d11cf"},print(l=!1){!l&&window._xe2_no_copy_print||console.info(this.info,`
5
5
  font-size: 18px;
6
6
  font-weight: 1000;
7
7
  line-height: 1;
@@ -18,4 +18,4 @@
18
18
  color: rgb(0, 120, 215);
19
19
  padding-bottom: 2px;
20
20
  padding-left: 35px;
21
- `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[u]=f.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&f.copyright.print()}catch{}f.ESUeViewer=$,f.GeoDivFromESImageLabel=Hn,f.GeoDivFromESTextLabel=Gn,f.HighlightFeatureAndFlyToCallFunc=Xi,f.HighlightFeatureCallFunc=Ki,f.SetLayerColorCallFunc=Zi,f.SetLayerVisibleCallFunc=qi,f.UeCloudViewerBase=it,f.UeES3DTileset=ve,f.UeESAlarm=Fe,f.UeESApertureEffect=Ie,f.UeESAreaMeasurement=Te,f.UeESBlastParticleSystem=Re,f.UeESBoxClipping=De,f.UeESCameraView=Le,f.UeESCameraVisibleRange=Pe,f.UeESCar=Ue,f.UeESClassification=Ae,f.UeESClippingPlane=Me,f.UeESDataMesh=We,f.UeESDatasmithRuntimeModel=$e,f.UeESDirectionMeasurement=_e,f.UeESDistanceMeasurement=Ne,f.UeESDynamicWater=ze,f.UeESEntityCluster=ke,f.UeESExcavate=Ge,f.UeESFireParticleSystem=He,f.UeESForestTileset=Je,f.UeESGaussianSplatting=Pi,f.UeESGeoDiv=Be,f.UeESGeoExtrudedPolygon=Mi,f.UeESGeoJson=Ke,f.UeESGeoLineString=pe,f.UeESGeoPolygon=U,f.UeESGeoRectangle=Xe,f.UeESGeoVector=D,f.UeESGeoWater=qe,f.UeESGltfModel=Ze,f.UeESHeightMeasurement=Ve,f.UeESHuman=Ye,f.UeESHumanPoi=Ti,f.UeESImageLabel=Qe,f.UeESImageryLayer=Ee,f.UeESLabel=M,f.UeESLevelRuntimeModel=be,f.UeESLocalCircle=xe,f.UeESLocalPolygon=ge,f.UeESLocalPolygonZ=Oe,f.UeESLocalRectangle=je,f.UeESLocalSkyBox=ti,f.UeESLocalVector=Ce,f.UeESLocalVector2D=he,f.UeESLocationMeasurement=ei,f.UeESMsTileset=Ai,f.UeESNavigator=Ri,f.UeESObjectWithLocation=F,f.UeESPath=Di,f.UeESPipeFence=ii,f.UeESPipeline=ni,f.UeESPipeserTileset=ri,f.UeESPit=oi,f.UeESPoi2D=si,f.UeESPoi3D=ai,f.UeESPoiTileset=li,f.UeESPolygonFence=di,f.UeESPolygonFlattenedPlane=ci,f.UeESPolygonWithHole=ui,f.UeESRtsFeatureEditing=Ui,f.UeESRtsTileset=hi,f.UeESSceneObject=N,f.UeESSeparateFoliage=vi,f.UeESSkylineAnalysis=$i,f.UeESStaticMesh=Wi,f.UeESSubmergingAnalysis=gi,f.UeESSunshineAnalysis=pi,f.UeESSurfaceAreaMeasurement=fi,f.UeESTerrainLayer=Se,f.UeESTextLabel=wi,f.UeESUEWidget=yi,f.UeESUnrealActor=mi,f.UeESVideoFusion=Ci,f.UeESViewShed=Ei,f.UeESViewerStatusBar=Li,f.UeESVisibilityAnalysis=Si,f.UeESVisualObject=P,f.UeESVolumeMeasurement=Fi,f.UeESWidget=Ii,f.bind3DTilesetByTagCallFunc=Cn,f.bindActorByTagCallFunc=pn,f.bindImageryByTagCallFunc=Fn,f.calcFlyToParamCallFunc=_,f.callFunctionCallFunc=me,f.captureCallFunc=nn,f.changeNavigationModeCallFunc=W,f.createActorByClassCallFunc=mn,f.destroyCallFunc=we,f.flyInCallFunc=x,f.flyInDefaultCameraCallFunc=ki,f.flyToCallFunc=K,f.generateMemReportCallFunc=Bi,f.getAllSocketNamesByActorTagCallFunc=an,f.getBoundSphereCallFunc=dn,f.getBoundSphereWithChildrenCallFunc=cn,f.getCameraRelativeHeightCallFunc=Dn,f.getFillMaterialParamInfoCallFunc=hn,f.getGlobalPropertyCallFunc=vn,f.getHeightByLonLatCallFunc=tn,f.getHeightByLonLatsCallFunc=en,f.getIdByComponentNameAndHitItemCallFunc=Rn,f.getLonLatAltToScreenPositionCallFunc=on,f.getObjectByInfoCallFunc=gn,f.getStatusCallFunc=An,f.getStrokeMaterialParamInfoCallFunc=un,f.getTilesetMaterialIDListCallFunc=_n,f.getVersionCallFunc=ln,f.highlightActorByTagCallFunc=Pn,f.mountPakFiles=Ji,f.moveObjectsCallFunc=$n,f.partialCaptureCallFunc=rn,f.pickCallFunc=Oi,f.pickPositionCallFunc=ji,f.quitCallFunc=xi,f.refreshTilesetCallFunc=zi,f.resetWithCurrentCameraCallFunc=ye,f.restoreOriginalSceneCallFunc=fn,f.saveStringToFileCallFunc=Ln,f.sendCustomMessageCallFunc=Un,f.setGlobalPropertyCallFunc=bi,f.setNodePositionCallFunc=Vi,f.setNodeRotationCallFunc=Yi,f.setNodeScaleCallFunc=Qi,f.smoothMoveCallFunc=et,f.smoothMoveOnGroundCallFunc=j,f.smoothMoveWithRotationCallFunc=O,f.smoothMoveWithRotationOnGroundCallFunc=tt,f.startEditingCallFunc=Mn,f.startVoiceCallFunc=Gi,f.stopEditingCallFunc=Wn,f.stopVoiceCallFunc=Hi,f.uePositionToLonLatAltCallFunc=sn,f.unBind3DTilesetByIdCallFunc=Sn,f.unBind3DTilesetByTagCallFunc=En,f.unBindActorByIDCallFunc=wn,f.unBindActorByTagCallFunc=yn,f.unBindImageryByIdCallFunc=Tn,f.unBindImageryByTagCallFunc=In,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
21
+ `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[c]=p.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&p.copyright.print()}catch{}p.ESUeViewer=M,p.GeoDivFromESImageLabel=Nn,p.GeoDivFromESTextLabel=xn,p.HighlightFeatureAndFlyToCallFunc=Ji,p.HighlightFeatureCallFunc=Hi,p.SetLayerColorCallFunc=Xi,p.SetLayerVisibleCallFunc=Ki,p.UeCloudViewerBase=te,p.UeES3DTileset=ht,p.UeESAlarm=St,p.UeESApertureEffect=Ft,p.UeESAreaMeasurement=It,p.UeESBlastParticleSystem=Tt,p.UeESBoxClipping=Rt,p.UeESCameraView=Dt,p.UeESCameraVisibleRange=Lt,p.UeESCar=Pt,p.UeESClassification=Bt,p.UeESClippingPlane=Ut,p.UeESDataMesh=At,p.UeESDatasmithRuntimeModel=Mt,p.UeESDirectionMeasurement=Wt,p.UeESDistanceMeasurement=$t,p.UeESDynamicWater=_t,p.UeESEntityCluster=bt,p.UeESExcavate=xt,p.UeESFireParticleSystem=Nt,p.UeESForestTileset=zt,p.UeESGaussianSplatting=Li,p.UeESGeoDiv=Gt,p.UeESGeoExtrudedPolygon=Ui,p.UeESGeoJson=Ht,p.UeESGeoLineString=gt,p.UeESGeoPolygon=P,p.UeESGeoRectangle=Jt,p.UeESGeoVector=D,p.UeESGeoWater=Kt,p.UeESGltfModel=Xt,p.UeESHeightMeasurement=qt,p.UeESHuman=Zt,p.UeESHumanPoi=Ii,p.UeESImageLabel=Vt,p.UeESImageryLayer=Ct,p.UeESLabel=U,p.UeESLevelRuntimeModel=Yt,p.UeESLocalCircle=Qt,p.UeESLocalPolygon=vt,p.UeESLocalPolygonZ=kt,p.UeESLocalRectangle=Ot,p.UeESLocalSkyBox=jt,p.UeESLocalVector=mt,p.UeESLocalVector2D=ut,p.UeESLocationMeasurement=ei,p.UeESMsTileset=Bi,p.UeESNavigator=Ti,p.UeESObjectWithLocation=S,p.UeESPath=Ri,p.UeESPipeFence=ti,p.UeESPipeline=ii,p.UeESPipeserTileset=ni,p.UeESPit=ri,p.UeESPoi2D=oi,p.UeESPoi3D=si,p.UeESPoiTileset=ai,p.UeESPolygonFence=li,p.UeESPolygonFlattenedPlane=di,p.UeESPolygonWithHole=ci,p.UeESRtsFeatureEditing=Pi,p.UeESRtsTileset=ui,p.UeESSceneObject=$,p.UeESSeparateFoliage=hi,p.UeESSkylineAnalysis=Mi,p.UeESStaticMesh=Ai,p.UeESSubmergingAnalysis=vi,p.UeESSunshineAnalysis=gi,p.UeESSurfaceAreaMeasurement=pi,p.UeESTerrainLayer=Et,p.UeESTextLabel=fi,p.UeESUEWidget=wi,p.UeESUnrealActor=yi,p.UeESVideoFusion=mi,p.UeESViewShed=Ci,p.UeESViewerStatusBar=Di,p.UeESVisibilityAnalysis=Ei,p.UeESVisualObject=L,p.UeESVolumeMeasurement=Si,p.UeESWidget=Fi,p.bind3DTilesetByTagCallFunc=mn,p.bindActorByTagCallFunc=gn,p.bindImageryByTagCallFunc=Sn,p.calcFlyToParamCallFunc=W,p.callFunctionCallFunc=yt,p.captureCallFunc=tn,p.changeNavigationModeCallFunc=A,p.createActorByClassCallFunc=yn,p.destroyCallFunc=ft,p.flyInCallFunc=Q,p.flyInDefaultCameraCallFunc=bi,p.flyToCallFunc=H,p.generateMemReportCallFunc=Gi,p.getAllSocketNamesByActorTagCallFunc=sn,p.getBoundSphereCallFunc=ln,p.getBoundSphereWithChildrenCallFunc=dn,p.getCameraRelativeHeightCallFunc=Rn,p.getFillMaterialParamInfoCallFunc=un,p.getGlobalPropertyCallFunc=hn,p.getHeightByLonLatCallFunc=ji,p.getHeightByLonLatsCallFunc=en,p.getIdByComponentNameAndHitItemCallFunc=Tn,p.getLonLatAltToScreenPositionCallFunc=rn,p.getObjectByInfoCallFunc=vn,p.getStatusCallFunc=Bn,p.getStrokeMaterialParamInfoCallFunc=cn,p.getTilesetMaterialIDListCallFunc=Wn,p.getVersionCallFunc=an,p.highlightActorByTagCallFunc=Ln,p.mountPakFiles=zi,p.moveObjectsCallFunc=Mn,p.partialCaptureCallFunc=nn,p.pickCallFunc=ki,p.pickPositionCallFunc=Oi,p.quitCallFunc=Qi,p.refreshTilesetCallFunc=_i,p.resetWithCurrentCameraCallFunc=wt,p.restoreOriginalSceneCallFunc=pn,p.saveStringToFileCallFunc=Dn,p.sendCustomMessageCallFunc=Pn,p.setGlobalPropertyCallFunc=Yi,p.setNodePositionCallFunc=qi,p.setNodeRotationCallFunc=Zi,p.setNodeScaleCallFunc=Vi,p.smoothMoveCallFunc=ee,p.smoothMoveOnGroundCallFunc=O,p.smoothMoveWithRotationCallFunc=k,p.smoothMoveWithRotationOnGroundCallFunc=j,p.startEditingCallFunc=Un,p.startVoiceCallFunc=xi,p.stopEditingCallFunc=An,p.stopVoiceCallFunc=Ni,p.uePositionToLonLatAltCallFunc=on,p.unBind3DTilesetByIdCallFunc=En,p.unBind3DTilesetByTagCallFunc=Cn,p.unBindActorByIDCallFunc=fn,p.unBindActorByTagCallFunc=wn,p.unBindImageryByIdCallFunc=In,p.unBindImageryByTagCallFunc=Fn,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));