@syhr/sy-three 1.0.0-rc.7 → 1.0.0-rc.9

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.
@@ -1,18 +1,18 @@
1
- "use strict";require('./sy-three.css');var Nt=Object.defineProperty,Bt=Object.defineProperties;var Gt=Object.getOwnPropertyDescriptors;var Fe=Object.getOwnPropertySymbols;var Kt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable;var pe=(r,e,t)=>e in r?Nt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))Kt.call(e,t)&&pe(r,t,e[t]);if(Fe)for(var t of Fe(e))zt.call(e,t)&&pe(r,t,e[t]);return r},ae=(r,e)=>Bt(r,Gt(e));var J=(r,e,t)=>pe(r,typeof e!="symbol"?e+"":e,t);var m=(r,e,t)=>new Promise((n,s)=>{var a=l=>{try{c(t.next(l))}catch(h){s(h)}},o=l=>{try{c(t.throw(l))}catch(h){s(h)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);c((t=t.apply(r,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("vue"),Vt=require("qs"),__$t__=require("axios"),qt=require("mitt");require("dayjs");const Wt=require("lodash-es");require("crypto-js");const X=require("gm-crypto"),$=require("element-plus");require("@element-plus/icons-vue");const De=require("pinia"),jt=require("three/examples/jsm/renderers/CSS2DRenderer.js"),O=require("three-edit-cores"),x=require("localforage"),Jt=require("three/addons/environments/RoomEnvironment.js"),oe={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},Ne={ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"}};var he={};/*!
1
+ "use strict";require('./sy-three.css');var Bt=Object.defineProperty,Gt=Object.defineProperties;var Vt=Object.getOwnPropertyDescriptors;var Fe=Object.getOwnPropertySymbols;var Kt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable;var pe=(n,e,t)=>e in n?Bt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,O=(n,e)=>{for(var t in e||(e={}))Kt.call(e,t)&&pe(n,t,e[t]);if(Fe)for(var t of Fe(e))zt.call(e,t)&&pe(n,t,e[t]);return n},ce=(n,e)=>Gt(n,Vt(e));var Y=(n,e,t)=>pe(n,typeof e!="symbol"?e+"":e,t);var m=(n,e,t)=>new Promise((r,s)=>{var a=l=>{try{c(t.next(l))}catch(h){s(h)}},o=l=>{try{c(t.throw(l))}catch(h){s(h)}},c=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,o);c((t=t.apply(n,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("vue"),__$t__=require("qs"),qt=require("axios"),Wt=require("mitt");require("dayjs");const jt=require("lodash-es");require("crypto-js");const J=require("gm-crypto"),X=require("element-plus");require("@element-plus/icons-vue");const Pe=require("pinia"),Xt=require("three/examples/jsm/renderers/CSS2DRenderer.js"),U=require("three-edit-cores"),v=require("localforage"),Yt=require("three/addons/environments/RoomEnvironment.js"),le={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},Ne={ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"}};var me={};/*!
2
2
  * vite-plugin-qiankun.js v1.0.14
3
3
  * (c) 2021-2022 Teng Mao Qing
4
4
  * Released under the MIT License.
5
- */Object.defineProperty(he,"__esModule",{value:!0});var Z=typeof window!="undefined"?window.proxy||window:{},ot=function(r){Z!=null&&Z.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),Z.qiankunName&&(window.moudleQiankunAppLifeCycles[Z.qiankunName]=r))};he.default=ot;var _e=he.qiankunWindow=Z;he.renderWithQiankun=ot;function Xt(){return window.__POWERED_BY_WUJIE__||window.$wujie?oe.WUJIE:window.__POWERED_BY_QIANKUN__||_e!=null&&_e.__POWERED_BY_QIANKUN__?oe.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?oe.MICROAPP:oe.NONE}const ct="/";Xt();const Yt=location.origin;var je,Je,Xe,Ye,Qe,Ze,et,tt,nt,rt,st,it;const lt={savePath:((Je=(je=window.meta)==null?void 0:je.graph)==null?void 0:Je.savePath)||"/cockpit/drawing",graphPenPath:((Ye=(Xe=window.meta)==null?void 0:Xe.graph)==null?void 0:Ye.graphPenPath)||"/cockpit/graph",templatePath:((Ze=(Qe=window.meta)==null?void 0:Qe.graph)==null?void 0:Ze.templatePath)||"/cockpit/template",graphImgUploadPath:((tt=(et=window.meta)==null?void 0:et.graph)==null?void 0:tt.graphImgUploadPath)||"/cockpit/upload",threeSavePath:((rt=(nt=window.meta)==null?void 0:nt.graph)==null?void 0:rt.threeSavePath)||"/cockpit/threed",threeModelPath:((it=(st=window.meta)==null?void 0:st.graph)==null?void 0:it.threeModelPath)||"/cockpit/models"},A=__$t__.create({baseURL:Yt,timeout:window.meta.axios.timeout||12e4,withCredentials:!1,paramsSerializer:r=>Vt.stringify(r)});A.interceptors.request.use(r=>(r.headers["x-token"]="ewoglCJhbGcilDogpc3",r),r=>Promise.reject(r));A.interceptors.response.use(r=>{const{data:e}=r;return Promise.resolve(e)},r=>Promise.reject(r));function Qt(r,e={},t={}){return new Promise(n=>{A.get(r,M({params:e},t)).then(s=>n({res:s,err:null})).catch(s=>n({res:null,err:s}))})}function Zt(r,e={},t={}){return new Promise(n=>{A.post(r,e,t).then(s=>n({res:s,err:null})).catch(s=>n({res:null,err:s}))})}function en(r,e={},t={}){return A.get(r,M({params:e},t))}function tn(r,e={},t={}){return A.post(r,e,t)}function nn(r,e={}){return A.get(`/filehandle/${r}`,{params:e})}function rn(r,e={},t={}){return A.post(`/filehandle/${r}`,e,t)}function sn(r,e={}){return A.get(`/user/${r}`,{params:e})}function an(r,e={},t={}){return A.post(`/user/${r}`,e,t)}function on(r,e={}){return A.get(`${r}`,e.local?{params:e,baseURL:ct}:{params:e})}function cn(r,e={}){return A.get(`/media/${r}/`,{params:e})}function ln(r,e={},t={}){return A.post(`/media/${r}/`,e,t)}function un(r,e={}){return A.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,{params:e})}function dn(r,e={},t={}){return A.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,e,t)}function hn(r,e={}){return A.get(`/history/${r}`,{params:e})}function mn(r,e={},t={}){return A.post(`/history/${r}`,e,t)}function fn(r,e={}){return A.get(`/scada/${r}`,{params:e})}function pn(r,e={},t={}){return A.post(`/scada/${r}`,e,t)}function _n(r,e={}){return A.get(`/common/factory/${r}`,{params:e})}function En(r,e={},t={}){return A.post(`/common/factory/${r}`,e,t)}function An(r,e={}){return A.get(`/factory/${r}`,{params:e})}function gn(r,e={},t={}){return A.post(`/factory/${r}`,e,t)}function wn(r,e={}){return A.get(`/pd/${r}`,{params:e})}function Sn(r,e={},t={}){return A.post(`/pd/${r}`,e,t)}const B={getApi:Qt,postApi:Zt,getFileApi:nn,postFileApi:rn,getBaseApi:en,postBaseApi:tn,getUserApi:sn,postUserApi:an,getGraphApi:on,getMediaApi:cn,postMediaApi:ln,getScadaApi:fn,postScadaApi:pn,getCommonApi:un,postCommonApi:dn,getHistoryApi:hn,postHistoryApi:mn,getFactoryApi:An,postFactoryApi:gn,getCommonFactoryApi:_n,postCommonFactoryApi:En,getPDApi:wn,postPDApi:Sn},Ae=qt();class In{constructor(e={}){this._options=M({url:e.socketUrl,onOpen:null,onClose:null,onError:null,onMessage:null},e),this._client=null,this._isConnect=!1,this._closeClient=!1,this._retryCount=0,this._retryTimes=10,this._retryInterval=1e4,this._retryIntervalObj=null,this._initSockjs()}_initSockjs(){const{url:e,onOpen:t,onClose:n,onError:s,onMessage:a,token:o}=this._options;WebSocket!==void 0?this._client=new WebSocket(e,[o]):this.$message({type:"error",message:"当前浏览器不支持WebSocket推送!"}),this._client.onopen=c=>{this._client.readyState===WebSocket.OPEN&&(this._retryCount=0,this._isConnect=!0,this._closeClient=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null),t&&t(c)},this._client.onclose=c=>{!this._closeClient&&this.retryIntervalStart(),this._isConnect=!1,n&&n(c)},this._client.onerror=c=>{s&&s(c)},this._client.onmessage=c=>{a&&a(c)}}_reconnect(){if(this._retryCount===this._retryTimes){this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null;return}this._client=null,this._initSockjs(),this._retryCount++}retryIntervalStart(){this._closeClient=!0,this._retryIntervalObj||(this._retryIntervalObj=setInterval(()=>{this._reconnect()},this._retryInterval))}sendMsg(e){this._isConnect&&this._client.send(e)}destroy(){this._client&&(this._isConnect=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null,this._closeClient=!0,this._client.close(),this._client=null)}}const yn=[65535,-99999];function Cn(r){if(typeof r!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return r.trim()!==""&&e.test(r.trim())}function Rn(r){return typeof r=="number"&&!yn.includes(r)}const Dn=()=>{var n;const r={},e=((n=window.location.href.split("?"))==null?void 0:n[1])||"",t=new URLSearchParams(e);for(const[s,a]of t.entries())r[s]=a;return r};function Be(r){return Object.prototype.toString.call(r).slice(8,-1)}function ge(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,r=>(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16))}(function(){if(typeof Object.id=="undefined"){var r=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++r,enumerable:!1,writable:!1}),e.__uniqueid}}})();function vn(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];this.encode=function(t){var n,s,a,o,c,l;for(a=t.length,s=0,n="";s<a;){if(o=t.charCodeAt(s++)&255,s==a){n+=r.charAt(o>>2),n+=r.charAt((o&3)<<4),n+="==";break}if(c=t.charCodeAt(s++),s==a){n+=r.charAt(o>>2),n+=r.charAt((o&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2),n+="=";break}l=t.charCodeAt(s++),n+=r.charAt(o>>2),n+=r.charAt((o&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2|(l&192)>>6),n+=r.charAt(l&63)}return n},this.decode=function(t){var n,s,a,o,c,l,h;for(l=t.length,c=0,h="";c<l;){do n=e[t.charCodeAt(c++)&255];while(c<l&&n==-1);if(n==-1)break;do s=e[t.charCodeAt(c++)&255];while(c<l&&s==-1);if(s==-1)break;h+=String.fromCharCode(n<<2|(s&48)>>4);do{if(a=t.charCodeAt(c++)&255,a==61)return h;a=e[a]}while(c<l&&a==-1);if(a==-1)break;h+=String.fromCharCode((s&15)<<4|(a&60)>>2);do{if(o=t.charCodeAt(c++)&255,o==61)return h;o=e[o]}while(c<l&&o==-1);if(o==-1)break;h+=String.fromCharCode((a&3)<<6|o)}return h},this.utf16to8=function(t){var n,s,a,o;for(n="",a=t.length,s=0;s<a;s++)o=t.charCodeAt(s),o>=1&&o<=127?n+=t.charAt(s):o>2047?(n+=String.fromCharCode(224|o>>12&15),n+=String.fromCharCode(128|o>>6&63),n+=String.fromCharCode(128|o>>0&63)):(n+=String.fromCharCode(192|o>>6&31),n+=String.fromCharCode(128|o>>0&63));return n},this.utf8to16=function(t){var n,s,a,o,c,l;for(n="",a=t.length,s=0;s<a;)switch(o=t.charCodeAt(s++),o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=t.charAt(s-1);break;case 12:case 13:c=t.charCodeAt(s++),n+=String.fromCharCode((o&31)<<6|c&63);break;case 14:c=t.charCodeAt(s++),l=t.charCodeAt(s++),n+=String.fromCharCode((o&15)<<12|(c&63)<<6|(l&63)<<0);break}return n},this.charToHex=function(t){var n,s,a;for(n="",s=0;s<t.length;)a=t.charCodeAt(s++).toString(16),n+="\\0x"+a,n+=s>0&&s%8==0?`\r
6
- `:", ";return n}}function xn(){var r=0,e=new Object;this.add=function(t,n){this.containsKey(t)||r++,e[t]=n},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&r--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var n in e)if(e[n]==t)return!0;return!1},this.getValues=function(){var t=[];for(var n in e)t.push(e[n]);return t},this.getKeys=function(){var t=[];for(var n in e)t.push(n);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function Tn(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new xn,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,n){var s=Object.id(n).toString();this.callbacks_.add(s,n);var a={MsgId:s,Method:e+"|"+r};t&&(a.Param=JSON.stringify(t));var o=JSON.stringify(a);this.connect&&this.ws.send(o)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),n=t.MsgId;if(this.callbacks_.containsKey(n)){var s=this.callbacks_.getValue(n);s(t.Result,t.Response),this.callbacks_.remove(n)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},n){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],n)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:n},s){this.exec("Arm_VerifyPIN",[parseInt(e),n,t],s)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},n){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],n)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},n){this.exec("Arm_LEDControl",[parseInt(e),t],n)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},n){this.exec("Arm_SwitchProtocol",[parseInt(e),t],n)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:n,AttrBuffer:s},a){this.exec("Arm_CreateFile",[parseInt(e),n,parseInt(t),s],a)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:n,FileOffset:s,DataInput:a},o){this.exec("Arm_WriteFile",[parseInt(e),n,parseInt(t),parseInt(s),a],o)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:n},s){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),n],s)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:n,DataLen:s},a){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),n,n.length,parseInt(s)],a)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:n},s){this.exec("Arm_DeleteFile",[parseInt(e),n,parseInt(t)],s)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:n},s){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),n],s)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:n},s){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),n],s)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},n){this.exec("Arm_WriteShareMemory",[parseInt(e),t],n)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},n){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],n)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:n,TryCount:s,PinFlag:a},o){this.exec("Arm_ChangePIN",[parseInt(e),a,n,t,parseInt(s)],o)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},n){this.exec("Arm_ResetUserPIN",[parseInt(e),t],n)},this.Arm_SetUserID=function({Handle:e,UserID:t},n){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],n)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},n){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],n)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},n){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},n){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},n){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:n,RsaPriFileID:s,RsaPriFileSize:a},o){this.exec("Arm_RsaPri",[parseInt(e),parseInt(s),parseInt(a),t,n],o)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:n,RsaPubInData:s,RsaPubFileSize:a},o){this.exec("Arm_RsaPub",[parseInt(e),parseInt(a),n,t,t.length,s],o)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:n},s){this.exec("Arm_EccSign",[parseInt(e),parseInt(n),t],s)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:n,EccSignData:s},a){this.exec("Arm_EccVerify",[parseInt(e),n,n.length,t,s],a)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:n},s){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(n),t],s)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:n,Sm2SignData:s},a){this.exec("Arm_Sm2Verify",[parseInt(e),n,n.length,t,s],a)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:n,TdesInData:s},a){this.exec("Arm_TDES",[parseInt(e),parseInt(n),t,s],a)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:n,Sm4InData:s},a){this.exec("Arm_SM4",[parseInt(e),parseInt(n),t,s],a)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:n},s){this.exec("Arm_HASH",[parseInt(e),t,n],s)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:n},s){this.exec("Arm_Seed",[parseInt(e),n,t],s)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},n){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],n)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:n,SonCount:s,StartUserID:a,AdminTryCount:o,UserPin:c,UserTryCount:l,UpdateRSAPriKey:h},S){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),n,c,parseInt(l),parseInt(o),h,parseInt(a),parseInt(s)],S)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},n){this.exec("Arm_InitSon",[parseInt(e),t],n)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},n){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],n)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:n,FileID:s,FileType:a,Offset:o,DataLen:c,DataBuffer:l,UpRSAPubKey:h},S){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,n,a,parseInt(s),parseInt(o),l,h,parseInt(c)],S)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:n,FileID:s,FileType:a,Offset:o,DataLen:c,DataBuffer:l},h){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,n,a,parseInt(s),parseInt(o),l,parseInt(c)],h)},this.Arm_Update=function({Handle:e,UpdateData:t},n){this.exec("Arm_Update",[parseInt(e),t],n)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:n},s){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(n)],s)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:n,Priv:s,IsReset:a,IsDecOnRAM:o},c){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[n,parseInt(t),parseInt(e),parseInt(s),parseInt(o),parseInt(a)],c)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},n){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},n){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},n){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],n)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:n,IsDecOnRAM:s},a){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(s),parseInt(n)],a)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:n,InBuffer:s,CallLimit:a},o){this.exec("Arm_Set_EXE_FILE_INFO",[s,parseInt(n),parseInt(e),parseInt(a),t,t.length],o)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const Pn={HID:0},ce={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},Ge={USER:0};class ut{constructor(){J(this,"Base64",new vn);J(this,"AtlCtrl",null);J(this,"ArmCount",0);J(this,"ArmIndex",0);J(this,"ArmHandle",0);J(this,"ArmRandom","");try{this.AtlCtrl=new Tn("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((n,s)=>{n?(this.ArmCount=+s,e(s)):t(s)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,n)=>{this.AtlCtrl.Arm_Open({Index:e},(s,a)=>{s?(this.ArmHandle=+a,t(a)):(this.ArmHandle=a,n(a))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_Close({Handle:e},(s,a)=>{s?t(a):n(a)})})}armChangePIN(e,t,n=255,s=Ge.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((o,c)=>{this.AtlCtrl.Arm_ChangePIN({Handle:a,NewPIN:e,OldPIN:t,TryCount:n,PinFlag:s},(l,h)=>{l&&h==0?(this.ArmPin=e,o(h)):c(h)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(a,o)=>{a?(this.ArmRandom=o,n(o)):s(o)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(s,a)=>{s?(this.ArmDeadline=a,t(a)):n(a)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(a,o)=>{a?(this.ArmUKey=o,n(o)):s(o)})})}armGetDongleInfo(e=0,t=ce.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((n,s)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(a,o)=>{if(a){switch(t){case ce.USER_ID:this.ArmUid=o;break;case ce.PRODUCT_ID:this.ArmPid=o;break;case ce.HARDWARE_ID:this.ArmHid=o;break}n(o)}else s(o)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(a,o)=>{a&&o==0?n(o):s(o)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_RFS({Handle:e},(s,a)=>{s&&a==0?t(a):n(a)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(a,o)=>{if(a&&o.length>0)try{o=this.Base64.decode(o),n(o)}catch(c){console.error(c),n(o)}else s(o)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(s,a)=>{s&&a==0?t(a):n(a)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(a,o)=>{a&&o==0?n(o):s(o)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(a,o)=>{a&&o==0?n(o):s(o)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(a,o)=>{a&&o==0?n(o):s(o)})})}armSwitchProtocol(e=Pn.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(a,o)=>{a&&o==0?n(o):s(o)})})}armVerifyPIN(e,t=Ge.USER,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,a)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:n,UserPin:e,UserType:t},(o,c)=>{o&&c==0?(this.ArmPin=e,s(c)):a(c)})})}armReadData(e=0,t=128,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,a)=>{this.AtlCtrl.Arm_ReadData({Handle:n,Offset:e,ReadLength:t},(o,c)=>{o?(this.ArmData=c,s(c)):a(c)})})}armWriteData(e,t=0,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,a)=>{this.AtlCtrl.Arm_WriteData({Handle:n,Offset:t,DataInput:e},(o,c)=>{o&&c==0?s(c):a(c)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(s,a)=>{s?(this.ArmData=a,t(a)):n(a)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,s)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(a,o)=>{a&&o==0?n(o):s(o)})})}}const dt="0123456789abcdeffedcba9876543210",ht="4b0de988570c3a0f",bn=window.ENCRYPT;let ee=bn&&new ut;function mt(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",n=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*n)],r--;return t}function ft(){return m(this,null,function*(){return ee||(ee=new ut),new Promise((r,e)=>{ee.armEnum().then(t=>{r(+t)}).catch(t=>{$.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Wt.throttle(()=>m(exports,null,function*(){const r=yield ft(),e={};if(typeof r!="number"||r<=0)$.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Mn();if(!e.token)return;t.length?t.includes(e.ukeyHid)||($.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):($.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Ln(r=0){return m(this,null,function*(){return ee?new Promise((e,t)=>{ee.armGetDongleInfo(r).then(n=>{n?e(n):($.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(n))}).catch(n=>{t(n)})}):$.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Mn(){return m(this,null,function*(){if(!ee)return $.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield ft();let e=[];for(let t=0;t<r;t++){const n=yield Ln(t);e.push(n)}return e})}mt(16);mt(16);const pt=window.meta.app.inspect?X.SM4.constants.CBC:X.SM4.constants.ECB,{publicKey:kr,privateKey:Fr}=X.SM2.generateKeyPair();function Ke(r,e,t={}){const n=_t(ht),s=t.mode||pt;t=s===X.SM4.constants.ECB?M({mode:s,inputEncoding:"utf8",outputEncoding:"hex"},t):M({iv:dt,mode:s,inputEncoding:"utf8",outputEncoding:"hex"},t);let a="";try{a=X.SM4.encrypt(r,n,t)}catch(o){console.log("err: ",o)}return a}function ze(r,e,t={}){const n=_t(ht),s=t.mode||pt;return t=s===X.SM4.constants.ECB?M({mode:s,inputEncoding:"hex",outputEncoding:"utf8"},t):M({iv:dt,mode:s,inputEncoding:"hex",outputEncoding:"utf8"},t),X.SM4.decrypt(r,n,t)}function _t(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}const se=r=>{const{onClose:e,customClass:t}=r;return $.ElMessage(ae(M({},r),{center:!0,customClass:`sy-message ${t||""}`,onClose:s=>{e&&e(s)}}))};["success","warning","info","error"].forEach(r=>{se[r]=e=>se(typeof e=="string"?{type:r,message:e}:ae(M({},e),{type:r}))});De.createPinia();const ve={getLocal:r=>{try{let e=window.localStorage.getItem(r);return e=e!==null?ze(e):e,JSON.parse(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Ke(t):t,window.localStorage.setItem(r,t)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||Be(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const n=window.localStorage.key(e);r((void 0).getLocal(n),n)}},clearLocal:()=>{window.localStorage.clear()},removeLocal:r=>{window.localStorage.removeItem(r)},getSession:r=>{try{let e=window.sessionStorage.getItem(r);return e=e!==null?ze(e):e,JSON.parse(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Ke(t):t,window.sessionStorage.setItem(r,t)}catch(t){console.error(t)}},eachSession:r=>{if(!r||Be(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const n=window.sessionStorage.key(e);r((void 0).getSession(n),n)}},clearSession:()=>{window.sessionStorage.clear()},removeSession:r=>{window.sessionStorage.removeItem(r)}},On=(r,e)=>new Promise((t,n)=>{B.postApi("/filehandle/save",{path:r,data:e}).then(s=>{s.res.success?t(!0):n(!1)})}),Hn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#1afa29" p-id="1156"></path></svg>',Ve='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1657" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#808080" p-id="1658"></path></svg>',Un='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25776" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M377.083 125.44c74.606-135.314 195.292-135.314 269.897 0l346.332 629.394c74.606 135.315 9.508 245.395-145.189 245.395H175.94c-154.697 0-219.428-109.715-145.188-245.395L377.083 125.44z" fill="#FF2D16" p-id="25777"></path><path d="M567.986 328.046c0-31.086-25.234-55.955-55.954-55.955s-55.954 25.235-55.954 55.955v280.137c0 31.086 25.234 55.954 55.954 55.954s55.954-25.234 55.954-55.954V328.046z m-111.908 448h111.908v111.908H456.078z" fill="#FFFFFF" p-id="25778"></path></svg>',kn={name:"局放测点",label:"局放测点",create:function(r,e){return m(this,null,function*(){const{transformControls:t}=e,n=document.createElement("div");n.style.position="relative",n.style.zIndex="1";const s=document.createElement("div");s.style.width="1.3vw",s.style.height="1.3vw",s.style.display="flex",s.style.alignItems="center",s.style.justifyContent="center",s.style.cursor="pointer",s.style.pointerEvents="auto",s.style.userSelect="none",s.innerHTML=Ve;const a=document.createElement("style");a.innerHTML=`
5
+ */Object.defineProperty(me,"__esModule",{value:!0});var te=typeof window!="undefined"?window.proxy||window:{},st=function(n){te!=null&&te.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),te.qiankunName&&(window.moudleQiankunAppLifeCycles[te.qiankunName]=n))};me.default=st;var _e=me.qiankunWindow=te;me.renderWithQiankun=st;function Jt(){return window.__POWERED_BY_WUJIE__||window.$wujie?le.WUJIE:window.__POWERED_BY_QIANKUN__||_e!=null&&_e.__POWERED_BY_QIANKUN__?le.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?le.MICROAPP:le.NONE}const it="/",at=window.meta.app.encrypt;Jt();const Qt=location.origin;var ze,$e,qe,We,je,Xe,Ye,Je,Qe,Ze,et,tt;const ot={savePath:(($e=(ze=window.meta)==null?void 0:ze.graph)==null?void 0:$e.savePath)||"/cockpit/drawing",graphPenPath:((We=(qe=window.meta)==null?void 0:qe.graph)==null?void 0:We.graphPenPath)||"/cockpit/graph",templatePath:((Xe=(je=window.meta)==null?void 0:je.graph)==null?void 0:Xe.templatePath)||"/cockpit/template",graphImgUploadPath:((Je=(Ye=window.meta)==null?void 0:Ye.graph)==null?void 0:Je.graphImgUploadPath)||"/cockpit/upload",threeSavePath:((Ze=(Qe=window.meta)==null?void 0:Qe.graph)==null?void 0:Ze.threeSavePath)||"/cockpit/threed",threeModelPath:((tt=(et=window.meta)==null?void 0:et.graph)==null?void 0:tt.threeModelPath)||"/cockpit/models"};var nt;const S=qt.create({baseURL:Qt,timeout:((nt=window.meta.axios)==null?void 0:nt.timeout)||6e4,withCredentials:!1,paramsSerializer:n=>__$t__.stringify(n)});S.interceptors.request.use(n=>(n.headers["x-token"]="ewoglCJhbGcilDogpc3",n),n=>Promise.reject(n));S.interceptors.response.use(n=>{const{data:e}=n;return Promise.resolve(e)},n=>Promise.reject(n));function Zt(n,e={},t={}){return new Promise(r=>{S.get(n,O({params:e},t)).then(s=>r({res:s,err:null})).catch(s=>r({res:null,err:s}))})}function en(n,e={},t={}){return new Promise(r=>{S.post(n,e,t).then(s=>r({res:s,err:null})).catch(s=>r({res:null,err:s}))})}function tn(n,e={},t={}){return S.get(n,O({params:e},t))}function nn(n,e={},t={}){return S.post(n,e,t)}function rn(n,e={}){return S.get(`/filehandle/${n}`,{params:e})}function sn(n,e={},t={}){return S.post(`/filehandle/${n}`,e,t)}function an(n,e={}){return S.get(`/user/${n}`,{params:e})}function on(n,e={},t={}){return S.post(`/user/${n}`,e,t)}function cn(n,e={}){return S.get(`${n}`,e.local?{params:e,baseURL:it}:{params:e})}function ln(n,e={}){return S.get(`/media/${n}/`,{params:e})}function un(n,e={},t={}){return S.post(`/media/${n}/`,e,t)}function dn(n,e={}){return S.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${n}/`,{params:e})}function hn(n,e={},t={}){return S.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${n}/`,e,t)}function mn(n,e={}){return S.get(`/history/${n}`,{params:e})}function fn(n,e={},t={}){return S.post(`/history/${n}`,e,t)}function pn(n,e={}){return S.get(`/scada/${n}`,{params:e})}function _n(n,e={},t={}){return S.post(`/scada/${n}`,e,t)}function En(n,e={}){return S.get(`/common/factory/${n}`,{params:e})}function An(n,e={},t={}){return S.post(`/common/factory/${n}`,e,t)}function gn(n,e={}){return S.get(`/factory/${n}`,{params:e})}function wn(n,e={},t={}){return S.post(`/factory/${n}`,e,t)}function Sn(n,e={}){return S.get(`/pd/${n}`,{params:e})}function In(n,e={},t={}){return S.post(`/pd/${n}`,e,t)}const G={getApi:Zt,postApi:en,getFileApi:rn,postFileApi:sn,getBaseApi:tn,postBaseApi:nn,getUserApi:an,postUserApi:on,getGraphApi:cn,getMediaApi:ln,postMediaApi:un,getScadaApi:pn,postScadaApi:_n,getCommonApi:dn,postCommonApi:hn,getHistoryApi:mn,postHistoryApi:fn,getFactoryApi:gn,postFactoryApi:wn,getCommonFactoryApi:En,postCommonFactoryApi:An,getPDApi:Sn,postPDApi:In},ge=Wt();class yn{constructor(e={}){this._options=O({url:e.socketUrl,onOpen:null,onClose:null,onError:null,onMessage:null},e),this._client=null,this._isConnect=!1,this._closeClient=!1,this._retryCount=0,this._retryTimes=10,this._retryInterval=1e4,this._retryIntervalObj=null,this._initSockjs()}_initSockjs(){const{url:e,onOpen:t,onClose:r,onError:s,onMessage:a,token:o}=this._options;WebSocket!==void 0?this._client=new WebSocket(e,[o]):this.$message({type:"error",message:"当前浏览器不支持WebSocket推送!"}),this._client.onopen=c=>{this._client.readyState===WebSocket.OPEN&&(this._retryCount=0,this._isConnect=!0,this._closeClient=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null),t&&t(c)},this._client.onclose=c=>{!this._closeClient&&this.retryIntervalStart(),this._isConnect=!1,r&&r(c)},this._client.onerror=c=>{s&&s(c)},this._client.onmessage=c=>{a&&a(c)}}_reconnect(){if(this._retryCount===this._retryTimes){this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null;return}this._client=null,this._initSockjs(),this._retryCount++}retryIntervalStart(){this._closeClient=!0,this._retryIntervalObj||(this._retryIntervalObj=setInterval(()=>{this._reconnect()},this._retryInterval))}sendMsg(e){this._isConnect&&this._client.send(e)}destroy(){this._client&&(this._isConnect=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null,this._closeClient=!0,this._client.close(),this._client=null)}}const Cn=[65535,-99999];function Rn(n){if(typeof n!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return n.trim()!==""&&e.test(n.trim())}function we(n){return!["null","undefined"].includes(n)&&n!==void 0&&n!==null&&n!==""}function Dn(n){return typeof n=="number"&&!Cn.includes(n)}const xn=()=>{var r;const n={},e=((r=window.location.href.split("?"))==null?void 0:r[1])||"",t=new URLSearchParams(e);for(const[s,a]of t.entries())n[s]=a;return n};function Ee(n){return Object.prototype.toString.call(n).slice(8,-1)}function Se(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}(function(){if(typeof Object.id=="undefined"){var n=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++n,enumerable:!1,writable:!1}),e.__uniqueid}}})();function vn(){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];this.encode=function(t){var r,s,a,o,c,l;for(a=t.length,s=0,r="";s<a;){if(o=t.charCodeAt(s++)&255,s==a){r+=n.charAt(o>>2),r+=n.charAt((o&3)<<4),r+="==";break}if(c=t.charCodeAt(s++),s==a){r+=n.charAt(o>>2),r+=n.charAt((o&3)<<4|(c&240)>>4),r+=n.charAt((c&15)<<2),r+="=";break}l=t.charCodeAt(s++),r+=n.charAt(o>>2),r+=n.charAt((o&3)<<4|(c&240)>>4),r+=n.charAt((c&15)<<2|(l&192)>>6),r+=n.charAt(l&63)}return r},this.decode=function(t){var r,s,a,o,c,l,h;for(l=t.length,c=0,h="";c<l;){do r=e[t.charCodeAt(c++)&255];while(c<l&&r==-1);if(r==-1)break;do s=e[t.charCodeAt(c++)&255];while(c<l&&s==-1);if(s==-1)break;h+=String.fromCharCode(r<<2|(s&48)>>4);do{if(a=t.charCodeAt(c++)&255,a==61)return h;a=e[a]}while(c<l&&a==-1);if(a==-1)break;h+=String.fromCharCode((s&15)<<4|(a&60)>>2);do{if(o=t.charCodeAt(c++)&255,o==61)return h;o=e[o]}while(c<l&&o==-1);if(o==-1)break;h+=String.fromCharCode((a&3)<<6|o)}return h},this.utf16to8=function(t){var r,s,a,o;for(r="",a=t.length,s=0;s<a;s++)o=t.charCodeAt(s),o>=1&&o<=127?r+=t.charAt(s):o>2047?(r+=String.fromCharCode(224|o>>12&15),r+=String.fromCharCode(128|o>>6&63),r+=String.fromCharCode(128|o>>0&63)):(r+=String.fromCharCode(192|o>>6&31),r+=String.fromCharCode(128|o>>0&63));return r},this.utf8to16=function(t){var r,s,a,o,c,l;for(r="",a=t.length,s=0;s<a;)switch(o=t.charCodeAt(s++),o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r+=t.charAt(s-1);break;case 12:case 13:c=t.charCodeAt(s++),r+=String.fromCharCode((o&31)<<6|c&63);break;case 14:c=t.charCodeAt(s++),l=t.charCodeAt(s++),r+=String.fromCharCode((o&15)<<12|(c&63)<<6|(l&63)<<0);break}return r},this.charToHex=function(t){var r,s,a;for(r="",s=0;s<t.length;)a=t.charCodeAt(s++).toString(16),r+="\\0x"+a,r+=s>0&&s%8==0?`\r
6
+ `:", ";return r}}function Tn(){var n=0,e=new Object;this.add=function(t,r){this.containsKey(t)||n++,e[t]=r},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&n--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var r in e)if(e[r]==t)return!0;return!1},this.getValues=function(){var t=[];for(var r in e)t.push(e[r]);return t},this.getKeys=function(){var t=[];for(var r in e)t.push(r);return t},this.getSize=function(){return n},this.clear=function(){n=0,e=new Object}}function Pn(n){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new Tn,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,r){var s=Object.id(r).toString();this.callbacks_.add(s,r);var a={MsgId:s,Method:e+"|"+n};t&&(a.Param=JSON.stringify(t));var o=JSON.stringify(a);this.connect&&this.ws.send(o)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),r=t.MsgId;if(this.callbacks_.containsKey(r)){var s=this.callbacks_.getValue(r);s(t.Result,t.Response),this.callbacks_.remove(r)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},r){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],r)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:r},s){this.exec("Arm_VerifyPIN",[parseInt(e),r,t],s)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},r){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],r)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},r){this.exec("Arm_LEDControl",[parseInt(e),t],r)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},r){this.exec("Arm_SwitchProtocol",[parseInt(e),t],r)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:r,AttrBuffer:s},a){this.exec("Arm_CreateFile",[parseInt(e),r,parseInt(t),s],a)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:r,FileOffset:s,DataInput:a},o){this.exec("Arm_WriteFile",[parseInt(e),r,parseInt(t),parseInt(s),a],o)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:r},s){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),r],s)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:r,DataLen:s},a){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),r,r.length,parseInt(s)],a)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:r},s){this.exec("Arm_DeleteFile",[parseInt(e),r,parseInt(t)],s)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:r},s){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),r],s)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:r},s){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),r],s)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},r){this.exec("Arm_WriteShareMemory",[parseInt(e),t],r)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},r){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],r)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:r,TryCount:s,PinFlag:a},o){this.exec("Arm_ChangePIN",[parseInt(e),a,r,t,parseInt(s)],o)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},r){this.exec("Arm_ResetUserPIN",[parseInt(e),t],r)},this.Arm_SetUserID=function({Handle:e,UserID:t},r){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],r)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},r){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],r)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},r){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],r)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},r){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],r)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},r){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],r)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:r,RsaPriFileID:s,RsaPriFileSize:a},o){this.exec("Arm_RsaPri",[parseInt(e),parseInt(s),parseInt(a),t,r],o)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:r,RsaPubInData:s,RsaPubFileSize:a},o){this.exec("Arm_RsaPub",[parseInt(e),parseInt(a),r,t,t.length,s],o)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:r},s){this.exec("Arm_EccSign",[parseInt(e),parseInt(r),t],s)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:r,EccSignData:s},a){this.exec("Arm_EccVerify",[parseInt(e),r,r.length,t,s],a)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:r},s){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(r),t],s)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:r,Sm2SignData:s},a){this.exec("Arm_Sm2Verify",[parseInt(e),r,r.length,t,s],a)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:r,TdesInData:s},a){this.exec("Arm_TDES",[parseInt(e),parseInt(r),t,s],a)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:r,Sm4InData:s},a){this.exec("Arm_SM4",[parseInt(e),parseInt(r),t,s],a)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:r},s){this.exec("Arm_HASH",[parseInt(e),t,r],s)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:r},s){this.exec("Arm_Seed",[parseInt(e),r,t],s)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},r){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],r)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:r,SonCount:s,StartUserID:a,AdminTryCount:o,UserPin:c,UserTryCount:l,UpdateRSAPriKey:h},E){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),r,c,parseInt(l),parseInt(o),h,parseInt(a),parseInt(s)],E)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},r){this.exec("Arm_InitSon",[parseInt(e),t],r)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},r){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],r)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:r,FileID:s,FileType:a,Offset:o,DataLen:c,DataBuffer:l,UpRSAPubKey:h},E){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,r,a,parseInt(s),parseInt(o),l,h,parseInt(c)],E)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:r,FileID:s,FileType:a,Offset:o,DataLen:c,DataBuffer:l},h){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,r,a,parseInt(s),parseInt(o),l,parseInt(c)],h)},this.Arm_Update=function({Handle:e,UpdateData:t},r){this.exec("Arm_Update",[parseInt(e),t],r)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:r},s){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(r)],s)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:r,Priv:s,IsReset:a,IsDecOnRAM:o},c){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[r,parseInt(t),parseInt(e),parseInt(s),parseInt(o),parseInt(a)],c)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},r){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],r)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},r){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],r)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},r){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],r)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:r,IsDecOnRAM:s},a){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(s),parseInt(r)],a)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:r,InBuffer:s,CallLimit:a},o){this.exec("Arm_Set_EXE_FILE_INFO",[s,parseInt(r),parseInt(e),parseInt(a),t,t.length],o)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const bn={HID:0},ue={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},Be={USER:0};class ct{constructor(){Y(this,"Base64",new vn);Y(this,"AtlCtrl",null);Y(this,"ArmCount",0);Y(this,"ArmIndex",0);Y(this,"ArmHandle",0);Y(this,"ArmRandom","");try{this.AtlCtrl=new Pn("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((r,s)=>{r?(this.ArmCount=+s,e(s)):t(s)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,r)=>{this.AtlCtrl.Arm_Open({Index:e},(s,a)=>{s?(this.ArmHandle=+a,t(a)):(this.ArmHandle=a,r(a))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_Close({Handle:e},(s,a)=>{s?t(a):r(a)})})}armChangePIN(e,t,r=255,s=Be.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((o,c)=>{this.AtlCtrl.Arm_ChangePIN({Handle:a,NewPIN:e,OldPIN:t,TryCount:r,PinFlag:s},(l,h)=>{l&&h==0?(this.ArmPin=e,o(h)):c(h)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(a,o)=>{a?(this.ArmRandom=o,r(o)):s(o)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(s,a)=>{s?(this.ArmDeadline=a,t(a)):r(a)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(a,o)=>{a?(this.ArmUKey=o,r(o)):s(o)})})}armGetDongleInfo(e=0,t=ue.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((r,s)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(a,o)=>{if(a){switch(t){case ue.USER_ID:this.ArmUid=o;break;case ue.PRODUCT_ID:this.ArmPid=o;break;case ue.HARDWARE_ID:this.ArmHid=o;break}r(o)}else s(o)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(a,o)=>{a&&o==0?r(o):s(o)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_RFS({Handle:e},(s,a)=>{s&&a==0?t(a):r(a)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(a,o)=>{if(a&&o.length>0)try{o=this.Base64.decode(o),r(o)}catch(c){console.error(c),r(o)}else s(o)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(s,a)=>{s&&a==0?t(a):r(a)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(a,o)=>{a&&o==0?r(o):s(o)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(a,o)=>{a&&o==0?r(o):s(o)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(a,o)=>{a&&o==0?r(o):s(o)})})}armSwitchProtocol(e=bn.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(a,o)=>{a&&o==0?r(o):s(o)})})}armVerifyPIN(e,t=Be.USER,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,a)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:r,UserPin:e,UserType:t},(o,c)=>{o&&c==0?(this.ArmPin=e,s(c)):a(c)})})}armReadData(e=0,t=128,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,a)=>{this.AtlCtrl.Arm_ReadData({Handle:r,Offset:e,ReadLength:t},(o,c)=>{o?(this.ArmData=c,s(c)):a(c)})})}armWriteData(e,t=0,r=this.ArmHandle){if(this.AtlCtrl)return new Promise((s,a)=>{this.AtlCtrl.Arm_WriteData({Handle:r,Offset:t,DataInput:e},(o,c)=>{o&&c==0?s(c):a(c)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,r)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(s,a)=>{s?(this.ArmData=a,t(a)):r(a)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((r,s)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(a,o)=>{a&&o==0?r(o):s(o)})})}}const lt="0123456789abcdeffedcba9876543210",ut="4b0de988570c3a0f",Ln=window.ENCRYPT;let ne=Ln&&new ct;function dt(n=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",r=e.length;for(;n>0;)t+=e[Math.floor(Math.random()*r)],n--;return t}function ht(){return m(this,null,function*(){return ne||(ne=new ct),new Promise((n,e)=>{ne.armEnum().then(t=>{n(+t)}).catch(t=>{X.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}jt.throttle(()=>m(exports,null,function*(){const n=yield ht(),e={};if(typeof n!="number"||n<=0)X.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield On();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(X.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(X.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Mn(n=0){return m(this,null,function*(){return ne?new Promise((e,t)=>{ne.armGetDongleInfo(n).then(r=>{r?e(r):(X.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(r))}).catch(r=>{t(r)})}):X.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function On(){return m(this,null,function*(){if(!ne)return X.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const n=yield ht();let e=[];for(let t=0;t<n;t++){const r=yield Mn(t);e.push(r)}return e})}dt(16);dt(16);const mt=window.meta.app.inspect?J.SM4.constants.CBC:J.SM4.constants.ECB,{publicKey:Vr,privateKey:Kr}=J.SM2.generateKeyPair();function Un(n,e,t={}){const r=ft(ut),s=t.mode||mt;t=s===J.SM4.constants.ECB?O({mode:s,inputEncoding:"utf8",outputEncoding:"hex"},t):O({iv:lt,mode:s,inputEncoding:"utf8",outputEncoding:"hex"},t);let a="";try{a=J.SM4.encrypt(n,r,t)}catch(o){console.log("err: ",o)}return a}function Hn(n,e,t={}){const r=ft(ut),s=t.mode||mt;return t=s===J.SM4.constants.ECB?O({mode:s,inputEncoding:"hex",outputEncoding:"utf8"},t):O({iv:lt,mode:s,inputEncoding:"hex",outputEncoding:"utf8"},t),J.SM4.decrypt(n,r,t)}function ft(n){return[...n].map(e=>e.charCodeAt().toString(16)).join("")}const ae=n=>{const{onClose:e,customClass:t}=n;return X.ElMessage(ce(O({},n),{center:!0,customClass:`sy-message ${t||""}`,onClose:s=>{e&&e(s)}}))};["success","warning","info","error"].forEach(n=>{ae[n]=e=>ae(typeof e=="string"?{type:n,message:e}:ce(O({},e),{type:n}))});Pe.createPinia();function de(n){return n=at&&we(n)?Hn(n):n,we(n)?JSON.parse(n):n}function Ge(n){return n=at&&we(n)?Un(n):n,JSON.stringify(n)}function ee(n,e,t,r){const s=new StorageEvent("storage",{url:window.location.href,key:n,oldValue:e,newValue:t,storageArea:r});window.dispatchEvent(s)}const be={getLocal:n=>{try{const e=window.localStorage.getItem(n);return de(e)}catch(e){console.error(e)}},setLocal:(n,e)=>{try{const t=window.localStorage.getItem(n),r=Ge(e);window.localStorage.setItem(n,r),ee(n,t,r,window.localStorage)}catch(t){console.error(t)}},eachLocal:n=>{if(!n||Ee(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const r=window.localStorage.key(e);n((void 0).getLocal(r),r)}},clearLocal:()=>{window.localStorage.clear(),ee(null,null,null,window.localStorage)},removeLocal:n=>{const e=window.localStorage.getItem(n);window.localStorage.removeItem(n),ee(n,e,null,window.localStorage)},getSession:n=>{try{const e=window.sessionStorage.getItem(n);return de(e)}catch(e){console.error(e)}},setSession:(n,e)=>{try{const t=window.sessionStorage.getItem(n),r=Ge(e);window.sessionStorage.setItem(n,r),ee(n,t,r,window.sessionStorage)}catch(t){console.error(t)}},eachSession:n=>{if(!n||Ee(n)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const r=window.sessionStorage.key(e);n((void 0).getSession(r),r)}},clearSession:()=>{window.sessionStorage.clear(),ee(null,null,null,window.sessionStorage)},removeSession:n=>{const e=window.sessionStorage.getItem(n);window.sessionStorage.removeItem(n),ee(n,e,null,window.sessionStorage)},onStorageChange:n=>{if(!n||Ee(n)!=="Function")return console.error("传递参数非函数类型!");const e=t=>{n({url:t.url,key:t.key,newValue:t.newValue?de(t.newValue):null,oldValue:t.oldValue?de(t.oldValue):null,storageArea:t.storageArea})};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}}},kn=(n,e)=>new Promise((t,r)=>{G.postApi("/filehandle/save",{path:n,data:e}).then(s=>{s.res.success?t(!0):r(!1)})}),Fn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#1afa29" p-id="1156"></path></svg>',Ve='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1657" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#808080" p-id="1658"></path></svg>',Nn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25776" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M377.083 125.44c74.606-135.314 195.292-135.314 269.897 0l346.332 629.394c74.606 135.315 9.508 245.395-145.189 245.395H175.94c-154.697 0-219.428-109.715-145.188-245.395L377.083 125.44z" fill="#FF2D16" p-id="25777"></path><path d="M567.986 328.046c0-31.086-25.234-55.955-55.954-55.955s-55.954 25.235-55.954 55.955v280.137c0 31.086 25.234 55.954 55.954 55.954s55.954-25.234 55.954-55.954V328.046z m-111.908 448h111.908v111.908H456.078z" fill="#FFFFFF" p-id="25778"></path></svg>',Bn={name:"局放测点",label:"局放测点",create:function(n,e){return m(this,null,function*(){const{transformControls:t}=e,r=document.createElement("div");r.style.position="relative",r.style.zIndex="1";const s=document.createElement("div");s.style.width="1.3vw",s.style.height="1.3vw",s.style.display="flex",s.style.alignItems="center",s.style.justifyContent="center",s.style.cursor="pointer",s.style.pointerEvents="auto",s.style.userSelect="none",s.innerHTML=Ve;const a=document.createElement("style");a.innerHTML=`
7
7
  .icon { width: 100%; height: 100%; display: block; }
8
- `,n.append(a),n.append(s);const o=document.createElement("div");Object.assign(o.style,{position:"absolute",top:"0",left:"1.8vw",display:"none",flexDirection:"column",gap:"10px",padding:"10px",borderRadius:"4px",border:"1px solid rgba(255, 255, 255, 0.2)",backdropFilter:"blur(12px)",background:"#24262933",minWidth:"12vw",zIndex:999}),r.valueEleId||(r.valueEleId=ge()),o.innerHTML=`
9
- <div style="padding-bottom: 10px; font-size: 16px; color: #ffffff; border-bottom: 1px solid rgba(255, 113, 108, 0.5);white-space: nowrap;">${r.name}</div>
8
+ `,r.append(a),r.append(s);const o=document.createElement("div");Object.assign(o.style,{position:"absolute",top:"0",left:"1.8vw",display:"none",flexDirection:"column",gap:"10px",padding:"10px",borderRadius:"4px",border:"1px solid rgba(255, 255, 255, 0.2)",backdropFilter:"blur(12px)",background:"#24262933",minWidth:"12vw",zIndex:999}),n.valueEleId||(n.valueEleId=Se()),o.innerHTML=`
9
+ <div style="padding-bottom: 10px; font-size: 16px; color: #ffffff; border-bottom: 1px solid rgba(255, 113, 108, 0.5);white-space: nowrap;">${n.name}</div>
10
10
  <div style="font-size: 14px; color: #cae4ff;">幅值峰值</div>
11
11
  <div style="display: flex; align-items: flex-end; gap: 10px; color: #FF716C;">
12
- <span id="${r.valueEleId}" style="font-size: 24px;font-weight: 600;">${r.value}</span>
12
+ <span id="${n.valueEleId}" style="font-size: 24px;font-weight: 600;">${n.value}</span>
13
13
  <span style="font-size: 14px;">dBm</span>
14
14
  </div>
15
- `;const c=new jt.CSS2DObject(n);c.name=r.name,c.dataId=r.guid,c.userData.params=r,s.addEventListener("mouseover",()=>{o.style.display="flex",n.className="top-info"}),s.addEventListener("mouseleave",()=>{o.style.display="none",n.className=""}),s.addEventListener("click",()=>{Ae.emit("three-event",{type:"pd-sensor-click",data:c}),r.preview||setTimeout(()=>{t.attach(c)},100)}),n.append(o);const l=S=>{S===0?s.innerHTML=Ve:S===1?s.innerHTML=Hn:S===2&&(s.innerHTML=Un)},h=S=>{const N=document.getElementById(r.valueEleId);N&&(N.innerText=S)};return c.changeState=l,c.changeValue=h,setTimeout(()=>{l(r.state),h(r.value)},200),c})},getStorage:function(r){return r.userData.params}};var at;x.config(M({driver:[x.INDEXEDDB,x.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((at=window.meta.storage)==null?void 0:at.config)||{}));function Fn(){return{getKey:p=>m(this,null,function*(){return yield x.key(p)}),getKeys:()=>m(this,null,function*(){return yield x.keys()}),getItem:p=>m(this,null,function*(){if(p)return yield x.getItem(p)}),setItem:(p,k)=>m(this,null,function*(){if(p)return yield x.setItem(p,k)}),removeItem:p=>m(this,null,function*(){if(p)return yield x.removeItem(p)}),clearItems:()=>m(this,null,function*(){return yield x.clear()}),iterateItems:(p,k)=>m(this,null,function*(){if(p)return yield x.iterate(p,k)}),getReady:()=>m(this,null,function*(){return yield x.ready()}),getLength:()=>m(this,null,function*(){return yield x.length()}),getDriver:()=>m(this,null,function*(){return yield x.driver()}),setDriver:p=>m(this,null,function*(){if(p)return yield x.setDriver(p)}),setConfig:p=>m(this,null,function*(){if(p)return yield x.config(p)}),dropInstance:p=>m(this,null,function*(){if(p)return yield x.dropInstance(p)}),createInstance:p=>m(this,null,function*(){if(p)return yield x.createInstance(p)})}}const Nn="THREED_LOG_BUFFER",Bn="THREED_CURRSCENE",Gn="THREED_ACTIVE_MENU",Kn="THREED_PIXEL_RATIO",le="THREED_MODEL_DBNAME",we="THREED_MODEL_DBSTORE",zn="THREED_SCENE_PREVIEW",Se="THREED_MODEL_LOAD_KEY",re="THREED_PREVIEW_URL_KEY",Vn="THREED_ADDON_EDITOR_JSON",$n="THREED_SCENE_STORAGE_SUFFIX",Ie={step:.1},qn=80,Et=30,Wn=1e3,jn=1200,Jn=3e5,Xn="三维测试",Yn="灯光",Qn=1,Zn=["环境光","平行光","点光源","聚光灯","半球光","平面光"],At=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),er=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],gt=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),wt=new Set(["CSS2DObject","CSS3DObject"]),tr=Object.assign({"/src/views/threed/models/pd-sensor.js":kn}),nr=Object.assign({}),rr={环境光:()=>new O.THREE.AmbientLight(16777215,1),平行光:()=>new O.THREE.DirectionalLight(16777215,1),点光源:()=>new O.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new O.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new O.THREE.HemisphereLight(16777215,0,1),平面光:()=>new O.THREE.RectAreaLight(16777215,1,100,100)},sr=[{name:"荧光流动",commonUniforms:!0,vertex:"vUv-material",fragment:`
15
+ `;const c=new Xt.CSS2DObject(r);c.name=n.name,c.dataId=n.guid,c.userData.params=n,s.addEventListener("mouseover",()=>{o.style.display="flex",r.className="top-info"}),s.addEventListener("mouseleave",()=>{o.style.display="none",r.className=""}),s.addEventListener("click",()=>{ge.emit("three-event",{type:"pd-sensor-click",data:c}),n.preview||setTimeout(()=>{t.attach(c)},100)}),r.append(o);const l=E=>{E===0?s.innerHTML=Ve:E===1?s.innerHTML=Fn:E===2&&(s.innerHTML=Nn)},h=E=>{const b=document.getElementById(n.valueEleId);b&&(b.innerText=E)};return c.changeState=l,c.changeValue=h,setTimeout(()=>{l(n.state),h(n.value)},200),c})},getStorage:function(n){return n.userData.params}};var rt;v.config(O({driver:[v.INDEXEDDB,v.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((rt=window.meta.storage)==null?void 0:rt.config)||{}));function Gn(){return{getKey:_=>m(this,null,function*(){return yield v.key(_)}),getKeys:()=>m(this,null,function*(){return yield v.keys()}),getItem:_=>m(this,null,function*(){if(_)return yield v.getItem(_)}),setItem:(_,V)=>m(this,null,function*(){if(_)return yield v.setItem(_,V)}),removeItem:_=>m(this,null,function*(){if(_)return yield v.removeItem(_)}),clearItems:()=>m(this,null,function*(){return yield v.clear()}),iterateItems:(_,V)=>m(this,null,function*(){if(_)return yield v.iterate(_,V)}),getReady:()=>m(this,null,function*(){return yield v.ready()}),getLength:()=>m(this,null,function*(){return yield v.length()}),getDriver:()=>m(this,null,function*(){return yield v.driver()}),setDriver:_=>m(this,null,function*(){if(_)return yield v.setDriver(_)}),setConfig:_=>m(this,null,function*(){if(_)return yield v.config(_)}),dropInstance:_=>m(this,null,function*(){if(_)return yield v.dropInstance(_)}),createInstance:_=>m(this,null,function*(){if(_)return yield v.createInstance(_)})}}const Vn="THREED_LOG_BUFFER",Kn="THREED_CURRSCENE",zn="THREED_ACTIVE_MENU",$n="THREED_PIXEL_RATIO",he="THREED_MODEL_DBNAME",Ie="THREED_MODEL_DBSTORE",qn="THREED_SCENE_PREVIEW",ye="THREED_MODEL_LOAD_KEY",ie="THREED_PREVIEW_URL_KEY",Wn="THREED_ADDON_EDITOR_JSON",jn="THREED_SCENE_STORAGE_SUFFIX",Ce={step:.1},Xn=80,pt=30,Yn=1e3,Jn=1200,Qn=3e5,Zn="三维测试",er="灯光",tr=1,nr=["环境光","平行光","点光源","聚光灯","半球光","平面光"],_t=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),rr=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],Et=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),At=new Set(["CSS2DObject","CSS3DObject"]),sr=Object.assign({"/src/views/threed/models/pd-sensor.js":Bn}),ir=Object.assign({}),ar={环境光:()=>new U.THREE.AmbientLight(16777215,1),平行光:()=>new U.THREE.DirectionalLight(16777215,1),点光源:()=>new U.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new U.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new U.THREE.HemisphereLight(16777215,0,1),平面光:()=>new U.THREE.RectAreaLight(16777215,1,100,100)},or=[{name:"荧光流动",commonUniforms:!0,vertex:"vUv-material",fragment:`
16
16
  vec4 o = gl_FragColor.rgba;
17
17
  vec2 u = gl_FragCoord.xy;
18
18
  vec2 v = iResolution.xy;
@@ -50,4 +50,4 @@
50
50
  uv *= 2.0 * ( cos(iTime * 2.0) -2.5);
51
51
  float anim = sin(iTime * 12.0) * 0.1 + 1.0;
52
52
  vec3 col = cheap_star(uv, anim) * vec3(0.35,0.2,0.15);
53
- `,key:"col",commonFinish:!0,render:"iTime+speed"}];let ne=null,U=null;const $e=r=>(r==null?void 0:r.name)||(r==null?void 0:r.label)||"",St=(r={})=>Object.values(r).filter(e=>e&&(e.label||e.name)),ir=St(tr),ar=St(nr),or=()=>({THREED_GUI_PARAMS:Ie,THREED_LOG_BUFFER:Nn,THREED_CURRSCENE:Bn,THREED_ACTIVE_MENU:Gn,THREED_PIXEL_RATIO:Kn,THREED_IMPORT_SIZE:qn,THREED_LIGHT_TYPES:Zn,THREED_EXPORT_BATCH:Et,THREED_RELOAD_DELAY:Wn,THREED_MODEL_DBNAME:le,THREED_MODEL_DBSTORE:we,THREED_SCENE_PREVIEW:zn,THREED_USER_DATA_KEYS:At,THREED_MODEL_LOAD_KEY:Se,THREED_PREVIEW_URL_KEY:re,THREED_ADDON_EDITOR_JSON:Vn,THREED_EXPORT_NODE_COUNT:jn,THREED_DEFAULT_SCENE_NAME:Xn,THREED_DEFAULT_ACTIVE_MENU:Yn,THREED_DEFAULT_PIXEL_RATIO:Qn,THREED_EXPORT_VERTEX_COUNT:Jn,THREED_SCENE_EXCLUDE_TYPES:er,THREED_EXPORT_EXCLUDE_TYPES:gt,THREED_EXPORT_RUNTIME_TYPES:wt,THREED_SCENE_STORAGE_SUFFIX:$n});function cr(){const{createInstance:r,dropInstance:e}=Fn(),t="/";let n=[];const s=i=>{let u=URL.createObjectURL(i);return n.push(u),u},a=()=>{n.forEach(i=>URL.revokeObjectURL(i)),n=[]},o=()=>m(this,null,function*(){return yield h(),{clearRequest:c,getAllRequest:k,getRequest:p,status:!0,message:"数据库打开成功",DATABASE:U}}),c=i=>m(this,null,function*(){if(!i)return{status:!1,message:"删除失败"};yield h(),yield U.removeItem(i);const u=yield G();return u.list=u.list.filter(d=>d.name!==i),{status:!0,message:"删除成功"}}),l=(...u)=>m(this,[...u],function*(i=le){U=null,ne=null,yield e({name:i,storeName:we})}),h=()=>m(this,null,function*(){return U||(ne||(ne=r({name:le,storeName:we}).then(i=>(U=i,i))),yield ne)}),S=i=>{if(!i)return!1;const u=String(i.message||"");return i.name==="DataError"||u.includes("in-line keys")},N=()=>m(this,null,function*(){U=null,ne=null,yield e({name:le}),yield h()});let K=null;const G=()=>m(this,null,function*(){return window.threeEditorDB?window.threeEditorDB:(K||(K=m(this,null,function*(){const i=yield o(),{data:u}=yield i.getAllRequest();return window.threeEditorDB={db:i,list:u},window.threeEditorDB})),yield K)}),p=i=>m(this,null,function*(){if(!i)return{status:!1,message:"获取失败"};yield h();const u=yield U.getItem(i);if(u!=null&&u.blob&&!i)return{status:!0,message:"获取成功",url:s(u.blob)};if(!i)return{status:!1,message:"获取失败"};const d=yield fetch(i).then(v=>v.blob()),f={blob:d};try{yield U.setItem(i,f)}catch(v){if(!S(v))throw v;yield N(),yield U.setItem(i,f)}const w=yield G(),H=M({name:i},f),D=w.list.findIndex(v=>v.name===i);return D>-1?w.list.splice(D,1,H):w.list.push(H),{status:!0,message:"文件缓存成功",url:s(d)}}),k=()=>m(this,null,function*(){yield h();const i=[];return U&&(yield U.iterate((u,d)=>{i.push(ae(M({},u||{}),{name:d}))})),window.threeEditorDB&&(window.threeEditorDB.list=i),{status:!0,message:"获取成功",data:i}}),Y=()=>m(this,null,function*(){var d;const{res:i}=yield B.getApi("/filehandle/scan",{path:lt.threeModelPath,extension:"glb,gltf"}),u=[];if(((d=i==null?void 0:i.children)==null?void 0:d.length)>0)for(const f of i.children)u.push({name:f.name,path:"/"+f.path});return u}),q=()=>window.GUI_PARAMS||Ie,_=()=>window.threeEditor||null,E=()=>window.editorJsons||[],T=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),g=()=>ir,P=()=>rr||{},I=()=>window[re]||"",y=()=>ar,b=()=>window.devicePixelRatio||1,R=()=>window[re]||"",L=()=>{const i=g(),u=y();return{modelDesigns:i,componentDesigns:u,modelList:i.map(d=>d.label),componentList:u.map(d=>d.label)}},F=(i,u)=>{var d;return(d=i==null?void 0:i.__DESIGNS__)==null?void 0:d.find(f=>f.label===u)},W=(i=0)=>!Number.isFinite(i)||i<=0?"0 B":i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:i<1024*1024*1024?`${(i/1024/1024).toFixed(1)} MB`:`${(i/1024/1024/1024).toFixed(2)} GB`,Q=i=>{const u=window[Se];typeof u=="function"&&u(i)},j=i=>!!i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z),te=i=>{var u,d;return!i||!i.visible||(u=i.userData)!=null&&u.excludeFromExport||i.isTransformControls||i.isHelper||i.isLight||i.isPoints||(d=i.type)!=null&&d.includes("Helper")||gt.has(i.type)||wt.has(i.type)||i.isCSS2DObject||i.isCSS3DObject?!1:i.isMesh||i.isGroup||i.isObject3D||i.isLine},me=(i,u)=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)?i:u,Ct=i=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)&&Number.isFinite(i.w)?i:{x:0,y:0,z:0,w:1},Le=i=>{if(!(i!=null&&i.isObject3D))return;const u=me(i.position,{x:0,y:0,z:0});i.position.set(u.x,u.y,u.z);const d=me(i.scale,{x:1,y:1,z:1});i.scale.set(d.x===0?1:d.x,d.y===0?1:d.y,d.z===0?1:d.z);const f=me(i.up,{x:0,y:1,z:0});i.up.set(f.x,f.y,f.z);const w=Ct(i.quaternion);i.quaternion.set(w.x,w.y,w.z,w.w),i.pivot&&!j(i.pivot)&&delete i.pivot,i.updateMatrix(),i.updateMatrixWorld(!1)},Rt=(i,u="_blank")=>window.open(i,u),Dt=(i,u="")=>window.prompt(i,u),vt=()=>window.location.reload(),xt=()=>document.documentElement.classList.remove("dark"),Tt=i=>{if(!Array.isArray(i==null?void 0:i.__DESIGNS__))return L();const u=[...g(),...y()],d=new Set(i.__DESIGNS__.map(f=>$e(f)));return u.forEach(f=>{const w=$e(f);!w||d.has(w)||(d.add(w),i.__DESIGNS__.unshift(f))}),L()},Pt=i=>{if(!Array.isArray(i==null?void 0:i.__GLSLLIB__))return;const u=new Set(i.__GLSLLIB__.map(d=>d==null?void 0:d.name));sr.forEach(d=>{u.has(d.name)||(u.add(d.name),i.__GLSLLIB__.push(d))})},fe=(i={})=>{const u={};return Object.entries(i||{}).forEach(([d,f])=>{if(!(At.has(d)||typeof f=="function")){if(!f||["string","number","boolean"].includes(typeof f)){u[d]=f;return}if(Array.isArray(f)){try{u[d]=structuredClone(f)}catch(w){return}return}if(!(f.isObject3D||f.isMaterial||f.isTexture||f.nodeType))try{u[d]=structuredClone(f)}catch(w){return}}}),u},bt=(i=Ie)=>{window.GUI_PARAMS=i},Lt=i=>{window.threeEditor=i},Mt=i=>{window.threeEditorDB=i},Ot=i=>{window[Se]=i},Ht=(i="")=>{window[re]=i},Ut=(i="")=>{window[re]=i},Me=i=>{var d;const u=[];return(d=i==null?void 0:i.children)==null||d.forEach(f=>{te(f)&&u.push(f)}),u},Oe=(i=[])=>{const u={rootCount:i.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return i.forEach(d=>{d.traverse(f=>{var w,H,D;if(te(f)){u.nodeCount+=1,f.isMesh&&(u.meshCount+=1,u.vertexCount+=((D=(H=(w=f.geometry)==null?void 0:w.attributes)==null?void 0:H.position)==null?void 0:D.count)||0);return}f!==d&&(u.skippedCount+=1)})}),u},He=()=>new Promise(i=>requestAnimationFrame(()=>setTimeout(i,0))),Ue=()=>new Promise(i=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>i(),{timeout:80});return}setTimeout(i,0)}),kt=(i,u)=>m(this,null,function*(){var w;if(!te(i))return null;const d=i.clone(!1);d.userData=fe(i.userData),j(i.pivot)?d.pivot=new O.THREE.Vector3(i.pivot.x,i.pivot.y,i.pivot.z):"pivot"in d&&delete d.pivot,Le(d);const f=[{source:i,clone:d}];for(;f.length;){const H=f.shift();for(const D of H.source.children){if(!te(D)){u.skippedCount+=1;continue}const v=D.clone(!1);v.userData=fe(D.userData),j(D.pivot)?v.pivot=new O.THREE.Vector3(D.pivot.x,D.pivot.y,D.pivot.z):"pivot"in v&&delete v.pivot,Le(v),H.clone.add(v),f.push({source:D,clone:v}),u.processedCount+=1,u.processedCount%Et===0&&(yield(w=u.onProgress)==null?void 0:w.call(u,{processedCount:u.processedCount,totalCount:u.totalCount,skippedCount:u.skippedCount,progress:18+Math.min(u.processedCount/Math.max(u.totalCount,1)*54,54)}),yield He())}}return d});return{baseUrl:t,getModels:Y,getRequest:p,reloadPage:vt,promptInput:Dt,waitForIdle:Ue,waitForPaint:He,clearRequest:c,getGuiParams:q,setGuiParams:bt,getAllRequest:k,getEditorJsons:E,getThreeEditor:_,formatFileSize:W,setThreeEditor:Lt,removeDarkClass:xt,openExternalUrl:Rt,getThreedModels:g,getViewportSize:T,buildExportScene:(d,...f)=>m(this,[d,...f],function*(i,u={}){const w=Me(i),H=Oe(w),D=new O.THREE.Scene,v={totalCount:H.nodeCount,processedCount:0,skippedCount:0,onProgress:u.onProgress};for(const Ft of w){const ke=yield kt(Ft,v);ke&&D.add(ke),yield Ue()}return D.updateMatrixWorld(!0),H.skippedCount+=v.skippedCount,{exportScene:D,exportObjects:w,stats:H}}),createModelDbApi:o,getEditorPreviewSceneUrl:R,sanitizeUserData:fe,setThreeEditorDB:Mt,findThreedDesign:F,getThreedLightMap:P,collectExportStats:Oe,getPreviewSceneUrl:I,setEditorPreviewSceneUrl:Ut,setPreviewSceneUrl:Ht,setModelLoadHander:Ot,isExportableObject:te,deleteThreeEditorDB:l,ensureThreeEditorDB:G,getDevicePixelRatio:b,getThreedComponents:y,collectExportObjects:Me,resetModelDbInstance:N,ensureModelDbInstance:h,getLocalDesignMenuData:L,invokeModelLoadHandler:Q,isLegacyInlineKeyError:S,ensureThreedShaderLibrary:Pt,ensureThreedDesignRegistry:Tt,createBlobUrl:s,revokeModelObjectUrls:a}}const{THREED_LOG_BUFFER:xe,THREED_CURRSCENE:ue,THREED_ACTIVE_MENU:Te,THREED_PIXEL_RATIO:Pe,THREED_SCENE_PREVIEW:be,THREED_ADDON_EDITOR_JSON:de,THREED_DEFAULT_SCENE_NAME:lr,THREED_DEFAULT_ACTIVE_MENU:ye,THREED_DEFAULT_PIXEL_RATIO:Ce,THREED_SCENE_STORAGE_SUFFIX:qe}=or(),ur=[xe,ue,Te,Pe,be,de],V=(r,e)=>{const t=ve.getLocal(r);return t==null?e:t},z=(r,e)=>{r&&ve.setLocal(r,e)},Ee=r=>{r&&ve.removeLocal(r)},dr=(r,e)=>{var n,s;const t=(n=r==null?void 0:r.trim)==null?void 0:n.call(r);return t&&e.some(a=>a.name===t)?t:((s=e[0])==null?void 0:s.name)||lr},Re=(r=[])=>Array.isArray(r)?r.filter(e=>typeof e=="string"&&e):[],We=()=>{const r=[],e=V(ue,{name:"",path:""}),t=Number.parseFloat(V(Pe,Ce));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:r,previewScene:!!V(be,!1),activeMenuTitle:V(Te,ye)||ye,pixelRatio:Number.isFinite(t)&&t>0?t:Ce,logarithmicDepthBuffer:V(xe,!0)!==!1,addonEditorJson:Re(V(de,[]))}},It=De.defineStore("threed",{state:()=>We(),actions:{getSceneList(){return m(this,null,function*(){var e;const r=yield B.getCommonApi("threedfloorplan",{limit:1e4,ordering:"-create_time"});(e=r==null?void 0:r.data)!=null&&e.length?(this.sceneList=r.data,this.currScene.path?this.sceneList.find(n=>n.id===this.currScene.id)||this.setCurrScene({name:"",path:""}):this.setCurrScene(this.sceneList[0])):(this.sceneList=[],this.setCurrScene({name:"",path:""}))})},setSceneList(r){this.sceneList=r},setSceneName(r){this.sceneName=dr(r,this.sceneList),z(ue,this.sceneName)},createScene(r,e=""){return m(this,null,function*(){var c,l;const t=(c=r==null?void 0:r.trim)==null?void 0:c.call(r);if(!t||this.sceneList.some(h=>h.name===t))return!1;const n=lt.threeSavePath+"/"+ge()+".json",s=ge();if(!(yield B.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:n,guid:s}]})).success)return!1;if(yield On(n,e)){const h=yield B.postCommonApi("threedfloorplan",{guid:s});if((l=h==null?void 0:h.data)!=null&&l.length)return this.sceneList=[...this.sceneList,h.data[0]],h.data[0]}return!0})},deleteScene(r){return m(this,null,function*(){var n;if(!r)return;if(!(yield B.postCommonApi("query/threedfloorplan/delete",{data:[r]})).success)return!1;const t=this.sceneList.findIndex(s=>s.id===r);return t===-1?!1:(this.sceneList.splice(t,1),((n=this.currScene)==null?void 0:n.id)===r&&this.setCurrScene(this.sceneList[0]||{name:"",path:""}),!0)})},setCurrScene(r){return m(this,null,function*(){this.currScene=r,z(ue,this.currScene)})},setPreviewMode(r){this.previewScene=!!r,z(be,this.previewScene)},setActiveMenuTitle(r){this.activeMenuTitle=r||ye,z(Te,this.activeMenuTitle)},setPixelRatio(r){const e=Number.parseFloat(r);this.pixelRatio=Number.isFinite(e)&&e>0?e:Ce,z(Pe,this.pixelRatio)},setLogarithmicDepthBuffer(r){this.logarithmicDepthBuffer=!!r,z(xe,this.logarithmicDepthBuffer)},getSceneStorageKey(r){return`${r||this.sceneName}${qe}`},getSceneStorageParams(r,e=null){return V(this.getSceneStorageKey(r),e)},setSceneStorageParams(r,e){r&&z(this.getSceneStorageKey(r),e)},removeSceneStorageParams(r){r&&Ee(this.getSceneStorageKey(r))},resetTaskState(){return m(this,null,function*(){yield new Promise(r=>setTimeout(r,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=Re(V(de,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(r){this.addonEditorJson=Re(r),z(de,this.addonEditorJson)},clearThreedStorage(){ur.forEach(e=>Ee(e)),Object.keys(window.localStorage).filter(e=>e.endsWith(qe)).forEach(e=>Ee(e));const r=We();this.currScene=r.currScene,this.sceneList=r.sceneList,this.previewScene=r.previewScene,this.activeMenuTitle=r.activeMenuTitle,this.pixelRatio=r.pixelRatio,this.logarithmicDepthBuffer=r.logarithmicDepthBuffer,this.addonEditorJson=r.addonEditorJson}}}),hr={backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},mr={fov:50,near:.1,far:1e5,zoom:1,layers:{mask:1},filmOffset:0,filmGauge:35,position:{x:247.72931803058157,y:715.3890430349733,z:789.6794984861216}},fr={outputColorSpace:"srgb",toneMapping:0,toneMappingExposure:1,shadowMap:{enabled:!1,type:1},color:0,opacity:0,sortObjects:!0,localClippingEnabled:!1,autoClear:!0,autoClearColor:!0,renderListCompare:[{name:"stats",enabled:!0},{name:"controls",enabled:!0},{name:"scene",enabled:!0},{name:"css3DRender",enabled:!0},{name:"css2DRender",enabled:!0}]},pr={autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,minDistance:.01,maxDistance:1e6,maxAzimuthAngle:null,minAzimuthAngle:null,maxPolarAngle:3.141592653589793,minPolarAngle:0,maxTargetRadius:null,minTargetRadius:0,enablePan:!0,panSpeed:1,enableRotate:!0,rotateSpeed:1,enableZoom:!0,zoomSpeed:1,zoomToCursor:!1,target:{x:-38.59603927643809,y:-48.97202695679889,z:-49.19814250541991}},_r={mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},Er={renderWay:"effectComposer",fxaaPass:{enabled:!0,order:60,multPixel:1},outlinePass:{enabled:!0,order:40,edgeStrength:3,edgeGlow:0,edgeThickness:1,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16449071,hiddenEdgeColor:16449071,overlayMaterial:{blending:5,blendEquation:100,blendSrc:201,blendDst:205}},outputPass:{enabled:!0,order:50},saoPass:{enabled:!1,order:10,saoBias:.5,saoIntensity:.01,saoScale:100,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},screenMaskPass:{enabled:!1,order:70,intensity:1,maskColor:16777215,R:.2,sr:1.2},ssrPass:{enabled:!1,order:30,maxDistance:.01,distanceAttenuation:!0,opacity:.5,thickness:.018,fresnel:!0,infiniteThick:!1,bouncing:!1},unrealBloomPass:{enabled:!1,order:20,strength:1.5,radius:.4,threshold:.85}},Ar={mode:"transform",openKeyEnable:!0,rightClickMenusEnable:!0,selectChildEnabled:!1,selectChildLevel:1,stats:{showStats:!1,statsMode:0},helpers:{axes:{showAxes:!0,axesLength:1e3},grid:{showGrid:!0,size:1e3,divisions:15,colorCenterLine:4473924,colorGrid:8947848},box3:{useBox3:!0,color:16776960}}},gr=[],wr=[],Sr=[],Ir=[],yr=[],Cr=[],Rr={},Dr=[],vr={viewAngleList:[],clipping:{size:20,clipList:[]}},xr={scene:hr,perspectiveCamera:mr,webglRenderer:fr,orbitControls:pr,transformControls:_r,effectComposer:Er,handler:Ar,lightCores:gr,innerCores:wr,modelCores:Sr,drawCores:Ir,textCores:yr,particleCores:Cr,geoCores:Rr,designCores:Dr,other:vr},yt=(r,e)=>{const t=r.__vccOpts||r;for(const[n,s]of e)t[n]=s;return t},Tr=Object.assign({name:"ThreedEditor"},{__name:"editor",props:{data:{type:Object,default:()=>({})},preview:{type:Boolean,default:!1}},emits:["emit-three-editor","graph-event"],setup(r,{expose:e,emit:t}){var P;const n=t,s=r,a=It(),{currScene:o}=De.storeToRefs(a),c=((P=window.meta.threed)==null?void 0:P.draco_path)||ct;O.ThreeEditor.dracoPath=c.endsWith("/")?c:`${c}/`;let l=null,h=null;const S=C.ref(null),{setGuiParams:N,getDevicePixelRatio:K,ensureThreeEditorDB:G,createBlobUrl:p,revokeModelObjectUrls:k,ensureThreedDesignRegistry:Y}=cr();Y(O.ThreeEditor),N({step:.1});const q=()=>{var I;return(I=l==null?void 0:l.renderSceneResize)==null?void 0:I.call(l)},_=()=>m(this,null,function*(){var y,b;let I=xr;try{if(s.data&&Object.keys(s.data).length)I=s.data;else if((y=o.value)!=null&&y.path){const R=yield B.getApi((b=o.value)==null?void 0:b.path).catch(()=>({}));console.log("初始化三维场景:",R),R.res&&(I=R.res)}l?l.resetEditorStorage(I):l=new O.ThreeEditor(S.value,{fps:null,pixelRatio:K()*a.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0,logarithmicDepthBuffer:a.logarithmicDepthBuffer},sceneParams:yield E(I)})}catch(R){console.error("三维图纸初始化失败",R),l==null||l.resetEditorStorage(I)}finally{l&&setTimeout(()=>{s.preview&&(l.handler.mode="none",l.handler.helpers.axes.showAxes=!1,l.handler.helpers.box3.useBox3=!1,l.handler.helpers.grid.showGrid=!1)},200),T()}n("emit-three-editor",l),window.addEventListener("resize",q)}),E=I=>m(this,null,function*(){k(),I.designCores.forEach(L=>{L.preview=s.preview});const y=yield G(),b=y.list||[],R=structuredClone(I||{});return R.modelCores=(R.modelCores||[]).filter(L=>{const F=L.modelInfo.originPath;if(F){const W=b.find(j=>j.name===F);if(!W){const j=y.db.getRequest(F);L.modelInfo.url=j.url;return}const Q=p(W.blob);L.modelInfo.url=Q}return!0}),R}),T=()=>{l!=null&&l.renderer&&(h=new O.THREE.PMREMGenerator(l.renderer),h.compileEquirectangularShader(),l.scene.environment=h.fromScene(new Jt.RoomEnvironment).texture)},g=()=>l;return C.watch(()=>o.value.path,()=>m(this,null,function*(){_()})),C.watch(()=>s.data,()=>{_()},{deep:!0}),C.onMounted(()=>{_()}),C.onUnmounted(()=>{window.removeEventListener("resize",q),k(),l==null||l.destroySceneRender(),a.setCurrScene({name:"",path:""})}),e({getEditorInstance:g}),(I,y)=>(C.openBlock(),C.createElementBlock("div",{ref_key:"editorRef",ref:S,class:"threed-editor",onDragover:y[0]||(y[0]=C.withModifiers(()=>{},["prevent"])),onDrop:y[1]||(y[1]=C.withModifiers(()=>{},["prevent"]))},null,544))}}),Pr=yt(Tr,[["__scopeId","data-v-86a4ac97"]]),br={class:"threed-preview"},Lr=Object.assign({name:"ThreedPreview"},{__name:"preview",props:{data:{type:Object,default:null},url:{type:String,default:""},id:{type:String,default:""},token:{type:String,default:""},socketUrl:{type:String,default:""}},emits:["loaded","graph-event"],setup(r,{expose:e,emit:t}){const n=r,s=t;let a=C.shallowRef({});const o=C.ref(),c=It();let l={},h=null,S=null;const N=_=>{var T,g,P;if(!_)return;if((T=_==null?void 0:_.includes)!=null&&T.call(_,"token 必传"))return se({message:_,type:"warning"});const E=typeof _=="string"?JSON.parse(_):_;if((E==null?void 0:E.data)==="服务错误"||(P=(g=E==null?void 0:E.data)==null?void 0:g.includes)!=null&&P.call(g,"token is expired"))return se({message:E.data,type:"warning"});switch(E.action){case Ne.ACPOINT.YCVALUE:case Ne.ACPOINT.YXVALUE:console.warn("遥测信息");break}},K=()=>{try{S=new In({socketUrl:n.socketUrl,token:n.token,onMessage:N})}catch(_){console.warn("三维场景消息处理失败",_)}},G=()=>m(this,null,function*(){var _;if(l){const E=Object.keys(l);if(E.length){const T=yield B.postPDApi("querychannelstatus/",{data:E.map(g=>({ied_id:g,ln_list:l[g].map(P=>P.ln_id)}))});(_=T==null?void 0:T.data)!=null&&_.length&&E.forEach(g=>{const P=T.data.find(y=>y.ied_id===g),I=l[g];I!=null&&I.length&&I.forEach(y=>{const b=P.result.find(R=>R.ln_id===y.ln_id);if(b){const R=q();if(!(R!=null&&R.scene))return;const L=R.scene.getObjectsByProperty("dataId",y.guid);let F=L==null?void 0:L[0];if(F){const W=b.status==="告警"?2:b.status==="正常"?1:0;F.userData.params.state=W;const Q=Cn(b.amp_peak)?Rn(Number(b.amp_peak))?Number(b.amp_peak):0:b.amp_peak;F.userData.params.value=Q;debugger;F.changeState(W),F.changeValue(Q)}}})})}}}),p=_=>{s("graph-event",_)},k=_=>{_&&(n.socketUrl&&K(),setTimeout(()=>{const E=_.scene.getObjectsByProperty("designType","局放测点");E.forEach(T=>{const{ied_id:g,ln_id:P}=T.userData.params;l[g]||(l[g]=[]),l[g].push({guid:T.dataId,id:T.uuid,ied_id:g,ln_id:P})}),E!=null&&E.length&&(h&&clearInterval(h),G(),h=setInterval(()=>{G()},2e3)),s("loaded",_)},100))},Y=()=>m(this,null,function*(){if(a.value&&Object.keys(a.value).length)return;const _=Dn(),E=n.url||_.url;if(E){const P=yield B.getApi(E).catch(()=>({}));P.res&&(a.value=P.res);return}if(!(n.id||_.id)){console.warn("三维场景渲染失败,场景id为空!");return}const g=yield B.getCommonApi("threedfloorplan",{guid:n.id});g.data.length?c.setCurrScene(g.data[0]):console.warn("三维场景渲染失败,场景id为:"+n.id+"不存在!")}),q=()=>o.value?o.value.getEditorInstance():null;return C.watch(()=>n.data,_=>{a.value=_,Y()},{deep:!0,immediate:!0}),C.watch(()=>n.id,()=>{Y()},{deep:!0,immediate:!0}),C.onMounted(()=>{Ae.on("three-event",p)}),C.onUnmounted(()=>{S&&S.destroy(),h&&clearInterval(h),Ae.off("three-event",p)}),e({getEditorInstance:q}),(_,E)=>(C.openBlock(),C.createElementBlock("div",br,[C.createVNode(Pr,{ref_key:"threedEditorRef",ref:o,data:C.unref(a),preview:"",onGraphEvent:p,onEmitThreeEditor:k},null,8,["data"])]))}}),ie=yt(Lr,[["__scopeId","data-v-5a321d2f"]]);ie.name||(ie.name="SyThree");const Mr=r=>{r.component(ie.name||"SyThree",ie)},Or={install:Mr};exports.SyThree=ie;exports.default=Or;
53
+ `,key:"col",commonFinish:!0,render:"iTime+speed"}];let se=null,F=null,Ae=[];const Ke=n=>(n==null?void 0:n.name)||(n==null?void 0:n.label)||"",gt=(n={})=>Object.values(n).filter(e=>e&&(e.label||e.name)),cr=gt(sr),lr=gt(ir),ur=()=>({THREED_GUI_PARAMS:Ce,THREED_LOG_BUFFER:Vn,THREED_CURRSCENE:Kn,THREED_ACTIVE_MENU:zn,THREED_PIXEL_RATIO:$n,THREED_IMPORT_SIZE:Xn,THREED_LIGHT_TYPES:nr,THREED_EXPORT_BATCH:pt,THREED_RELOAD_DELAY:Yn,THREED_MODEL_DBNAME:he,THREED_MODEL_DBSTORE:Ie,THREED_SCENE_PREVIEW:qn,THREED_USER_DATA_KEYS:_t,THREED_MODEL_LOAD_KEY:ye,THREED_PREVIEW_URL_KEY:ie,THREED_ADDON_EDITOR_JSON:Wn,THREED_EXPORT_NODE_COUNT:Jn,THREED_DEFAULT_SCENE_NAME:Zn,THREED_DEFAULT_ACTIVE_MENU:er,THREED_DEFAULT_PIXEL_RATIO:tr,THREED_EXPORT_VERTEX_COUNT:Qn,THREED_SCENE_EXCLUDE_TYPES:rr,THREED_EXPORT_EXCLUDE_TYPES:Et,THREED_EXPORT_RUNTIME_TYPES:At,THREED_SCENE_STORAGE_SUFFIX:jn});function dr(){const{createInstance:n,dropInstance:e}=Gn(),t="/",r=i=>{const u=URL.createObjectURL(i);return Ae.push(u),u},s=()=>{Ae.forEach(i=>URL.revokeObjectURL(i)),Ae=[]},a=()=>m(this,null,function*(){return yield l(),{clearRequest:o,getAllRequest:_,getRequest:z,status:!0,message:"数据库打开成功",DATABASE:F}}),o=i=>m(this,null,function*(){if(!i)return{status:!1,message:"删除失败"};yield l(),yield F.removeItem(i);const u=yield K();return u.list=u.list.filter(d=>d.name!==i),{status:!0,message:"删除成功"}}),c=(...u)=>m(this,[...u],function*(i=he){F=null,se=null,yield e({name:i,storeName:Ie})}),l=()=>m(this,null,function*(){return F||(se||(se=n({name:he,storeName:Ie}).then(i=>(F=i,i))),yield se)}),h=i=>{if(!i)return!1;const u=String(i.message||"");return i.name==="DataError"||u.includes("in-line keys")},E=()=>m(this,null,function*(){F=null,se=null,yield e({name:he}),yield l()});let b=null;const K=()=>m(this,null,function*(){return window.threeEditorDB?window.threeEditorDB:(b||(b=m(this,null,function*(){const i=yield a(),{data:u}=yield i.getAllRequest();return window.threeEditorDB={db:i,list:u},window.threeEditorDB})),yield b)}),z=i=>m(this,null,function*(){if(!i)return{status:!1,message:"获取失败"};yield l();const u=yield F.getItem(i);if(u!=null&&u.blob&&!i)return{status:!0,message:"获取成功",url:r(u.blob)};if(!i)return{status:!1,message:"获取失败"};const d=yield fetch(i).then(x=>x.blob()),f={blob:d};try{yield F.setItem(i,f)}catch(x){if(!h(x))throw x;yield E(),yield F.setItem(i,f)}const I=yield K(),k=O({name:i},f),R=I.list.findIndex(x=>x.name===i);return R>-1?I.list.splice(R,1,k):I.list.push(k),{status:!0,message:"文件缓存成功",url:r(d)}}),_=()=>m(this,null,function*(){yield l();const i=[];return F&&(yield F.iterate((u,d)=>{i.push(ce(O({},u||{}),{name:d}))})),window.threeEditorDB&&(window.threeEditorDB.list=i),{status:!0,message:"获取成功",data:i}}),V=()=>m(this,null,function*(){var d;const{res:i}=yield G.getApi("/filehandle/scan",{path:ot.threeModelPath,extension:"glb,gltf"}),u=[];if(((d=i==null?void 0:i.children)==null?void 0:d.length)>0)for(const f of i.children)u.push({name:f.name,path:"/"+f.path});return u}),Q=()=>window.GUI_PARAMS||Ce,Z=()=>window.threeEditor||null,p=()=>window.editorJsons||[],g=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),C=()=>cr,y=()=>ar||{},T=()=>window[ie]||"",N=()=>lr,A=()=>window.devicePixelRatio||1,w=()=>window[ie]||"",P=()=>{const i=C(),u=N();return{modelDesigns:i,componentDesigns:u,modelList:i.map(d=>d.label),componentList:u.map(d=>d.label)}},L=(i,u)=>{var d;return(d=i==null?void 0:i.__DESIGNS__)==null?void 0:d.find(f=>f.label===u)},M=(i=0)=>!Number.isFinite(i)||i<=0?"0 B":i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(1)} KB`:i<1024*1024*1024?`${(i/1024/1024).toFixed(1)} MB`:`${(i/1024/1024/1024).toFixed(2)} GB`,H=i=>{const u=window[ye];typeof u=="function"&&u(i)},B=i=>!!i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z),$=i=>{var u,d;return!i||!i.visible||(u=i.userData)!=null&&u.excludeFromExport||i.isTransformControls||i.isHelper||i.isLight||i.isPoints||(d=i.type)!=null&&d.includes("Helper")||Et.has(i.type)||At.has(i.type)||i.isCSS2DObject||i.isCSS3DObject?!1:i.isMesh||i.isGroup||i.isObject3D||i.isLine},re=(i,u)=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)?i:u,q=i=>i&&Number.isFinite(i.x)&&Number.isFinite(i.y)&&Number.isFinite(i.z)&&Number.isFinite(i.w)?i:{x:0,y:0,z:0,w:1},Le=i=>{if(!(i!=null&&i.isObject3D))return;const u=re(i.position,{x:0,y:0,z:0});i.position.set(u.x,u.y,u.z);const d=re(i.scale,{x:1,y:1,z:1});i.scale.set(d.x===0?1:d.x,d.y===0?1:d.y,d.z===0?1:d.z);const f=re(i.up,{x:0,y:1,z:0});i.up.set(f.x,f.y,f.z);const I=q(i.quaternion);i.quaternion.set(I.x,I.y,I.z,I.w),i.pivot&&!B(i.pivot)&&delete i.pivot,i.updateMatrix(),i.updateMatrixWorld(!1)},Dt=(i,u="_blank")=>window.open(i,u),xt=(i,u="")=>window.prompt(i,u),vt=()=>window.location.reload(),Tt=()=>document.documentElement.classList.remove("dark"),Pt=i=>{if(!Array.isArray(i==null?void 0:i.__DESIGNS__))return P();const u=[...C(),...N()],d=new Set(i.__DESIGNS__.map(f=>Ke(f)));return u.forEach(f=>{const I=Ke(f);!I||d.has(I)||(d.add(I),i.__DESIGNS__.unshift(f))}),P()},bt=i=>{if(!Array.isArray(i==null?void 0:i.__GLSLLIB__))return;const u=new Set(i.__GLSLLIB__.map(d=>d==null?void 0:d.name));or.forEach(d=>{u.has(d.name)||(u.add(d.name),i.__GLSLLIB__.push(d))})},fe=(i={})=>{const u={};return Object.entries(i||{}).forEach(([d,f])=>{if(!(_t.has(d)||typeof f=="function")){if(!f||["string","number","boolean"].includes(typeof f)){u[d]=f;return}if(Array.isArray(f)){try{u[d]=structuredClone(f)}catch(I){return}return}if(!(f.isObject3D||f.isMaterial||f.isTexture||f.nodeType))try{u[d]=structuredClone(f)}catch(I){return}}}),u},Lt=(i=Ce)=>{window.GUI_PARAMS=i},Mt=i=>{window.threeEditor=i},Ot=i=>{window.threeEditorDB=i},Ut=i=>{window[ye]=i},Ht=(i="")=>{window[ie]=i},kt=(i="")=>{window[ie]=i},Me=i=>{var d;const u=[];return(d=i==null?void 0:i.children)==null||d.forEach(f=>{$(f)&&u.push(f)}),u},Oe=(i=[])=>{const u={rootCount:i.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return i.forEach(d=>{d.traverse(f=>{var I,k,R;if($(f)){u.nodeCount+=1,f.isMesh&&(u.meshCount+=1,u.vertexCount+=((R=(k=(I=f.geometry)==null?void 0:I.attributes)==null?void 0:k.position)==null?void 0:R.count)||0);return}f!==d&&(u.skippedCount+=1)})}),u},Ue=()=>new Promise(i=>requestAnimationFrame(()=>setTimeout(i,0))),He=()=>new Promise(i=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>i(),{timeout:80});return}setTimeout(i,0)}),Ft=(i,u)=>m(this,null,function*(){var I;if(!$(i))return null;const d=i.clone(!1);d.userData=fe(i.userData),B(i.pivot)?d.pivot=new U.THREE.Vector3(i.pivot.x,i.pivot.y,i.pivot.z):"pivot"in d&&delete d.pivot,Le(d);const f=[{source:i,clone:d}];for(;f.length;){const k=f.shift();for(const R of k.source.children){if(!$(R)){u.skippedCount+=1;continue}const x=R.clone(!1);x.userData=fe(R.userData),B(R.pivot)?x.pivot=new U.THREE.Vector3(R.pivot.x,R.pivot.y,R.pivot.z):"pivot"in x&&delete x.pivot,Le(x),k.clone.add(x),f.push({source:R,clone:x}),u.processedCount+=1,u.processedCount%pt===0&&(yield(I=u.onProgress)==null?void 0:I.call(u,{processedCount:u.processedCount,totalCount:u.totalCount,skippedCount:u.skippedCount,progress:18+Math.min(u.processedCount/Math.max(u.totalCount,1)*54,54)}),yield Ue())}}return d});return{baseUrl:t,getModels:V,getRequest:z,reloadPage:vt,promptInput:xt,waitForIdle:He,waitForPaint:Ue,clearRequest:o,getGuiParams:Q,setGuiParams:Lt,getAllRequest:_,getEditorJsons:p,getThreeEditor:Z,formatFileSize:M,setThreeEditor:Mt,removeDarkClass:Tt,openExternalUrl:Dt,getThreedModels:C,getViewportSize:g,buildExportScene:(d,...f)=>m(this,[d,...f],function*(i,u={}){const I=Me(i),k=Oe(I),R=new U.THREE.Scene,x={totalCount:k.nodeCount,processedCount:0,skippedCount:0,onProgress:u.onProgress};for(const Nt of I){const ke=yield Ft(Nt,x);ke&&R.add(ke),yield He()}return R.updateMatrixWorld(!0),k.skippedCount+=x.skippedCount,{exportScene:R,exportObjects:I,stats:k}}),createModelDbApi:a,getEditorPreviewSceneUrl:w,sanitizeUserData:fe,setThreeEditorDB:Ot,findThreedDesign:L,getThreedLightMap:y,collectExportStats:Oe,getPreviewSceneUrl:T,setEditorPreviewSceneUrl:kt,setPreviewSceneUrl:Ht,setModelLoadHander:Ut,isExportableObject:$,deleteThreeEditorDB:c,ensureThreeEditorDB:K,getDevicePixelRatio:A,getThreedComponents:N,collectExportObjects:Me,resetModelDbInstance:E,ensureModelDbInstance:l,getLocalDesignMenuData:P,invokeModelLoadHandler:H,isLegacyInlineKeyError:h,ensureThreedShaderLibrary:bt,ensureThreedDesignRegistry:Pt,createBlobUrl:r,revokeModelObjectUrls:s}}const{THREED_LOG_BUFFER:wt,THREED_CURRSCENE:Re,THREED_ACTIVE_MENU:St,THREED_PIXEL_RATIO:It,THREED_SCENE_PREVIEW:yt,THREED_ADDON_EDITOR_JSON:De,THREED_DEFAULT_SCENE_NAME:hr,THREED_DEFAULT_ACTIVE_MENU:xe,THREED_DEFAULT_PIXEL_RATIO:ve,THREED_SCENE_STORAGE_SUFFIX:mr}=ur(),j=(n,e)=>{const t=be.getLocal(n);return t==null?e:t},W=(n,e)=>{n&&be.setLocal(n,e)},fr=n=>{n&&be.removeLocal(n)},pr=(n,e)=>{var r,s;const t=(r=n==null?void 0:n.trim)==null?void 0:r.call(n);return t&&e.some(a=>a.name===t)?t:((s=e[0])==null?void 0:s.name)||hr},Te=(n=[])=>Array.isArray(n)?n.filter(e=>typeof e=="string"&&e):[],_r=()=>{const n=[],e=j(Re,{name:"",path:""}),t=Number.parseFloat(j(It,ve));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:n,previewScene:!!j(yt,!1),activeMenuTitle:j(St,xe)||xe,pixelRatio:Number.isFinite(t)&&t>0?t:ve,logarithmicDepthBuffer:j(wt,!0)!==!1,addonEditorJson:Te(j(De,[]))}},Ct=Pe.defineStore("threed",{state:()=>_r(),actions:{getSceneList(n){return m(this,null,function*(){var t;const e=yield G.getCommonApi("threedfloorplan",{limit:1e4,ordering:"-create_time"});if((t=e==null?void 0:e.data)!=null&&t.length){if(this.sceneList=e.data,n){const r=this.sceneList.find(s=>s.org_id===n);r?this.setCurrScene(r):this.setCurrScene({name:"",path:""});return}this.currScene.path?this.sceneList.find(s=>s.id===this.currScene.id)||this.setCurrScene({name:"",path:""}):this.setCurrScene(this.sceneList[0])}else this.sceneList=[],this.setCurrScene({name:"",path:""})})},setSceneList(n){this.sceneList=n},setSceneName(n){this.sceneName=pr(n,this.sceneList),W(Re,this.sceneName)},createScene(n,e=""){return m(this,null,function*(){var c,l,h;const t=(l=(c=n.name)==null?void 0:c.trim)==null?void 0:l.call(c);if(!t||this.sceneList.some(E=>E.name===t))return!1;const r=ot.threeSavePath+"/"+Se()+".json",s=Se();if(!(yield G.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:r,guid:s,org_id:n.org_id,org_name:n.org_name}]})).success)return!1;if(yield kn(r,e)){const E=yield G.postCommonApi("threedfloorplan",{guid:s});if((h=E==null?void 0:E.data)!=null&&h.length)return this.sceneList=[...this.sceneList,E.data[0]],E.data[0]}return!0})},deleteScene(n){return m(this,null,function*(){var r;if(!n)return;if(!(yield G.postCommonApi("query/threedfloorplan/delete",{data:[n]})).success)return!1;const t=this.sceneList.findIndex(s=>s.id===n);return t===-1?!1:(this.sceneList.splice(t,1),((r=this.currScene)==null?void 0:r.id)===n&&this.setCurrScene(this.sceneList[0]||{name:"",path:""}),!0)})},setCurrScene(n){return m(this,null,function*(){this.currScene=n,W(Re,this.currScene)})},setPreviewMode(n){this.previewScene=!!n,W(yt,this.previewScene)},setActiveMenuTitle(n){this.activeMenuTitle=n||xe,W(St,this.activeMenuTitle)},setPixelRatio(n){const e=Number.parseFloat(n);this.pixelRatio=Number.isFinite(e)&&e>0?e:ve,W(It,this.pixelRatio)},setLogarithmicDepthBuffer(n){this.logarithmicDepthBuffer=!!n,W(wt,this.logarithmicDepthBuffer)},getSceneStorageKey(n){return`${n||this.sceneName}${mr}`},getSceneStorageParams(n,e=null){return j(this.getSceneStorageKey(n),e)},setSceneStorageParams(n,e){n&&W(this.getSceneStorageKey(n),e)},removeSceneStorageParams(n){n&&fr(this.getSceneStorageKey(n))},resetTaskState(){return m(this,null,function*(){yield new Promise(n=>setTimeout(n,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=Te(j(De,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(n){this.addonEditorJson=Te(n),W(De,this.addonEditorJson)}}}),Er={backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},Ar={fov:50,near:.1,far:1e5,zoom:1,layers:{mask:1},filmOffset:0,filmGauge:35,position:{x:247.72931803058157,y:715.3890430349733,z:789.6794984861216}},gr={outputColorSpace:"srgb",toneMapping:0,toneMappingExposure:1,shadowMap:{enabled:!1,type:1},color:0,opacity:0,sortObjects:!0,localClippingEnabled:!1,autoClear:!0,autoClearColor:!0,renderListCompare:[{name:"stats",enabled:!0},{name:"controls",enabled:!0},{name:"scene",enabled:!0},{name:"css3DRender",enabled:!0},{name:"css2DRender",enabled:!0}]},wr={autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,minDistance:.01,maxDistance:1e6,maxAzimuthAngle:null,minAzimuthAngle:null,maxPolarAngle:3.141592653589793,minPolarAngle:0,maxTargetRadius:null,minTargetRadius:0,enablePan:!0,panSpeed:1,enableRotate:!0,rotateSpeed:1,enableZoom:!0,zoomSpeed:1,zoomToCursor:!1,target:{x:-38.59603927643809,y:-48.97202695679889,z:-49.19814250541991}},Sr={mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},Ir={renderWay:"effectComposer",fxaaPass:{enabled:!0,order:60,multPixel:1},outlinePass:{enabled:!0,order:40,edgeStrength:3,edgeGlow:0,edgeThickness:1,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16449071,hiddenEdgeColor:16449071,overlayMaterial:{blending:5,blendEquation:100,blendSrc:201,blendDst:205}},outputPass:{enabled:!0,order:50},saoPass:{enabled:!1,order:10,saoBias:.5,saoIntensity:.01,saoScale:100,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},screenMaskPass:{enabled:!1,order:70,intensity:1,maskColor:16777215,R:.2,sr:1.2},ssrPass:{enabled:!1,order:30,maxDistance:.01,distanceAttenuation:!0,opacity:.5,thickness:.018,fresnel:!0,infiniteThick:!1,bouncing:!1},unrealBloomPass:{enabled:!1,order:20,strength:1.5,radius:.4,threshold:.85}},yr={mode:"transform",openKeyEnable:!0,rightClickMenusEnable:!0,selectChildEnabled:!1,selectChildLevel:1,stats:{showStats:!1,statsMode:0},helpers:{axes:{showAxes:!0,axesLength:1e3},grid:{showGrid:!0,size:1e3,divisions:15,colorCenterLine:4473924,colorGrid:8947848},box3:{useBox3:!0,color:16776960}}},Cr=[],Rr=[],Dr=[],xr=[],vr=[],Tr=[],Pr={},br=[],Lr={viewAngleList:[],clipping:{size:20,clipList:[]}},Mr={scene:Er,perspectiveCamera:Ar,webglRenderer:gr,orbitControls:wr,transformControls:Sr,effectComposer:Ir,handler:yr,lightCores:Cr,innerCores:Rr,modelCores:Dr,drawCores:xr,textCores:vr,particleCores:Tr,geoCores:Pr,designCores:br,other:Lr},Rt=(n,e)=>{const t=n.__vccOpts||n;for(const[r,s]of e)t[r]=s;return t},Or=Object.assign({name:"ThreedEditor"},{__name:"editor",props:{data:{type:Object,default:()=>({})},preview:{type:Boolean,default:!1}},emits:["emit-three-editor","graph-event"],setup(n,{expose:e,emit:t}){var N;const r=t,s=n,a=Ct(),{currScene:o}=Pe.storeToRefs(a),c=((N=window.meta.threed)==null?void 0:N.draco_path)||it;U.ThreeEditor.dracoPath=c.endsWith("/")?c:`${c}/`;let l=null,h=null,E=!1;const b=D.ref(null),{setGuiParams:K,getDevicePixelRatio:z,ensureThreeEditorDB:_,createBlobUrl:V,revokeModelObjectUrls:Q,ensureThreedDesignRegistry:Z}=dr();Z(U.ThreeEditor),K({step:.1});const p=()=>{var A;return(A=l==null?void 0:l.renderSceneResize)==null?void 0:A.call(l)},g=()=>m(this,null,function*(){var w,P;if(E)return;let A=Mr;try{if(s.data&&Object.keys(s.data).length)A=s.data;else if((w=o.value)!=null&&w.path){const M=yield G.getApi((P=o.value)==null?void 0:P.path).catch(()=>({}));if(E)return;M.res&&(A=M.res)}const L=yield C(A);if(E)return;l?l.resetEditorStorage(L):l=new U.ThreeEditor(b.value,{fps:null,pixelRatio:z()*a.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0},sceneParams:L})}catch(L){console.error("三维图纸初始化失败",L),l==null||l.resetEditorStorage(A)}finally{y()}r("emit-three-editor",l),window.addEventListener("resize",p)}),C=A=>m(this,null,function*(){A.designCores.forEach(H=>{H.preview=s.preview}),s.preview&&(A.handler.mode="none",A.handler.helpers.axes.showAxes=!1,A.handler.helpers.box3.useBox3=!1,A.handler.helpers.grid.showGrid=!1,A.handler.rightClickMenusEnable=!1);const w=yield _(),P=w.list||[],L=structuredClone(A||{}),M=[];for(const H of L.modelCores||[]){const B=H.modelInfo.originPath;if(B){const $=P.find(q=>q.name===B);if(!$){const q=yield w.db.getRequest(B);q!=null&&q.url&&(H.modelInfo.url=q.url),M.push(H);continue}const re=V($.blob);H.modelInfo.url=re}M.push(H)}return L.modelCores=M,L}),y=()=>{l!=null&&l.renderer&&(h=new U.THREE.PMREMGenerator(l.renderer),h.compileEquirectangularShader(),l.scene.environment=h.fromScene(new Yt.RoomEnvironment).texture)},T=()=>l;return D.watch([()=>o.value.path,()=>s.data],([A,w])=>{console.log("watch",A,w),g()},{deep:!0}),D.onMounted(()=>m(this,null,function*(){var A,w;E=!1,(A=b.value)!=null&&A.clientHeight&&((w=b.value)!=null&&w.clientWidth)&&g()})),D.onUnmounted(()=>{E=!0,window.removeEventListener("resize",p),l==null||l.destroySceneRender(),h==null||h.dispose(),Q()}),e({getEditorInstance:T}),(A,w)=>(D.openBlock(),D.createElementBlock("div",{ref_key:"editorRef",ref:b,class:"threed-editor",onDragover:w[0]||(w[0]=D.withModifiers(()=>{},["prevent"])),onDrop:w[1]||(w[1]=D.withModifiers(()=>{},["prevent"]))},null,544))}}),Ur=Rt(Or,[["__scopeId","data-v-6948bdc3"]]),Hr={class:"threed-preview"},kr=Object.assign({name:"ThreedPreview"},{__name:"preview",props:{data:{type:Object,default:null},url:{type:String,default:""},id:{type:String,default:""},token:{type:String,default:""},socketUrl:{type:String,default:""}},emits:["loaded","graph-event"],setup(n,{expose:e,emit:t}){const r=n,s=t;let a=D.shallowRef({});const o=D.ref(),c=Ct();let l={},h=null,E=null;const b=p=>{var C,y,T;if(!p)return;if((C=p==null?void 0:p.includes)!=null&&C.call(p,"token 必传"))return ae({message:p,type:"warning"});const g=typeof p=="string"?JSON.parse(p):p;if((g==null?void 0:g.data)==="服务错误"||(T=(y=g==null?void 0:g.data)==null?void 0:y.includes)!=null&&T.call(y,"token is expired"))return ae({message:g.data,type:"warning"});switch(g.action){case Ne.ACPOINT.YCVALUE:case Ne.ACPOINT.YXVALUE:console.warn("遥测信息");break}},K=()=>{try{E=new yn({socketUrl:r.socketUrl,token:r.token,onMessage:b})}catch(p){console.warn("三维场景消息处理失败",p)}},z=()=>m(this,null,function*(){var p;if(l){const g=Object.keys(l);if(g.length){const C=yield G.postPDApi("querychannelstatus/",{data:g.map(y=>({ied_id:y,ln_list:l[y].map(T=>T.ln_id)}))});(p=C==null?void 0:C.data)!=null&&p.length&&g.forEach(y=>{const T=C.data.find(A=>A.ied_id===y),N=l[y];N!=null&&N.length&&N.forEach(A=>{const w=T.result.find(P=>P.ln_id===A.ln_id);if(w){const P=Z();if(!(P!=null&&P.scene))return;const L=P.scene.getObjectsByProperty("dataId",A.guid);let M=L==null?void 0:L[0];if(M){const H=w.status==="告警"?2:w.status==="正常"?1:0;M.userData.params.state=H;const B=Rn(w.amp_peak)?Dn(Number(w.amp_peak))?Number(w.amp_peak):0:w.amp_peak;M.userData.params.value=B,M.changeState(H),M.changeValue(B)}}})})}}}),_=p=>{s("graph-event",p)},V=p=>{p&&(r.socketUrl&&K(),setTimeout(()=>{const g=p.scene.getObjectsByProperty("designType","局放测点");g.forEach(C=>{const{ied_id:y,ln_id:T}=C.userData.params;l[y]||(l[y]=[]),l[y].push({guid:C.dataId,id:C.uuid,ied_id:y,ln_id:T})}),g!=null&&g.length&&(h&&clearInterval(h),z(),h=setInterval(()=>{z()},2e3)),s("loaded",p)},100))},Q=()=>m(this,null,function*(){if(a.value&&Object.keys(a.value).length)return;const p=xn(),g=r.url||p.url;if(g){const T=yield G.getApi(g).catch(()=>({}));T.res&&(a.value=T.res);return}if(!(r.id||p.id)){console.warn("三维场景渲染失败,场景id为空!");return}const y=yield G.getCommonApi("threedfloorplan",{guid:r.id});y.data.length?c.setCurrScene(y.data[0]):console.warn("三维场景渲染失败,场景id为:"+r.id+"不存在!")}),Z=()=>o.value?o.value.getEditorInstance():null;return D.watch(()=>r.data,p=>{p&&(a.value=p,Q())},{deep:!0,immediate:!0}),D.watch(()=>r.id,p=>{p&&Q()},{deep:!0,immediate:!0}),D.onMounted(()=>{ge.on("three-event",_)}),D.onUnmounted(()=>{E&&E.destroy(),h&&clearInterval(h),ge.off("three-event",_)}),e({getEditorInstance:Z}),(p,g)=>(D.openBlock(),D.createElementBlock("div",Hr,[D.createVNode(Ur,{ref_key:"threedEditorRef",ref:o,data:D.unref(a),preview:"",onGraphEvent:_,onEmitThreeEditor:V},null,8,["data"])]))}}),oe=Rt(kr,[["__scopeId","data-v-fbc5634a"]]);oe.name||(oe.name="SyThree");const Fr=n=>{n.component(oe.name||"SyThree",oe)},Nr={install:Fr};exports.SyThree=oe;exports.default=Nr;
@@ -1 +1 @@
1
- @charset "UTF-8";.threed-editor[data-v-86a4ac97]{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sc-bg-color)}.threed-editor[data-v-86a4ac97] .top-info{z-index:9999!important}.threed-preview[data-v-5a321d2f]{width:100%;height:100%}
1
+ @charset "UTF-8";.threed-editor[data-v-6948bdc3]{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sc-bg-color)}.threed-editor[data-v-6948bdc3] .top-info{z-index:9999!important}.threed-preview[data-v-fbc5634a]{position:relative;width:100%;height:100%}