earthsdk3-ue 3.4.0-beta.4 → 3.4.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/earthsdk3-ue.iife.js +3 -3
- package/dist/earthsdk3-ue.js +13 -7
- package/dist/earthsdk3-ue.umd.cjs +2 -2
- package/dist/types/ESUeViewer/ESUeViewer.d.ts +6 -0
- package/dist/types/ESUeViewer/ESUeViewer.d.ts.map +1 -1
- package/dist/types/ESUeViewer/inner/ReactProps.d.ts +4 -0
- package/dist/types/ESUeViewer/inner/ReactProps.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(f,c){typeof exports=="object"&&typeof module<"u"?c(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"],c):(f=typeof globalThis<"u"?globalThis:f||self,c(f.EarthSDK3_UE={},f.EarthSDK3,f.xbsj_base,f.libPixelstreamingfrontendUe5_2,f.html2canvas))})(this,function(f,c,l,L,Xn){"use strict";var Fr=Object.defineProperty;var Ir=(f,c,l)=>c in f?Fr(f,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[c]=l;var w=(f,c,l)=>Ir(f,typeof c!="symbol"?c+"":c,l);const qn={...c.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??""},Ni=()=>({...c.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});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},Yi=(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)})},Qi=(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)})},Vi=(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=c.ESSceneObject.getSceneObject(e.objectId);e.objectId=i?i.mainClass.id:e.objectId}else if(e.mode=="Line"){const i=c.ESSceneObject.getSceneObject(e.geoLineStringId);e.geoLineStringId=i?i.mainClass.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?c.ESSceneObject.getSceneObject(r):void 0;return s&&s.parentID&&(s=c.ESSceneObject.getSceneObject(s.parentID)),o=new c.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 c.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},Mn=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},An=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 Yn 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 v=o[s/4];s+=4;for(let a=0;a<v;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 Qn=-1;L.Logger.SetLoggerVerbosity(1);class Vn 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 v=s.webRtcController.sendMessageController.dataChannelSender.sendData;s.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(a){s.esMsgWsWrapper?s.esMsgWsWrapper.sendInputData(a):v.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 Yn(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=++Qn;if(this.esMsgWsWrapper){if(o<r){this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-0/1-`+n);return}const v=Math.ceil(o/r)|0;[...new Array(v).keys()].map(m=>n.slice(m*r,(m+1)*r)).forEach((m,p)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-${p}/${v}-`+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 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(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 g=()=>s.debug=o.debug??!1;g(),this.d(o.debugChanged.don(g))}let v=!1;{const g=()=>{if(v)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(),v=!0}};this.d(this.videoinitedChanged.don(()=>{g()})),this.d(this.webRtcConnectedChanged.don(()=>{g()})),this.d(this.esmsgwsopenChanged.don(()=>{g()}))}this.d(s.event.don((g,h)=>{if(g==="error")this._errorEvent.emit(h);else if(g==="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 g==="webRtcConnected"?this.webRtcConnected=!0:g==="videoinited"?this.videoinited=!0:g==="esmsgwsopen"&&(this.esmsgwsopen=!0)}));{const g=this.dv(l.createAnimateFrame());let h,y;g.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(g=>{for(const h of g){const y=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);y&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),y.resultCallback(h.r))}}));let a=0;const m=g=>{const h={n:a++,tt:Date.now(),t:"c",fs:g};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(!v||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=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=g.map(R=>({f:R,s:JSON.stringify(R).length}));let C=y.length,E=0,T=0,F=[];do{do{const{f:R,s:I}=y[E];if(F.push(R),++E,T+I>h||F.length>=20)break}while(E<C);F.length>0&&(o.debug&&console.log(`传送${F.length}条消息...`),m([...F]),F.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 v=s.coordinateConverter.normalizeAndQuantizeUnsigned(o.offsetX,o.offsetY),m=s.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");m&&m([o.button,v.x,v.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 v=Math.ceil(o/r)|0;[...new Array(v).keys()].map(m=>n.slice(m*r,(m+1)*r)).forEach((m,p)=>{const d={type:"earthsdk",time:new Date().getTime(),params:`${s}-${p}/${v}-`+m};this.sendData(JSON.stringify(d))})}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 d=()=>s.debug=o.debug??!1;d(),this.d(o.debugChanged.don(d))}{let d=!1;const g=this.dv(l.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(g.don(()=>{if(d)return;const h=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&h){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),d=!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),d=!1}))}this.d(s.event.don((d,g)=>{if(d==="errorEvent")this._errorEvent.emit(g);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 h=JSON.parse(g);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 d=this.dv(l.createAnimateFrame());let g,h,y;d.start(()=>{if(g!==t.offsetWidth||h!==t.offsetHeight||y!==o.resolutionScale){if(g=t.offsetWidth,h=t.offsetHeight,g===void 0||h===void 0||!Number.isFinite(g)||!Number.isFinite(h)||g<0||h<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${g} ${h}`);return}y=o.resolutionScale,s.resize(g/y,h/y)}})}this.d(this._ueFuncResultWithIdsEvent.don(d=>{for(const g of d){const h=this._waitingUeFuncIdAndResultCallbacks.get(g.fid);h&&(this._waitingUeFuncIdAndResultCallbacks.delete(g.fid),h.resultCallback(g.r))}}));let v=0;const a=d=>{const g={n:v++,tt:Date.now(),t:"c",fs:d};this._waitingUeCalls.add(g),o.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()),this._ue5ViewerWrapper.emitUIInteractionForBigData(g,()=>{this._waitingUeCalls.delete(g)})},m=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=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=g.map(R=>({f:R,s:JSON.stringify(R).length}));let C=y.length,E=0,T=0,F=[];do{do{const{f:R,s:I}=y[E];if(F.push(R),++E,T+I>h||F.length>=20)break}while(E<C);F.length>0&&(o.debug&&console.log(`传送${F.length}条消息...`),a([...F]),F.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 v=c.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);s.src=v,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 v=u[e++]&63;if((o&240)==224?o=(o&15)<<12|s<<6|v:((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|v<<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 v=fe(t);t.setGlobalProperty(v)};n();const r=ce(),o=[];r.forEach(v=>{const a=t[v+"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 c.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 v;return((v=c.ESSceneObject.getSceneObjById(s))==null?void 0:v.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 v=!1,a=null;this.d(s.onRuntimeInitialized.don(()=>{var g;if(v=!0,(g=s==null?void 0:s.vIframe)!=null&&g.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(g=>{for(const h of g){const y=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);y&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),y(h.r))}}));let m=0;const p=()=>{if(!v||!a||!a.UE_JSHTML5Communication||!a.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=this._ueFuncWithIdAndResultCallbacks.map(([I])=>I),h={n:m++,tt:Date.now(),t:"c",fs:g,callid:l.createGuid()};for(const[I,M]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(I.fid,M);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 F=Math.ceil(E/C)|0;[...new Array(F).keys()].map(I=>y.slice(I*C,(I+1)*C)).forEach((I,M)=>{const $i=`${T}-${M}/${F}-`+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 d=JSON.parse(p);if(d.t==="cr"){const g=d;if(g.frs&&this._ueFuncResultWithIdsEvent.emit(g.frs),g.ers)for(let h of g.ers)this._ueEvent.emit(h)}}catch(d){console.error(d)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(m=>{for(const p of m){const d=this._waitingUeFuncIdAndResultCallbacks.get(p.fid);d&&(this._waitingUeFuncIdAndResultCallbacks.delete(p.fid),d(p.r))}}));let s=0;const v=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const m=this._ueFuncWithIdAndResultCallbacks.map(([g])=>g),p={n:s++,tt:Date.now(),t:"c",fs:m};for(const[g,h]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(g.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 d=++cr;window.ue.es.oncommand(`${d}-0/1-`+JSON.stringify(p)).then(()=>{this._waitingUeCalls.delete(p)})};this.dv(l.createInterval()).start(v,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 v=e[s+"Changed"];r.push(v)});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=c.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 v=this.dv(l.createNextAnimateFrameEvent(...s));this.d(v.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)},v=a=>{r(a,!1)};n.addEventListener("mouseenter",o),n.addEventListener("mouseleave",s),n.addEventListener("mousemove",v),this.d(()=>{n.removeEventListener("mouseenter",o),n.removeEventListener("mouseleave",s),n.removeEventListener("mousemove",v)})}t.useCustomInteraction=!1,this.dv(new c.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",v=>{t.statusUpdateEvent.emit(v)})),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(v=>{var a;return((a=c.ESSceneObject.getSceneObjById(v))==null?void 0:a.parentID)??v}),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,d)=>p.hasOwnProperty(d);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 d=this.dv(l.createProcessingFromAsyncFunc(async g=>{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:M}=i.options;h=R,y=I,C=M??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:R,offsetHeight:I}=p;let{uri:M,app:$i,token:Bn}=i.options;M.endsWith("/")||(M+="/");const wr=Bn?`?essstoken=${Bn}`:"",Kn=`/${$i}/${R??1920}/${I??1080}`+wr;console.log(`请求信令服务器: ${M}instance${Kn}`);const yr=await g.promise(fetch(`${M}instance${Kn}`,{method:"GET"})),b=await g.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 g.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:F}=p;E.resize(T*window.devicePixelRatio,F*window.devicePixelRatio),n.viewer=E,this.d(()=>n.viewer=void 0),this.dv(new hr(n,E))}));d.start(),this.d(this._reconnectEvent.don(g=>{s===void 0&&(g&&!g.isDestroyed()&&g.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(()=>{d.restart()},o)))})),this.d(d.errorEvent.don(g=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",g),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const p=i,d=p.options.project,g=p.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const h=this.dv(new dr(t,d,g,n));n.viewer=h,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const z=class z extends c.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 Mn(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:v,y:a}=this.container.getBoundingClientRect();r=[v+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=c.getGeoBoundingSphereFromPositions(r);if(!o)return;const{center:s,radius:v}=o,a={distance:i??v,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 v={mode:"Line",geoLineStringId:t,speed:i,heightOffset:n,loop:r,turnRateDPS:o,lineMode:s},a=await W(this.viewer,v);return a&&!a.error&&(this._navigationMode.value=v.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},v=await W(this.viewer,s);return v&&!v.error&&(this._navigationMode.value=s.mode),v}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},v=await W(this.viewer,s);return v&&!v.error&&(this._navigationMode.value=s.mode),v}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.mainClass;if(!r||!this.viewer||i==null)return;const o=Array.isArray(i)?[...i]:[i];return r.editingID=`${n.callSource}_${l.createGuid()}`,await An(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 s=t[r].mainClass;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=()=>({...c.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 c.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(i&&(e.mainClass.typeName===e.typeName&&this.d(this.createdEvent.don(()=>{const n=this.constructor.propValFuncs,r=e.defaultProps,o=Object.keys(r).filter(d=>n[d]!==null);o.push(...this.constructor.forceUeUpdateProps);const s=e.constructor.defaults,v={val:{}},a=[];for(let d of o){const g=d+"Changed",h=e[g];a.push(h);const y=n[d];if(y===null)throw console.error("vf === null error"),new Error("vf === null error");const C=()=>{const E=e[d]??s[d];let T=y?y(E,this,t,e):E;if(T===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${d} 对象名:${e.name} 对象id: ${e.id}`);return}v.val[d]=T};C(),this.d(h.don(C))}const m=()=>{i.callUeFunc({f:"update",p:{id:e.id,...v.val}}),v.val={}},p=this.dv(l.createNextAnimateFrameEvent(...a));this.d(p.don(m)),this.d(e.createdEvent.don(m)),this.d(e.flushEvent.don(()=>p.flush()))})),e.mainClass.typeName===e.typeName)){let n=!1;this.d(()=>{n&&we(i,e.id)}),i.callUeFunc({f:"create",p:{type:e.typeName,id:e.id}}).then(()=>{n=!0,e.createdEvent.emit()}).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 S 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((v,a)=>{et(i,e.id,v,a)})),this.d(e.smoothMoveWithRotationEvent.don((v,a,m)=>{O(i,e.id,v,a,m)})),this.d(e.smoothMoveOnGroundEvent.don((v,a,m,p)=>{j(i,e.id,v,a,p,m)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((v,a,m,p,d)=>{tt(i,e.id,v,a,m,p,d)})),this.d(e.smoothMoveKeepPitchEvent.don(async(v,a)=>{const m=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:e.id,Destination:v,Time:a}});m.error&&console.error("SmoothMoveKeepPitch:",m.error)})),this.d(e.automaticLandingEvent.don(v=>{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=v)})}));const o=async(v,a,m,p)=>{const{viewer:d}=v;if(!d){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const g=await d.callUeFunc({f:"SmoothMoveRelatively",p:{id:a,RelativePosition:m,Time:p}});return g.error&&console.error("SmoothMoveRelatively:",g.error),g};this.d(e.smoothMoveRelativelyEvent.don((v,a)=>{o(t,e.id,v,a)}));const s=async(v,a,m,p,d)=>{const{viewer:g}=v;if(!g){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const h=await g.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:a,RelativePosition:m,NewRotation:p,Time:d}});return h.error&&console.error("SmoothMoveRelativelyWithRotation:",h.error),h};this.d(e.smoothMoveRelativelyWithRotationEvent.don((v,a,m)=>{s(t,e.id,v,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 A extends S{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 S{constructor(e,t){super(e,t),t.viewer}}w(Ce,"propValFuncs",{...S.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 c.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??c.defaultFlyToParam,flyInParam:t.flyInParam??c.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}})},v=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(v.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)),d=()=>{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};d(),this.d(p.don(d))}const m=async()=>{const{id:p}=t;if(r!==void 0){r=void 0;try{const d=await i.unBind3DTilesetById(p);if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d}`);return}}if(o!==void 0){o=void 0;try{const d=await n.callUeFunc({f:"destroy",p:{id:p}});if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset Destroy: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset Destroy: ${d}`);return}}};this.d(()=>{m()});{const p=this.dv(l.createProcessingFromAsyncFunc(async g=>{if(a.value===void 0){await g.promise(m());return}if(a.value.type==="ActorTag"){const{actorTag:h}=a.value;if(r!==h&&await g.promise(m()),r!==void 0||h===void 0)return;try{r=h;const y=await g.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 g.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 g.promise(s())})),d=async()=>{p.restart()};d(),this.d(a.changed.don(d))}this.d(t.refreshTilesetEvent.don(()=>{zi(n,t.id)})),this.d(t.flyToEvent.don(async(p,d)=>{if(!r&&!o)return;const g=await K(n,t.id,p);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),t.flyOverEvent.emit(d,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:d,rotation:g}=p;t.flyInParam={position:d,rotation:g,flyDuration:1}})),this.d(i.propChanged.don(p=>{!r&&!o||p.objId===t.id&&Object.keys(p.props).forEach(d=>{const g=p.props[d]===null?void 0:p.props[d];t[d]=g})})),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}},d=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}},g=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],d(y,E)})),this.d(t.resetFeatureStyleEvent.don(()=>{g(),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 d=await n.callUeFunc({f:"GetFeatureTable",p:{id:t.id}});d.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${d.error}`),t._featureTableResultEvent.emit(d.re.table)}catch(d){console.warn(`UeES3DTileset GetFeatureTable: ${d}`),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 d=await n.callUeFunc({f:"GetMaterialNameList",p:{id:t.id}});d.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${d.error}`),t.getMaterialNameListEvent.emit(d.re.materialNameList)}catch(d){console.warn(`UeES3DTileset GetMaterialNameList: ${d}`),t.getMaterialNameListEvent.emit(void 0)}};this.ad(t.getMaterialNameListEvent.don(d=>{d=="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",c.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 c.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=c.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=c.ESSceneObject.context.getStrFromEnv(d.url),s.value=d}};p(),this.ad(e.urlChanged.don(p))}const v=async()=>{if(!n&&!r)return;let p=e.targetID??c.ESImageryLayer.defaults.targetID;if(p&&p!=""){const d=c.ESSceneObject.getSceneObject(p);p=d?d.mainClass.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??c.defaultFlyToParam,flyInParam:e.flyInParam??c.defaultFlyInParam,url:s.value??"",zIndex:e.zIndex??0,maximumLevel:e.maximumLevel??c.ESImageryLayer.defaults.maximumLevel,minimumLevel:e.minimumLevel??c.ESImageryLayer.defaults.minimumLevel,options:e.options??c.ESImageryLayer.defaults.options,targetID:p,opacity:e.opacity??c.ESImageryLayer.defaults.opacity,splitDirection:e.splitDirection??c.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(v));const m=async()=>{const{id:p}=e;if(n!==void 0){n=void 0;try{const d=await t.unBindImageryById(p);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:p,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(()=>{m()});{const p=this.dv(l.createProcessingFromAsyncFunc(async g=>{if(o.value===void 0){await g.promise(m());return}if(o.value.type==="ActorTag"){const{actorTag:h,componentTag:y}=o.value;if(n!==h&&await g.promise(m()),n!==void 0||h===void 0)return;try{n=h;const C=await g.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 g.promise(m()),r!==void 0||h===void 0)return;try{r=h;const y=await g.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 g.promise(v())})),d=async()=>{p.restart()};d(),this.d(o.changed.don(d))}{const p=this.dv(l.createNextAnimateFrameEvent(e.actorTagChanged,s.changed,e.componentTagChanged)),d=()=>{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};d(),this.d(p.don(d))}this.d(e.flyToEvent.don(async(p,d)=>{if(!n&&!r)return;const g=await K(i,e.id,p);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),e.flyOverEvent.emit(d,h,t)})),this.d(e.flyInEvent.don(async(p,d)=>{var y,C;if(!n&&!r)return;const g=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";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),e.flyOverEvent.emit(d,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:d,rotation:g}=p;e.flyInParam={position:d,rotation:g,flyDuration:1}})),this.d(t.propChanged.don(p=>{!n&&!r||p.objId===e.id&&Object.keys(p.props).forEach(d=>{const g=p.props[d]===null?void 0:p.props[d];e[d]=g})}))}};w(rt,"type",rt.register("ESUeViewer",c.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",c.ESTerrainLayer.type,k)),w(k,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),w(k,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(e):(e.url=c.ESSceneObject.context.getStrFromEnv(e.url),e),czmMaxzoom:null,czmMinzoom:null});let Se=k;const ot=class ot extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ot,"type",ot.register("ESUeViewer",c.ESAlarm.type,ot));let Fe=ot;const st=class st extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(st,"type",st.register("ESUeViewer",c.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",c.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=c.ESAreaMeasurement.defaults.fillStyle;try{o={...e.fillStyle??c.ESAreaMeasurement.defaults.fillStyle}}catch(s){console.error("ESAreaMeasurement fillStyle 属性类型错误!",s),o={...c.ESAreaMeasurement.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,stroked:e.stroked??c.ESAreaMeasurement.defaults.stroked,fillStyle:o,filled:e.filled??c.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",c.ESAreaMeasurement.type,lt));let Te=lt;const dt=class dt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(dt,"type",dt.register("ESUeViewer",c.ESBlastParticleSystem.type,dt));let Re=dt;const X=class X extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};w(X,"type",X.register("ESUeViewer",c.ESBoxClipping.type,X)),w(X,"propValFuncs",{...S.propValFuncs,targetID:e=>{if(!e)return"";const t=c.ESSceneObject.getSceneObject(e);return t?t.mainClass.id:e}});let De=X;const ct=class ct extends S{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:v,position:a,rotation:m}=e;x(i,s,a,m,v??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",c.ESCameraView.type,ct));let Le=ct;const ut=class ut extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ut,"type",ut.register("ESUeViewer",c.ESCameraVisibleRange.type,ut));let Pe=ut;const ht=class ht extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ht,"type",ht.register("ESUeViewer",c.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=c.ESClassification.defaults.fillStyle;try{o={...e.fillStyle??c.ESClassification.defaults.fillStyle}}catch(s){console.error("ESClassification fillStyle 属性类型错误!",s),o={...c.ESClassification.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,filled:e.filled??c.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",c.ESClassification.type,vt));let Me=vt;const q=class q extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};w(q,"type",q.register("ESUeViewer",c.ESClippingPlane.type,q)),w(q,"propValFuncs",{...S.propValFuncs,targetID:e=>{if(!e)return"";const t=c.ESSceneObject.getSceneObject(e);return t?t.mainClass.id:e}});let Ae=q;const gt=class gt extends S{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=c.ESSceneObject.context.getStrFromEnv(e.url??c.ESDataMesh.defaults.url);else{const v=e.url;v.url=c.ESSceneObject.context.getStrFromEnv(v.url??c.ESDataMesh.defaults.url),n.value=v}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{const s=e.colorStops??c.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:e.id,url:n.value??c.ESDataMesh.defaults.url,currentTime:e.currentTime??c.ESDataMesh.defaults.currentTime,minPropValue:e.minPropValue??c.ESDataMesh.defaults.minPropValue,maxPropValue:e.maxPropValue??c.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",c.ESDataMesh.type,gt));let We=gt;const pt=class pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(pt,"type",pt.register("ESUeViewer",c.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",c.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??c.ESDistanceMeasurement.defaults.strokeStyle}}catch(s){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",s),o={...c.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",c.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",c.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",c.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",c.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",c.ESExcavate.type,Z)),w(Z,"propValFuncs",{...U.propValFuncs,targetID:e=>{if(!e)return"";const t=c.ESSceneObject.getSceneObject(e);return t?t.mainClass.id:e}});let Ge=Z;const Et=class Et extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Et,"type",Et.register("ESUeViewer",c.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=c.ESSceneObject.context.getStrFromEnv(e.url);else{const v=e.url;v.url=c.ESSceneObject.context.getStrFromEnv(v.url),n.value=v}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{i.callUeFunc({f:"update",p:{id:e.id,url:n.value??c.ESForestTileset.defaults.url,treeTypes:e.treeTypes??c.ESForestTileset.defaults.treeTypes,xiaoBanWidget:e.xiaoBanWidget??c.ESForestTileset.defaults.xiaoBanWidget,youShiSZ:e.youShiSZ??c.ESForestTileset.defaults.youShiSZ,diLei:e.diLei??c.ESForestTileset.defaults.diLei,senLinLB:e.senLinLB??c.ESForestTileset.defaults.senLinLB,labelMaterial:e.labelMaterial??c.ESForestTileset.defaults.labelMaterial,heightOffset:e.heightOffset??c.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",c.ESForestTileset.type,St));let Je=St;const Ft=class Ft extends c.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",c.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 c.ESTextLabel);r.parentID=t.id,t.mainClass=r,i.add(r),this.dispose(()=>i.delete(r)),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 v=await i.getCurrentCameraInfo();if(!v)return;const{position:a,rotation:m}=v;t.flyInParam={position:a,rotation:m,flyDuration:1}})),this.dispose(t.smoothMoveEvent.disposableOn((v,a)=>{et(n,r.id,v,a)})),this.dispose(t.smoothMoveWithRotationEvent.disposableOn((v,a,m)=>{O(n,r.id,v,a,m)})),this.dispose(t.smoothMoveOnGroundEvent.disposableOn((v,a,m,p)=>{j(n,r.id,v,a,p,m)})),this.dispose(t.smoothMoveWithRotationOnGroundEvent.disposableOn((v,a,m,p,d)=>{tt(n,r.id,v,a,m,p,d)})),this.dispose(t.flyToEvent.disposableOn((v,a)=>{r.flyTo(v)})),this.dispose(t.flyInEvent.don(v=>{r.flyIn(v)}));const o=this._screenPosition,s=this.disposeVar(new c.ESCustomDiv);s.parentID=t.id,i.add(s),this.dispose(()=>i.delete(s)),this.dispose(l.bind([s,"allowPicking"],[t,"allowPicking"]));{const v=this.disposeVar(l.createAnimateFrame()),a=()=>{t.show?v.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,d]=m;p===-1&&d===-1?this._screenPosition.value=void 0:this._screenPosition.value=[p,d]}}):v.cancel()};a(),this.dispose(t.showChanged.disposableOn(a))}{const v=()=>class extends l.Destroyable{constructor(d,g,h){if(super(),this._subContainer=d,!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 c.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 F=t.show;o.value&&F?(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,F]=t.anchor??c.ESGeoDiv.defaults.anchor;y.originRatioX=T,y.originRatioY=F};E(),this.dispose(t.anchorChanged.disposableOn(E))}{const E=()=>{y.opacity=t.opacity??c.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=v():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 c.ESImageLabel),this._imageLabel.isHoverZoom=!1,this._imageLabel.parentID=t.id;const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}t.mainClass=this._imageLabel;const r=this._imageLabel;i.add(r),this.d(()=>i.delete(r));{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()??c.ESGeoDiv.defaults.opacity,m.style.position="fixed",m.style.zIndex="-1",m.style.top="0px",!document.body.contains(m)){document.body.appendChild(m);let d=m?m.querySelectorAll("*[class]"):[];for(let g=0;g<d.length;g++){const h=d[g];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(d=>{document.body.contains(m)&&document.body.removeChild(m),r.url=d.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 v=this.dv(l.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(v.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:v}=o;if(s==="leftClick"&&v){const a=(v==null?void 0:v.classNames)??[],m=Object.keys(this._hasClassDivAndPos);for(let p=0;p<m.length;p++){const d=m[p];let g=this._hasClassDivAndPos[d];v&&v.mouseRelativePos&&v.mouseRelativePos[0]>=g[0]&&v.mouseRelativePos[0]<=g[2]&&v.mouseRelativePos[1]>=g[1]&&v.mouseRelativePos[1]<=g[3]&&a.push(d)}v.classNames=a}t.widgetEvent.emit({type:s,add:v})})),this.d(t.calcFlyToParamEvent.don(()=>{$(n,r.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const o=i.getCurrentCameraInfo();if(!o)return;const{position:s,rotation:v}=o;t.flyInParam={position:s,rotation:v,flyDuration:1}})),this.d(t.smoothMoveEvent.don((o,s)=>{et(n,r.id,o,s)})),this.d(t.smoothMoveWithRotationEvent.don((o,s,v)=>{O(n,r.id,o,s,v)})),this.d(t.smoothMoveOnGroundEvent.don((o,s,v,a)=>{j(n,r.id,o,s,a,v)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((o,s,v,a,m)=>{tt(n,r.id,o,s,v,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",c.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",c.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",c.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",c.ESGeoWater.type,Dt));let qe=Dt;const G=class G extends S{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)=>{Yi(i,e.id,n,r)})),this.d(e.setNodeRotationEvent.don((n,r)=>{Qi(i,e.id,n,r)})),this.d(e.setNodeScaleEvent.don((n,r)=>{Vi(i,e.id,n,r)}))}};w(G,"forceUeUpdateProps",[...S.forceUeUpdateProps,"url"]),w(G,"propValFuncs",{...S.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(c.rpToap(e)):(e.url=c.ESSceneObject.context.getStrFromEnv(c.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),w(G,"type",G.register("ESUeViewer",c.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",c.ESHeightMeasurement.type,Lt));let Ye=Lt;const Pt=class Pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=async(o,s,v,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:v,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:v}=o;if(!v){console.error("StopAIMove: ueViewer.viewer is undefined");return}const a=await v.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",c.ESHuman.type,Pt));let Qe=Pt;const H=class H extends A{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",c.ESImageLabel.type,H)),w(H,"forceUeUpdateProps",[...A.forceUeUpdateProps,"url"]),w(H,"propValFuncs",{...A.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(c.rpToap(e)):(e.url=c.ESSceneObject.context.getStrFromEnv(c.rpToap(e.url)),e)});let Ve=H;const Ut=class Ut extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Ut,"type",Ut.register("ESUeViewer",c.ESLevelRuntimeModel.type,Ut));let be=Ut;const Mt=class Mt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Mt,"type",Mt.register("ESUeViewer",c.ESLocalCircle.type,Mt));let xe=Mt;const At=class At extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(At,"type",At.register("ESUeViewer",c.ESLocalPolygonZ.type,At));let Oe=At;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",c.ESLocalRectangle.type,Wt));let je=Wt;const _t=class _t extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(_t,"type",_t.register("ESUeViewer",c.ESLocalSkyBox.type,_t));let ti=_t;const $t=class $t extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w($t,"type",$t.register("ESUeViewer",c.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",c.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",c.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 v=typeof n=="number"?n.toString():n;Xi(i,e.id,v,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",c.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",c.ESPit.type,Gt));let oi=Gt;const Ht=class Ht extends A{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",c.ESPoi2D.type,Ht));let si=Ht;const Jt=class Jt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Jt,"type",Jt.register("ESUeViewer",c.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",c.ESPoiTileset.type,J)),w(J,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),w(J,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(e):(e.url=c.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",c.ESPolygonFence.type,Bt));let di=Bt;const Y=class Y extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Y,"type",Y.register("ESUeViewer",c.ESPolygonFlattenedPlane.type,Y)),w(Y,"propValFuncs",{...U.propValFuncs,targetID:e=>{if(!e)return"";const t=c.ESSceneObject.getSceneObject(e);return t?t.mainClass.id:e}});let ci=Y;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",c.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 v=[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);v=[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);v=[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]),d=parseInt(a[3]),g=parseFloat(a[4]);v=[m,p,d,g]}}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]),d=parseInt(a[3]);v=[m,p,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 s=e.layerConfig;if(!s)return;const v=[];s.forEach(a=>{s.filter(p=>p.dataset==a.dataset).length==1?v.push({condition:[{field:"dataset",op:"==",value:a.dataset}],color:n(a.value.color??"rgb(255,255,255)"),show:a.value.visible}):v.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(v)};r();const o=this.dv(l.createNextAnimateFrameEvent(e.layerConfigChanged,e.colorBlendModeChanged));this.d(o.don(()=>{r()}))}}};w(Xt,"type",Xt.register("ESUeViewer",c.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=>{c.addTreesCallFunc(t,e.id,n)})),this.d(e.removeAllTreesEvent.don(()=>{c.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(n=>{c.updateTreeParamsCallFunc(t,e.id,n)})),this.d(e.cutDownTreesEvent.don((n,r)=>{c.cutDownTreesCallFunc(t,e.id,n,r)})),this.d(e.growthSimulationEvent.don((n,r,o)=>{c.growthSimulationCallFunc(t,e.id,n,r,o)}))}};w(qt,"type",qt.register("ESUeViewer",c.ESSeparateFoliage.type,qt));let vi=qt;const Zt=class Zt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Zt,"type",Zt.register("ESUeViewer",c.ESSubmergingAnalysis.type,Zt));let gi=Zt;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}})})),this.d(e.stopEvent.don(()=>{i.callUeFunc({f:"Stop",p:{id:e.id}})}))}};w(Yt,"type",Yt.register("ESUeViewer",c.ESSunshineAnalysis.type,Yt));let pi=Yt;const Qt=class Qt 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(Qt,"type",Qt.register("ESUeViewer",c.ESSurfaceAreaMeasurement.type,Qt));let fi=Qt;const Vt=class Vt extends A{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Vt,"type",Vt.register("ESUeViewer",c.ESTextLabel.type,Vt));let wi=Vt;const Q=class Q extends A{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(Q,"type",Q.register("ESUeViewer",c.ESUEWidget.type,Q)),w(Q,"propValFuncs",{...A.propValFuncs,info:e=>JSON.stringify(e??{})});let yi=Q;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 c.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??c.defaultFlyToParam,flyInParam:e.flyInParam??c.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 v=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:d}=e,g=await t.unBindActorByID(d);g&&g.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${g.error}`),o=void 0;const h=await i.callUeFunc({f:"destroy",p:{id:d}});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 d=this.dv(l.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),g=async()=>{e.actorTag!==""?p.value={type:"ActorTag",actorTag:e.actorTag}:p.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};g(),this.d(d.don(g)),this.d(e.flushEvent.don(()=>d.flush()))}{const d=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(v())})),g=async()=>{d.restart()};g(),this.d(p.changed.don(g))}this.d(e.positionChanged.don(v)),this.d(e.callFunctionEvent.don(async(d,g)=>{if(a()){e.__callFunctionResultEvent.emit(void 0);return}const h=await me(i,e.id,d,g);e.__callFunctionResultEvent.emit(h)})),this.d(e.smoothMoveEvent.don((d,g)=>{a()||et(i,e.id,d,g)})),this.d(e.smoothMoveWithRotationEvent.don((d,g,h)=>{a()||O(i,e.id,d,g,h)})),this.d(e.smoothMoveOnGroundEvent.don((d,g,h,y)=>{a()||j(i,e.id,d,g,y,h)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((d,g,h,y,C)=>{a()||tt(i,e.id,d,g,h,y,C)})),this.d(e.automaticLandingEvent.don(d=>{if(a())return;const g=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(h=>{h!==null&&(e.position=[...g,h],e.collision=d)})})),this.d(e.flyToEvent.don(async(d,g)=>{if(a())return;const h=await K(i,e.id,d);let y="over";h===void 0?y="error":h.endType===0?y="over":h.endType===1&&(y="cancelled"),e.flyOverEvent.emit(g,y,t)})),this.d(e.calcFlyToParamEvent.don(()=>{a()||$(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const d=await t.getCurrentCameraInfo();if(!d)return;const{position:g,rotation:h}=d;e.flyInParam={position:g,rotation:h,flyDuration:1}})),this.d(t.propChanged.don(d=>{a()||d.objId===e.id&&Object.keys(d.props).forEach(g=>{const h=d.props[g]===null?void 0:d.props[g];e[g]=h})}))}};w(bt,"type",bt.register("ESUeViewer",c.ESUnrealActor.type,bt));let mi=bt;const xt=class xt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(xt,"type",xt.register("ESUeViewer",c.ESVideoFusion.type,xt));let Ci=xt;const Ot=class Ot extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Ot,"type",Ot.register("ESUeViewer",c.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",c.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",c.ESVolumeMeasurement.type,te));let Fi=te;const V=class V extends A{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(V,"type",V.register("ESUeViewer",c.ESWidget.type,V)),w(V,"propValFuncs",{...A.propValFuncs,info:e=>JSON.stringify(e??{})});let Ii=V;const ee=class ee extends c.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",c.ESHumanPoi.type,ee));let Ti=ee;c.ESSceneObject.context.getStrFromEnv(c.ESNavigator.defaults.imgUrl);const ie=class ie extends c.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new c.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,v){super(),this._subContainer=o;const a=document.createElement("div");this._subContainer.appendChild(a),this.dispose(()=>this._subContainer.removeChild(a));{const d=async()=>{const g=await t.getCurrentCameraInfo(),h=g==null?void 0:g.position,C=[...g==null?void 0:g.rotation];C[0]=360,t.flyIn(h,C)};a.addEventListener("click",d),a.style.cursor="pointer",this.dispose(()=>a.removeEventListener("click",d))}{const d=()=>{a.style.width=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`,a.style.height=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`};d(),e.dispose(e.cssSizeChanged.disposableOn(d))}a.style.position="fixed";{const d=()=>{a.style.top=`${e.cssPosition?e.cssPosition[0]:c.ESNavigator.defaults.cssPosition[0]}px`,a.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESNavigator.defaults.cssPosition[1]}px`};d(),e.dispose(e.cssPositionChanged.disposableOn(d))}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 d=()=>p.src=e.imgUrl;d(),e.dispose(e.imgUrlChanged.disposableOn(d))}{const d=()=>{const C=-t.getCurrentCameraInfo().rotation[0];p.style.transform=`rotate(${C}deg)`};let g;const h=async()=>{d(),e.show?(a.style.display="block",g=setInterval(()=>{d()},1e3)):(a.style.display="none",clearInterval(g))};this.dispose(e.showChanged.disposableOn(h)),h(),this.dispose(()=>clearInterval(g))}p.style.transformOrigin="50% 50%"}}}};w(ie,"type",ie.register("ESUeViewer",c.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)),this.dispose(e.createdEvent.disposableOn(n))}}};w(B,"type",B.register("ESUeViewer",c.ESPath.type,B)),w(B,"forceUeUpdateProps",[...D.forceUeUpdateProps]),w(B,"propValFuncs",{...D.propValFuncs,materialMode:null});let Di=B;async function fr(u){navigator.clipboard.writeText(u).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const ne=class ne extends c.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new c.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),n.instanceClass=class extends l.Destroyable{constructor(o,s,v){if(super(),this._subContainer=o,!v||!(v 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=`${c.ESViewerStatusBar.defaults.height}px`,a.style.left="0",a.style.bottom="0",a.style.color="#fff",a.style.padding="0 20px 0 0",a.style.boxSizing="border-box",a.style.lineHeight=`${c.ESViewerStatusBar.defaults.height}px`,a.style.zIndex="100",a.style.alignContent="center",a.style.justifyContent="space-between";const 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 d=document.createElement("span");m.appendChild(d),d.addEventListener("dblclick",function(){let h=d.innerHTML;h.startsWith("鼠标位置")&&(h=h.slice(5)),fr(h)}),d.style.cursor="pointer",this.dispose(()=>m.removeChild(d));const g=document.createElement("span");a.appendChild(g),this.dispose(()=>a.removeChild(g));{const h=()=>{a.style.height=(e.height??c.ESViewerStatusBar.defaults.height)+"px",a.style.lineHeight=(e.height??c.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(h)),h()}{const h=()=>{a.style.fontSize=(e.fontSize??c.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(${c.ESViewerStatusBar.defaults.bgColor[0]},${c.ESViewerStatusBar.defaults.bgColor[1]},${c.ESViewerStatusBar.defaults.bgColor[2]},${c.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(h)),h()}v.getVersion().then(h=>{h&&(g.innerText=`Ue 版本 : ${h[0]} `)}).catch(h=>{console.log(h)});{const h=()=>{let E="",T="";E+=`帧率:${v.getFPS().toFixed(0)}FPS`,p.innerText=E;const F=t.getCurrentCameraInfo();E+=` 经度: ${F.position[0].toFixed(5)}° 纬度: ${F.position[1].toFixed(5)}° 高度: ${F.position[2].toFixed(2)}米 偏航角: ${F.rotation[0].toFixed(2)}° 俯仰角: ${F.rotation[1].toFixed(2)}° 翻滚角:${F.rotation[2].toFixed(2)}° `,p.innerText=E,t.pick().then(R=>{if(R){const{pickResult:I}=R;if(I&&I.position){const{position:M}=I;T+=`鼠标位置:${M[0].toFixed(5)}° ${M[1].toFixed(5)}° ${M[2].toFixed(2)}m`}else T+="暂时无法获取鼠标位置...";d.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",c.ESViewerStatusBar.type,ne));let Li=ne;const re=class re extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(re,"type",re.register("ESUeViewer",c.ESGaussianSplatting.type,re));let Pi=re;const oe=class oe extends N{constructor(t,i){super(t,i);w(this,"_es3DTileset",this.dv(new c.ES3DTileset));if(!i.viewer){console.warn("viewer is undefined!");return}this.es3DTileset.parentID=t.id,t.mainClass=this._es3DTileset;{const r=this._es3DTileset;i.add(r),this.dispose(()=>i.delete(r)),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",c.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",c.ESMsTileset.type,se));let Mi=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??c.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??c.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??c.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",c.ESGeoExtrudedPolygon.type,ae));let Ai=ae;const le=class le extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(le,"type",le.register("ESUeViewer",c.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",c.ESSkylineAnalysis.type,de));let _i=de;f.copyright=void 0;try{const u="earthsdk3-ue",e="3.4.0-beta.4",t="2025-09-02T06:26:49.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="1c85a7938326029bfd0efde53b240e71da26ae46",s=((Date.now()-1756794409e3)/36e5).toFixed(1),v=`%c🌏 ${u}%c ${e}.${r.slice(0,8)}.${t} (距今${s}个小时)
|
|
1
|
+
(function(f,c){typeof exports=="object"&&typeof module<"u"?c(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"],c):(f=typeof globalThis<"u"?globalThis:f||self,c(f.EarthSDK3_UE={},f.EarthSDK3,f.xbsj_base,f.libPixelstreamingfrontendUe5_2,f.html2canvas))})(this,function(f,c,l,L,Xn){"use strict";var Fr=Object.defineProperty;var Ir=(f,c,l)=>c in f?Fr(f,c,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[c]=l;var w=(f,c,l)=>Ir(f,typeof c!="symbol"?c+"":c,l);const qn={...c.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=()=>({...c.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},Yi=(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)})},Qi=(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)})},Vi=(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=c.ESSceneObject.getSceneObject(e.objectId);e.objectId=i?i.mainClass.id:e.objectId}else if(e.mode=="Line"){const i=c.ESSceneObject.getSceneObject(e.geoLineStringId);e.geoLineStringId=i?i.mainClass.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?c.ESSceneObject.getSceneObject(r):void 0;return s&&s.parentID&&(s=c.ESSceneObject.getSceneObject(s.parentID)),o=new c.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 c.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},Mn=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},An=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 Yn 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 v=o[s/4];s+=4;for(let a=0;a<v;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 Qn=-1;L.Logger.SetLoggerVerbosity(1);class Vn 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 v=s.webRtcController.sendMessageController.dataChannelSender.sendData;s.webRtcController.sendMessageController.dataChannelSender.constructor.prototype.sendData=function(a){s.esMsgWsWrapper?s.esMsgWsWrapper.sendInputData(a):v.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 Yn(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=++Qn;if(this.esMsgWsWrapper){if(o<r){this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-0/1-`+n);return}const v=Math.ceil(o/r)|0;[...new Array(v).keys()].map(m=>n.slice(m*r,(m+1)*r)).forEach((m,p)=>{this.esMsgWsWrapper&&this.esMsgWsWrapper.emitDescriptorWithString(ue.UIInteraction,`${s}-${p}/${v}-`+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 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(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 g=()=>s.debug=o.debug??!1;g(),this.d(o.debugChanged.don(g))}let v=!1;{const g=()=>{if(v)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(),v=!0}};this.d(this.videoinitedChanged.don(()=>{g()})),this.d(this.webRtcConnectedChanged.don(()=>{g()})),this.d(this.esmsgwsopenChanged.don(()=>{g()}))}this.d(s.event.don((g,h)=>{if(g==="error")this._errorEvent.emit(h);else if(g==="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 g==="webRtcConnected"?this.webRtcConnected=!0:g==="videoinited"?this.videoinited=!0:g==="esmsgwsopen"&&(this.esmsgwsopen=!0)}));{const g=this.dv(l.createAnimateFrame());let h,y;g.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(g=>{for(const h of g){const y=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);y&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),y.resultCallback(h.r))}}));let a=0;const m=g=>{const h={n:a++,tt:Date.now(),t:"c",fs:g};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(!v||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=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=g.map(R=>({f:R,s:JSON.stringify(R).length}));let C=y.length,E=0,T=0,F=[];do{do{const{f:R,s:I}=y[E];if(F.push(R),++E,T+I>h||F.length>=20)break}while(E<C);F.length>0&&(o.debug&&console.log(`传送${F.length}条消息...`),m([...F]),F.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 v=s.coordinateConverter.normalizeAndQuantizeUnsigned(o.offsetX,o.offsetY),m=s.toStreamerMessagesProvider.toStreamerHandlers.get("MouseUp");m&&m([o.button,v.x,v.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 v=Math.ceil(o/r)|0;[...new Array(v).keys()].map(m=>n.slice(m*r,(m+1)*r)).forEach((m,p)=>{const d={type:"earthsdk",time:new Date().getTime(),params:`${s}-${p}/${v}-`+m};this.sendData(JSON.stringify(d))})}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 d=()=>s.debug=o.debug??!1;d(),this.d(o.debugChanged.don(d))}{let d=!1;const g=this.dv(l.createNextAnimateFrameEvent(this._videoInitialized.changed,this._webRtcConnected.changed,this._webSocketOpen.changed));this.d(g.don(()=>{if(d)return;const h=this._ue5ViewerWrapper.instance.webSocketReady;if(this.videoInitialized&&this.webRtcConnected&&h){this._ue5ViewerWrapper.instance.emitUIInteraction(),this._readyEvent.emit(),d=!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),d=!1}))}this.d(s.event.don((d,g)=>{if(d==="errorEvent")this._errorEvent.emit(g);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 h=JSON.parse(g);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 d=this.dv(l.createAnimateFrame());let g,h,y;d.start(()=>{if(g!==t.offsetWidth||h!==t.offsetHeight||y!==o.resolutionScale){if(g=t.offsetWidth,h=t.offsetHeight,g===void 0||h===void 0||!Number.isFinite(g)||!Number.isFinite(h)||g<0||h<0){console.warn(`lastWidth === undefined || lastHeight === undefined || !Number.isFinite(lastWidth) || !Number.isFinite(lastHeight) || lastWidth < 0 || lastHeight < 0 ${g} ${h}`);return}y=o.resolutionScale,s.resize(g/y,h/y)}})}this.d(this._ueFuncResultWithIdsEvent.don(d=>{for(const g of d){const h=this._waitingUeFuncIdAndResultCallbacks.get(g.fid);h&&(this._waitingUeFuncIdAndResultCallbacks.delete(g.fid),h.resultCallback(g.r))}}));let v=0;const a=d=>{const g={n:v++,tt:Date.now(),t:"c",fs:d};this._waitingUeCalls.add(g),o.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()),this._ue5ViewerWrapper.emitUIInteractionForBigData(g,()=>{this._waitingUeCalls.delete(g)})},m=()=>{if(!this._ue5ViewerWrapper.instance.webSocketReady||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=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=g.map(R=>({f:R,s:JSON.stringify(R).length}));let C=y.length,E=0,T=0,F=[];do{do{const{f:R,s:I}=y[E];if(F.push(R),++E,T+I>h||F.length>=20)break}while(E<C);F.length>0&&(o.debug&&console.log(`传送${F.length}条消息...`),a([...F]),F.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 v=c.ESSceneObject.getStrFromEnv(n+`/web/${i}.html`);s.src=v,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 v=u[e++]&63;if((o&240)==224?o=(o&15)<<12|s<<6|v:((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|v<<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 v=fe(t);t.setGlobalProperty(v)};n();const r=ce(),o=[];r.forEach(v=>{const a=t[v+"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 c.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 v;return((v=c.ESSceneObject.getSceneObjById(s))==null?void 0:v.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 v=!1,a=null;this.d(s.onRuntimeInitialized.don(()=>{var g;if(v=!0,(g=s==null?void 0:s.vIframe)!=null&&g.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(g=>{for(const h of g){const y=this._waitingUeFuncIdAndResultCallbacks.get(h.fid);y&&(this._waitingUeFuncIdAndResultCallbacks.delete(h.fid),y(h.r))}}));let m=0;const p=()=>{if(!v||!a||!a.UE_JSHTML5Communication||!a.UE_JSHTML5Communication.JSSendMessageToUE||this._ueFuncWithIdAndResultCallbacks.length===0)return;const g=this._ueFuncWithIdAndResultCallbacks.map(([I])=>I),h={n:m++,tt:Date.now(),t:"c",fs:g,callid:l.createGuid()};for(const[I,M]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(I.fid,M);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 F=Math.ceil(E/C)|0;[...new Array(F).keys()].map(I=>y.slice(I*C,(I+1)*C)).forEach((I,M)=>{const $i=`${T}-${M}/${F}-`+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 d=JSON.parse(p);if(d.t==="cr"){const g=d;if(g.frs&&this._ueFuncResultWithIdsEvent.emit(g.frs),g.ers)for(let h of g.ers)this._ueEvent.emit(h)}}catch(d){console.error(d)}},this.dispose(this._ueFuncResultWithIdsEvent.disposableOn(m=>{for(const p of m){const d=this._waitingUeFuncIdAndResultCallbacks.get(p.fid);d&&(this._waitingUeFuncIdAndResultCallbacks.delete(p.fid),d(p.r))}}));let s=0;const v=()=>{if(!r||this._ueFuncWithIdAndResultCallbacks.length===0)return;const m=this._ueFuncWithIdAndResultCallbacks.map(([g])=>g),p={n:s++,tt:Date.now(),t:"c",fs:m};for(const[g,h]of this._ueFuncWithIdAndResultCallbacks)this._waitingUeFuncIdAndResultCallbacks.set(g.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 d=++cr;window.ue.es.oncommand(`${d}-0/1-`+JSON.stringify(p)).then(()=>{this._waitingUeCalls.delete(p)})};this.dv(l.createInterval()).start(v,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 v=e[s+"Changed"];r.push(v)});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=c.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 v=this.dv(l.createNextAnimateFrameEvent(...s));this.d(v.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)},v=a=>{r(a,!1)};n.addEventListener("mouseenter",o),n.addEventListener("mouseleave",s),n.addEventListener("mousemove",v),this.d(()=>{n.removeEventListener("mouseenter",o),n.removeEventListener("mouseleave",s),n.removeEventListener("mousemove",v)})}t.useCustomInteraction=!1,this.dv(new c.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",v=>{t.statusUpdateEvent.emit(v)})),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(v=>{var a;return((a=c.ESSceneObject.getSceneObjById(v))==null?void 0:a.parentID)??v}),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,d)=>p.hasOwnProperty(d);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 d=this.dv(l.createProcessingFromAsyncFunc(async g=>{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:M}=i.options;h=R,y=I,C=M??!1}if(r(i.options,"uri")&&r(i.options,"app")){const{offsetWidth:R,offsetHeight:I}=p;let{uri:M,app:$i,token:Bn}=i.options;M.endsWith("/")||(M+="/");const wr=Bn?`?essstoken=${Bn}`:"",Kn=`/${$i}/${R??1920}/${I??1080}`+wr;console.log(`请求信令服务器: ${M}instance${Kn}`);const yr=await g.promise(fetch(`${M}instance${Kn}`,{method:"GET"})),b=await g.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 g.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:F}=p;E.resize(T*window.devicePixelRatio,F*window.devicePixelRatio),n.viewer=E,this.d(()=>n.viewer=void 0),this.dv(new hr(n,E))}));d.start(),this.d(this._reconnectEvent.don(g=>{s===void 0&&(g&&!g.isDestroyed()&&g.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(()=>{d.restart()},o)))})),this.d(d.errorEvent.don(g=>{n.setStatus("Error"),n.setStatusLog("云渲染视口创建失败!"),console.warn("云渲染视口创建失败!",g),this._reconnectEvent.emit(void 0)}))}else if(r(i.options,"project")){const p=i,d=p.options.project,g=p.options.baseUrl;n.setStatus("Creating"),n.setStatusLog("下载编译中...");const h=this.dv(new dr(t,d,g,n));n.viewer=h,this.d(()=>n.viewer=void 0)}else n.setStatus("Error"),n.setStatusLog("视口创建失败!"),console.warn("视口创建失败: 参数错误!")}}const z=class z extends c.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 Mn(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:v,y:a}=this.container.getBoundingClientRect();r=[v+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=c.getGeoBoundingSphereFromPositions(r);if(!o)return;const{center:s,radius:v}=o,a={distance:i??v,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 v={mode:"Line",geoLineStringId:t,speed:i,heightOffset:n,loop:r,turnRateDPS:o,lineMode:s},a=await W(this.viewer,v);return a&&!a.error&&(this._navigationMode.value=v.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},v=await W(this.viewer,s);return v&&!v.error&&(this._navigationMode.value=s.mode),v}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},v=await W(this.viewer,s);return v&&!v.error&&(this._navigationMode.value=s.mode),v}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.mainClass;if(!r||!this.viewer||i==null)return;const o=Array.isArray(i)?[...i]:[i];return r.editingID=`${n.callSource}_${l.createGuid()}`,await An(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 s=t[r].mainClass;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=()=>({...c.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 c.EngineObject{constructor(e,t){super(e,t);const i=t.viewer;if(i&&(e.mainClass.typeName===e.typeName&&this.d(this.createdEvent.don(()=>{const n=this.constructor.propValFuncs,r=e.defaultProps,o=Object.keys(r).filter(d=>n[d]!==null);o.push(...this.constructor.forceUeUpdateProps);const s=e.constructor.defaults,v={val:{}},a=[];for(let d of o){const g=d+"Changed",h=e[g];a.push(h);const y=n[d];if(y===null)throw console.error("vf === null error"),new Error("vf === null error");const C=()=>{const E=e[d]??s[d];let T=y?y(E,this,t,e):E;if(T===void 0){console.warn(`UE自动更新的属性,不应该为undefined! 属性名:${d} 对象名:${e.name} 对象id: ${e.id}`);return}v.val[d]=T};C(),this.d(h.don(C))}const m=()=>{i.callUeFunc({f:"update",p:{id:e.id,...v.val}}),v.val={}},p=this.dv(l.createNextAnimateFrameEvent(...a));this.d(p.don(m)),this.d(e.createdEvent.don(m)),this.d(e.flushEvent.don(()=>p.flush()))})),e.mainClass.typeName===e.typeName)){let n=!1;this.d(()=>{n&&we(i,e.id)}),i.callUeFunc({f:"create",p:{type:e.typeName,id:e.id}}).then(()=>{n=!0,e.createdEvent.emit()}).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 S 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((v,a)=>{et(i,e.id,v,a)})),this.d(e.smoothMoveWithRotationEvent.don((v,a,m)=>{O(i,e.id,v,a,m)})),this.d(e.smoothMoveOnGroundEvent.don((v,a,m,p)=>{j(i,e.id,v,a,p,m)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((v,a,m,p,d)=>{tt(i,e.id,v,a,m,p,d)})),this.d(e.smoothMoveKeepPitchEvent.don(async(v,a)=>{const m=await i.callUeFunc({f:"SmoothMoveKeepPitch",p:{id:e.id,Destination:v,Time:a}});m.error&&console.error("SmoothMoveKeepPitch:",m.error)})),this.d(e.automaticLandingEvent.don(v=>{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=v)})}));const o=async(v,a,m,p)=>{const{viewer:d}=v;if(!d){console.error("SmoothMoveRelatively: ueViewer.viewer is undefined");return}const g=await d.callUeFunc({f:"SmoothMoveRelatively",p:{id:a,RelativePosition:m,Time:p}});return g.error&&console.error("SmoothMoveRelatively:",g.error),g};this.d(e.smoothMoveRelativelyEvent.don((v,a)=>{o(t,e.id,v,a)}));const s=async(v,a,m,p,d)=>{const{viewer:g}=v;if(!g){console.error("SmoothMoveRelativelyWithRotation: ueViewer.viewer is undefined");return}const h=await g.callUeFunc({f:"SmoothMoveRelativelyWithRotation",p:{id:a,RelativePosition:m,NewRotation:p,Time:d}});return h.error&&console.error("SmoothMoveRelativelyWithRotation:",h.error),h};this.d(e.smoothMoveRelativelyWithRotationEvent.don((v,a,m)=>{s(t,e.id,v,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 A extends S{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 S{constructor(e,t){super(e,t),t.viewer}}w(Ce,"propValFuncs",{...S.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 c.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??c.defaultFlyToParam,flyInParam:t.flyInParam??c.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}})},v=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(v.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)),d=()=>{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};d(),this.d(p.don(d))}const m=async()=>{const{id:p}=t;if(r!==void 0){r=void 0;try{const d=await i.unBind3DTilesetById(p);if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset UnBind3DTilesetById: ${d}`);return}}if(o!==void 0){o=void 0;try{const d=await n.callUeFunc({f:"destroy",p:{id:p}});if(!d)return;if(d.error!==""){console.warn(`UeES3DTileset Destroy: ${d.error}`);return}}catch(d){console.warn(`UeES3DTileset Destroy: ${d}`);return}}};this.d(()=>{m()});{const p=this.dv(l.createProcessingFromAsyncFunc(async g=>{if(a.value===void 0){await g.promise(m());return}if(a.value.type==="ActorTag"){const{actorTag:h}=a.value;if(r!==h&&await g.promise(m()),r!==void 0||h===void 0)return;try{r=h;const y=await g.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 g.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 g.promise(s())})),d=async()=>{p.restart()};d(),this.d(a.changed.don(d))}this.d(t.refreshTilesetEvent.don(()=>{zi(n,t.id)})),this.d(t.flyToEvent.don(async(p,d)=>{if(!r&&!o)return;const g=await K(n,t.id,p);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),t.flyOverEvent.emit(d,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:d,rotation:g}=p;t.flyInParam={position:d,rotation:g,flyDuration:1}})),this.d(i.propChanged.don(p=>{!r&&!o||p.objId===t.id&&Object.keys(p.props).forEach(d=>{const g=p.props[d]===null?void 0:p.props[d];t[d]=g})})),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}},d=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}},g=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],d(y,E)})),this.d(t.resetFeatureStyleEvent.don(()=>{g(),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 d=await n.callUeFunc({f:"GetFeatureTable",p:{id:t.id}});d.error!==""&&console.warn(`UeES3DTileset GetFeatureTable: ${d.error}`),t._featureTableResultEvent.emit(d.re.table)}catch(d){console.warn(`UeES3DTileset GetFeatureTable: ${d}`),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 d=await n.callUeFunc({f:"GetMaterialNameList",p:{id:t.id}});d.error!==""&&console.warn(`UeES3DTileset GetMaterialNameList: ${d.error}`),t.getMaterialNameListEvent.emit(d.re.materialNameList)}catch(d){console.warn(`UeES3DTileset GetMaterialNameList: ${d}`),t.getMaterialNameListEvent.emit(void 0)}};this.ad(t.getMaterialNameListEvent.don(d=>{d=="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",c.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 c.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=c.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=c.ESSceneObject.context.getStrFromEnv(d.url),s.value=d}};p(),this.ad(e.urlChanged.don(p))}const v=async()=>{if(!n&&!r)return;let p=e.targetID??c.ESImageryLayer.defaults.targetID;if(p&&p!=""){const d=c.ESSceneObject.getSceneObject(p);p=d?d.mainClass.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??c.defaultFlyToParam,flyInParam:e.flyInParam??c.defaultFlyInParam,url:s.value??"",zIndex:e.zIndex??0,maximumLevel:e.maximumLevel??c.ESImageryLayer.defaults.maximumLevel,minimumLevel:e.minimumLevel??c.ESImageryLayer.defaults.minimumLevel,options:e.options??c.ESImageryLayer.defaults.options,targetID:p,opacity:e.opacity??c.ESImageryLayer.defaults.opacity,splitDirection:e.splitDirection??c.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(v));const m=async()=>{const{id:p}=e;if(n!==void 0){n=void 0;try{const d=await t.unBindImageryById(p);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:p,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(()=>{m()});{const p=this.dv(l.createProcessingFromAsyncFunc(async g=>{if(o.value===void 0){await g.promise(m());return}if(o.value.type==="ActorTag"){const{actorTag:h,componentTag:y}=o.value;if(n!==h&&await g.promise(m()),n!==void 0||h===void 0)return;try{n=h;const C=await g.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 g.promise(m()),r!==void 0||h===void 0)return;try{r=h;const y=await g.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 g.promise(v())})),d=async()=>{p.restart()};d(),this.d(o.changed.don(d))}{const p=this.dv(l.createNextAnimateFrameEvent(e.actorTagChanged,s.changed,e.componentTagChanged)),d=()=>{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};d(),this.d(p.don(d))}this.d(e.flyToEvent.don(async(p,d)=>{if(!n&&!r)return;const g=await K(i,e.id,p);let h="over";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),e.flyOverEvent.emit(d,h,t)})),this.d(e.flyInEvent.don(async(p,d)=>{var y,C;if(!n&&!r)return;const g=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";g===void 0?h="error":g.endType===0?h="over":g.endType===1&&(h="cancelled"),e.flyOverEvent.emit(d,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:d,rotation:g}=p;e.flyInParam={position:d,rotation:g,flyDuration:1}})),this.d(t.propChanged.don(p=>{!n&&!r||p.objId===e.id&&Object.keys(p.props).forEach(d=>{const g=p.props[d]===null?void 0:p.props[d];e[d]=g})}))}};w(rt,"type",rt.register("ESUeViewer",c.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",c.ESTerrainLayer.type,k)),w(k,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),w(k,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(e):(e.url=c.ESSceneObject.context.getStrFromEnv(e.url),e),czmMaxzoom:null,czmMinzoom:null});let Se=k;const ot=class ot extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ot,"type",ot.register("ESUeViewer",c.ESAlarm.type,ot));let Fe=ot;const st=class st extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(st,"type",st.register("ESUeViewer",c.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",c.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=c.ESAreaMeasurement.defaults.fillStyle;try{o={...e.fillStyle??c.ESAreaMeasurement.defaults.fillStyle}}catch(s){console.error("ESAreaMeasurement fillStyle 属性类型错误!",s),o={...c.ESAreaMeasurement.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,stroked:e.stroked??c.ESAreaMeasurement.defaults.stroked,fillStyle:o,filled:e.filled??c.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",c.ESAreaMeasurement.type,lt));let Te=lt;const dt=class dt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(dt,"type",dt.register("ESUeViewer",c.ESBlastParticleSystem.type,dt));let Re=dt;const X=class X extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};w(X,"type",X.register("ESUeViewer",c.ESBoxClipping.type,X)),w(X,"propValFuncs",{...S.propValFuncs,targetID:e=>{if(!e)return"";const t=c.ESSceneObject.getSceneObject(e);return t?t.mainClass.id:e}});let De=X;const ct=class ct extends S{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:v,position:a,rotation:m}=e;x(i,s,a,m,v??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",c.ESCameraView.type,ct));let Le=ct;const ut=class ut extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ut,"type",ut.register("ESUeViewer",c.ESCameraVisibleRange.type,ut));let Pe=ut;const ht=class ht extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(ht,"type",ht.register("ESUeViewer",c.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=c.ESClassification.defaults.fillStyle;try{o={...e.fillStyle??c.ESClassification.defaults.fillStyle}}catch(s){console.error("ESClassification fillStyle 属性类型错误!",s),o={...c.ESClassification.defaults.fillStyle}}o.materialParams=JSON.stringify(o.materialParams),i.callUeFunc({f:"update",p:{id:e.id,filled:e.filled??c.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",c.ESClassification.type,vt));let Me=vt;const q=class q extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is underfined!");return}}};w(q,"type",q.register("ESUeViewer",c.ESClippingPlane.type,q)),w(q,"propValFuncs",{...S.propValFuncs,targetID:e=>{if(!e)return"";const t=c.ESSceneObject.getSceneObject(e);return t?t.mainClass.id:e}});let Ae=q;const gt=class gt extends S{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=c.ESSceneObject.context.getStrFromEnv(e.url??c.ESDataMesh.defaults.url);else{const v=e.url;v.url=c.ESSceneObject.context.getStrFromEnv(v.url??c.ESDataMesh.defaults.url),n.value=v}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{const s=e.colorStops??c.ESDataMesh.defaults.colorStops;i.callUeFunc({f:"update",p:{id:e.id,url:n.value??c.ESDataMesh.defaults.url,currentTime:e.currentTime??c.ESDataMesh.defaults.currentTime,minPropValue:e.minPropValue??c.ESDataMesh.defaults.minPropValue,maxPropValue:e.maxPropValue??c.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",c.ESDataMesh.type,gt));let We=gt;const pt=class pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(pt,"type",pt.register("ESUeViewer",c.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",c.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??c.ESDistanceMeasurement.defaults.strokeStyle}}catch(s){console.error("ESDistanceMeasurement strokeStyle 属性类型错误!",s),o={...c.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",c.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",c.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",c.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",c.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",c.ESExcavate.type,Z)),w(Z,"propValFuncs",{...U.propValFuncs,targetID:e=>{if(!e)return"";const t=c.ESSceneObject.getSceneObject(e);return t?t.mainClass.id:e}});let Ge=Z;const Et=class Et extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Et,"type",Et.register("ESUeViewer",c.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=c.ESSceneObject.context.getStrFromEnv(e.url);else{const v=e.url;v.url=c.ESSceneObject.context.getStrFromEnv(v.url),n.value=v}};s(),this.ad(e.urlChanged.don(s))}const r=()=>{i.callUeFunc({f:"update",p:{id:e.id,url:n.value??c.ESForestTileset.defaults.url,treeTypes:e.treeTypes??c.ESForestTileset.defaults.treeTypes,xiaoBanWidget:e.xiaoBanWidget??c.ESForestTileset.defaults.xiaoBanWidget,youShiSZ:e.youShiSZ??c.ESForestTileset.defaults.youShiSZ,diLei:e.diLei??c.ESForestTileset.defaults.diLei,senLinLB:e.senLinLB??c.ESForestTileset.defaults.senLinLB,labelMaterial:e.labelMaterial??c.ESForestTileset.defaults.labelMaterial,heightOffset:e.heightOffset??c.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",c.ESForestTileset.type,St));let Je=St;const Ft=class Ft extends c.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",c.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 c.ESTextLabel);r.parentID=t.id,t.mainClass=r,i.add(r),this.dispose(()=>i.delete(r)),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 v=await i.getCurrentCameraInfo();if(!v)return;const{position:a,rotation:m}=v;t.flyInParam={position:a,rotation:m,flyDuration:1}})),this.dispose(t.smoothMoveEvent.disposableOn((v,a)=>{et(n,r.id,v,a)})),this.dispose(t.smoothMoveWithRotationEvent.disposableOn((v,a,m)=>{O(n,r.id,v,a,m)})),this.dispose(t.smoothMoveOnGroundEvent.disposableOn((v,a,m,p)=>{j(n,r.id,v,a,p,m)})),this.dispose(t.smoothMoveWithRotationOnGroundEvent.disposableOn((v,a,m,p,d)=>{tt(n,r.id,v,a,m,p,d)})),this.dispose(t.flyToEvent.disposableOn((v,a)=>{r.flyTo(v)})),this.dispose(t.flyInEvent.don(v=>{r.flyIn(v)}));const o=this._screenPosition,s=this.disposeVar(new c.ESCustomDiv);s.parentID=t.id,i.add(s),this.dispose(()=>i.delete(s)),this.dispose(l.bind([s,"allowPicking"],[t,"allowPicking"]));{const v=this.disposeVar(l.createAnimateFrame()),a=()=>{t.show?v.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,d]=m;p===-1&&d===-1?this._screenPosition.value=void 0:this._screenPosition.value=[p,d]}}):v.cancel()};a(),this.dispose(t.showChanged.disposableOn(a))}{const v=()=>class extends l.Destroyable{constructor(d,g,h){if(super(),this._subContainer=d,!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 c.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 F=t.show;o.value&&F?(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,F]=t.anchor??c.ESGeoDiv.defaults.anchor;y.originRatioX=T,y.originRatioY=F};E(),this.dispose(t.anchorChanged.disposableOn(E))}{const E=()=>{y.opacity=t.opacity??c.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=v():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 c.ESImageLabel),this._imageLabel.isHoverZoom=!1,this._imageLabel.parentID=t.id;const n=i.viewer;if(!n){console.warn("viewer is undefined!");return}t.mainClass=this._imageLabel;const r=this._imageLabel;i.add(r),this.d(()=>i.delete(r));{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()??c.ESGeoDiv.defaults.opacity,m.style.position="fixed",m.style.zIndex="-1",m.style.top="0px",!document.body.contains(m)){document.body.appendChild(m);let d=m?m.querySelectorAll("*[class]"):[];for(let g=0;g<d.length;g++){const h=d[g];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(d=>{document.body.contains(m)&&document.body.removeChild(m),r.url=d.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 v=this.dv(l.createNextAnimateFrameEvent(t.instanceClassChanged,t.opacityChanged));this.d(v.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:v}=o;if(s==="leftClick"&&v){const a=(v==null?void 0:v.classNames)??[],m=Object.keys(this._hasClassDivAndPos);for(let p=0;p<m.length;p++){const d=m[p];let g=this._hasClassDivAndPos[d];v&&v.mouseRelativePos&&v.mouseRelativePos[0]>=g[0]&&v.mouseRelativePos[0]<=g[2]&&v.mouseRelativePos[1]>=g[1]&&v.mouseRelativePos[1]<=g[3]&&a.push(d)}v.classNames=a}t.widgetEvent.emit({type:s,add:v})})),this.d(t.calcFlyToParamEvent.don(()=>{$(n,r.id)})),this.d(t.calcFlyInParamEvent.don(()=>{const o=i.getCurrentCameraInfo();if(!o)return;const{position:s,rotation:v}=o;t.flyInParam={position:s,rotation:v,flyDuration:1}})),this.d(t.smoothMoveEvent.don((o,s)=>{et(n,r.id,o,s)})),this.d(t.smoothMoveWithRotationEvent.don((o,s,v)=>{O(n,r.id,o,s,v)})),this.d(t.smoothMoveOnGroundEvent.don((o,s,v,a)=>{j(n,r.id,o,s,a,v)})),this.d(t.smoothMoveWithRotationOnGroundEvent.don((o,s,v,a,m)=>{tt(n,r.id,o,s,v,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",c.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",c.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",c.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",c.ESGeoWater.type,Dt));let qe=Dt;const G=class G extends S{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)=>{Yi(i,e.id,n,r)})),this.d(e.setNodeRotationEvent.don((n,r)=>{Qi(i,e.id,n,r)})),this.d(e.setNodeScaleEvent.don((n,r)=>{Vi(i,e.id,n,r)}))}};w(G,"forceUeUpdateProps",[...S.forceUeUpdateProps,"url"]),w(G,"propValFuncs",{...S.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(c.rpToap(e)):(e.url=c.ESSceneObject.context.getStrFromEnv(c.rpToap(e.url)),e),czmMaximumScale:null,czmMinimumPixelSize:null,czmNativeScale:null,czmColor:null}),w(G,"type",G.register("ESUeViewer",c.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",c.ESHeightMeasurement.type,Lt));let Ye=Lt;const Pt=class Pt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=async(o,s,v,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:v,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:v}=o;if(!v){console.error("StopAIMove: ueViewer.viewer is undefined");return}const a=await v.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",c.ESHuman.type,Pt));let Qe=Pt;const H=class H extends A{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",c.ESImageLabel.type,H)),w(H,"forceUeUpdateProps",[...A.forceUeUpdateProps,"url"]),w(H,"propValFuncs",{...A.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(c.rpToap(e)):(e.url=c.ESSceneObject.context.getStrFromEnv(c.rpToap(e.url)),e)});let Ve=H;const Ut=class Ut extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Ut,"type",Ut.register("ESUeViewer",c.ESLevelRuntimeModel.type,Ut));let be=Ut;const Mt=class Mt extends he{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Mt,"type",Mt.register("ESUeViewer",c.ESLocalCircle.type,Mt));let xe=Mt;const At=class At extends P{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(At,"type",At.register("ESUeViewer",c.ESLocalPolygonZ.type,At));let Oe=At;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",c.ESLocalRectangle.type,Wt));let je=Wt;const _t=class _t extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(_t,"type",_t.register("ESUeViewer",c.ESLocalSkyBox.type,_t));let ti=_t;const $t=class $t extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w($t,"type",$t.register("ESUeViewer",c.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",c.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",c.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 v=typeof n=="number"?n.toString():n;Xi(i,e.id,v,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",c.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",c.ESPit.type,Gt));let oi=Gt;const Ht=class Ht extends A{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",c.ESPoi2D.type,Ht));let si=Ht;const Jt=class Jt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Jt,"type",Jt.register("ESUeViewer",c.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",c.ESPoiTileset.type,J)),w(J,"forceUeUpdateProps",[...P.forceUeUpdateProps,"url"]),w(J,"propValFuncs",{...P.propValFuncs,url:e=>typeof e=="string"?c.ESSceneObject.context.getStrFromEnv(e):(e.url=c.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",c.ESPolygonFence.type,Bt));let di=Bt;const Y=class Y extends U{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Y,"type",Y.register("ESUeViewer",c.ESPolygonFlattenedPlane.type,Y)),w(Y,"propValFuncs",{...U.propValFuncs,targetID:e=>{if(!e)return"";const t=c.ESSceneObject.getSceneObject(e);return t?t.mainClass.id:e}});let ci=Y;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",c.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 v=[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);v=[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);v=[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]),d=parseInt(a[3]),g=parseFloat(a[4]);v=[m,p,d,g]}}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]),d=parseInt(a[3]);v=[m,p,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 s=e.layerConfig;if(!s)return;const v=[];s.forEach(a=>{s.filter(p=>p.dataset==a.dataset).length==1?v.push({condition:[{field:"dataset",op:"==",value:a.dataset}],color:n(a.value.color??"rgb(255,255,255)"),show:a.value.visible}):v.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(v)};r();const o=this.dv(l.createNextAnimateFrameEvent(e.layerConfigChanged,e.colorBlendModeChanged));this.d(o.don(()=>{r()}))}}};w(Xt,"type",Xt.register("ESUeViewer",c.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=>{c.addTreesCallFunc(t,e.id,n)})),this.d(e.removeAllTreesEvent.don(()=>{c.removeAllTreesCallFunc(t,e.id)})),this.d(e.updateTreeParamsEvent.don(n=>{c.updateTreeParamsCallFunc(t,e.id,n)})),this.d(e.cutDownTreesEvent.don((n,r)=>{c.cutDownTreesCallFunc(t,e.id,n,r)})),this.d(e.growthSimulationEvent.don((n,r,o)=>{c.growthSimulationCallFunc(t,e.id,n,r,o)}))}};w(qt,"type",qt.register("ESUeViewer",c.ESSeparateFoliage.type,qt));let vi=qt;const Zt=class Zt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Zt,"type",Zt.register("ESUeViewer",c.ESSubmergingAnalysis.type,Zt));let gi=Zt;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}})})),this.d(e.stopEvent.don(()=>{i.callUeFunc({f:"Stop",p:{id:e.id}})}))}};w(Yt,"type",Yt.register("ESUeViewer",c.ESSunshineAnalysis.type,Yt));let pi=Yt;const Qt=class Qt 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(Qt,"type",Qt.register("ESUeViewer",c.ESSurfaceAreaMeasurement.type,Qt));let fi=Qt;const Vt=class Vt extends A{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Vt,"type",Vt.register("ESUeViewer",c.ESTextLabel.type,Vt));let wi=Vt;const Q=class Q extends A{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(Q,"type",Q.register("ESUeViewer",c.ESUEWidget.type,Q)),w(Q,"propValFuncs",{...A.propValFuncs,info:e=>JSON.stringify(e??{})});let yi=Q;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 c.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??c.defaultFlyToParam,flyInParam:e.flyInParam??c.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 v=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:d}=e,g=await t.unBindActorByID(d);g&&g.error!==""&&console.warn(`${e.id} UeESUnrealActor UnBindActorByID: ${g.error}`),o=void 0;const h=await i.callUeFunc({f:"destroy",p:{id:d}});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 d=this.dv(l.createNextAnimateFrameEvent(e.actorClassChanged,e.actorTagChanged)),g=async()=>{e.actorTag!==""?p.value={type:"ActorTag",actorTag:e.actorTag}:p.value={type:"ActorClass",actorClass:e.actorClass===""?"default":e.actorClass}};g(),this.d(d.don(g)),this.d(e.flushEvent.don(()=>d.flush()))}{const d=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(v())})),g=async()=>{d.restart()};g(),this.d(p.changed.don(g))}this.d(e.positionChanged.don(v)),this.d(e.callFunctionEvent.don(async(d,g)=>{if(a()){e.__callFunctionResultEvent.emit(void 0);return}const h=await me(i,e.id,d,g);e.__callFunctionResultEvent.emit(h)})),this.d(e.smoothMoveEvent.don((d,g)=>{a()||et(i,e.id,d,g)})),this.d(e.smoothMoveWithRotationEvent.don((d,g,h)=>{a()||O(i,e.id,d,g,h)})),this.d(e.smoothMoveOnGroundEvent.don((d,g,h,y)=>{a()||j(i,e.id,d,g,y,h)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((d,g,h,y,C)=>{a()||tt(i,e.id,d,g,h,y,C)})),this.d(e.automaticLandingEvent.don(d=>{if(a())return;const g=[e.position[0],e.position[1]];t.getHeightByLonLat(e.position[0],e.position[1],"Visibility").then(h=>{h!==null&&(e.position=[...g,h],e.collision=d)})})),this.d(e.flyToEvent.don(async(d,g)=>{if(a())return;const h=await K(i,e.id,d);let y="over";h===void 0?y="error":h.endType===0?y="over":h.endType===1&&(y="cancelled"),e.flyOverEvent.emit(g,y,t)})),this.d(e.calcFlyToParamEvent.don(()=>{a()||$(i,e.id)})),this.d(e.calcFlyInParamEvent.don(async()=>{if(!t.actived)return;const d=await t.getCurrentCameraInfo();if(!d)return;const{position:g,rotation:h}=d;e.flyInParam={position:g,rotation:h,flyDuration:1}})),this.d(t.propChanged.don(d=>{a()||d.objId===e.id&&Object.keys(d.props).forEach(g=>{const h=d.props[g]===null?void 0:d.props[g];e[g]=h})}))}};w(bt,"type",bt.register("ESUeViewer",c.ESUnrealActor.type,bt));let mi=bt;const xt=class xt extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(xt,"type",xt.register("ESUeViewer",c.ESVideoFusion.type,xt));let Ci=xt;const Ot=class Ot extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(Ot,"type",Ot.register("ESUeViewer",c.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",c.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",c.ESVolumeMeasurement.type,te));let Fi=te;const V=class V extends A{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(V,"type",V.register("ESUeViewer",c.ESWidget.type,V)),w(V,"propValFuncs",{...A.propValFuncs,info:e=>JSON.stringify(e??{})});let Ii=V;const ee=class ee extends c.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",c.ESHumanPoi.type,ee));let Ti=ee;c.ESSceneObject.context.getStrFromEnv(c.ESNavigator.defaults.imgUrl);const ie=class ie extends c.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new c.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,v){super(),this._subContainer=o;const a=document.createElement("div");this._subContainer.appendChild(a),this.dispose(()=>this._subContainer.removeChild(a));{const d=async()=>{const g=await t.getCurrentCameraInfo(),h=g==null?void 0:g.position,C=[...g==null?void 0:g.rotation];C[0]=360,t.flyIn(h,C)};a.addEventListener("click",d),a.style.cursor="pointer",this.dispose(()=>a.removeEventListener("click",d))}{const d=()=>{a.style.width=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`,a.style.height=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`};d(),e.dispose(e.cssSizeChanged.disposableOn(d))}a.style.position="fixed";{const d=()=>{a.style.top=`${e.cssPosition?e.cssPosition[0]:c.ESNavigator.defaults.cssPosition[0]}px`,a.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESNavigator.defaults.cssPosition[1]}px`};d(),e.dispose(e.cssPositionChanged.disposableOn(d))}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 d=()=>p.src=e.imgUrl;d(),e.dispose(e.imgUrlChanged.disposableOn(d))}{const d=()=>{const C=-t.getCurrentCameraInfo().rotation[0];p.style.transform=`rotate(${C}deg)`};let g;const h=async()=>{d(),e.show?(a.style.display="block",g=setInterval(()=>{d()},1e3)):(a.style.display="none",clearInterval(g))};this.dispose(e.showChanged.disposableOn(h)),h(),this.dispose(()=>clearInterval(g))}p.style.transformOrigin="50% 50%"}}}};w(ie,"type",ie.register("ESUeViewer",c.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)),this.dispose(e.createdEvent.disposableOn(n))}}};w(B,"type",B.register("ESUeViewer",c.ESPath.type,B)),w(B,"forceUeUpdateProps",[...D.forceUeUpdateProps]),w(B,"propValFuncs",{...D.propValFuncs,materialMode:null});let Di=B;async function fr(u){navigator.clipboard.writeText(u).then(function(){console.log("复制成功")},function(e){console.log("复制失败")})}const ne=class ne extends c.EngineObject{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}const n=this.disposeVar(new c.ESCustomDiv);t.add(n),this.dispose(()=>t.delete(n)),n.instanceClass=class extends l.Destroyable{constructor(o,s,v){if(super(),this._subContainer=o,!v||!(v 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=`${c.ESViewerStatusBar.defaults.height}px`,a.style.left="0",a.style.bottom="0",a.style.color="#fff",a.style.padding="0 20px 0 0",a.style.boxSizing="border-box",a.style.lineHeight=`${c.ESViewerStatusBar.defaults.height}px`,a.style.zIndex="100",a.style.alignContent="center",a.style.justifyContent="space-between";const 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 d=document.createElement("span");m.appendChild(d),d.addEventListener("dblclick",function(){let h=d.innerHTML;h.startsWith("鼠标位置")&&(h=h.slice(5)),fr(h)}),d.style.cursor="pointer",this.dispose(()=>m.removeChild(d));const g=document.createElement("span");a.appendChild(g),this.dispose(()=>a.removeChild(g));{const h=()=>{a.style.height=(e.height??c.ESViewerStatusBar.defaults.height)+"px",a.style.lineHeight=(e.height??c.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(h)),h()}{const h=()=>{a.style.fontSize=(e.fontSize??c.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(${c.ESViewerStatusBar.defaults.bgColor[0]},${c.ESViewerStatusBar.defaults.bgColor[1]},${c.ESViewerStatusBar.defaults.bgColor[2]},${c.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(h)),h()}v.getVersion().then(h=>{h&&(g.innerText=`Ue 版本 : ${h[0]} `)}).catch(h=>{console.log(h)});{const h=()=>{let E="",T="";E+=`帧率:${v.getFPS().toFixed(0)}FPS`,p.innerText=E;const F=t.getCurrentCameraInfo();E+=` 经度: ${F.position[0].toFixed(5)}° 纬度: ${F.position[1].toFixed(5)}° 高度: ${F.position[2].toFixed(2)}米 偏航角: ${F.rotation[0].toFixed(2)}° 俯仰角: ${F.rotation[1].toFixed(2)}° 翻滚角:${F.rotation[2].toFixed(2)}° `,p.innerText=E,t.pick().then(R=>{if(R){const{pickResult:I}=R;if(I&&I.position){const{position:M}=I;T+=`鼠标位置:${M[0].toFixed(5)}° ${M[1].toFixed(5)}° ${M[2].toFixed(2)}m`}else T+="暂时无法获取鼠标位置...";d.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",c.ESViewerStatusBar.type,ne));let Li=ne;const re=class re extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(re,"type",re.register("ESUeViewer",c.ESGaussianSplatting.type,re));let Pi=re;const oe=class oe extends N{constructor(t,i){super(t,i);w(this,"_es3DTileset",this.dv(new c.ES3DTileset));if(!i.viewer){console.warn("viewer is undefined!");return}this.es3DTileset.parentID=t.id,t.mainClass=this._es3DTileset;{const r=this._es3DTileset;i.add(r),this.dispose(()=>i.delete(r)),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",c.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",c.ESMsTileset.type,se));let Mi=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??c.ESGeoExtrudedPolygon.defaults.height,extrudedHeight:e.extrudedHeight??c.ESGeoExtrudedPolygon.defaults.extrudedHeight,perPositionHeight:e.perPositionHeight??c.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",c.ESGeoExtrudedPolygon.type,ae));let Ai=ae;const le=class le extends S{constructor(e,t){if(super(e,t),!t.viewer){console.warn("viewer is undefined!");return}}};w(le,"type",le.register("ESUeViewer",c.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",c.ESSkylineAnalysis.type,de));let _i=de;f.copyright=void 0;try{const u="earthsdk3-ue",e="3.4.0-beta.5",t="2025-09-02T07:33:45.000Z",i="北京西部世界科技有限公司",n="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="d812c37b5ad15a4a9870af897192d55bdcb1e8d6",s=((Date.now()-1756798425e3)/36e5).toFixed(1),v=`%c🌏 ${u}%c ${e}.${r.slice(0,8)}.${t} (距今${s}个小时)
|
|
2
2
|
%c${n?n+`
|
|
3
3
|
`:""}当前网站正在使用${u},此软件版权归${i}所有
|
|
4
|
-
`;f.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","
|
|
4
|
+
`;f.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","d812c37b5ad15a4a9870af897192d55bdcb1e8d6")},get info(){return v},get date(){return"2025-09-02T07:33:45.000Z"},get author(){return"suplyang"},get version(){return"3.4.0-beta.5"},get name(){return"earthsdk3-ue"},get commitId(){return"d812c37b5ad15a4a9870af897192d55bdcb1e8d6"},print(a=!1){!a&&window._xe2_no_copy_print||console.info(this.info,`
|
|
5
5
|
font-size: 18px;
|
|
6
6
|
font-weight: 1000;
|
|
7
7
|
line-height: 1;
|